@font-face {
  font-family: "Press Start 2P";
  src: url("../fonts/press-start-2p.woff2") format("woff2");
  font-display: swap;
}
:root {
  --bg: #212529;
  --ink: #fff;
  --muted: #adb5bd;
  --taxes: #e76e55;
  --drift: #f7d51d;
  --churn: #a86cf0;
  --kept: #92cc41;
  --pixel: 3px;
}
html, body, pre, code, kbd, samp, button, input {
  font-family: "Press Start 2P", "Courier New", monospace;
}
html { background: var(--bg); overflow-x: hidden; }
body { margin: 0; color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; overflow-x: hidden; }
#app { max-width: 480px; margin: 0 auto; padding: 44px 16px 40px; }
.screen { display: flex; flex-direction: column; gap: 14px; }
h1.title { font-size: 34px; text-align: center; margin: 4px 0 0; letter-spacing: 2px; text-shadow: 4px 4px 0 #000; }
.tagline { text-align: center; font-size: 10px; color: var(--muted); margin: 0; line-height: 1.8; }
.heading { font-size: 18px; margin: 8px 0 0; text-align: center; line-height: 1.5; }
.label { font-size: 11px; color: var(--muted); }
.muted { color: var(--muted); font-size: 11px; line-height: 1.7; }
.small { font-size: 9px; }
.center { text-align: center; }
.error { color: var(--taxes); font-size: 11px; }
.rule { font-size: 9px; color: var(--muted); line-height: 1.8; text-align: center; margin-top: 12px; }
.wide { width: 100%; }
.big { font-size: 16px; padding: 14px 8px; }
.blink { animation: blink 1.2s linear infinite; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.4; } }
a { color: var(--kept); }
.nes-input.is-dark { font-size: 12px; }
.nes-btn { font-size: 11px; }
.nes-btn.is-selected { background: var(--kept); color: #212529; }
.nes-btn.is-selected::after { box-shadow: inset -4px -4px #6fa02e; }

.control { margin: 6px 0 24px; }
#controls { margin-top: 10px; }
.control .nes-container { padding: 12px 10px 8px; }
.control .nes-container.with-title > .title { font-size: 11px; margin: -24px 0 4px -6px; padding: 0 6px; background: var(--bg); color: var(--kept); }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.control-grid .nes-btn { font-size: 9px; padding: 8px 2px; white-space: normal; line-height: 1.5; }
.control-note { font-size: 9px; color: var(--muted); line-height: 1.7; margin: 10px 0 0; min-height: 30px; }
.control-hint { font-size: 8px; color: var(--muted); margin: 0 0 8px; line-height: 1.6; }

.hud { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.hud-kept, .hud-mid { flex: 0 0 auto; }
.hud-kept { display: flex; flex-direction: column; }
.hud-label { font-size: 9px; color: var(--muted); }
.hud-number { font-size: 30px; color: var(--kept); line-height: 1; }
.hud-number.hit { animation: hit 0.3s steps(2) 1; }
@keyframes hit { 50% { color: var(--taxes); transform: scale(1.15); } }
.hud-month { font-size: 14px; }
#spark { image-rendering: pixelated; background: #2b3036; border: 3px solid #000; flex: 0 1 140px; min-width: 90px; height: auto; }

.roster { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; padding: 8px 0; }
.roster-demo { opacity: 0.55; pointer-events: none; }
.seat { position: relative; height: 30px; min-width: 0; display: flex; align-items: flex-end; justify-content: center; }
.roster-demo .seat { height: 20px; }
.sprite { width: var(--pixel); height: var(--pixel); position: relative; }
.seat.gone .sprite { filter: grayscale(1) brightness(0.45); animation: leave 0.7s ease-in forwards; }
@keyframes leave { to { transform: translateY(14px); opacity: 0.35; } }
.tag { position: absolute; left: 50%; bottom: 60%; transform: translateX(-50%); font-size: 7px; white-space: nowrap;
  padding: 3px 4px; color: #212529; border: 2px solid #000; z-index: 5; animation: float 1.6s ease-out forwards; }
.tag.taxes { background: var(--taxes); }
.tag.drift { background: var(--drift); }
.tag.churn { background: var(--churn); }
@keyframes float { 0% { opacity: 0; transform: translate(-50%, 6px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -34px); } }
.banner { position: fixed; left: 50%; top: 40%; transform: translateX(-50%); background: #fff; color: #212529; border: 4px solid #000;
  box-shadow: 6px 6px 0 #000; padding: 14px 18px; font-size: 14px; z-index: 20; animation: pop 0.3s steps(3) 1; text-align: center; max-width: 80vw; }
.banner.bad { background: var(--taxes); color: #fff; }
.banner.good { background: var(--kept); }
@keyframes pop { from { transform: translateX(-50%) scale(0.6); } }

.score-card { text-align: center; padding: 16px 8px 12px; }
.score-big { font-size: 46px; color: var(--kept); line-height: 1; }
.score-of { font-size: 16px; color: var(--muted); margin-left: 4px; }
.score-sub { font-size: 10px; color: var(--muted); margin-top: 8px; }
.why { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.why span { font-size: 8px; padding: 4px 6px; border: 2px solid #000; color: #212529; }
.why .taxes { background: var(--taxes); }
.why .drift { background: var(--drift); }
.why .churn { background: var(--churn); }
.standing { font-size: 10px; line-height: 1.9; padding: 12px 10px; }
.standing .new-best { color: var(--drift); }
.standing .rank { color: var(--kept); }

.review { margin: 6px 0; }
.review .nes-balloon { font-size: 9px; line-height: 1.7; width: 100%; box-sizing: border-box; padding: 10px 12px; color: #212529; }
.review .stars { color: #c67f00; font-size: 12px; letter-spacing: 2px; }
.review .who { display: block; margin-top: 6px; font-size: 8px; color: #555; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.sound-toggle { position: fixed; right: 8px; top: 8px; font-size: 8px; padding: 5px 7px; opacity: 0.6; z-index: 30; }
@media (max-width: 380px) { .title { font-size: 26px; } .score-big { font-size: 40px; } .control-grid .nes-btn { font-size: 8px; } }
.shake { animation: shake 0.4s steps(4) 1; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.forecast { padding: 12px 12px 8px; margin-top: 4px; }
.forecast p { margin: 0 0 6px; font-size: 10px; line-height: 1.7; }
.forecast .label { margin-bottom: 4px; }
.hud-ref { font-size: 12px; color: var(--drift); margin-top: 4px; }
.hud-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hud-calls { font-size: 9px; color: var(--muted); white-space: nowrap; }
.hud-calls b { color: var(--kept); font-weight: normal; font-size: 14px; }
.tally { display: flex; gap: 6px; justify-content: center; min-height: 18px; }
.tally span { font-size: 7px; padding: 3px 5px; border: 2px solid #000; color: #212529; }
.tally .taxes { background: var(--taxes); } .tally .drift { background: var(--drift); } .tally .churn { background: var(--churn); }
.seat.warned { cursor: pointer; }
.seat.warned::after { content: "?"; position: absolute; top: -4px; right: 0; font-size: 9px; color: #212529; background: #fff; border: 2px solid #000;
  padding: 1px 2px; line-height: 1; animation: pulse 0.8s steps(2) infinite; z-index: 4; }
.seat.warned.taxes::after { background: var(--taxes); }
.seat.warned.drift::after { background: var(--drift); }
.seat.warned.churn::after { background: var(--churn); }
@keyframes pulse { 50% { transform: translateY(-2px); } }
.seat.saved::after { content: "★"; position: absolute; top: -4px; right: 0; font-size: 9px; color: var(--drift); animation: none; background: none; border: none; }
.seat.saved .sprite { filter: drop-shadow(0 0 2px var(--drift)); }
.roster.referrals { grid-template-columns: repeat(10, 1fr); padding: 0; min-height: 34px; }
.seat.referral .sprite { filter: drop-shadow(0 0 3px var(--kept)); }
.fast { position: fixed; left: 8px; top: 8px; font-size: 8px; padding: 5px 7px; opacity: 0.8; z-index: 30; }
#quiz.nes-container, #callcard.nes-container { position: fixed; left: 16px; right: 16px; top: 12%; z-index: 40; padding: 14px 12px; max-width: 448px; margin: 0 auto; box-shadow: 6px 6px 0 #000; }
.quiz-q { font-size: 10px; line-height: 1.8; margin: 6px 0 12px; }
.quiz-a { display: grid; grid-template-columns: 1fr; gap: 8px; }
.quiz-a .nes-btn { font-size: 9px; white-space: normal; text-align: left; line-height: 1.6; padding: 8px; }
.quiz-a .nes-btn.right { background: var(--kept); color: #212529; }
.quiz-a .nes-btn.wrong { background: var(--taxes); color: #fff; }
.quiz-why { font-size: 9px; color: var(--muted); line-height: 1.7; margin: 12px 0; }
.score-ref { font-size: 22px; color: var(--drift); margin-left: 6px; }
.counter { font-size: 9px; padding: 12px 10px; line-height: 1.8; }
.counter .lead { color: var(--drift); margin-bottom: 8px; }
.cf-row { display: grid; grid-template-columns: 74px repeat(4, 1fr); gap: 4px; align-items: center; margin: 4px 0; }
.cf-row .cf-name { font-size: 7px; color: var(--muted); }
.cf-cell { text-align: center; font-size: 9px; padding: 5px 0; border: 2px solid #343a40; }
.cf-cell.played { border-color: var(--kept); color: var(--kept); }
.cf-cell small { display: block; font-size: 6px; color: var(--muted); margin-top: 2px; }
.cf-cell.up small { color: var(--kept); } .cf-cell.down small { color: var(--taxes); }
.call-balloon { width: 100%; box-sizing: border-box; padding: 8px 10px; margin: 4px 0 26px; color: #212529; }
.call-complaint { font-size: 9px; line-height: 1.7; margin: 0; }
.roster.no-calls .seat.warned { cursor: default; }
.roster.no-calls .seat.warned::after { animation: none; opacity: 0.45; background: #adb5bd; }
.seat.warned.life::after { content: "☎"; background: #4a90d9; color: #fff; }
.tally .life, .why .life { background: #4a90d9; color: #fff; }
#board-list.nes-container { position: fixed; left: 16px; right: 16px; top: 8%; z-index: 40; padding: 12px 10px; max-width: 448px; margin: 0 auto; box-shadow: 6px 6px 0 #000; font-size: 9px; }
.board-mini { width: 100%; border-collapse: collapse; margin: 6px 0; }
.board-mini td { padding: 4px 3px; border-bottom: 2px solid #343a40; font-size: 8px; }
.board-mini td:first-child { color: var(--muted); width: 18px; }
.board-mini .breg { color: var(--muted); font-size: 7px; }
.board-mini .bkept { text-align: right; color: var(--kept); }
.board-mini tr.me td { color: var(--drift); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row .nes-btn { font-size: 9px; }
