/* Money Trails: retro pixel look.
   Rules (from pixel-art UI practice): square corners only, chunky notched borders, hard shadows,
   one fixed palette, whole-pixel sizes, nearest-neighbor scaling, stepped animation. */

@font-face { font-family: 'Press Start 2P'; src: url('../assets/fonts/press-start-2p-400.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'VT323'; src: url('../assets/fonts/vt323-400.woff2') format('woff2'); font-display: swap; }

/* The whole game uses this 16-color palette (same as src/ui/icons.js). */
:root {
  --c-ink: #1b1a26;   --c-paper: #f4ecd8; --c-grey: #8c8a93; --c-silver: #c9c6cf;
  --c-yellow: #f2c94c; --c-orange: #e8823a; --c-red: #c9393a; --c-green: #4c9a4a;
  --c-forest: #2d5e3a; --c-blue: #3e6fb0;  --c-navy: #263a5e; --c-teal: #2f8f8a;
  --c-purple: #6b4f8f; --c-tan: #c8925a;   --c-brown: #7a4b2a; --c-skin: #e0ac69;

  --bg: var(--c-paper);
  --bg-dot: #e6dbbf;
  --panel: #fffaf0;
  --panel-2: #efe3c6;
  --ink: var(--c-ink);
  --muted: #5c5466;
  --line: var(--c-ink);
  --shadow: rgba(27, 26, 38, 0.35);
  --accent: var(--c-orange);
  --accent-ink: var(--c-ink);
  --good: var(--c-forest);
  --good-bg: #cfe6c4;
  --bad: #a52a2b;
  --bad-bg: #f6d3cc;
  --warn: #6b4a00;
  --warn-bg: #fbe7a6;
  --u: 4px; /* one "pixel" of UI chrome */
  --font-head: 'Press Start 2P', 'Courier New', monospace;
  --font: 'VT323', 'Courier New', monospace;
  --tap: 48px;
  color-scheme: light;
}

/* Night mode: classic dialog-box navy with paper-colored borders */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14131c; --bg-dot: #1d1c29; --panel: var(--c-navy); --panel-2: #1e2e4c; --ink: var(--c-paper); --muted: #b9b3c6;
    --line: var(--c-paper); --shadow: rgba(0, 0, 0, 0.6); --good: #9be08f; --good-bg: #24452c; --bad: #ff9a8f; --bad-bg: #4d2026;
    --warn: var(--c-yellow); --warn-bg: #3e3417; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14131c; --bg-dot: #1d1c29; --panel: var(--c-navy); --panel-2: #1e2e4c; --ink: var(--c-paper); --muted: #b9b3c6;
  --line: var(--c-paper); --shadow: rgba(0, 0, 0, 0.6); --good: #9be08f; --good-bg: #24452c; --bad: #ff9a8f; --bad-bg: #4d2026;
  --warn: var(--c-yellow); --warn-bg: #3e3417; color-scheme: dark;
}
:root[data-text="large"] body { font-size: 26px; }

* { box-sizing: border-box; border-radius: 0 !important; }
html, body { margin: 0; height: 100%; }
body {
  background-color: var(--bg);
  /* 2×2 dither dots, scaled to 4px "pixels" */
  background-image: conic-gradient(var(--bg-dot) 25%, transparent 0 50%, var(--bg-dot) 0 75%, transparent 0);
  background-size: 8px 8px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 22px;
  line-height: 1.2;
  font-synthesis: none; /* no fake bold: it smears pixel fonts */
  overscroll-behavior: none;
  -webkit-font-smoothing: none;
  font-smooth: never;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
img, svg, canvas { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- pixel frame: notched corners + hard drop shadow ---------- */
.px {
  background: var(--panel);
  margin: var(--u);
  box-shadow:
    0 calc(-1 * var(--u)) 0 0 var(--line), 0 var(--u) 0 0 var(--line),
    calc(-1 * var(--u)) 0 0 0 var(--line), var(--u) 0 0 0 var(--line),
    calc(2 * var(--u)) var(--u) 0 0 var(--shadow), var(--u) calc(2 * var(--u)) 0 0 var(--shadow);
}

.px-icon { display: inline-block; flex: none; vertical-align: -0.2em; line-height: 0; }
.px-icon svg { width: 100%; height: 100%; display: block; }

.app {
  height: 100dvh; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.stage { flex: 1 1 auto; min-height: 170px; position: relative; overflow: hidden; background: #8ecae6; }
.stage canvas { display: block; }
/* faint CRT scanlines over the world */
.stage::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0, 0, 0, 0.07) 3px 4px);
}
@media (min-width: 900px) {
  .stage { margin: 12px 20px; box-shadow: 0 -4px 0 var(--line), 0 4px 0 var(--line), -4px 0 0 var(--line), 4px 0 0 var(--line), 8px 8px 0 var(--shadow); }
}

h1, h2, h3, .head { font-family: var(--font-head); font-weight: 400; line-height: 1.4; margin: 0 0 10px; letter-spacing: 0; }
h1 { font-size: 32px; line-height: 1.15; }
@media (min-width: 560px) { h1 { font-size: 48px; } }
h2 { font-size: 16px; }
h3 { font-family: var(--font); font-size: 24px; text-transform: uppercase; line-height: 1.1; color: var(--muted); }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 20px; }
.center { text-align: center; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- buttons: bevelled blocks that press down ---------- */
.btn, .icon-btn {
  position: relative; cursor: pointer; border: 0; margin: var(--u);
  min-height: var(--tap); padding: 10px 18px;
  font-family: var(--font-head); font-size: 16px; line-height: 1.5; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow:
    0 -4px 0 0 var(--c-ink), 0 4px 0 0 var(--c-ink), -4px 0 0 0 var(--c-ink), 4px 0 0 0 var(--c-ink),
    inset -4px -4px 0 0 rgba(0, 0, 0, 0.25), inset 4px 4px 0 0 rgba(255, 255, 255, 0.35),
    4px 8px 0 0 var(--shadow);
}
.btn:hover, .icon-btn:hover { filter: brightness(1.06); }
.btn:active, .icon-btn:active, .btn.pressed {
  transform: translate(0, 4px);
  box-shadow:
    0 -4px 0 0 var(--c-ink), 0 4px 0 0 var(--c-ink), -4px 0 0 0 var(--c-ink), 4px 0 0 0 var(--c-ink),
    inset 4px 4px 0 0 rgba(0, 0, 0, 0.25);
}
.btn.secondary, .icon-btn { background: var(--c-paper); color: var(--c-ink); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line); }
.btn.block { width: calc(100% - 8px); }
.btn small { display: block; font-family: var(--font); text-transform: none; font-size: 20px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.icon-btn { padding: 0; min-width: var(--tap); }
:focus-visible { outline: 4px dashed var(--c-blue); outline-offset: 6px; }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- HUD ---------- */
.hud { padding: 8px 14px 4px; display: grid; gap: 8px; }
.hud-top { display: flex; align-items: center; gap: 8px; }
.hud-where { flex: 1; min-width: 0; display: grid; gap: 2px; }
.hud-where b { font-family: var(--font); font-weight: 400; font-size: 22px; line-height: 1.6; display: flex; gap: 6px; align-items: center; }
.hud-where small { color: var(--muted); font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud .icon-btn { min-height: 40px; min-width: 40px; }
.track { position: relative; height: 12px; margin: 4px; background: var(--panel-2); box-shadow: 0 -4px 0 var(--line), 0 4px 0 var(--line), -4px 0 0 var(--line), 4px 0 0 var(--line); }
.track-fill { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, var(--c-teal) 0 8px, var(--c-green) 8px 12px); transition: width 0.6s steps(6); }
.track-dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--panel); outline: 3px solid var(--line); }
.track-dot.done { background: var(--c-yellow); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0 2px; }
.stat {
  text-align: left; cursor: pointer; border: 0; color: var(--ink); padding: 6px 6px 9px; min-height: var(--tap); position: relative; overflow: hidden;
  display: grid; gap: 2px;
}
.stat .lbl { font-family: var(--font-head); font-size: 8px; color: var(--muted); display: flex; gap: 4px; align-items: center; white-space: nowrap; text-transform: uppercase; }
.stat .val { font-size: 26px; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.1; }
.stat .bar { position: absolute; left: 0; bottom: 0; height: 5px; background: repeating-linear-gradient(90deg, var(--c-teal) 0 6px, transparent 6px 8px); transition: width 0.6s steps(5); }
.stat.flash-good { animation: flashGood 0.8s steps(2) 2; }
.stat.flash-bad { animation: flashBad 0.8s steps(2) 2; }
@keyframes flashGood { 50% { background: var(--good-bg); } }
@keyframes flashBad { 50% { background: var(--bad-bg); } }
.goal-line { display: flex; align-items: center; gap: 8px; font-size: 20px; color: var(--muted); padding: 0 4px; }
.goal-line .mini { flex: 1; height: 8px; background: var(--panel-2); outline: 2px solid var(--line); }
.goal-line .mini > i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--c-orange) 0 6px, var(--c-yellow) 6px 8px); transition: width 0.6s steps(5); }

/* ---------- Dock ---------- */
.dock { padding: 6px 14px 12px; display: grid; gap: 10px; }
.ticker { padding: 8px 12px; font-size: 21px; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.ticker b { font-family: var(--font-head); font-weight: 400; font-size: 8px; margin-right: 4px; }
.ticker .pos { color: var(--good); }
.ticker .neg { color: var(--bad); }
.ticker small { width: 100%; color: var(--muted); font-size: 20px; }
.controls { display: flex; gap: 10px; align-items: stretch; }
.pace { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pace button {
  border: 0; cursor: pointer; padding: 6px 2px; min-height: 60px; color: var(--ink);
  display: grid; gap: 2px; justify-items: center; align-content: center; line-height: 1.1;
}
.pace button .nm { font-family: var(--font-head); font-size: 8px; text-transform: uppercase; }
.pace button .amt { font-size: 20px; color: var(--muted); }
.pace button .amt.neg { color: var(--bad); }
.pace button[aria-pressed="true"] { background: var(--c-yellow); color: var(--c-ink); }
.pace button[aria-pressed="true"] .amt { color: var(--c-ink); }
.pace button[aria-pressed="true"] .amt.neg { color: #8a1d1e; }
.playctl { display: grid; gap: 10px; grid-template-rows: 1fr 1fr; }
.playctl .icon-btn { min-height: 26px; min-width: 44px; margin: 4px; }
.icon-btn[aria-pressed="true"] { background: var(--c-yellow); }

/* ---------- Overlay layer ---------- */
.layer { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.layer > * { pointer-events: auto; }
.scrim {
  position: fixed; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 12px;
  background: repeating-linear-gradient(45deg, rgba(27, 26, 38, 0.55) 0 4px, rgba(27, 26, 38, 0.4) 4px 8px);
}
@media (min-width: 700px) { .scrim { align-items: center; } }
.sheet { width: calc(100% - 8px); max-width: 560px; max-height: calc(100dvh - 40px); overflow: auto; padding: 18px 16px; animation: popIn 0.24s steps(3); }
.sheet.wide { max-width: 720px; }
@keyframes popIn { from { transform: translateY(24px); opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before { animation: none !important; transition: none !important; }

.full { position: fixed; inset: 0; overflow: auto; display: flex; justify-content: center; align-items: flex-start; background-color: var(--bg);
  background-image: conic-gradient(var(--bg-dot) 25%, transparent 0 50%, var(--bg-dot) 0 75%, transparent 0); background-size: 8px 8px; }
.full.see-through { background: transparent; }
.full-inner { width: 100%; max-width: 640px; padding: calc(20px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); }

/* Title */
.title-wrap { min-height: 100dvh; display: grid; align-content: center; gap: 14px; text-align: center; }
.title-card { padding: 22px 16px; display: grid; gap: 10px; }
.logo { color: var(--ink); margin: 6px 0; text-shadow: 4px 4px 0 var(--c-orange); }
.title-card .btn { justify-self: center; min-width: min(280px, 100%); }
.tag { display: inline-flex; gap: 8px; align-items: center; justify-self: center; font-family: var(--font-head); font-size: 8px; text-transform: uppercase; padding: 8px 10px; background: var(--c-yellow); color: var(--c-ink); }
.press { font-family: var(--font-head); font-size: 8px; color: var(--muted); }

/* Option cards */
.options { display: grid; gap: 14px; }
.opt {
  text-align: left; border: 0; cursor: pointer; padding: 12px 14px; width: calc(100% - 8px); color: var(--ink);
  display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: start;
}
.opt > .px-icon { grid-row: span 3; margin-top: 2px; }
.opt .nm { font-family: var(--font); font-size: 26px; line-height: 1; text-transform: uppercase; }
.opt .ds { color: var(--muted); font-size: 21px; }
.opt .facts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt:hover { background: var(--panel-2); }
.opt[aria-pressed="true"] { background: var(--c-yellow); color: var(--c-ink); }
.opt[aria-pressed="true"] .ds { color: #3d3528; }
.opt:disabled { opacity: 0.5; cursor: not-allowed; }
.steps { display: flex; gap: 4px; margin-bottom: 16px; }
.steps i { flex: 1; height: 8px; background: var(--panel-2); outline: 2px solid var(--line); outline-offset: -2px; }
.steps i.on { background: var(--c-orange); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 20px; padding: 0 7px; white-space: nowrap;
  background: var(--panel-2); color: var(--ink); outline: 2px solid currentColor; outline-offset: -2px;
}
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.opt[aria-pressed="true"] .chip { background: var(--c-paper); color: var(--c-ink); }

.field input[type="text"] {
  width: calc(100% - 8px); margin: 4px; font: inherit; font-size: 28px; padding: 10px 14px; border: 0; background: var(--panel); color: var(--ink); min-height: var(--tap);
  box-shadow: 0 -4px 0 var(--line), 0 4px 0 var(--line), -4px 0 0 var(--line), 4px 0 0 var(--line), inset 4px 4px 0 var(--panel-2);
}

/* Event card */
.ev-head { display: flex; gap: 14px; align-items: center; margin-bottom: 4px; }
.ev-icon { width: 72px; height: 72px; display: grid; place-items: center; background: var(--panel-2); flex: none; margin: 4px;
  box-shadow: 0 -4px 0 var(--line), 0 4px 0 var(--line), -4px 0 0 var(--line), 4px 0 0 var(--line); }
.ev-month { font-size: 20px; color: var(--muted); }
.ev-text { font-size: 24px; }
.choice {
  width: calc(100% - 8px); text-align: left; border: 0; cursor: pointer; padding: 12px 14px; color: var(--ink);
  display: grid; gap: 8px; min-height: var(--tap);
}
.choice:hover, .choice:focus-visible { background: var(--panel-2); }
.choice .lbl { font-size: 24px; display: flex; gap: 10px; align-items: baseline; }
.choice .lbl::before { content: '>'; font-family: var(--font-head); font-size: 16px; color: var(--c-orange); }
.choice .key { font-family: var(--font-head); font-size: 8px; color: var(--muted); display: none; }
@media (hover: hover) and (pointer: fine) { .choice .key { display: inline; } }
.outcome { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 20px; }
.outcome .odds { color: var(--muted); margin-right: 2px; }
.result-text { font-size: 27px; }
.lesson { background: var(--warn-bg); color: var(--ink); padding: 12px 14px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start;
  box-shadow: 0 -4px 0 var(--warn), 0 4px 0 var(--warn), -4px 0 0 var(--warn), 4px 0 0 var(--warn); margin: 4px; }
.lesson .px-icon { grid-row: span 2; }
.lesson .head { font-size: 8px; color: var(--warn); margin: 0; text-transform: uppercase; }
.term { border: 0; background: none; padding: 0; color: inherit; text-decoration: underline; text-decoration-style: dashed; text-underline-offset: 4px; cursor: pointer; }
.notes { font-size: 21px; color: var(--muted); display: grid; gap: 6px; }
.notes div { display: flex; gap: 8px; }
.notes div::before { content: '*'; font-family: var(--font-head); font-size: 8px; color: var(--c-orange); }

/* Budget sliders */
.slider { display: grid; gap: 4px; }
.slider .top { display: flex; justify-content: space-between; }
.slider input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; cursor: pointer; }
.slider input[type="range"]::-webkit-slider-runnable-track { height: 12px; background: var(--panel-2); box-shadow: 0 0 0 3px var(--line); }
.slider input[type="range"]::-moz-range-track { height: 12px; background: var(--panel-2); box-shadow: 0 0 0 3px var(--line); }
.slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 28px; margin-top: -8px; background: var(--c-orange); box-shadow: 0 0 0 3px var(--c-ink), inset -3px -3px 0 rgba(0,0,0,.25); border: 0; }
.slider input[type="range"]::-moz-range-thumb { width: 24px; height: 28px; background: var(--c-orange); box-shadow: 0 0 0 3px var(--c-ink); border: 0; }
.money-table { width: 100%; border-collapse: collapse; font-size: 22px; font-variant-numeric: tabular-nums; }
.money-table td { padding: 6px 0; border-bottom: 2px dotted var(--muted); }
.money-table td:last-child { text-align: right; }
.money-table tr.total td { border-bottom: 0; border-top: 4px solid var(--line); font-size: 26px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg button { min-height: var(--tap); border: 0; cursor: pointer; padding: 6px; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--c-yellow); color: var(--c-ink); }
.card { padding: 14px; }

/* Summary */
.score-big { font-family: var(--font-head); font-size: 48px; line-height: 1.2; color: var(--c-orange); text-shadow: 4px 4px 0 var(--c-ink); }
.part { display: grid; gap: 4px; }
.part .top { display: flex; justify-content: space-between; }
.part .meter { height: 14px; background: var(--panel-2); outline: 3px solid var(--line); outline-offset: -3px; overflow: hidden; }
.part .meter i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--c-teal) 0 10px, var(--c-green) 10px 14px); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.badge { padding: 10px; display: grid; gap: 4px; justify-items: start; }
.badge b { font-family: var(--font-head); font-size: 8px; font-weight: 400; line-height: 1.5; }
.hl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 0; border-bottom: 2px dotted var(--muted); }
.hl:last-child { border-bottom: 0; }
.hl .px-icon { grid-row: span 2; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--c-ink); color: var(--c-paper); padding: 10px 16px; opacity: 0; pointer-events: none; z-index: 30;
  max-width: calc(100% - 32px); text-align: center; box-shadow: 0 0 0 4px var(--c-paper), 0 0 0 8px var(--c-ink);
}
.toast.show { opacity: 1; }

.pop { position: fixed; inset: 0; display: grid; place-items: center; z-index: 20; padding: 16px;
  background: repeating-linear-gradient(45deg, rgba(27, 26, 38, 0.55) 0 4px, rgba(27, 26, 38, 0.4) 4px 8px); }
.pop .card { max-width: 440px; width: calc(100% - 8px); max-height: calc(100dvh - 48px); overflow: auto; animation: popIn 0.2s steps(3); }

@media (max-width: 380px) {
  .stat .val { font-size: 22px; }
  .stats { gap: 8px; }
}
@media (max-height: 680px) { .goal-line { display: none; } }

/* Font sizes: Press Start 2P only at 8 / 16 / 32 / 48px (its 8px grid), VT323 for everything else.
   VT323 keeps 2, 5 and S clearly different, which matters in a money game. */
.money-table td:last-child { white-space: nowrap; padding-left: 10px; }
.slider small { font-size: 20px; }
b, strong { font-weight: 400; }
.score-big small { font-family: var(--font); }

/* Title card in Money Makes Cents forest green, whatever the theme */
.title-card { background: #1e3428; color: #f4ecd8; --line: #e0d0a8; --muted: #c9bfa3;
  box-shadow: 0 -4px 0 0 #e0d0a8, 0 4px 0 0 #e0d0a8, -4px 0 0 0 #e0d0a8, 4px 0 0 0 #e0d0a8, 8px 4px 0 0 var(--shadow), 4px 8px 0 0 var(--shadow); }
.title-card .muted { color: #c9bfa3; }
.title-card .btn.ghost { color: #f4ecd8; }
.logo { margin: 4px auto 6px; line-height: 0; text-shadow: none; }
.logo svg { width: 216px; height: auto; display: block; margin: 0 auto; }
@media (min-width: 560px) { .logo svg { width: 270px; } }
.tag { background: #e0d0a8; }

/* ---------- Tutorial ---------- */
.coach { position: fixed; z-index: 25; padding: 12px 14px; background: var(--c-yellow); color: var(--c-ink); --line: var(--c-ink); --muted: #4a3f2a;
  animation: popIn 0.2s steps(3); }
.coach p { margin: 6px 0 10px; font-size: 22px; }
.coach .head { font-size: 8px; margin: 0; }
.coach-head { display: flex; justify-content: space-between; align-items: center; }
.coach-step { font-size: 20px; color: #4a3f2a; }
.coach .btn { min-height: 40px; padding: 6px 12px; }
.coach-wait { font-family: var(--font-head); font-size: 8px; }
.coach-skip { border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding: 6px 0; font-size: 20px; opacity: 0.85; }
/* stepped pixel triangle pointing at the target */
.coach-arrow { position: absolute; width: 12px; height: 8px; background: var(--c-ink); }
.coach-arrow.up { top: -12px; clip-path: polygon(0 100%, 25% 50%, 50% 0, 75% 50%, 100% 100%); }
.coach-arrow.down { bottom: -12px; clip-path: polygon(0 0, 25% 50%, 50% 100%, 75% 50%, 100% 0); }
.coach-target { position: relative; z-index: 24; outline: 4px dashed var(--c-yellow); outline-offset: 6px; animation: coachBlink 1s steps(1) infinite; }
@keyframes coachBlink { 50% { outline-color: var(--c-orange); } }
.tutorial-tip { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; margin: 4px; padding: 10px 12px;
  background: color-mix(in srgb, var(--c-teal) 20%, var(--panel)); color: var(--ink);
  box-shadow: 0 -4px 0 var(--c-teal), 0 4px 0 var(--c-teal), -4px 0 0 var(--c-teal), 4px 0 0 var(--c-teal); }
.tutorial-tip .head { font-size: 8px; margin: 0 0 4px; color: var(--c-teal); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tutorial-tip .head { color: #7fd6cf; } }
:root[data-theme="dark"] .tutorial-tip .head { color: #7fd6cf; }
.tutorial-tip .coach-skip { font-size: 18px; }
.hud-top .icon-btn[aria-pressed="true"] { background: var(--c-yellow); }
