/* Wicked Pissah: 8-bit duck tour. Daytime and unhurried: a sunny ride, not an arcade alarm. */
:root {
  --ink: #0F0F1B;
  --panel: #1D1F33;
  --line: #4A4F78;
  --text: #F4F1E8;
  --muted: #BCC1D9;
  --gold: #F2B630;     /* logo gold — keep */
  --red: #E4002B;      /* logo shadow red — keep */

  --t-tourist: #A9AEC4;
  --t-transplant: #6E98D6;
  --t-townie: #5FA35A;
  --t-masshole: #F2B630;
    --t-pissah: #E4002B;

  --display: "Press Start 2P", monospace;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ink); color: var(--text);
  font: 400 18px/1.45 var(--body);
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 16px 48px;
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.game { width: 100%; max-width: 460px; }

/* The logo treatment the user picked. Reused for the Wicked Pissah moment. */
.logo-type { font-family: var(--display); color: var(--gold); text-shadow: 4px 4px 0 var(--red), 8px 8px 0 var(--ink); line-height: 1.2; }

.hud { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.hud .logo-type { font-size: 14px; text-shadow: 2px 2px 0 var(--red); }
.odometer { font-family: var(--display); font-size: 14px; }
.odometer small { color: var(--muted); font-size: 10px; }

.scene { position: relative; }
canvas { display: block; width: 100%; aspect-ratio: 180 / 124; image-rendering: pixelated; image-rendering: crisp-edges; border: 3px solid var(--text); }

.banner { position: absolute; left: 0; right: 0; top: 12%; text-align: center; pointer-events: none; opacity: 0; font-size: clamp(22px, 8vw, 32px); }
.banner small { display: block; margin-top: 12px; font-family: var(--body); font-weight: 700; font-size: 16px; color: var(--text); text-shadow: 2px 2px 0 var(--ink); }
.banner.show { animation: pop 2.4s ease-out forwards; }
@keyframes pop {
  0% { opacity: 0; transform: translateY(12px) scale(0.6); }
  10% { opacity: 1; transform: translateY(0) scale(1.08); }
  18%, 82% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; }
}

.under { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 12px; color: var(--text); font-size: 17px; }
.under strong { font-family: var(--display); font-size: 13px; color: var(--text); font-weight: 400; white-space: nowrap; }
.under.low strong { color: var(--gold); }
.progress { display: flex; gap: 5px; margin-top: 10px; }
.progress i { flex: 1; height: 6px; background: var(--line); }
.progress i[data-t] { background: var(--tier); }

.panel { margin-top: 14px; background: var(--panel); border: 3px solid var(--line); padding: 18px 16px 16px; }
.who { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.say { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.2; text-wrap: balance; }
.answer-row { display: flex; gap: 10px; margin-top: 16px; }
.answer-row input {
  flex: 1; min-width: 0; background: var(--ink); border: 3px solid var(--line); border-radius: 0;
  padding: 10px 12px; font-size: 22px; font-weight: 700;
}
.answer-row input:focus-visible { outline: none; border-color: var(--gold); }
.answer-row input::placeholder { color: #7A80A8; }
.btn {
  appearance: none; cursor: pointer; border: 0; background: var(--gold); color: var(--ink);
  font-family: var(--display); font-size: 12px; padding: 12px 16px;
  box-shadow: inset -3px -3px 0 #B8841A;
}
.btn:active { box-shadow: inset 3px 3px 0 #B8841A; }
.btn-wide { width: 100%; margin-top: 18px; padding: 18px; font-size: 14px; }
.result { margin: 14px 0 0; font-size: 20px; }
.result b { color: var(--gold); font-weight: 700; }
.tier-tag { display: inline-block; margin-right: 8px; padding: 2px 8px; font-size: 15px; font-weight: 700; color: var(--ink); background: var(--tier); }
.gain { display: block; margin-top: 6px; color: var(--muted); font-size: 17px; }

[data-t="tourist"] { --tier: var(--t-tourist); }
[data-t="transplant"] { --tier: var(--t-transplant); }
[data-t="townie"] { --tier: var(--t-townie); }
[data-t="masshole"] { --tier: var(--t-masshole); }
[data-t="pissah"] { --tier: var(--t-pissah); }
[data-t="stuck"] { --tier: #6B6F8E; }

/* Title */
.logo { margin: 6px 0 0; text-align: center; font-size: clamp(28px, 10vw, 42px); }
.tag { margin: 22px 0 0; text-align: center; }
.ladder { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; }
.ladder li { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; }
.ladder .emo { font-size: 20px; line-height: 1; text-align: center; font-weight: 400; }
.ladder li i { width: 14px; height: 14px; background: var(--tier); }
.ladder li span:last-child { color: var(--muted); }
.ladder li.top span:nth-child(2) { color: var(--gold); font-weight: 700; }
.note { margin: 12px 0 0; color: var(--muted); font-size: 16px; text-align: center; }

/* Final */
.final-kicker { margin: 0; color: var(--muted); }
.final-big { margin: 6px 0 0; font-family: var(--display); font-size: clamp(20px, 6vw, 26px); line-height: 1.3; color: var(--gold); text-shadow: 3px 3px 0 var(--red); }
.final-note { margin: 8px 0 0; }
.river { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px 0; font-size: 16px; color: #8F95BC; }
.river li::after { content: "›"; margin: 0 6px; color: var(--line); }
.river li:last-child::after { content: ""; }
.river li.made { color: var(--text); }
.river li.end { color: var(--gold); font-weight: 700; }
.stats { display: flex; gap: 22px; margin-top: 18px; }
.stats div { display: grid; }
.stats strong { font-size: 26px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.stats span { color: var(--muted); font-size: 16px; }
.card { margin: 18px 0 0; padding: 14px; background: var(--ink); border: 2px dashed var(--line); white-space: pre-wrap; font: 700 18px/1.5 var(--body); }

.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { .banner.show { animation: pop 2.4s steps(1) forwards; } }

/* Answers list on the results screen */
.answers { list-style: none; padding: 0; margin: 10px 0 0; }
.answers li { padding: 12px 0; border-top: 2px solid var(--line); }
.answers .q { margin: 0; color: var(--muted); font-size: 16px; }
.answers .a { margin: 4px 0 0; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 20px; font-weight: 700; }
.answers .top { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.section-title { margin: 26px 0 0; font-size: 18px; font-weight: 700; }
.live { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 18px; color: var(--muted); font-size: 15px; }
.link { appearance: none; background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--text); text-decoration: underline; text-underline-offset: 3px; font-size: 16px; }
.hint { min-height: 1.4em; margin: 10px 0 0; color: var(--gold); font-weight: 700; }
.shake { animation: shake 0.3s; }
@keyframes shake { 30% { transform: translateX(-5px); } 60% { transform: translateX(5px); } }
.form-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
