/* "Rum label on a nautical chart": parchment, navy ink, rum-label red, brass. */
:root {
  --paper: #f3ead7; --paper2: #ebdfc5; --card: #fbf6ea; --line: #d9c9a6; --line2: #c7b28a;
  --ink: #14213d; --muted: #5a5f6e; --faint: #8b8676;
  --rum: #9e1b32; --rum-dark: #6e1022; --brass: #b8862b; --navy: #14213d; --sea: #1f4e79;
  --gold: #c9a227; --silver: #9ea7b3; --bronze: #a8693d;
  --me: #2a78d6; --leader: #eb6834; --ok: #2e7d4f; --err: #b3261e;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --num: "Barlow Condensed", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0; color: var(--ink); min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* faint chart grid */
  background:
    linear-gradient(rgba(20, 33, 61, .045) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(20, 33, 61, .045) 1px, transparent 1px) 0 0 / 48px 48px,
    radial-gradient(1200px 600px at 50% -20%, #f8f1e1 0%, transparent 70%),
    var(--paper);
}
h1, h2, .display { font-family: var(--display); font-weight: 800; letter-spacing: -.01em; }
.num, .total, .kpi .v, .countdown b, .medal, .podium .block, .big { font-family: var(--num); font-weight: 700; }
a { color: var(--rum); text-decoration: none; }
a:hover { text-decoration: underline; }

/* nav: the label band */
nav { display: flex; gap: .4rem 1.2rem; align-items: center; flex-wrap: wrap; padding: .65rem 1.4rem;
      background: var(--navy); color: #f3ead7; position: sticky; top: 0; z-index: 5;
      border-bottom: 3px solid var(--brass); }
nav .brand { font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: #f3ead7; margin-right: auto; white-space: nowrap; }
nav .brand .acc { color: #f3ead7; }
nav .brand .tag { font-family: var(--num); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--brass);
                  border: 1px solid var(--brass); padding: .05rem .4rem; border-radius: 3px; vertical-align: middle; margin-left: .3rem; }
nav .links { display: flex; gap: .2rem; }
nav .links a { white-space: nowrap; padding: .35rem .7rem; color: #cfc6b2; font-weight: 600; font-size: .92rem; border-radius: 4px; }
nav .links a:hover { color: #fff; background: rgba(255, 255, 255, .07); text-decoration: none; }
nav a.on { color: #fff !important; background: var(--rum); }
nav .who { color: #cfc6b2; font-size: .85rem; display: flex; gap: .5rem; align-items: center; margin: 0; }
nav .who button.link { color: #a59d8a; }

main { max-width: 1180px; margin: 0 auto; padding: 1.8rem 1.2rem 3rem; }
h1 { font-size: 2.2rem; margin: .2rem 0 .3rem; color: var(--navy); }
h2 { font-size: 1.45rem; margin: 2.1rem 0 .8rem; color: var(--navy); display: flex; align-items: center; gap: .7rem; }
h2::after { content: ""; flex: 1; border-top: 2px dotted var(--line2); }   /* rhumb line */
.sub { color: var(--muted); margin: 0 0 1.2rem; }
.kicker { font-family: var(--num); letter-spacing: .25em; text-transform: uppercase; color: var(--rum); font-weight: 700; font-size: .85rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.15rem;
        box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 6px 18px rgba(60, 40, 10, .08); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); }
.kpis { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1rem; }
.kpi { text-align: center; border-top: 4px solid var(--rum); }
.kpi .v { font-size: 2.4rem; line-height: 1.1; color: var(--navy); }
.kpi .l { color: var(--muted); font-size: .85rem; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: .5rem .5rem; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--faint); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.me td { background: rgba(42, 120, 214, .09); }
.total { font-size: 1.35rem; color: var(--navy); white-space: nowrap; }
.up { color: var(--ok); } .down { color: var(--err); } .flat { color: var(--faint); }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.pill { display: inline-block; padding: .05rem .45rem; border-radius: 3px; font-size: .72rem; font-weight: 600; border: 1px solid var(--line2); color: var(--muted); }
.pill.final { color: var(--ok); border-color: #8fbf9f; background: rgba(46, 125, 79, .07); }
.pill.ab { color: var(--err); border-color: #e0a19c; background: rgba(179, 38, 30, .06); }
.pill.audace { color: var(--rum-dark); border-color: var(--brass); background: rgba(184, 134, 43, .14); }
/* banter tags, like a stamp on a rum label */
.badge { display: inline-block; padding: .05rem .45rem; border-radius: 3px; font-family: var(--num); font-size: .78rem; font-weight: 700;
         letter-spacing: .08em; text-transform: uppercase; margin-left: .35rem; vertical-align: middle; white-space: nowrap;
         color: var(--rum); border: 1.5px solid var(--rum); transform: rotate(-2deg); }
.badge.plain { color: var(--navy); border-color: var(--line2); transform: none; font-family: inherit; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: .85rem; }
.medal { display: inline-block; width: 1.75rem; height: 1.75rem; line-height: 1.75rem; text-align: center; border-radius: 50%; font-size: 1rem; color: #fff; }
.m1 { background: var(--gold); } .m2 { background: var(--silver); } .m3 { background: var(--bronze); }
.flash { padding: .8rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-weight: 600; border-left: 4px solid; }
.flash.ok { background: #e6efe3; border-color: var(--ok); color: #1f5236; }
.flash.err { background: #f5dfdc; border-color: var(--err); color: #7d1a14; }
select, input { font-size: 1rem; background: #fffdf7; color: var(--ink); border: 1px solid var(--line2); border-radius: 5px; padding: .55rem .7rem; max-width: 100%; font-family: inherit; }
select:focus, input:focus { outline: 2px solid var(--sea); outline-offset: 1px; }
select { width: 100%; }
label { display: block; color: var(--muted); font-size: .84rem; margin: .6rem 0 .25rem; font-weight: 600; }
button { background: var(--rum); color: #fff; border: 0; border-radius: 5px; padding: .7rem 1.5rem; font-family: var(--num);
         font-weight: 700; font-size: 1.1rem; letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
         box-shadow: 0 3px 0 var(--rum-dark); }
button:hover { background: #b0213b; }
button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--rum-dark); }
button.small { padding: .35rem .8rem; font-size: .9rem; }
button.link { background: none; color: var(--faint); padding: 0; font-weight: 400; font-size: .8rem; text-decoration: underline; box-shadow: none;
              font-family: inherit; letter-spacing: 0; text-transform: none; }
button.danger { background: var(--err); box-shadow: 0 3px 0 #7d1a14; }
button.wide { width: 100%; margin-top: 1.2rem; }
.btn-link:hover { text-decoration: none; }
.row { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; }
/* the greedy bets: the rum shelf */
.greedy { background: linear-gradient(160deg, #f6e3c4, var(--card) 70%); border-color: var(--brass); }
.count { font-variant-numeric: tabular-nums; }
.auth { max-width: 430px; margin: 2rem auto; }
.auth h1 { margin-top: .2rem; }
.auth input { width: 100%; }
.scroll { overflow-x: auto; }
.only-sm { display: none; }
.cls-title { font-family: var(--display); font-size: 1.25rem; font-weight: 800; color: var(--navy); }

/* hero: chart of the course + countdown */
.hero { position: relative; overflow: hidden; padding: 1.8rem 1.6rem 1.6rem; border-radius: 10px; margin-bottom: 1.2rem;
        background: var(--navy); color: #f3ead7; border: 1px solid #0b1428; box-shadow: 0 12px 30px rgba(20, 33, 61, .25); }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 5vw, 3rem); margin: .3rem 0 .4rem; max-width: 16ch; }
.hero .sub { color: #cfc6b2; }
.hero .kicker { color: var(--brass); }
.hero a { color: #f2c46d; }
.hero .rose { position: absolute; right: -40px; top: -40px; width: 300px; height: 300px; opacity: .16; pointer-events: none; }
.route { margin: 1.1rem 0 .2rem; max-width: 560px; }
.route svg { width: 100%; height: 64px; display: block; }
.countdown { display: flex; gap: .5rem; margin: 1rem 0 .3rem; }
.countdown div { background: rgba(243, 234, 215, .08); border: 1px solid rgba(184, 134, 43, .55); border-radius: 6px; padding: .4rem .3rem; min-width: 4.3rem; text-align: center; }
.countdown b { display: block; font-size: 2.3rem; line-height: 1; color: #f2c46d; font-variant-numeric: tabular-nums; }
.countdown span { font-size: .68rem; color: #cfc6b2; text-transform: uppercase; letter-spacing: .12em; }
.hero button { background: var(--brass); color: var(--navy); box-shadow: 0 3px 0 #7d5a17; }
.hero button:hover { background: #c99636; }

/* podium of the bettors */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: .6rem; max-width: 620px; margin: .6rem auto 1.4rem; }
.podium .step { text-align: center; }
.podium .who { font-family: var(--display); font-weight: 800; font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .who a { color: var(--navy); }
.podium .pts { color: var(--muted); font-size: .85rem; margin-bottom: .35rem; }
.podium .block { border-radius: 4px 4px 0 0; display: flex; align-items: flex-start; justify-content: center; padding-top: .4rem;
                 font-size: 2.4rem; color: rgba(255, 255, 255, .92); border-bottom: 4px solid var(--navy); }
.podium .p1 .block { height: 120px; background: var(--gold); }
.podium .p2 .block { height: 88px; background: var(--silver); }
.podium .p3 .block { height: 64px; background: var(--bronze); }
.podium .cap { font-family: var(--num); letter-spacing: .2em; font-size: .75rem; color: var(--rum); text-transform: uppercase; font-weight: 700; }

/* chart */
.chart { position: relative; }
.chart svg { width: 100%; height: 320px; display: block; touch-action: pan-y; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--faint); font-size: 11px; }
.chart .other { stroke: #b5ab95; stroke-width: 1.5; fill: none; opacity: .7; }
.chart .me { stroke: var(--me); stroke-width: 3; fill: none; }
.chart .leader { stroke: var(--leader); stroke-width: 3; fill: none; }
.chart .xhair { stroke: var(--faint); stroke-dasharray: 3 3; }
.tip { position: absolute; pointer-events: none; background: #fffdf7; border: 1px solid var(--line2); border-radius: 6px; color: var(--ink);
       padding: .45rem .6rem; font-size: .8rem; display: none; white-space: nowrap; z-index: 3; max-height: 260px; overflow: hidden;
       box-shadow: 0 6px 16px rgba(60, 40, 10, .15); }
.legend { display: flex; gap: 1.2rem; font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }
.legend i { display: inline-block; width: 16px; height: 3px; vertical-align: middle; margin-right: .35rem; border-radius: 2px; }

footer { color: var(--faint); font-size: .8rem; text-align: center; padding: 1.8rem 1rem; border-top: 2px dotted var(--line2); max-width: 1180px; margin: 0 auto; }
footer .sig { font-family: var(--display); font-style: italic; color: var(--muted); font-size: .95rem; display: block; margin-bottom: .3rem; }
footer a { color: var(--faint); }

/* phones */
@media (max-width: 760px) {
  nav { padding: .55rem .8rem; }
  nav .brand .long, nav .brand .tag { display: none; }
  nav .brand { font-size: 1.1rem; }
  nav .links { order: 3; width: 100%; overflow-x: auto; gap: .1rem; padding-bottom: .1rem; scrollbar-width: none; }
  nav .links a { padding: .3rem .5rem; font-size: .85rem; }
  nav .links::-webkit-scrollbar { display: none; }
  main { padding: 1.1rem .7rem 2.5rem; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.2rem; margin-top: 1.6rem; }
  .card { padding: .85rem .8rem; }
  .hero { padding: 1.3rem 1rem 1.2rem; }
  .hero .rose { width: 200px; height: 200px; right: -50px; top: -50px; }
  .kpi .v { font-size: 1.9rem; }
  th, td { padding: .45rem .3rem; }
  table { font-size: .88rem; }
  .hide-sm { display: none; }
  .only-sm { display: block; }
  .chart svg { height: 230px; }
  .countdown div { min-width: 3.5rem; }
  .countdown b { font-size: 1.9rem; }
  .podium .block { font-size: 1.8rem; }
  .podium .p1 .block { height: 90px; } .podium .p2 .block { height: 66px; } .podium .p3 .block { height: 48px; }
  table.stack thead { display: none; }
  table.stack tr { display: block; border-bottom: 1px solid var(--line); padding: .5rem 0; }
  table.stack td { display: block; border: 0; padding: .15rem .2rem; }
  table.stack td[data-l]::before { content: attr(data-l); display: block; color: var(--faint); font-size: .72rem;
                                   text-transform: uppercase; letter-spacing: .04em; margin-top: .3rem; }
}
