:root {
  --ink: #141122;
  --muted: #5c5770;
  --bg: #ffd23f;
  --stage-bg: #1e193b;
  --surface: #fffdf7;
  --surface-alt: #fff4cf;
  --gold: #ffc928;
  --blue: #2653ff;
  --green: #00c882;
  --red: #ff4438;
  --pink: #ff7ac3;
  --orange: #ff9130;
  --radius: 18px;
  --shadow: 0 4px 0 var(--ink);
  --shadow-lg: 0 6px 0 var(--ink);
}

* { box-sizing: border-box; margin: 0; }

body {
  min-height: 100dvh;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(20, 17, 34, 0.11) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
  color: var(--ink);
  font: 600 16px/1.45 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.28s ease;
}

body.stage {
  background-color: var(--stage-bg);
  background-image: radial-gradient(rgba(255, 210, 63, 0.16) 1.5px, transparent 1.5px);
}

h1, h2, h3, .display {
  font-family: 'Archivo Black', Impact, sans-serif;
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -0.01em;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 72px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 2.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 14px 5px 6px;
  font: 400 1.05rem 'Archivo Black', sans-serif;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.brand:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.brand:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  object-fit: cover;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  border: 2.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 13px;
  font: 800 0.84rem 'Plus Jakarta Sans', sans-serif;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, background-color 0.15s ease;
}

.pill:hover { transform: translateY(-1px); }
.pill:active { transform: translateY(2px); box-shadow: none; }
.pill.off { background: #e8e2d0; color: var(--muted); }
.pill-danger { background: var(--red); color: #fff; }
.room-pill { background: var(--blue); color: #fff; }

.timer-badge {
  min-width: 54px;
  height: 36px;
  padding: 0 11px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  font: 400 1rem 'Archivo Black', sans-serif;
  box-shadow: 0 3px 0 var(--ink);
  font-variant-numeric: tabular-nums;
}

.timer-badge.hot {
  background: var(--red);
  color: #fff;
  animation: pulse 0.5s infinite alternate;
}

/* Timer & round progress */
.timer-bar {
  height: 12px;
  border: 2.5px solid var(--ink);
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 0 var(--ink);
}

.timer-bar i {
  display: block;
  height: 100%;
  background: var(--blue);
  transition: width 0.2s linear, background-color 0.2s ease;
}

.timer-bar.hurry i { background: var(--red); }

.hurry-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--orange);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 2px 0 var(--ink);
  align-self: flex-end;
  animation: pop 0.25s ease-out;
}

.buff-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.buff-strip-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.boost-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 13px;
  border: 2.5px dashed var(--ink);
  background: #fff8db;
  color: var(--ink);
  font: 800 0.9rem 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  text-align: left;
  transition: transform 0.08s ease, background-color 0.12s ease;
}

.boost-toggle:hover { transform: translateY(-1px); }

.boost-toggle.active {
  border-style: solid;
  background: var(--gold);
  box-shadow: 0 3px 0 var(--ink);
}

.rest-lies-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: enter 0.24s ease-out;
}

.rest-lie-card {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rest-lie-text {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.2rem;
  color: var(--ink);
}

.progress-dots {
  display: flex;
  gap: 7px;
}

.progress-dots:empty { display: none; }

.progress-dots i {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.55);
  border: 2px solid var(--ink);
}

.progress-dots .f { background: var(--green); }
.progress-dots .c { background: var(--blue); }
.stage .progress-dots i { background: rgba(255, 253, 247, 0.2); border-color: rgba(255, 253, 247, 0.45); }
.stage .progress-dots .f { background: var(--green); border-color: var(--ink); }
.stage .progress-dots .c { background: var(--gold); border-color: var(--ink); }

/* Cards & layout */
main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  animation: enter 0.2s ease-out;
}

.card-mint { background: #dcfff0; }
.card-pink { background: #ffe4f3; }
.card-sky { background: #e3ecff; }
.card-gold { background: #fff3c4; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.kicker {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stage-kicker { color: var(--gold); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 2px solid var(--ink);
  background: var(--surface-alt);
}

.badge-gold { background: var(--gold); color: var(--ink); }
.badge-blue { background: var(--blue); color: #fff; }
.badge-green { background: var(--green); color: #052e20; }
.badge-red { background: var(--red); color: #fff; }
.badge-pink { background: var(--pink); color: var(--ink); }

.muted { color: var(--muted); font-size: 0.93rem; font-weight: 600; }
.stage-note { color: rgba(255, 253, 247, 0.86); font-size: 0.95rem; font-weight: 700; }
.center { text-align: center; }

/* Home / Hero */
.hero {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 20px;
  background: var(--surface);
}

.mascot {
  width: 150px;
  height: 150px;
  border-radius: 16px;
  border: 2.5px solid var(--ink);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-copy h1 { font-size: clamp(1.75rem, 4.5vw, 2.3rem); }

.steps-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.step-pill {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.step-pill:nth-child(1) { background: #ffe4f3; }
.step-pill:nth-child(2) { background: #dcfff0; }
.step-pill:nth-child(3) { background: #e3ecff; }

.step-pill b {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }

.field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  font-weight: 800;
}

.counter {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

input {
  width: 100%;
  font: 700 1.05rem 'Plus Jakarta Sans', system-ui, sans-serif;
  padding: 12px 14px;
  border: 2.5px solid var(--ink);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}

input:focus {
  outline: none;
  background: #fffdf0;
  border-color: var(--blue);
  box-shadow: 0 3px 0 var(--blue);
}

input.code-input {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

input.code-input::placeholder {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  letter-spacing: normal;
  text-transform: none;
  font-weight: 600;
  color: var(--muted);
}

.err {
  color: #b81108;
  font-weight: 800;
  font-size: 0.92rem;
  min-height: 1.3em;
}

.shake { animation: shake 0.35s; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  border: 2.5px solid var(--ink);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 16px;
  font: 800 0.98rem 'Plus Jakarta Sans', system-ui, sans-serif;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: center;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.1s ease;
}

.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { background: #e3ded2; color: #7e7891; box-shadow: none; cursor: not-allowed; }

.btn.primary { background: var(--blue); color: #fff; }
.btn.gold { background: var(--gold); color: var(--ink); }
.btn.success { background: var(--green); color: #042b1d; }
.btn.danger { background: var(--red); color: #fff; }
.btn.pink { background: var(--pink); color: var(--ink); }
.btn.ghost {
  background: rgba(255, 253, 247, 0.65);
  box-shadow: 0 2px 0 var(--ink);
}
.stage .btn.ghost {
  background: rgba(255, 253, 247, 0.14);
  color: #fff;
  border-color: rgba(255, 253, 247, 0.45);
  box-shadow: none;
}

.link-btn {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 2px 0;
  font: 800 0.9rem 'Plus Jakarta Sans', sans-serif;
  color: var(--blue);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.link-btn:hover { text-decoration: underline; }

.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions-grid:has(> :only-child) { grid-template-columns: 1fr; }

/* Invite banner / card */
.invite-banner {
  background: #e3ecff;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.invite-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.code-tiles { display: flex; gap: 8px; cursor: pointer; }

.code-tiles i {
  font-style: normal;
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.65rem;
  width: 46px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: var(--gold);
  box-shadow: 0 3px 0 var(--ink);
}

.code-tiles i:nth-child(2) { background: var(--pink); }
.code-tiles i:nth-child(3) { background: var(--green); }
.code-tiles i:nth-child(4) { background: #8bb8ff; }

.invite-url-box {
  display: flex;
  align-items: center;
  background: var(--surface-alt);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 4px 10px;
}

.invite-url-box input {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 6px 2px;
  font-size: 0.9rem;
}

.invite-url-box input:focus { box-shadow: none; background: transparent; }

/* Compact Theme Picker */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.cat {
  min-height: 44px;
  padding: 8px 11px;
  border-radius: 12px;
  justify-content: space-between;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: left;
  box-shadow: 0 3px 0 var(--ink);
  background: #fff;
}

.cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-count {
  flex: none;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1.5px solid var(--ink);
}

.cat.on {
  background: var(--green);
  color: #042b1d;
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--ink);
}

.cat.on .cat-count {
  background: #fff;
}

.theme-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 13px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: #dcfff0;
}

.theme-detail strong { font-size: 0.96rem; }

.ai-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 2px dashed var(--ink);
  background: #f5f0ff;
}

.ai-row {
  display: flex;
  gap: 8px;
}

.ai-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-size: 0.94rem;
}

.ai-row .btn {
  width: auto;
  flex: none;
  min-height: 44px;
  padding: 8px 16px;
}

@media (max-width: 480px) {
  .ai-row { flex-direction: column; }
  .ai-row .btn { width: 100%; }
}

/* Secret Finale Hijack */
.hijack-alert {
  background: linear-gradient(145deg, #241b4b 0%, #3a1842 100%);
  color: #fff;
  border-color: var(--gold);
  text-align: center;
  align-items: center;
  padding: 28px 22px;
  gap: 16px;
}

.hijack-alert h2 {
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  color: var(--gold);
}

.hijack-alert p {
  color: rgba(255, 253, 247, 0.88);
  max-width: 44ch;
}

.radar-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 210, 63, 0.5);
}

.radar-bars span {
  width: 6px;
  border-radius: 999px;
  background: var(--red);
  animation: eq 0.9s ease-in-out infinite alternate;
}

.radar-bars span:nth-child(2) { background: var(--gold); animation-delay: 0.15s; }
.radar-bars span:nth-child(3) { background: var(--pink); animation-delay: 0.3s; }
.radar-bars span:nth-child(4) { background: var(--green); animation-delay: 0.45s; }
.radar-bars span:nth-child(5) { background: var(--gold); animation-delay: 0.2s; }

@keyframes eq {
  from { height: 8px; }
  to { height: 24px; }
}

.secret-card {
  background: linear-gradient(155deg, #fffdf7 0%, #fff2c2 100%);
}

.blank-chip-btn {
  align-self: flex-start;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  padding: 4px 12px;
  font: 800 0.8rem 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
}

.blank-chip-btn:hover { background: #ffe070; }

/* Player chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: color-mix(in srgb, var(--c) 22%, #fff);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 5px 12px 5px 8px;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 2px 0 var(--ink);
}

.chip-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: var(--c);
  flex: none;
}

.chip-tag {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--ink);
  color: var(--ink);
}

.chip.done {
  background: var(--c);
  color: var(--ink);
}

.chip.new { animation: pop 0.35s cubic-bezier(0.3, 1.7, 0.5, 1); }

/* Question & options */
.question-card {
  background: var(--blue);
  color: #fff;
}

.question-card .kicker { color: rgba(255, 255, 255, 0.85); }

.question-text {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(1.35rem, 3.8vw, 1.85rem);
  line-height: 1.24;
}

.options-list { display: flex; flex-direction: column; gap: 10px; }

.opt {
  justify-content: flex-start;
  text-align: left;
  padding: 12px 15px;
  font-weight: 800;
  background: #fff;
}

.opt-letter {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 2px solid var(--ink);
  background: var(--gold);
  display: inline-grid;
  place-items: center;
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.85rem;
  flex: none;
}

.opt.me { background: #dcfff0; }
.opt.me .opt-letter { background: var(--green); }

/* Dramatic Reveal */
.reveal-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.reveal-step {
  width: 30px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.22);
  border: 1.5px solid rgba(255, 253, 247, 0.45);
}

.reveal-step.done { background: var(--green); border-color: var(--ink); }
.reveal-step.now { background: var(--gold); border-color: var(--ink); width: 44px; }

.answer-card {
  padding: 0;
  overflow: hidden;
  text-align: center;
}

.answer-face {
  padding: 30px 20px;
  background: var(--gold);
  border-bottom: 2.5px solid var(--ink);
  transition: background-color 0.24s ease, color 0.24s ease;
}

.answer-face h2 {
  font-size: clamp(1.8rem, 6vw, 2.9rem);
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.answer-card.wrong .answer-face {
  background: var(--red);
  color: #fff;
}

.answer-card.wrong .answer-face .kicker {
  color: rgba(255, 255, 255, 0.86);
}

.answer-card.right .answer-face {
  background: var(--green);
  color: #042b1d;
}

.answer-card.right .answer-face .kicker {
  color: rgba(4, 43, 29, 0.8);
}

.suspense-bar {
  padding: 16px 20px;
  background: var(--surface);
  font-weight: 800;
  color: var(--muted);
}

.picks {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  animation: enter 0.22s ease-out;
}

.verdict-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 15px;
  border-radius: 14px;
  border: 2.5px solid var(--ink);
}

.verdict-banner.truth { background: #dcfff0; }
.verdict-banner.lie { background: #ffe5e3; }

.verdict-author {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.02rem;
}

.verdict-pts {
  padding: 4px 11px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--gold);
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.86rem;
}

.caught-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.caught-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.caught-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: color-mix(in srgb, var(--c) 24%, #fff);
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 2px 0 var(--ink);
}

.caught-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
}

.caught-tag.fooled { background: var(--red); color: #fff; }
.caught-tag.smart { background: var(--green); color: #042b1d; }
.caught-tag.self { background: #fff; color: var(--muted); }

/* Enhanced Standings */
.standings-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.standing-row {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 2.5px solid var(--ink);
  background: #fff;
  box-shadow: 0 3px 0 var(--ink);
  will-change: transform;
}

.standing-row.rising {
  z-index: 2;
  box-shadow: 0 6px 0 var(--ink);
}

.standing-row.self {
  background: #fff7d6;
  box-shadow: 0 4px 0 var(--blue);
  border-color: var(--blue);
}

.standing-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pct, 0%);
  background: color-mix(in srgb, var(--c) 18%, transparent);
  pointer-events: none;
  transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.standing-left, .standing-right {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.standing-right {
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.rank-medal {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: var(--surface-alt);
  display: grid;
  place-items: center;
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.92rem;
  flex: none;
}

.rank-medal.r1 { background: var(--gold); }
.rank-medal.r2 { background: #e3e8f0; }
.rank-medal.r3 { background: #f4c392; }

.standing-name {
  font-weight: 800;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.standing-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.standing-score {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.gain-pill {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green);
  border: 1.5px solid var(--ink);
  color: #042b1d;
}

.climb-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: #dcfff0;
  border: 1.5px solid var(--ink);
  color: #045438;
}

.climb-pill.down {
  background: #ffe5e3;
  color: #9c150c;
}

.gain-pill.pop {
  animation: pop 0.3s cubic-bezier(0.3, 1.7, 0.5, 1);
}

.blank-preview {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(20, 17, 34, 0.06);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

.champion {
  background: linear-gradient(135deg, #ffe270 0%, #ffc928 100%);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 18px;
}

.trophy {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: #fff9df;
  display: grid;
  place-items: center;
  font-size: 2rem;
  flex: none;
  box-shadow: 0 3px 0 var(--ink);
}

.award { background: #ffe4f3; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 34, 0.55);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 30;
}

.modal-backdrop[hidden] { display: none; }

.modal {
  width: min(100%, 400px);
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: enter 0.16s ease-out;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

/* Toast & Confetti */
#toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 120px);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border: 2px solid var(--gold);
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s ease;
  z-index: 40;
  max-width: 90vw;
  text-align: center;
}

#toast.on { transform: translate(-50%, 0); }

.cf {
  position: fixed;
  top: -22px;
  width: var(--size);
  height: var(--size);
  border: 2px solid var(--ink);
  background: var(--color);
  pointer-events: none;
  animation: fall 3s ease-in both;
  z-index: 25;
}

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

@keyframes enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pop {
  from { transform: scale(0.72); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes pulse { to { transform: scale(1.07); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes fall { to { transform: translate(var(--drift), 110vh) rotate(var(--spin)); } }

@media (max-width: 600px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .mascot { margin: 0 auto; width: 120px; height: 120px; }
  .steps-row, .actions-grid { grid-template-columns: 1fr; }
  .theme-grid { grid-template-columns: 1fr 1fr; }
  .champion { flex-direction: column; text-align: center; }
  .card { padding: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
