:root {
  --ink: #1f1b3d;
  --lav: #e6e1ff;
  --white: #ffffff;
  --pink: #ff7ab2;
  --yellow: #ffd84a;
  --mint: #6fe3b5;
  --blue: #7b8cff;
  --muted: #4b4670;
  --rose: #c21f6b;
  --display: 'Bagel Fat One', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--lav);
  color: var(--ink);
  font-family: var(--body);
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
#app { max-width: 430px; margin: 0 auto; }

.screen {
  min-height: 100dvh;
  padding-block: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-bottom));
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.date { font-weight: 700; font-size: 14px; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-align: center; }
.eyebrow-light { color: #cfd6ff; text-align: left; font-size: 12px; }
.wordmark { font-family: var(--display); font-size: 22px; }

.chip {
  border: 3px solid var(--ink); border-radius: 999px; padding: 4px 12px;
  font-weight: 700; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
}
.chip-mint { background: var(--mint); }

/* Start */
.hero { display: flex; justify-content: center; padding: 14px 0 8px; }
.tag {
  position: relative; width: 230px; height: 140px; background: var(--yellow);
  border: 3px solid var(--ink); border-radius: 30px; box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-6deg); display: flex; align-items: center; justify-content: center;
}
.tag-hole {
  position: absolute; left: 18px; top: 50%; margin-top: -9px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--lav); border: 3px solid var(--ink);
}
.tag-text { font-family: var(--display); font-size: 78px; line-height: 1; padding-left: 20px; }
.title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 60px; line-height: 0.95; text-wrap: balance; }
.lede { margin: 0; font-size: 17px; line-height: 1.45; max-width: 320px; }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rules li {
  display: flex; align-items: center; gap: 12px; background: var(--white);
  border: 3px solid var(--ink); border-radius: 16px; padding: 10px 14px; font-weight: 500; font-size: 15px;
}
.dot { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.dot-blue { background: var(--blue); }
.dot-pink { background: var(--pink); }
.dot-mint { background: var(--mint); }
.title-small { font-size: 44px; }
.next-box-wide { padding: 16px 14px; }
.foot { margin: auto 0 0; text-align: center; font-size: 13px; font-weight: 500; color: var(--muted); }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; min-height: 60px; padding: 0 18px;
  background: var(--pink); color: var(--ink); border: 3px solid var(--ink); border-radius: 18px;
  box-shadow: 4px 4px 0 var(--ink); font-family: var(--display); font-size: 18px;
  white-space: nowrap; cursor: pointer; touch-action: manipulation;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn-big { width: 100%; font-size: 22px; box-shadow: 5px 5px 0 var(--ink); }
.btn-pink { background: var(--pink); }
.btn-mint { background: var(--mint); }

/* Play */
.timer-chip {
  background: var(--yellow); border: 3px solid var(--ink); border-radius: 999px; padding: 4px 14px;
  font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; min-width: 72px; text-align: center;
}
.timer-chip.low { background: var(--pink); }
.pips-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pips { display: flex; gap: 6px; flex-wrap: wrap; }
.round-label { font-weight: 700; font-size: 14px; white-space: nowrap; }
.pip {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 999px; background: var(--white);
  border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums;
}
.pip.current { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); font-size: 14px; }
.pip.g { background: var(--mint); }
.pip.y { background: var(--yellow); }
.pip.p { background: var(--pink); }

.stage-wrap { width: 100%; }
#stage { display: block; width: 100%; height: auto; aspect-ratio: 350 / 400; }
.panel { display: flex; flex-direction: column; gap: 14px; }
.item { display: flex; flex-direction: column; gap: 2px; }
.item h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.1; }
.item-small h2 { font-family: var(--body); font-weight: 700; font-size: 17px; line-height: 1.25; }
.item span { font-size: 14px; font-weight: 500; color: var(--muted); }
.guess-row { display: flex; gap: 10px; align-items: stretch; }
.guess-field {
  display: flex; flex: 1; min-width: 0; align-items: center; gap: 6px; background: var(--white);
  border: 3px solid var(--ink); border-radius: 18px; padding: 0 14px; min-height: 60px;
}
.guess-field:focus-within { outline: 3px solid var(--blue); outline-offset: 3px; }
.dollar { font-family: var(--display); font-size: 30px; }
#guess {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink);
  font-family: var(--display); font-size: 30px; font-variant-numeric: tabular-nums;
}
#guess::placeholder { color: #b5afd6; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; font-weight: 500; }
.total-row strong { font-family: var(--display); font-weight: 400; font-size: 26px; }

/* Result */
.score-block { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.score-sticker {
  transform: rotate(-3deg); background: var(--yellow); border: 3px solid var(--ink); border-radius: 26px;
  box-shadow: 6px 6px 0 var(--ink); padding: 4px 32px 8px; font-family: var(--display); font-size: 80px; line-height: 1.05;
  animation: slam 0.7s ease-out both;
}
.score-note { margin: 0; font-size: 14px; font-weight: 500; color: var(--muted); text-align: center; }
.streak { margin: 0; font-weight: 700; font-size: 14px; }
.rows {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; background: var(--white);
  border: 3px solid var(--ink); border-radius: 20px; overflow: hidden;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.rows li {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 2px solid var(--lav);
  animation: rise 0.45s ease-out both;
}
.rows li:last-child { border-bottom: 0; }
.rows li:nth-child(1) { animation-delay: 0.5s; }
.rows li:nth-child(2) { animation-delay: 0.65s; }
.rows li:nth-child(3) { animation-delay: 0.8s; }
.rows li:nth-child(4) { animation-delay: 0.95s; }
.rows li:nth-child(5) { animation-delay: 1.1s; }
.swatch { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--ink); }
.swatch.g { background: var(--mint); }
.swatch.y { background: var(--yellow); }
.swatch.p { background: var(--pink); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-name { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.row-sub { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-off { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
.bottom-row { display: flex; gap: 10px; margin-top: auto; align-items: stretch; }
.bottom-row .btn-big { flex: 1; width: auto; }
.next-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 14px;
  background: var(--white); border: 3px solid var(--ink); border-radius: 18px;
}
.next-box span { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.next-box strong { font-size: 18px; font-variant-numeric: tabular-nums; }

/* Motion */
@keyframes bob { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(-2deg) translateY(-8px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes slam {
  0% { opacity: 0; transform: rotate(-12deg) scale(2.2); }
  60% { opacity: 1; transform: rotate(-3deg) scale(0.94); }
  100% { opacity: 1; transform: rotate(-3deg) scale(1); }
}
@keyframes rise { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.bob { animation: bob 2.8s ease-in-out infinite; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .bob, .pulse, .score-sticker, .rows li { animation: none; }
}
