/* ============================================================================
   YOU'RE A WINNER — styles
   ========================================================================== */

:root {
  --bg:        #0d1117;
  --bg-2:      #131a23;
  --panel:     #171f2b;
  --panel-2:   #1d2735;
  --line:      #27313f;
  --line-2:    #36445a;
  --text:      #dfe6f0;
  /* Three-step ink ramp. Every step clears WCAG AA 4.5:1 against the darkest
     surface in this file (#1d2735) — the old faint step was 3.06:1 and it was
     doing the work on section headings, form labels and ledger dates. */
  --text-dim:  #aeb9cb;   /* 7.61:1 */
  --text-faint:#8794a8;   /* 4.90:1 */
  --green:     #3fb950;
  --green-dim: #1f6f2c;
  --red:       #f0616d;
  --red-dim:   #7a2530;
  --gold:      #d9a441;
  --gold-dim:  #6b4f18;
  --blue:      #4f9cf0;
  --purple:    #a978f0;
  --shadow:    0 8px 30px rgba(0,0,0,.45);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body { overflow-y: scroll; }

a { color: var(--blue); }

h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-faint); font-weight: 700; }

p { margin: 0 0 .9em; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px 80px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.up { color: var(--green); }
.down { color: var(--red); }
.gold { color: var(--gold); }
.center { text-align: center; }
.right { text-align: right; }
.small { font-size: .85rem; }
.tiny { font-size: .76rem; }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
button {
  font-family: inherit; font-size: .92rem; font-weight: 550;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 7px;
  padding: 9px 16px; cursor: pointer;
  transition: background .12s, border-color .12s, transform .06s;
}
button:hover:not(:disabled) { background: #26334a; border-color: #4a5c78; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .38; cursor: not-allowed; }
button.primary { background: var(--gold); border-color: var(--gold); color: #221a06; font-weight: 700; }
button.primary:hover:not(:disabled) { background: #e9b755; border-color: #e9b755; }
button.danger { border-color: var(--red-dim); color: var(--red); }
button.danger:hover:not(:disabled) { background: #2b1418; }
button.ghost { background: transparent; }
button.sm { padding: 5px 11px; font-size: .82rem; }
button.wide { width: 100%; }

input[type=text], input[type=number], select {
  font-family: inherit; font-size: .92rem;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 7px;
  padding: 9px 12px; width: 100%;
}
input:focus, select:focus { border-color: var(--blue); }

/* A trapped focus ring is only useful if you can see it. One visible indicator
   for everything keyboard-reachable, including the SVG map. */
:focus-visible { outline: 2px solid #79b8ff; outline-offset: 2px; }
.usmap path.st:focus-visible { outline: none; stroke: #79b8ff; stroke-width: 2.5; }
.usmap text.stlabel:focus-visible { outline: 2px solid #79b8ff; outline-offset: 1px; }
label { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em;
        color: var(--text-faint); font-weight: 700; margin-bottom: 5px; }

/* ---------- Panels ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px; margin-bottom: 18px;
}
.panel.tight { padding: 14px 16px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* ---------- Splash / setup ---------- */
#splash { padding-top: 60px; }
.logo {
  font-family: var(--mono); font-size: 3.1rem; font-weight: 700;
  letter-spacing: -.04em; line-height: 1.05; margin-bottom: 6px;
}
.logo span { color: var(--gold); }
.tagline { color: var(--text-dim); font-size: 1.05rem; max-width: 640px; }

.opt-row { display: flex; gap: 10px; flex-wrap: wrap; }
.opt {
  flex: 1 1 200px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 13px 15px; cursor: pointer; transition: all .1s;
}
.opt:hover { border-color: var(--line-2); }
.opt.sel { border-color: var(--gold); background: #241d0e; }
.opt b { display: block; margin-bottom: 3px; }
.opt span { display: block; }
.opt .small { color: var(--text-dim); }
.opt .range { font-family: var(--mono); font-weight: 700; color: var(--gold); margin-bottom: 5px; }

/* ---------- Claim breakdown ---------- */
.waterfall { font-family: var(--mono); font-size: .95rem; }
.wf-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.wf-row:last-child { border-bottom: none; }
.wf-row.total { border-top: 2px solid var(--line-2); font-weight: 700; font-size: 1.15rem; padding-top: 14px; }
.wf-row .lbl { color: var(--text-dim); }
.wf-row .lbl b { color: var(--text); font-weight: 600; }
.bar { height: 26px; border-radius: 5px; display: flex; overflow: hidden; margin: 14px 0 6px; }
.bar div { height: 100%; }
.bar .b-net { background: var(--green); }
.bar .b-fed { background: var(--red); }
.bar .b-state { background: #b8553f; }
.bar .b-true { background: var(--gold); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--text-dim); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }

/* ---------- Top bar ---------- */
#topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(13,17,23,.94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
/* The right padding keeps the topbar clear of the fixed sound toggle, which
   sits at top:14 right:16 and otherwise lands on top of the last button. */
.tb-inner { max-width: 1180px; margin: 0 auto; padding: 11px 68px 11px 20px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.tb-date { font-family: var(--mono); font-weight: 700; font-size: 1rem; min-width: 130px; }
.tb-stat { display: flex; flex-direction: column; line-height: 1.2; }
.tb-stat .k { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); font-weight: 700; }
.tb-stat .v { font-family: var(--mono); font-weight: 650; font-size: .98rem; }
.tb-spacer { flex: 1; }

#tabs { display: flex; gap: 2px; max-width: 1180px; margin: 0 auto; padding: 0 20px;
  border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  border-radius: 0; padding: 11px 15px; color: var(--text-dim); font-weight: 600;
  font-size: .9rem; white-space: nowrap;
}
.tab:hover { background: transparent; color: var(--text); border-color: var(--line-2); }
.tab.active { color: var(--gold); border-color: var(--gold); }

/* ---------- Meters ---------- */
.meter { margin-bottom: 11px; }
.meter .mlbl { display: flex; justify-content: space-between; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-weight: 700; margin-bottom: 4px; }
.meter .track { height: 7px; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.meter .fill { height: 100%; border-radius: 4px; transition: width .3s; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
     color: var(--text-faint); font-weight: 700; padding: 7px 10px; border-bottom: 1px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.022); }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 15px 17px; margin-bottom: 12px;
}
.card.sel { border-color: var(--gold); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.card-head b { font-size: 1rem; }
.card .firm { color: var(--text-faint); font-size: .82rem; }
.price-tag { font-family: var(--mono); font-weight: 700; color: var(--gold); white-space: nowrap; }
.pitch { font-style: italic; color: var(--text-dim); border-left: 2px solid var(--line-2);
         padding-left: 11px; margin: 9px 0; font-size: .89rem; }
.tell { background: rgba(79,156,240,.07); border: 1px solid rgba(79,156,240,.2);
        border-radius: 6px; padding: 8px 11px; font-size: .84rem; margin: 9px 0; }
.tell b { color: var(--blue); }
.reveal { background: rgba(217,164,65,.08); border: 1px solid var(--gold-dim);
          border-radius: 6px; padding: 8px 11px; font-size: .84rem; margin: 9px 0; }

.badge { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: 2px 7px; border-radius: 4px; background: var(--panel-2);
  color: var(--text-dim); border: 1px solid var(--line-2); }
.badge.good { color: var(--green); border-color: var(--green-dim); background: rgba(63,185,80,.1); }
.badge.bad  { color: var(--red); border-color: var(--red-dim); background: rgba(240,97,109,.1); }
.badge.gold { color: var(--gold); border-color: var(--gold-dim); background: rgba(217,164,65,.1); }

/* ---------- Modal ---------- */
#modal-bg {
  position: fixed; inset: 0; background: rgba(3,6,11,.8); backdrop-filter: blur(4px);
  z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px;
  max-width: 660px; width: 100%; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow); padding: 26px 28px;
}
.modal h2 { margin-bottom: 4px; }
.modal .kicker { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--gold); font-weight: 700; margin-bottom: 6px; }
.modal .body { color: var(--text-dim); white-space: pre-wrap; margin-bottom: 18px; }
.choice {
  display: block; width: 100%; text-align: left; margin-bottom: 9px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 13px 15px;
}
.choice:hover { border-color: var(--gold); background: #1e2634; }
.choice b { display: block; font-size: .95rem; margin-bottom: 2px; }
.choice .small { color: var(--text-faint); }

/* ---------- Log ---------- */
.logline { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.logline:last-child { border-bottom: none; }
.logline .when { font-family: var(--mono); font-size: .76rem; color: var(--text-faint);
  min-width: 92px; padding-top: 2px; }
.logline.tax .what { color: var(--gold); }
.logline.bad .what { color: var(--red); }
.logline.buy .what { color: var(--purple); }
.logline.event .what { color: var(--text); }
.logline.money .what { color: var(--text-dim); }
.logline.advisor .what { color: var(--blue); }

/* ---------- Sparkline ---------- */
.spark { width: 100%; height: 64px; display: block; }

/* ---------- Notes ---------- */
.note {
  background: rgba(217,164,65,.06); border-left: 3px solid var(--gold);
  padding: 11px 15px; border-radius: 0 8px 8px 0; font-size: .88rem;
  color: var(--text-dim); margin: 12px 0;
}
.note b { color: var(--gold); }
.warn { background: rgba(240,97,109,.07); border-left-color: var(--red); }
.warn b { color: var(--red); }

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pill { font-size: .76rem; padding: 3px 9px; border-radius: 20px;
        background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text-dim); }

.buy-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.buy-row input { flex: 1; }

footer { color: var(--text-faint); font-size: .8rem; padding: 30px 0 10px; border-top: 1px solid var(--line); margin-top: 30px; }

/* ============================================================================
   OPENING SEQUENCE — sound toggle, map, ticket, the draw
   ========================================================================== */

#sound-toggle {
  position: fixed; top: 14px; right: 16px; z-index: 500;
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
  font-size: 1.05rem; line-height: 1;
  background: rgba(23,31,43,.85); backdrop-filter: blur(6px);
}

/* ---------- Map ---------- */
.map-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .map-layout { grid-template-columns: 1fr; } }

.map-holder { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.usmap { width: 100%; height: auto; display: block; }

.usmap path.st {
  fill: #223046; stroke: #0d1117; stroke-width: 1;
  cursor: pointer; transition: fill .12s ease, stroke .12s ease;
}
.usmap path.st:hover { fill: #33455f; }
.usmap path.st:focus { outline: none; fill: #33455f; stroke: var(--blue); stroke-width: 1.6; }
.usmap path.st.sel { fill: var(--gold); stroke: #fff3d6; stroke-width: 1.4; }
.usmap path.st.nolottery {
  fill: #171f2b; stroke: #0d1117; cursor: not-allowed;
}
.usmap path.st.nolottery:hover { fill: #1e2735; }
/* Leader lines are decoration only — without this they sit on top of the tiny
   north-east states and swallow every click aimed at them. */
.usmap line.leader { stroke: #4a5c78; stroke-width: .8; pointer-events: none; }
.usmap text.stlabel {
  fill: var(--text-dim); font-family: var(--mono); font-size: 13px; font-weight: 700;
  cursor: pointer; user-select: none;
}
.usmap text.stlabel:hover { fill: var(--text); }
.usmap text.stlabel.sel { fill: var(--gold); }

.map-side {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 15px 17px; min-height: 300px;
}
.map-empty { display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; height: 260px; }
.map-empty-icon { font-size: 2.6rem; opacity: .35; margin-bottom: 10px; }
.side-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.side-head b { font-size: 1.12rem; }
.side-table { font-size: .85rem; }
.side-table td { padding: 6px 0; }
.side-table td.k { color: var(--text-dim); }
.side-net {
  margin-top: 12px; padding: 12px 14px; border-radius: 8px;
  background: rgba(63,185,80,.07); border: 1px solid var(--green-dim);
  display: flex; flex-direction: column;
}
.side-net .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-faint); font-weight: 700; }
.side-net .v { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: var(--green); }

/* ---------- The draw screen ---------- */
#drawscreen {
  position: fixed; inset: 0; z-index: 300; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 0%, #1b2436 0%, #0d1117 62%);
}
.draw-inner {
  max-width: 620px; margin: 0 auto; padding: 34px 20px 60px;
  min-height: 100vh; justify-content: center;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.draw-kicker {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--text-faint); font-weight: 700; min-height: 22px; margin-bottom: 18px;
}
.draw-kicker .gold { color: var(--gold); letter-spacing: .12em; font-size: 1rem; }

.ball-rack { display: flex; gap: 9px; justify-content: center; min-height: 56px; margin-bottom: 22px; flex-wrap: wrap; }
.ball {
  width: 50px; height: 50px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffffff 0%, #e6e9ee 45%, #b9c0cb 100%);
  color: #10151d; font-family: var(--mono); font-weight: 800; font-size: 1.18rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 5px 16px rgba(0,0,0,.55), inset 0 -3px 7px rgba(0,0,0,.18);
  opacity: 0; transform: translateY(-42px) scale(.55) rotate(-25deg);
  transition: opacity .32s ease-out, transform .42s cubic-bezier(.2,1.5,.45,1);
}
.ball.in { opacity: 1; transform: none; }
.ball.bonus {
  background: radial-gradient(circle at 34% 30%, #ff8f8f 0%, #e8404f 48%, #9d1a26 100%);
  color: #fff; box-shadow: 0 5px 20px rgba(232,64,79,.45), inset 0 -3px 7px rgba(0,0,0,.3);
}

/* ---------- The ticket ---------- */
.ticket-stage { width: 100%; display: flex; justify-content: center; perspective: 900px; }
.ticket {
  position: relative; width: 100%; max-width: 380px; text-align: left;
  background: repeating-linear-gradient(180deg, #fbf7ec 0px, #fbf7ec 22px, #f6f1e3 22px, #f6f1e3 23px);
  color: #22201a; border-radius: 3px; padding: 18px 20px 16px;
  font-family: var(--mono); font-size: .78rem; line-height: 1.5;
  box-shadow: 0 22px 46px rgba(0,0,0,.6), 0 2px 0 rgba(255,255,255,.35) inset;
  opacity: 0; transform: translateY(150px) rotateX(38deg);
  transition: opacity .5s ease-out, transform .95s cubic-bezier(.16,.9,.3,1);
}
.ticket.printed { opacity: 1; transform: none; }
.ticket-notch {
  position: absolute; top: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: #0d1117;
}
.ticket-notch.left { left: -9px; }
.ticket-notch.right { right: -9px; }
.t-head { text-align: center; margin-bottom: 6px; }
.t-logo { font-size: 1.32rem; font-weight: 800; letter-spacing: .14em; }
.t-op { font-size: .62rem; letter-spacing: .16em; color: #6d6759; }
.t-rule { border-top: 1px dashed #b6ad96; margin: 9px 0; }
.t-meta { display: flex; justify-content: space-between; gap: 10px; font-size: .72rem; color: #4a4639; }
.t-meta span:last-child { color: #22201a; font-weight: 700; }
.t-meta.big { font-size: .92rem; }
.t-meta.big span:last-child { font-size: 1.02rem; }
.t-play { display: flex; align-items: center; gap: 7px; margin: 10px 0 4px; flex-wrap: wrap; }
.t-letter { font-weight: 800; font-size: .9rem; color: #6d6759; }
.tnum {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; padding: 3px 5px; border: 1.4px solid #22201a; border-radius: 3px;
  font-weight: 800; font-size: .95rem; background: transparent;
  transition: background .25s, color .25s, transform .25s, box-shadow .25s;
}
.tnum.bonus { border-color: #b3202e; color: #b3202e; }
.tnum.hit { background: #1f7a33; border-color: #1f7a33; color: #fff; transform: scale(1.12); box-shadow: 0 0 14px rgba(31,122,51,.6); }
.tnum.bonus.hit { background: #b3202e; border-color: #b3202e; color: #fff; box-shadow: 0 0 14px rgba(179,32,46,.6); }
.t-play-note { font-size: .62rem; color: #6d6759; letter-spacing: .06em; }
.t-barcode { font-size: .82rem; letter-spacing: -1px; overflow: hidden; white-space: nowrap; color: #22201a; }
.t-serial { font-size: .68rem; color: #6d6759; letter-spacing: .12em; }
.t-fine { font-size: .55rem; color: #857e6d; margin-top: 8px; line-height: 1.4; }
/* Sits low on the ticket so it never covers the drawn numbers or the
   jackpot line — those are the whole point of the screen. */
.t-stamp {
  position: absolute; top: 79%; left: 50%;
  font-size: 2rem; font-weight: 900; letter-spacing: .16em;
  color: rgba(179,32,46,.7); border: 4px solid rgba(179,32,46,.7);
  padding: 2px 14px; border-radius: 6px; pointer-events: none;
  transform: translate(-50%,-50%) rotate(-14deg) scale(2.6); opacity: 0;
  transition: opacity .3s ease-out, transform .45s cubic-bezier(.2,1.4,.4,1);
}
.t-stamp.on { opacity: 1; transform: translate(-50%,-50%) rotate(-14deg) scale(1); }

.draw-result { margin-top: 28px; }
.win-amount {
  font-family: var(--mono); font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 800;
  color: var(--gold); letter-spacing: -.02em; line-height: 1.1;
  text-shadow: 0 0 40px rgba(217,164,65,.35);
}
.win-sub { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-faint); font-weight: 700; }

/* ---------- In-game motion ---------- */
@keyframes pulseUp   { 0% { color: var(--green); } 100% { } }
@keyframes pulseDown { 0% { color: var(--red);   } 100% { } }
.pulse-up   { animation: pulseUp .9s ease-out; }
.pulse-down { animation: pulseDown .9s ease-out; }

@keyframes tabEnter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tab-enter { animation: tabEnter .22s ease-out; }

@keyframes dateRoll { from { opacity: 0; transform: translateY(-9px); } to { opacity: 1; transform: none; } }
.tb-date.roll { animation: dateRoll .3s ease-out; }

@keyframes modalIn { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }
.modal.in { animation: modalIn .26s cubic-bezier(.2,.9,.3,1); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .ticket { opacity: 1; transform: none; }
  .ball { opacity: 1; transform: none; }
}

/* ============================================================================
   THE SIXTY DAYS
   ========================================================================== */
.daybar-wrap {
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 16px 20px; margin-bottom: 18px;
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(10px);
}
.daybar-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.daycount {
  font-family: var(--mono); font-size: 2.1rem; font-weight: 800;
  color: var(--gold); line-height: 1;
}
.daylabel { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-faint); font-weight: 700; }
.dayfee { font-family: var(--mono); font-size: .85rem; color: var(--text-dim); }
.daybar-wrap .track { height: 8px; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.daybar-wrap .fill { height: 100%; border-radius: 4px; transition: width .35s ease; }

.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pc-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color .12s, opacity .12s;
}
.pc-card:hover { border-color: var(--line-2); }
.pc-card.taken { border-color: var(--green-dim); background: rgba(63,185,80,.05); }
.pc-card.off { opacity: .42; }
.pc-head { display: flex; gap: 11px; align-items: flex-start; }
.pc-icon { font-size: 1.5rem; line-height: 1.1; }
.pc-head b { font-size: .98rem; display: block; }
.pc-cost { font-family: var(--mono); font-size: .76rem; color: var(--gold); }
.pc-detail {
  font-size: .8rem; color: var(--text-faint);
  border-left: 2px solid var(--line-2); padding-left: 10px;
}
.pc-card button { align-self: flex-start; margin-top: auto; }
.pc-card .badge { align-self: flex-start; margin-top: auto; }
.pill.done { border-color: var(--green-dim); color: var(--green); background: rgba(63,185,80,.08); }

/* ---------- The children ---------- */
.kid-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.kid-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 13px 15px;
}
.kid-head { display: flex; justify-content: space-between; align-items: baseline; }
.kid-head b { font-size: 1.02rem; }
.kid-age {
  font-family: var(--mono); font-size: .8rem; color: var(--text-faint);
  border: 1px solid var(--line-2); border-radius: 20px; padding: 1px 9px;
}
.kid-card .meter { margin-top: 10px; margin-bottom: 6px; }

/* ============================================================================
   CHARTS
   ========================================================================== */
.ch-wrap { position: relative; margin-top: 6px; }
.ch { width: 100%; height: auto; display: block; overflow: visible; }
/* Axis text, the crosshair and the reference line are decoration. Without
   pointer-events:none the crosshair sits on top of the hover bands and
   swallows every mousemove — the same trap as the map's label leaders. */
.ch-tick, .ch-ref, .ch-endlabel, .ch-cross { pointer-events: none; }
.ch-tick { fill: #8794a8; font-size: 11px; font-family: var(--mono); }
.ch-ref { fill: #aeb9cb; font-size: 11px; font-family: var(--sans); font-weight: 600; }
.ch-endlabel { fill: #dfe6f0; font-size: 13px; font-family: var(--mono); font-weight: 700; }
.ch-hot rect { cursor: crosshair; }

.ch-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.ch-key { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-dim); }
.ch-key i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.ch-tip {
  position: absolute; pointer-events: none; opacity: 0;
  background: #0b1017; border: 1px solid var(--line-2); border-radius: 6px;
  padding: 6px 10px; font-size: .78rem; color: var(--text); white-space: nowrap;
  box-shadow: var(--shadow); transition: opacity .1s; z-index: 5;
}
.ch-tip.on { opacity: 1; }

.ch-table { margin-top: 8px; }
.ch-table summary {
  cursor: pointer; font-size: .76rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-faint); font-weight: 700; list-style: none;
}
.ch-table summary::-webkit-details-marker { display: none; }
.ch-table summary::before { content: '▸ '; }
.ch-table[open] summary::before { content: '▾ '; }
.ch-table table { margin-top: 8px; font-size: .8rem; max-height: 260px; }
.ch-table > table { display: block; overflow-y: auto; max-height: 260px; }

/* Horizontal part-to-whole: 2px surface gaps, never strokes */
.ch-stack { display: flex; height: 26px; border-radius: 5px; overflow: hidden; margin: 10px 0 8px; gap: 2px; }
.ch-seg { height: 100%; }
.ch-stack-table td { padding: 7px 10px; }
.ch-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }

/* A dialog that must be answered gets no close affordance and a firmer edge. */
.modal.undismissable { border-color: var(--gold-dim); }
#modal-bg { overscroll-behavior: contain; }
.modal:focus { outline: none; }

/* ============================================================================
   THE MONTH IN REVIEW
   ========================================================================== */
.panel.review { border-color: var(--line-2); background: linear-gradient(180deg, #1a2331 0%, var(--panel) 60%); }
.review-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.review-delta {
  font-family: var(--mono); font-size: 1.55rem; font-weight: 800;
  line-height: 1.1; text-align: right;
}
.review-delta .tiny { display: block; font-weight: 600; }
.review-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 720px) { .review-cols { grid-template-columns: 1fr; } }
.review-col h5 {
  margin: 0 0 7px; font-size: .72rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-faint); font-weight: 700;
}
.review-line {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 5px 0; font-size: .87rem; border-bottom: 1px solid var(--line);
}
.review-line:last-child { border-bottom: none; }
.review-line > span:first-child { color: var(--text-dim); }
.review-line.total { border-top: 1px solid var(--line-2); font-weight: 700; margin-top: 3px; padding-top: 8px; }
.review-line.total > span:first-child { color: var(--text); }
.review-net {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--line-2);
  font-weight: 700; font-size: 1.05rem;
}

/* ============================================================================
   THE AMOUNT PICKER
   ========================================================================== */
.amt {
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 15px 17px;
}
.amt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.amt-value { font-size: 1.9rem; font-weight: 800; color: var(--gold); line-height: 1.1; }
.amt-pct { font-size: .8rem; color: var(--text-faint); white-space: nowrap; }

.amt-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px; margin: 10px 0 4px;
  background: transparent; padding: 0; border: none;
}
.amt-slider::-webkit-slider-runnable-track {
  height: 8px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line-2);
}
.amt-slider::-moz-range-track {
  height: 8px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line-2);
}
.amt-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%; margin-top: -8px;
  background: var(--gold); border: 2px solid #221a06; cursor: grab;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.amt-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold); border: 2px solid #221a06; cursor: grab;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.amt-slider:active::-webkit-slider-thumb { cursor: grabbing; }

.amt-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.amt-chip {
  padding: 5px 12px; font-size: .8rem; font-weight: 650;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 20px;
}
.amt-field {
  flex: 1 1 130px; min-width: 110px;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.amt-hint { margin-top: 7px; line-height: 1.5; }
.amt-hint .mono { color: var(--text-dim); }

.amt-foot { margin-top: 12px; }
.amt-foot:empty { margin-top: 0; }
.amt-ba {
  display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  font-size: .87rem; padding: 5px 0; border-bottom: 1px solid var(--line);
}
.amt-ba:last-child { border-bottom: none; }
.amt-ba > span:first-child { color: var(--text-dim); }

.amt-warn { margin-top: 8px; color: var(--red); display: none; }
.amt-warn.on { display: block; }

.amt-note { margin-top: 8px; font-size: .82rem; color: var(--text-dim); }

/* The transfer block on the banking tab */
.xfer { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; margin-bottom: 14px; }
@media (max-width: 640px) { .xfer { grid-template-columns: 1fr; } .xfer .xfer-arrow { display: none; } }
.xfer-arrow { padding-bottom: 10px; color: var(--text-faint); font-size: 1.1rem; }

/* ============================================================================
   YOUR LIFE RIGHT NOW — the setup section and the household tab
   ========================================================================== */
.life-summary { margin: 14px 0 16px; }
.life-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.life-title { flex: 1 1 auto; }
.life-num { width: 130px; text-align: right; font-family: var(--mono); }
.life-unit { color: var(--text-faint); font-size: .82rem; }
.life-budget td, .life-debts td { padding: 6px 8px; }
.life-budget td:first-child, .life-debts td:first-child { color: var(--text-dim); }
.life-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 10px; margin-top: 6px; border-top: 2px solid var(--line-2); font-weight: 700;
}

/* ---------- Game body: content + advisory rail ---------- */
/* The rail is a sidebar on wide screens and a normal block underneath the
   tab content on narrow ones. It reads after the main content in the DOM,
   so keyboard order and screen-reader order both stay correct. */
.gamebody {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 0;
  max-width: 1560px;
  margin: 0 auto;
  align-items: start;
}
.gamebody > .wrap { max-width: 1180px; margin: 0; }

#rail {
  position: sticky; top: 96px;
  padding: 22px 20px 60px 4px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  scrollbar-width: thin;
}
#rail h4 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-faint); font-weight: 700; margin: 0 0 4px;
}
#rail .rail-sub { font-size: .78rem; color: var(--text-faint); margin: 0 0 12px; }

.advice {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: 9px; padding: 12px 14px; margin-bottom: 10px;
}
.advice.u3 { border-left-color: var(--red); }
.advice.u2 { border-left-color: var(--gold); }
.advice.u1 { border-left-color: var(--blue); }
.advice .from {
  display: flex; align-items: baseline; gap: 6px;
  font-size: .74rem; color: var(--text-faint); margin-bottom: 6px;
}
.advice .from b { color: var(--text-dim); font-size: .78rem; font-weight: 650; }
.advice .head { font-weight: 700; font-size: .9rem; margin-bottom: 5px; line-height: 1.3; }
.advice .said {
  font-size: .83rem; line-height: 1.5; color: var(--text-dim);
  font-style: italic;
}
.advice .said::before { content: '\201C'; }
.advice .said::after  { content: '\201D'; }

.advice-empty {
  background: var(--bg-2); border: 1px dashed var(--line-2);
  border-radius: 9px; padding: 12px 14px; margin-bottom: 10px;
}
.advice-empty .head { font-weight: 700; font-size: .85rem; margin-bottom: 4px; }
.advice-empty .why { font-size: .8rem; line-height: 1.45; color: var(--text-faint); }

@media (max-width: 1180px) {
  .gamebody { grid-template-columns: minmax(0, 1fr); }
  .gamebody > .wrap { max-width: 1180px; margin: 0 auto; }
  #rail {
    position: static; max-height: none; overflow: visible;
    max-width: 1180px; margin: 0 auto; padding: 0 20px 60px;
  }
}

/* ---------- Autoplay ---------- */
.tb-auto { display: flex; align-items: center; gap: 6px; }
.tb-auto select {
  padding: 6px 8px; font-size: .8rem; width: auto; min-width: 0;
}
button.playing { background: var(--gold-dim); border-color: var(--gold); color: #fff; }
.autoplay-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  height: 3px; background: rgba(217,164,65,.18);
}
.autoplay-bar > i {
  display: block; height: 100%; background: var(--gold);
  transform-origin: left center;
}
