/* Payday: PHX Good Readiness money game */
:root {
  --bg: #fff6ec;
  --bg-2: #ffe9d4;
  --surface: #ffffff;
  --surface-2: #fff3e6;
  --ink: #1d1b2e;
  --ink-2: #4a4662;
  --line: rgba(29, 27, 46, 0.12);
  --shadow: 0 1px 2px rgba(60, 30, 10, 0.06), 0 8px 24px rgba(60, 30, 10, 0.09);
  --shadow-lg: 0 2px 4px rgba(60, 30, 10, 0.08), 0 24px 60px rgba(60, 30, 10, 0.18);
  --accent: #c2410c;
  --accent-2: #ea580c;
  --accent-ink: #ffffff;
  --sun-1: #ffb347;
  --sun-2: #ff7a45;
  --m1: #f6b48a;
  --m2: #eb9a6b;
  --cactus: #2f8a5b;

  --needs: #2563eb;
  --save: #059669;
  --fun: #db2777;
  --cush: #d97706;
  --needs-soft: #dbeafe;
  --save-soft: #d1fae5;
  --fun-soft: #fce7f3;
  --cush-soft: #fef3c7;

  --bill: #1f9d63;
  --bill-2: #157a4c;
  --bill-ink: #ffffff;
  --gold: #f5b72e;

  --skin: #8a5636;
  --skin-d: #6b3f25;
  --hair: #1f1511;
  --hoodie: #26457a;
  --hood: #1c355f;
  --vest: #ff7a1a;
  --reflect: #f1f5f4;

  --radius: 20px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15132b; --bg-2: #1d1a3a; --surface: #221f42; --surface-2: #2b2752;
    --ink: #f7f4ff; --ink-2: #cbc6e8; --line: rgba(255, 255, 255, 0.12);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.35), 0 24px 60px rgba(0,0,0,.55);
    --sun-1: #ff9e5e; --sun-2: #d9467b; --m1: #4b3b7a; --m2: #362a62; --cactus: #2a6b4f;
    --needs-soft: #1e2b55; --save-soft: #133c35; --fun-soft: #43183a; --cush-soft: #45320f;
    --needs: #6b9bff; --save: #34d399; --fun: #f472b6; --cush: #fbbf24;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15132b; --bg-2: #1d1a3a; --surface: #221f42; --surface-2: #2b2752;
  --ink: #f7f4ff; --ink-2: #cbc6e8; --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.35), 0 24px 60px rgba(0,0,0,.55);
  --sun-1: #ff9e5e; --sun-2: #d9467b; --m1: #4b3b7a; --m2: #362a62; --cactus: #2a6b4f;
  --needs-soft: #1e2b55; --save-soft: #133c35; --fun-soft: #43183a; --cush-soft: #45320f;
  --needs: #6b9bff; --save: #34d399; --fun: #f472b6; --cush: #fbbf24;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(120% 60% at 50% -10%, var(--bg-2), transparent 70%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.money { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; border-radius: 12px; }

.app { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 16px 8px;
  position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.logo-ph {
  font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--ink-2);
  border: 1.5px dashed var(--line); border-color: color-mix(in srgb, var(--ink) 30%, transparent);
  padding: 5px 7px; border-radius: 8px; white-space: nowrap;
}
.brand-name { font-weight: 800; font-size: 15px; white-space: nowrap; }
.top-status { position: absolute; left: 50%; transform: translateX(-50%); }
.payday-pill {
  display: inline-block; background: var(--ink); color: var(--bg); font-weight: 800; font-size: 13px;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.top-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .2s var(--spring);
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .i-spk { fill: var(--ink); }
.icon-btn .i-sun circle { fill: var(--ink); stroke: none; }
.icon-btn[aria-pressed="false"] .i-on, .icon-btn[aria-pressed="true"] .i-off { display: none; }
#themeBtn .i-sun { display: none; }
:root[data-theme="dark"] #themeBtn .i-sun { display: inline; }
:root[data-theme="dark"] #themeBtn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #themeBtn .i-sun { display: inline; }
  :root:not([data-theme="light"]) #themeBtn .i-moon { display: none; }
}
.icon-btn .i-moon { fill: var(--ink); stroke: none; }

/* When game is running on phones, hide brand name to make room for the pill */
@media (max-width: 520px) {
  .app[data-screen="game"] .brand-name { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  border: 0; cursor: pointer; border-radius: 16px; padding: 14px 20px; font-weight: 800; font-size: 17px;
  transition: transform .25s var(--spring), box-shadow .2s, background .2s, opacity .2s;
  touch-action: manipulation;
}
.btn-primary {
  background: linear-gradient(180deg, #d4501a, var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 4px 0 #8f2e08, 0 10px 24px rgba(194, 65, 12, .35);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #8f2e08, 0 4px 10px rgba(194, 65, 12, .3); }
.btn-primary:disabled {
  background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line); cursor: not-allowed; transform: none;
}
.btn-big { padding: 16px 26px; font-size: 18px; }
.btn-ghost { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }

.eyebrow { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
:root[data-theme="dark"] .eyebrow { color: #ffa36b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .eyebrow { color: #ffa36b; } }
.fineprint { font-size: 13px; color: var(--ink-2); margin: 10px 0 0; }

.screen { flex: 1; width: 100%; }

/* ---------- Title ---------- */
.screen-title { display: flex; flex-direction: column; padding: 0 16px 24px; }
.title-art {
  position: relative; height: 290px; border-radius: 28px; overflow: hidden; margin-top: 4px;
  background: linear-gradient(180deg, var(--sun-1) -20%, var(--sun-2) 120%);
  box-shadow: var(--shadow-lg);
}
.sky-sun {
  position: absolute; width: 190px; height: 190px; border-radius: 50%; left: 50%; top: 40px; transform: translateX(-50%);
  background: radial-gradient(circle, #fff4c9 0 55%, rgba(255, 244, 201, 0) 70%); opacity: .85;
}
.desert { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 150px; }
.desert .m1 { fill: var(--m1); }
.desert .m2 { fill: var(--m2); }
.desert .cactus path { fill: var(--cactus); }
.title-jordan { position: absolute; left: 50%; bottom: -6px; width: 220px; transform: translateX(-50%); animation: bob 3.6s ease-in-out infinite; }
.float-bill, .float-coin { position: absolute; }
.float-bill {
  width: 62px; height: 32px; border-radius: 6px; background: var(--bill);
  box-shadow: inset 0 0 0 3px var(--bill-2), 0 6px 12px rgba(0,0,0,.18);
}
.float-bill::after { content: "$"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 18px; }
.float-coin { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); box-shadow: inset 0 0 0 4px #e09b12, 0 6px 12px rgba(0,0,0,.18); }
.fb1 { left: 9%; top: 30%; animation: drift 5s ease-in-out infinite; transform: rotate(-14deg); }
.fb2 { right: 8%; top: 18%; animation: drift 6s ease-in-out -2s infinite; transform: rotate(12deg); }
.fc1 { left: 22%; top: 12%; animation: drift 4.4s ease-in-out -1s infinite; }
.fc2 { right: 22%; top: 50%; animation: drift 5.4s ease-in-out -3s infinite; }
@keyframes drift { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -12px; rotate: 8deg; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }

.title-copy { padding: 22px 4px 0; max-width: 520px; }
.game-logo {
  margin: 4px 0 6px; font-size: 64px; line-height: .95; font-weight: 900; letter-spacing: -.03em;
  display: flex; gap: 2px;
}
.game-logo span:first-child { color: var(--ink); }
.game-logo span:last-child { color: var(--accent); }
:root[data-theme="dark"] .game-logo span:last-child { color: #ff8a4c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .game-logo span:last-child { color: #ff8a4c; } }
.lede { font-size: 18px; margin: 0 0 16px; color: var(--ink); }
.how { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 10px; }
.how li { display: flex; gap: 12px; align-items: center; font-size: 16px; color: var(--ink-2); }
.how b { color: var(--ink); }
.how-ic {
  flex: none; width: 30px; height: 30px; border-radius: 10px; background: var(--ink); color: var(--bg);
  display: grid; place-items: center; font-weight: 900; font-size: 15px;
}

@media (min-width: 900px) {
  .screen-title { flex-direction: row; align-items: center; gap: 48px; padding: 16px 48px 40px; max-width: 1240px; margin: 0 auto; }
  .title-art { flex: 1.1; height: 600px; max-height: calc(100dvh - 120px); }
  .title-copy { flex: 1; padding: 0; }
  .title-jordan { width: 380px; }
  .sky-sun { width: 300px; height: 300px; top: 70px; }
  .desert { height: 240px; }
  .game-logo { font-size: 104px; }
  .lede { font-size: 20px; }
}

/* ---------- Meet ---------- */
.screen-meet { display: grid; place-items: center; padding: 8px 16px 24px; }
.meet-card {
  width: 100%; max-width: 920px; background: var(--surface); border-radius: 28px; box-shadow: var(--shadow-lg);
  overflow: hidden; display: flex; flex-direction: column;
}
.meet-jordan {
  height: 210px; background: linear-gradient(180deg, var(--needs-soft), var(--save-soft));
  display: flex; justify-content: center; align-items: flex-end;
}
.meet-jordan .jordan { width: 210px; display: block; }
.meet-copy { padding: 20px 20px 24px; }
.meet-copy h2 { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: -.02em; }
.meet-sub { margin: 2px 0 14px; color: var(--ink-2); }
.facts { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.facts li { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.fact-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; }
.fact-ic svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="dark"] .fact-ic svg { stroke: #ffa36b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fact-ic svg { stroke: #ffa36b; } }
.goals-peek { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gp { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border-radius: 16px; padding: 12px; }
.gp b { display: block; font-size: 14px; line-height: 1.2; }
.gp span { font-size: 13px; color: var(--ink-2); }
.gp-ic, .meter-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background-repeat: no-repeat; background-position: center; background-size: 22px; }
.gp-ic.car, .meter-ic.car { background-color: var(--save-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 15l1.6-5h10.8l1.6 5M3.5 15h17v3.5h-17zM7 18.5v1.8M17 18.5v1.8'/%3E%3C/svg%3E"); }
.gp-ic.key, .meter-ic.key { background-color: var(--cush-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='12' r='4'/%3E%3Cpath d='M12 12h9M18 12v3M21 12v2'/%3E%3C/svg%3E"); }
.meter-ic.heart { background-color: var(--fun-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23db2777'%3E%3Cpath d='M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z'/%3E%3C/svg%3E"); }
.meet-copy .btn { margin-top: 16px; width: 100%; }
@media (min-width: 900px) {
  .meet-card { flex-direction: row; }
  .meet-jordan { height: auto; width: 46%; min-height: 520px; }
  .meet-jordan .jordan { width: 360px; }
  .meet-copy { padding: 40px; flex: 1; }
  .meet-copy h2 { font-size: 44px; }
  .meet-copy .btn { width: auto; }
}

/* ---------- Game ---------- */
.screen-game { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px; }
.hud { display: grid; grid-template-columns: 1fr; gap: 8px; }
.hud-jordan { display: flex; gap: 10px; align-items: center; }
.jordan-wrap { flex: none; width: 74px; height: 74px; border-radius: 50%; overflow: hidden; background: linear-gradient(180deg, var(--needs-soft), var(--save-soft)); box-shadow: inset 0 0 0 2px var(--line); position: relative; }
.jordan-wrap .jordan { width: 100%; height: 100%; display: block; transform: translateY(6%) scale(1.15); transform-origin: 50% 40%; }
.bubble {
  position: relative; flex: 1; background: var(--surface); border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow);
  font-weight: 700; font-size: 15px; line-height: 1.3; min-height: 54px; display: flex; align-items: center;
}
.bubble::before {
  content: ""; position: absolute; left: -7px; top: 50%; width: 16px; height: 16px; background: var(--surface);
  transform: translateY(-50%) rotate(45deg); border-radius: 3px;
}
.bubble span { position: relative; }
.bubble.pop { animation: bubblePop .45s var(--spring); }
@keyframes bubblePop { 0% { transform: scale(.92); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }

.meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.meter { background: var(--surface); border-radius: 14px; padding: 7px 9px 9px; box-shadow: var(--shadow); min-width: 0; }
.meter-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; min-width: 0; }
.meter .meter-ic { width: 22px; height: 22px; border-radius: 7px; background-size: 15px; }
.meter-name { font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.meter-val { font-size: 13px; white-space: nowrap; }
.meter-val b { font-weight: 900; }
.meter-goal { color: var(--ink-2); font-size: 12px; }
.bar { height: 9px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .9s var(--spring); }
#carBar i { background: linear-gradient(90deg, #10b981, var(--save)); }
#moveBar i { background: linear-gradient(90deg, #fbbf24, var(--cush)); }
#moodBar i { background: linear-gradient(90deg, #f472b6, var(--fun)); }
.meter.bump { animation: meterBump .6s var(--spring); }
@keyframes meterBump { 0% { transform: scale(1); } 35% { transform: scale(1.06); } 100% { transform: scale(1); } }
.hud-fine { display: none; }

/* Mobile meters: tight labels */
@media (max-width: 899px) {
  .meter-name { display: none; }
  .meter-goal { display: none; }
  .meter-top { justify-content: space-between; }
  .meter-val { font-size: 14px; }
}

.board { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.paycheck-row { display: flex; }
.stub {
  flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--surface); border-radius: 16px; padding: 9px 14px; box-shadow: var(--shadow);
  border-left: 6px solid var(--bill);
}
.stub-l { display: flex; align-items: baseline; gap: 8px; }
.stub-label { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.stub-amt { font-size: 24px; font-weight: 900; letter-spacing: -.01em; }
.stub-r { text-align: right; display: flex; flex-direction: column; line-height: 1.2; }
.stub-left { font-weight: 800; font-size: 14px; }
.stub-ex { font-size: 12px; color: var(--ink-2); }
.stub.arrive { animation: stubIn .7s var(--spring); }
@keyframes stubIn { 0% { transform: translateY(-30px) scale(.9); opacity: 0; } 100% { transform: none; opacity: 1; } }

.tray {
  position: relative; height: 92px; border-radius: 18px;
  background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--ink) 4%, transparent) 10px 20px), var(--surface-2);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.tray.empty::after {
  content: "Every bill has a job."; position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); font-weight: 800;
}
.bill {
  position: absolute; top: 50%; left: 0; width: 96px; height: 52px; margin-top: -26px;
  border-radius: 8px; border: 0; padding: 0; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  background: linear-gradient(160deg, #27b574, var(--bill) 55%, var(--bill-2));
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.25), inset 0 0 0 6px var(--bill-2), 0 3px 0 #0f5a37, 0 8px 14px rgba(0,0,0,.18);
  color: var(--bill-ink);
  transition: transform .35s var(--spring), left .45s var(--spring), box-shadow .2s;
}
.bill .b-amt { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-weight: 900; font-size: 20px; letter-spacing: -.02em; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.bill .b-seal { position: absolute; right: 10px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.bill .b-seal::after { content: ""; position: absolute; left: 7px; top: 7px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid #fff; }
.bill .b-seal::before { content: ""; position: absolute; left: 15px; top: 11.5px; width: 7px; height: 2px; background: #fff; }
.bill:hover { transform: translateY(-6px) rotate(var(--r, 0deg)); }
.bill.selected { transform: translateY(-14px) rotate(0deg) scale(1.06); box-shadow: inset 0 0 0 3px rgba(255,255,255,.25), inset 0 0 0 6px var(--bill-2), 0 0 0 3px var(--gold), 0 16px 24px rgba(0,0,0,.25); z-index: 50 !important; }
.bill.dragging { position: fixed; margin: 0; z-index: 1000 !important; cursor: grabbing; transition: none; box-shadow: inset 0 0 0 3px rgba(255,255,255,.25), inset 0 0 0 6px var(--bill-2), 0 24px 36px rgba(0,0,0,.3); }
.bill.ghost-fly { position: fixed; margin: 0; z-index: 1000; pointer-events: none; transition: none; }
.bill.deal { animation: deal .55s var(--spring) both; }
@keyframes deal { 0% { transform: translateY(-80px) rotate(-30deg) scale(.6); opacity: 0; } 100% { opacity: 1; } }

.jars { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jar-cell { position: relative; min-width: 0; }
.jar {
  --c: var(--needs); --soft: var(--needs-soft);
  width: 100%; border: 0; cursor: pointer; text-align: center; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 2px transparent;
  padding: 6px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 0;
  transition: transform .3s var(--spring), box-shadow .2s, background .2s;
  touch-action: manipulation; position: relative;
}
.jar-cell[data-jar="save"] .jar { --c: var(--save); --soft: var(--save-soft); }
.jar-cell[data-jar="fun"] .jar { --c: var(--fun); --soft: var(--fun-soft); }
.jar-cell[data-jar="cush"] .jar { --c: var(--cush); --soft: var(--cush-soft); }
.jar:hover { transform: translateY(-2px); }
.jar.hot, .jars.picking .jar { box-shadow: var(--shadow), inset 0 0 0 2.5px var(--c); background: var(--soft); }
.jar.hot { transform: scale(1.04); }
.jars.picking .jar { animation: invite 1.2s ease-in-out infinite; }
@keyframes invite { 0%, 100% { box-shadow: var(--shadow), inset 0 0 0 2.5px var(--c); } 50% { box-shadow: var(--shadow), inset 0 0 0 4px var(--c), 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); } }
.jar.gulp { animation: gulp .5s var(--spring); }
@keyframes gulp { 0% { transform: scale(1); } 30% { transform: scale(1.08, .94); } 60% { transform: scale(.97, 1.04); } 100% { transform: scale(1); } }
.jar.nope { animation: nope .4s ease; }
@keyframes nope { 0%, 100% { transform: none; } 20% { transform: translateX(-7px) rotate(-2deg); } 40% { transform: translateX(6px) rotate(2deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.jar-key {
  position: absolute; left: 8px; top: 8px; width: 22px; height: 22px; border-radius: 7px; font-size: 12px; font-weight: 900;
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
}
.jar-art { width: 74px; height: 80px; display: block; }
.jar-svg { width: 100%; height: 100%; overflow: visible; display: block; }
.jar-lid { fill: var(--c); }
.jar-neck { fill: color-mix(in srgb, var(--c) 60%, #000 0%); opacity: .55; }
.jar-glass { fill: color-mix(in srgb, var(--soft) 70%, transparent); stroke: color-mix(in srgb, var(--c) 70%, var(--ink) 0%); stroke-width: 3; }
.jar-fill { fill: var(--c); opacity: .9; }
.jar-wave { fill: var(--c); opacity: .9; transform: translateY(-5px); animation: wave 2.4s linear infinite; }
@keyframes wave { from { translate: 0 0; } to { translate: -25px 0; } }
.jar-fill-g { transform: translateY(112px); transition: transform 1s var(--spring); }
.jar-bills rect { fill: rgba(255,255,255,.28); }
.jar-goal { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 4; opacity: .55; }
.jar-shine { fill: none; stroke: rgba(255,255,255,.7); stroke-width: 4; stroke-linecap: round; }
.jar-badge { fill: var(--surface); }
.jar-icon { fill: var(--c); }
.jar-icon path { stroke: none; }
.jar-cell[data-jar="needs"] .jar-icon { fill: none; stroke: var(--c); stroke-width: 3; stroke-linejoin: round; }
.jar-cell[data-jar="needs"] .jar-icon path { stroke: var(--c); }
.jar-name { font-weight: 900; font-size: 16px; line-height: 1.15; margin-top: 2px; }
.jar-amt { font-weight: 900; font-size: 22px; line-height: 1.1; color: var(--ink); }
.jar-amt.tick { animation: tick .35s var(--spring); }
@keyframes tick { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.jar-sub { font-size: 12px; line-height: 1.25; color: var(--ink-2); margin-top: 2px; min-height: 2.5em; }
.jar-sub b { color: var(--ink); }
.jar.full .jar-sub { color: var(--save); font-weight: 800; }
:root:not([data-theme="dark"]) .jar.full .jar-sub { color: #047857; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .jar.full .jar-sub { color: #6ee7b7; } }
:root[data-theme="dark"] .jar.full .jar-sub { color: #6ee7b7; }
.jar-back {
  position: absolute; right: 6px; top: 6px; border: 0; border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 800;
  background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer;
  transition: opacity .2s, transform .25s var(--spring);
}
.jar-back:disabled { opacity: 0; pointer-events: none; transform: scale(.7); }

.board-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kbd-hint { display: none; margin: 0; font-size: 13px; color: var(--ink-2); }
kbd { font-family: inherit; font-weight: 800; font-size: 12px; background: var(--surface); border-radius: 6px; padding: 1px 6px; box-shadow: inset 0 -2px 0 var(--line), inset 0 0 0 1px var(--line); color: var(--ink); }
.btn-lock { width: 100%; }
.btn-lock.ready { animation: readyPulse 1.6s ease-in-out infinite; }
@keyframes readyPulse { 0%, 100% { box-shadow: 0 4px 0 #8f2e08, 0 10px 24px rgba(194,65,12,.35); } 50% { box-shadow: 0 4px 0 #8f2e08, 0 10px 34px rgba(234,88,12,.6); } }

@media (min-width: 900px) {
  .screen-game { display: grid; grid-template-columns: 330px 1fr; gap: 28px; padding: 8px 40px 28px; max-width: 1280px; margin: 0 auto; align-items: start; }
  .hud { gap: 14px; position: sticky; top: 16px; }
  .hud-jordan { flex-direction: column; align-items: stretch; gap: 14px; }
  .jordan-wrap { width: 100%; height: 230px; border-radius: 28px; }
  .jordan-wrap .jordan { width: 250px; height: 250px; margin: 0 auto; transform: translateY(2%); }
  .bubble { font-size: 17px; min-height: 76px; padding: 14px 18px; }
  .bubble::before { left: 50%; top: -7px; transform: translateX(-50%) rotate(45deg); }
  .meters { grid-template-columns: 1fr; gap: 10px; }
  .meter { padding: 12px 14px 14px; }
  .meter .meter-ic { width: 30px; height: 30px; background-size: 19px; }
  .meter-name { font-size: 14px; color: var(--ink); }
  .meter-val { font-size: 15px; }
  .bar { height: 12px; }
  .hud-fine { display: block; margin: 0; }
  .board { gap: 16px; }
  .stub { padding: 14px 20px; }
  .stub-amt { font-size: 30px; }
  .tray { height: 130px; }
  .bill { width: 124px; height: 66px; margin-top: -33px; border-radius: 10px; }
  .bill .b-amt { font-size: 26px; left: 16px; }
  .bill .b-seal { width: 32px; height: 32px; margin-top: -16px; }
  .bill .b-seal::after { left: 9px; top: 9px; width: 10px; height: 10px; }
  .bill .b-seal::before { left: 19px; top: 14.5px; width: 8px; }
  .jars { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .jar { padding: 14px 12px 16px; }
  .jar-art { width: 110px; height: 120px; }
  .jar-name { font-size: 19px; margin-top: 6px; }
  .jar-amt { font-size: 28px; }
  .jar-sub { font-size: 13px; }
  .jar-key { width: 26px; height: 26px; font-size: 13px; left: 10px; top: 10px; }
  .kbd-hint { display: block; }
  .btn-lock { width: auto; min-width: 280px; }
}

/* ---------- Overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, #0d0b1f 55%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .25s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.life-card { width: 100%; max-width: 400px; perspective: 1400px; }
.lc-inner { position: relative; transform-style: preserve-3d; transition: transform .8s var(--spring); transform: rotateY(0deg); }
.life-card.flipped .lc-inner { transform: rotateY(180deg); }
.lc-back, .lc-front { backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 26px; }
.lc-back {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.25) 0 8%, transparent 9%) 0 0 / 46px 46px,
    linear-gradient(150deg, var(--sun-1), var(--sun-2));
  box-shadow: var(--shadow-lg), inset 0 0 0 8px rgba(255,255,255,.35);
}
.lc-back span { color: #fff; font-weight: 900; font-size: 30px; letter-spacing: -.01em; text-shadow: 0 2px 0 rgba(0,0,0,.15); transform: rotate(-6deg); }
.lc-front { transform: rotateY(180deg); background: var(--surface); box-shadow: var(--shadow-lg); padding: 18px 18px 18px; }
.life-card.dealing { animation: dealCard .6s var(--spring) both; }
@keyframes dealCard { 0% { transform: translateY(60vh) rotate(18deg) scale(.7); } 100% { transform: none; } }
.lc-kicker { margin: 0; font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
:root[data-theme="dark"] .lc-kicker { color: #ffa36b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lc-kicker { color: #ffa36b; } }
.lc-art { height: 108px; display: grid; place-items: center; margin: 4px 0 2px; border-radius: 18px; background: var(--surface-2); }
.lc-art svg { height: 96px; width: auto; }
.lc-art .shadow { fill: rgba(0,0,0,.1); }
.lc-art .c-a { fill: #b45309; }
.lc-art .c-b { fill: #f59e0b; }
.lc-art .c-ink { fill: #1d1b2e; }
.lc-art .c-screen { fill: #e0f2fe; }
.lc-art .c-lace { stroke: #fde68a; stroke-width: 4; stroke-linecap: round; fill: none; }
.lc-art .c-crack { stroke: #1d1b2e; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.lc-art .c-dash { stroke: #fff; stroke-width: 3; stroke-dasharray: 5 5; }
.lc-art .c-line { stroke: rgba(255,255,255,.75); stroke-width: 5; stroke-linecap: round; }
.lc-art .c-hand { stroke: #1d1b2e; stroke-width: 5; stroke-linecap: round; fill: none; }
.lc-art .c-plus { stroke: #059669; stroke-width: 6; stroke-linecap: round; }
.lc-art .c-swirl { stroke: #fff; stroke-width: 5; fill: none; stroke-linecap: round; }
.lc-art svg .c-a[d^="M24"] { fill: #7c3aed; }
.lc-title { margin: 8px 0 4px; font-size: 24px; line-height: 1.15; font-weight: 900; letter-spacing: -.01em; }
.lc-text { margin: 0 0 12px; color: var(--ink-2); font-size: 16px; }
.lc-choices { display: grid; gap: 10px; }
.choice {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; text-align: left;
  border: 0; cursor: pointer; border-radius: 16px; padding: 12px 14px; background: var(--surface-2);
  box-shadow: inset 0 0 0 2px var(--line); transition: transform .25s var(--spring), box-shadow .2s, background .2s;
}
.choice:hover { box-shadow: inset 0 0 0 2px var(--accent-2); transform: translateY(-2px); }
.choice:active { transform: scale(.98); }
.choice .ch-label { font-weight: 900; font-size: 17px; }
.choice .ch-sub { grid-column: 1; font-size: 14px; color: var(--ink-2); }
.choice .ch-cost { grid-row: 1 / span 2; grid-column: 2; font-weight: 900; font-size: 16px; padding: 6px 10px; border-radius: 10px; background: var(--surface); white-space: nowrap; }
.choice .ch-cost.plus { color: #047857; }
:root[data-theme="dark"] .choice .ch-cost.plus { color: #6ee7b7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .choice .ch-cost.plus { color: #6ee7b7; } }
.lc-result { animation: resultIn .45s var(--spring) both; }
@keyframes resultIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.lc-result-text { font-size: 17px; font-weight: 700; margin: 2px 0 10px; }
.lc-result .btn { width: 100%; margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 14px; font-weight: 800; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.chip.good { background: var(--save-soft); }
.chip.bad { background: var(--fun-soft); }
.chip.warn { background: var(--cush-soft); }

.sheet {
  width: 100%; max-width: 460px; background: var(--surface); border-radius: 28px; padding: 20px; box-shadow: var(--shadow-lg);
  animation: sheetIn .5s var(--spring) both;
}
@keyframes sheetIn { from { transform: translateY(40px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.sheet-head h2 { margin: 2px 0 0; font-size: 26px; font-weight: 900; letter-spacing: -.01em; line-height: 1.1; }
.wrap-jordan { flex: none; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: linear-gradient(180deg, var(--needs-soft), var(--save-soft)); }
.wrap-jordan .jordan { width: 100%; height: 100%; transform: translateY(6%) scale(1.15); transform-origin: 50% 40%; }
.wrap-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.wrap-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); font-weight: 700; font-size: 15px; animation: rowIn .45s var(--spring) both; }
.wrap-list li .wl-ic { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 900; font-size: 15px; color: #fff; }
.wrap-list li .wl-txt { flex: 1; }
.wrap-list li .wl-val { font-weight: 900; white-space: nowrap; }
@keyframes rowIn { from { transform: translateX(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet .btn { width: 100%; }

/* ---------- Score ---------- */
.screen-score { padding: 4px 16px 32px; display: grid; justify-items: center; }
.score-card { width: 100%; max-width: 760px; background: var(--surface); border-radius: 28px; box-shadow: var(--shadow-lg); padding: 20px; animation: sheetIn .6s var(--spring) both; }
.score-hero { display: flex; align-items: center; gap: 14px; }
.score-jordan { flex: none; width: 108px; height: 108px; border-radius: 50%; overflow: hidden; background: linear-gradient(180deg, var(--sun-1), var(--sun-2)); }
.score-jordan .jordan { width: 100%; height: 100%; transform: translateY(6%) scale(1.15); transform-origin: 50% 40%; }
.score-head h2 { margin: 2px 0 4px; font-size: 32px; line-height: 1.05; font-weight: 900; letter-spacing: -.02em; }
.stars { display: flex; gap: 6px; }
.star {
  width: 34px; height: 34px; display: inline-block;
  background: color-mix(in srgb, var(--ink) 16%, transparent);
  clip-path: polygon(50% 2%, 63% 35%, 98% 37%, 71% 59%, 80% 94%, 50% 75%, 20% 94%, 29% 59%, 2% 37%, 37% 35%);
}
.star.on { background: linear-gradient(160deg, #ffd65a, #f59e0b); animation: starIn .6s var(--spring) both; }
@keyframes starIn { 0% { transform: scale(0) rotate(-90deg); } 100% { transform: scale(1) rotate(0); } }
.star-key { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.score-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 8px; }
.stat { background: var(--surface-2); border-radius: 16px; padding: 12px 14px; }
.stat .st-l { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.stat .st-v { font-size: 24px; font-weight: 900; line-height: 1.15; }
.stat .st-v small { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.stat .bar { margin-top: 8px; }
.stat.hit { box-shadow: inset 0 0 0 2px var(--save); }
.tk-h { margin: 18px 0 10px; font-size: 20px; font-weight: 900; }
.takeaways { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: tk; }
.takeaways li { display: grid; grid-template-columns: 40px 1fr; gap: 2px 12px; align-items: start; padding: 14px; border-radius: 18px; background: var(--surface-2); }
.takeaways li::before {
  counter-increment: tk; content: counter(tk); grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 900; color: #fff; font-size: 18px; background: var(--tkc, var(--save));
}
.takeaways li:nth-child(1) { --tkc: #047857; }
.takeaways li:nth-child(2) { --tkc: #b45309; }
.takeaways li:nth-child(3) { --tkc: #1d4ed8; }
.takeaways b { font-size: 17px; }
.takeaways span { color: var(--ink-2); font-size: 15px; }
.cta { display: flex; gap: 12px; align-items: center; margin: 18px 0 0; padding: 16px; border-radius: 18px; background: var(--ink); color: var(--bg); }
.cta p { margin: 0; font-weight: 800; font-size: 16px; line-height: 1.35; }
.cta-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--gold); display: grid; place-items: center; }
.cta-ic svg { width: 26px; height: 26px; fill: none; stroke: #1d1b2e; stroke-width: 2.4; stroke-linecap: round; }
.score-actions { margin-top: 18px; display: flex; gap: 10px; }
.score-actions .btn { flex: 1; }
@media (min-width: 900px) {
  .score-card { padding: 32px 36px; }
  .score-jordan { width: 150px; height: 150px; }
  .score-head h2 { font-size: 44px; }
  .score-stats { grid-template-columns: repeat(4, 1fr); }
  .takeaways li { grid-template-columns: 44px 1fr; }
  .score-actions .btn { flex: none; min-width: 240px; }
}

/* ---------- Jordan colors ---------- */
.jordan .skin { fill: var(--skin); }
.jordan .skin-d { fill: var(--skin-d); }
.jordan .neck { fill: var(--skin-d); }
.jordan .hair { fill: var(--hair); }
.jordan .fade { stroke: color-mix(in srgb, var(--hair) 70%, var(--skin)); stroke-width: 5; fill: none; stroke-linecap: round; opacity: .7; }
.jordan .hair-tex { stroke: #3a2a22; stroke-width: 2; fill: none; stroke-linecap: round; }
.jordan .hoodie { fill: var(--hoodie); }
.jordan .hood { fill: var(--hood); }
.jordan .vest { fill: var(--vest); }
.jordan .reflect { fill: var(--reflect); }
.jordan .string { stroke: #e8eefb; stroke-width: 3; stroke-linecap: round; }
.jordan .badge { fill: #ffffff; stroke: #cbd5e1; stroke-width: 1; }
.jordan .badge-pic { fill: #93c5fd; }
.jordan .badge-line { stroke: #94a3b8; stroke-width: 1.5; }
.jordan .ink { fill: #1a1210; }
.jordan .shine { fill: #fff; }
.jordan .stroke-ink { stroke: #1a1210; stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.jordan .brow { stroke: #1a1210; stroke-width: 5; fill: none; stroke-linecap: round; }
.jordan .nose { stroke: var(--skin-d); stroke-width: 3.5; fill: none; stroke-linecap: round; }
.jordan .mouth { fill: #3b1610; }
.jordan .teeth { fill: #fff; }
.jordan .teeth-line { stroke: #fff; stroke-width: 3; }
.jordan .tongue { fill: #e0607a; }
.jordan .blush { fill: #c2603f; opacity: .45; }
.jordan .sweat { fill: #7dd3fc; }
.jordan .eyes { transform-origin: 100px 95px; animation: blink 5s infinite; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.jordan .face { transition: opacity .15s; }
.react { animation: react .55s var(--spring); }
@keyframes react { 0% { transform: scale(1); } 30% { transform: scale(1.1) rotate(-3deg); } 100% { transform: scale(1); } }
.hop { animation: hop .7s var(--spring); }
@keyframes hop { 0%, 100% { translate: 0 0; } 40% { translate: 0 -14px; } }

/* ---------- FX ---------- */
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 300; }
.floater {
  position: fixed; z-index: 310; pointer-events: none; font-weight: 900; font-size: 18px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow); animation: floatUp 1.1s ease-out forwards; white-space: nowrap;
}
@keyframes floatUp { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 20% { transform: translate(-50%, -10px) scale(1.1); opacity: 1; } 100% { transform: translate(-50%, -60px) scale(1); opacity: 0; } }

.screen.enter { animation: screenIn .5s var(--spring) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .jordan .eyes { animation: none; }
}
