/*
 * theme.css — PocketLedger's design-system values.
 * Calm, numeric fintech: a deep navy rail, a cool grey page, white cards and
 * one emerald accent for money that is yours. Both modes are written out.
 */

:root {
  --canvas: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #eaeff4;
  --border: #dbe2ea;
  --border-strong: #b3bfcd;
  --ink: #0f1c2e;
  --muted: #566579;
  --accent: #0b7a5e;
  --accent-hover: #09664f;
  --accent-ink: #ffffff;
  --accent-text: #0a6a52;
  --accent-strong: #095c47;
  --accent-soft: #dff3ec;
  --accent-border: #9fd6c4;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #dfefe4;
  --success-strong: #126c34;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #f6e9db;
  --warning-strong: #9a4707;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #f6e1e1;
  --danger-strong: #a51919;
  --chart-1: #0b7a5e;
  --chart-2: #2563eb;
  --chart-3: #d97706;
  --chart-4: #be185d;
  --chart-5: #7c3aed;
  --chart-6: #0891b2;

  --x-rail-bg: #0f1c2e;
  --x-rail-ink: #c5d0de;
  --x-rail-muted: #8494a8;
  --x-rail-hover: #1a2a41;
  --x-rail-active: #17463d;
  --x-rail-active-ink: #ffffff;
  --x-rail-line: #22324a;

  --font-display: "Plus Jakarta Sans Variable", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter Variable", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter Variable", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 700;
  --display-tracking: -0.02em;
  --eyebrow-tracking: 0.06em;

  --radius-btn: 0.625rem;
  --radius-card: 0.875rem;
  --radius-input: 0.625rem;
  --btn-weight: 600;
  --x-ink: #1c2f52;
  --x-orange: #ff6a2b;
  --x-orange-d: #c9431a;
  --x-gold: #ffc21a;
  --x-paper: #fffaf0;
  --x-c1: #bfe4ff;
  --x-c2: #2a4170;
  --x-c3: #1c2f52;
  --x-c4: #fff;
  --x-c5: rgba(20,34,62,.45);
  --x-c6: rgba(20,34,62,.3);
  --x-c7: #fff7c2;
  --x-c8: #ffd84a;
  --x-c9: #f5a400;
  --x-c10: #e08a00;
  --x-c11: #ffe680;
  --x-c12: #b56d00;
  --x-c13: rgba(20,34,62,.6);
  --x-c14: rgba(20,34,62,.35);
  --x-c15: #e9fbff;
  --x-c16: #bfefff;
  --x-c17: #0b6f9c;
  --x-c18: rgba(11,111,156,.4);
  --x-c19: rgba(90,210,255,.8);
  --x-c20: #5fd4ff;
  --x-c21: #1396d6;
  --x-c22: #ff8a4a;
  --x-c23: rgba(201,67,26,.35);
  --x-c24: rgba(255,250,240,.62);
  --x-c25: rgba(255,250,240,.28);
  --x-c26: rgba(255,250,240,0);
  --x-c27: rgba(28,47,82,.25);
  --x-c28: #c3cfdd;
  --x-c29: rgba(28,47,82,.2);
  --x-c30: #ff9a52;
  --x-c31: #f2551a;
  --x-c32: rgba(201,67,26,.45);
  --x-c33: rgba(255,255,255,.45);
  --x-c34: rgba(150,45,10,.55);
  --x-c35: #6b7f9c;
  --x-c36: #ffc21a;
  --x-c37: #000;
  --x-c38: rgba(255,255,255,.94);
  --x-c39: rgba(28,47,82,.86);
  --x-c40: #9fb0c8;
  --x-c41: rgba(18,30,56,.55);
  --x-c42: rgba(20,34,62,.4);
  --x-c43: rgba(8,16,36,.5);
  --x-c44: rgba(201,67,26,.4);
  --x-c45: #4d8df0;
  --x-c46: #2f6fe0;
  --x-c47: #1d4ea8;
  --x-c48: rgba(29,78,168,.4);
  --x-c49: rgba(20,50,120,.6);
  --x-c50: #ffe066;
  --x-c51: #6a4300;
  --x-c52: #d99a00;
  --x-c53: #e8eef6;
  --x-c54: #a9bddb;
  --x-c55: rgba(255,250,240,.5);
}

html[data-theme="dark"] {
  --canvas: #0b1320;
  --surface: #121d2c;
  --surface-2: #1a2738;
  --border: #25344a;
  --border-strong: #41536c;
  --ink: #e9eff6;
  --muted: #98a8bc;
  --accent: #2fbf95;
  --accent-hover: #4dcea8;
  --accent-ink: #04231a;
  --accent-text: #4fd1a8;
  --accent-strong: #86e3c6;
  --accent-soft: #12332b;
  --accent-border: #1f5446;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #172f22;
  --success-strong: #58a474;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #3a2517;
  --warning-strong: #ca854f;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #3b191b;
  --danger-strong: #d57575;
  --chart-1: #34c79c;
  --chart-2: #60a5fa;
  --chart-3: #f0a23b;
  --chart-4: #f472b6;
  --chart-5: #a78bfa;
  --chart-6: #38bdf8;

  --x-rail-bg: #0a111c;
  --x-rail-ink: #c5d0de;
  --x-rail-muted: #8494a8;
  --x-rail-hover: #16233a;
  --x-rail-active: #12332b;
  --x-rail-active-ink: #ffffff;
  --x-rail-line: #1c2a3f;
  --x-ink: #1c2f52;
  --x-orange: #ff6a2b;
  --x-orange-d: #c9431a;
  --x-gold: #ffc21a;
  --x-paper: #fffaf0;
  --x-c1: #bfe4ff;
  --x-c2: #2a4170;
  --x-c3: #1c2f52;
  --x-c4: #fff;
  --x-c5: rgba(20,34,62,.45);
  --x-c6: rgba(20,34,62,.3);
  --x-c7: #fff7c2;
  --x-c8: #ffd84a;
  --x-c9: #f5a400;
  --x-c10: #e08a00;
  --x-c11: #ffe680;
  --x-c12: #b56d00;
  --x-c13: rgba(20,34,62,.6);
  --x-c14: rgba(20,34,62,.35);
  --x-c15: #e9fbff;
  --x-c16: #bfefff;
  --x-c17: #0b6f9c;
  --x-c18: rgba(11,111,156,.4);
  --x-c19: rgba(90,210,255,.8);
  --x-c20: #5fd4ff;
  --x-c21: #1396d6;
  --x-c22: #ff8a4a;
  --x-c23: rgba(201,67,26,.35);
  --x-c24: rgba(255,250,240,.62);
  --x-c25: rgba(255,250,240,.28);
  --x-c26: rgba(255,250,240,0);
  --x-c27: rgba(28,47,82,.25);
  --x-c28: #c3cfdd;
  --x-c29: rgba(28,47,82,.2);
  --x-c30: #ff9a52;
  --x-c31: #f2551a;
  --x-c32: rgba(201,67,26,.45);
  --x-c33: rgba(255,255,255,.45);
  --x-c34: rgba(150,45,10,.55);
  --x-c35: #6b7f9c;
  --x-c36: #ffc21a;
  --x-c37: #000;
  --x-c38: rgba(255,255,255,.94);
  --x-c39: rgba(28,47,82,.86);
  --x-c40: #9fb0c8;
  --x-c41: rgba(18,30,56,.55);
  --x-c42: rgba(20,34,62,.4);
  --x-c43: rgba(8,16,36,.5);
  --x-c44: rgba(201,67,26,.4);
  --x-c45: #4d8df0;
  --x-c46: #2f6fe0;
  --x-c47: #1d4ea8;
  --x-c48: rgba(29,78,168,.4);
  --x-c49: rgba(20,50,120,.6);
  --x-c50: #ffe066;
  --x-c51: #6a4300;
  --x-c52: #d99a00;
  --x-c53: #e8eef6;
  --x-c54: #a9bddb;
  --x-c55: rgba(255,250,240,.5);
}

/* Metro Rush: full-screen game shell, heads-up display and screens */
.mr-root {
  position: fixed; inset: 0; overflow: hidden; background: var(--x-c1); font-family: "Baloo 2", ui-rounded, "Segoe UI", system-ui, sans-serif; color: var(--x-ink); user-select: none; -webkit-user-select: none; touch-action: none; }
.mr-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.mr-root [hidden] { display: none !important; }
.mr-root button { font-family: inherit; }
.mr-display, .mr-logo, .mr-score, .mr-coinbox, .mr-btn-play, .mr-ribbon, .mr-stat strong, .mr-best strong { font-family: "Lilita One", "Baloo 2", ui-rounded, system-ui, sans-serif; font-weight: 400; }

/* ----- heads-up display ----- */
.mr-hud { position: absolute; inset: 0; pointer-events: none; padding: max(16px, env(safe-area-inset-top)) 18px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; }
.mr-coinbox { justify-self: start; display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 20px 0 8px; border-radius: 27px; background: linear-gradient(180deg, var(--x-c2), var(--x-c3)); border: 3px solid var(--x-c4); box-shadow: 0 5px 0 var(--x-c5), 0 12px 24px var(--x-c6); color: var(--x-c4); font-size: 30px; line-height: 1; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.mr-coinbox.mr-bump { animation: mr-bump .22s ease-out; }
@keyframes mr-bump { 40% { transform: scale(1.12); } }
.mr-coin-ico { display: inline-block; width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 34% 28%, var(--x-c7) 0 12%, var(--x-c8) 13% 52%, var(--x-c9) 53%); box-shadow: inset 0 0 0 3px var(--x-c10), inset 0 0 0 6px var(--x-c11), 0 2px 0 var(--x-c12); position: relative; flex: none; }
.mr-coin-ico::after { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 19px; color: var(--x-c10); font-family: system-ui, sans-serif; line-height: 1; }
.mr-coin-sm { width: 20px; height: 20px; vertical-align: -4px; margin-right: 5px; box-shadow: inset 0 0 0 2px var(--x-c10); } .mr-coin-sm::after { font-size: 11px; }
.mr-scorebox { justify-self: center; display: flex; flex-direction: column; align-items: center; }
.mr-score-label { font-weight: 800; font-size: 14px; letter-spacing: 3px; text-transform: uppercase; color: var(--x-c4); text-shadow: 0 2px 0 var(--x-c13); line-height: 1; }
.mr-score { font-size: clamp(52px, 8.5vmin, 76px); line-height: .95; color: var(--x-c4); -webkit-text-stroke: 7px var(--x-ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--x-c14); font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.mr-shield-chip { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px 0 8px; border-radius: 19px; background: linear-gradient(180deg, var(--x-c15), var(--x-c16)); border: 3px solid var(--x-c4); color: var(--x-c17); font-weight: 800; font-size: 17px; box-shadow: 0 4px 0 var(--x-c18), 0 0 24px var(--x-c19); animation: mr-pulse 1s ease-in-out infinite; }
.mr-shield-ico { width: 24px; height: 24px; border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; background: radial-gradient(circle at 35% 30%, var(--x-c4), var(--x-c20) 55%, var(--x-c21)); box-shadow: inset 0 0 0 2px var(--x-c17); }
@keyframes mr-pulse { 50% { transform: scale(1.06); } }
.mr-round-btn { justify-self: end; pointer-events: auto; width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--x-c4); background: linear-gradient(180deg, var(--x-c22), var(--x-orange)); box-shadow: 0 5px 0 var(--x-orange-d), 0 12px 24px var(--x-c23); cursor: pointer; display: grid; place-items: center; }
.mr-round-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--x-orange-d); }
.mr-pause-bars { width: 18px; height: 20px; border-left: 6px solid var(--x-c4); border-right: 6px solid var(--x-c4); box-sizing: border-box; border-radius: 2px; }

/* ----- start screen ----- */
.mr-screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.mr-start { align-items: flex-start; justify-content: center; padding: 0 0 0 clamp(24px, 7vw, 120px); background: linear-gradient(90deg, var(--x-c24) 0%, var(--x-c25) 36%, var(--x-c26) 60%); }
.mr-start-col { display: flex; flex-direction: column; align-items: center; width: min(520px, 46vw); }
.mr-logo { margin: 0; line-height: .86; font-size: clamp(72px, 12.5vmin, 168px); letter-spacing: 1px; text-transform: uppercase; transform: rotate(-5deg); }
.mr-logo span { display: block; -webkit-text-stroke: clamp(8px, 1.5vmin, 16px) var(--x-ink); paint-order: stroke fill; text-shadow: 0 clamp(6px, 1.1vmin, 12px) 0 var(--x-ink), 0 clamp(14px, 2.2vmin, 26px) 0 var(--x-c27); }
.mr-logo-a { color: var(--x-c4); }
.mr-logo-b { color: var(--x-gold); margin-left: .42em; background: none; }
.mr-tag { margin: clamp(18px, 3vmin, 34px) 0 0; font-size: clamp(17px, 2.5vmin, 24px); font-weight: 800; color: var(--x-c4); background: var(--x-ink); padding: 5px 20px 3px; border-radius: 22px; transform: rotate(-2deg); letter-spacing: .5px; }
.mr-btn { font-weight: 800; font-size: 20px; border: 0; cursor: pointer; padding: 11px 28px 9px; border-radius: 18px; background: var(--x-c4); color: var(--x-ink); box-shadow: 0 5px 0 var(--x-c28), 0 12px 24px var(--x-c29); transition: transform .08s; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.mr-btn:active { transform: translateY(3px); }
.mr-btn-play { background: linear-gradient(180deg, var(--x-c30) 0%, var(--x-orange) 55%, var(--x-c31) 100%); color: var(--x-c4); font-size: clamp(34px, 5.6vmin, 52px); padding: 14px 58px 12px; border-radius: 30px; border: 4px solid var(--x-c4); box-shadow: 0 8px 0 var(--x-orange-d), 0 20px 40px var(--x-c32), inset 0 3px 0 var(--x-c33); letter-spacing: 2px; text-transform: uppercase; text-shadow: 0 3px 0 var(--x-c34); }
.mr-play-tri { width: 0; height: 0; border-left: .62em solid var(--x-c4); border-top: .4em solid transparent; border-bottom: .4em solid transparent; filter: drop-shadow(0 3px 0 var(--x-c34)); }
.mr-start .mr-btn-play { margin-top: clamp(22px, 4.5vmin, 46px); animation: mr-bob 1.5s ease-in-out infinite; }
@keyframes mr-bob { 50% { transform: translateY(-5px) scale(1.03); } }
.mr-row { display: flex; gap: 12px; align-items: stretch; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.mr-best { background: var(--x-c4); border-radius: 18px; padding: 6px 18px 4px 12px; display: flex; align-items: center; gap: 10px; box-shadow: 0 5px 0 var(--x-c28), 0 12px 24px var(--x-c29); }
.mr-best-label { font-size: 13px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--x-c35); }
.mr-best strong { font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.mr-trophy { width: 30px; height: 30px; flex: none; background: radial-gradient(circle at 50% 38%, var(--x-c11) 0 34%, transparent 35%), linear-gradient(var(--x-c36), var(--x-c9)); -webkit-mask: radial-gradient(circle at 50% 36%, var(--x-c37) 0 40%, transparent 41%), linear-gradient(var(--x-c37), var(--x-c37)) 50% 78% / 22% 26% no-repeat, linear-gradient(var(--x-c37), var(--x-c37)) 50% 100% / 56% 16% no-repeat; mask: radial-gradient(circle at 50% 36%, var(--x-c37) 0 40%, transparent 41%), linear-gradient(var(--x-c37), var(--x-c37)) 50% 78% / 22% 26% no-repeat, linear-gradient(var(--x-c37), var(--x-c37)) 50% 100% / 56% 16% no-repeat; }
.mr-trophy-sm { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin-right: 5px; }
.mr-btn-ghost { background: var(--x-c38); font-size: 17px; padding: 9px 18px 7px; }
.mr-speaker { width: 20px; height: 18px; background: var(--x-ink); clip-path: polygon(0 32%, 30% 32%, 62% 4%, 62% 96%, 30% 68%, 0 68%, 0 32%, 74% 26%, 86% 26%, 86% 74%, 74% 74%); }
.mr-sound[aria-pressed="false"] .mr-speaker { opacity: .35; clip-path: polygon(0 32%, 30% 32%, 62% 4%, 62% 96%, 30% 68%, 0 68%); }
.mr-help { position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); margin: 0 auto; width: fit-content; max-width: calc(100% - 24px); list-style: none; padding: 9px 20px 7px; background: var(--x-c39); color: var(--x-c4); border-radius: 18px; font-size: 16px; font-weight: 700; display: flex; gap: 6px 22px; flex-wrap: wrap; justify-content: center; align-items: center; }
.mr-help li { display: flex; align-items: center; gap: 5px; } .mr-help b { font-weight: 700; margin-left: 3px; }
.mr-help kbd { display: grid; place-items: center; min-width: 28px; height: 26px; padding: 0 5px; border-radius: 7px; background: var(--x-c4); color: var(--x-ink); font: inherit; font-weight: 800; box-shadow: 0 3px 0 var(--x-c40); }
.mr-help-touch { opacity: .75; font-weight: 600; }
.mr-help-swipe { display: none !important; }

/* ----- pause and game over panels ----- */
.mr-panel-screen { background: var(--x-c41); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.mr-panel { position: relative; width: min(440px, 92vw); background: var(--x-paper); border-radius: 32px; border: 5px solid var(--x-c4); padding: 58px 26px 26px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 12px 0 var(--x-c42), 0 36px 70px var(--x-c43); animation: mr-pop .28s cubic-bezier(.2,1.4,.4,1); }
@keyframes mr-pop { from { transform: scale(.8); opacity: 0; } }
.mr-ribbon { position: absolute; left: 50%; top: -30px; transform: translateX(-50%) rotate(-2deg); white-space: nowrap; background: linear-gradient(180deg, var(--x-c22), var(--x-orange)); color: var(--x-c4); font-size: 42px; line-height: 1; padding: 14px 40px 10px; border-radius: 20px; border: 4px solid var(--x-c4); box-shadow: 0 7px 0 var(--x-orange-d), 0 16px 30px var(--x-c44); text-transform: uppercase; letter-spacing: 2px; text-shadow: 0 3px 0 var(--x-c34); }
.mr-ribbon-blue { background: linear-gradient(180deg, var(--x-c45), var(--x-c46)); box-shadow: 0 7px 0 var(--x-c47), 0 16px 30px var(--x-c48); text-shadow: 0 3px 0 var(--x-c49); }
.mr-newbest { align-self: center; background: linear-gradient(180deg, var(--x-c50), var(--x-gold)); color: var(--x-c51); font-weight: 800; padding: 5px 20px 3px; border-radius: 16px; font-size: 20px; box-shadow: 0 4px 0 var(--x-c52); animation: mr-pulse .8s ease-in-out infinite; }
.mr-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 8px; }
.mr-stat { background: var(--x-c4); border-radius: 18px; padding: 10px 6px 8px; display: flex; flex-direction: column; box-shadow: inset 0 0 0 3px var(--x-c53); }
.mr-stat-main { grid-column: 1 / -1; background: var(--x-ink); box-shadow: none; padding: 12px 6px 10px; }
.mr-stat span { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--x-c35); font-weight: 800; }
.mr-stat strong { font-size: 34px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.mr-stat-main span { color: var(--x-c54); } .mr-stat-main strong { color: var(--x-c4); font-size: 62px; letter-spacing: 1px; }
.mr-panel .mr-btn-play { font-size: 30px; padding: 12px 20px 10px; border-radius: 24px; }

/* ----- phones and narrow windows ----- */
@media (max-aspect-ratio: 9/10) {
  .mr-start { align-items: center; justify-content: flex-start; padding: max(5vh, 30px) 16px 0; background: linear-gradient(180deg, var(--x-c55) 0%, var(--x-c26) 40%); }
  .mr-start-col { width: 100%; height: 100%; }
  .mr-logo { font-size: clamp(64px, 20vw, 120px); }
  .mr-start .mr-btn-play { margin-top: auto; }
  .mr-help { font-size: 14px; gap: 4px 14px; padding: 8px 14px 6px; }
  .mr-help li { display: none; } .mr-help li.mr-help-swipe { display: flex !important; }
  .mr-row { margin-bottom: 74px; }
  .mr-coinbox { height: 48px; font-size: 26px; } .mr-coin-ico { width: 32px; height: 32px; } .mr-round-btn { width: 50px; height: 50px; }
}
