/* Letterbox — chunky, sticker-style board game look. */

:root {
  --ink: #1f1a3d;
  --ink-soft: #5d5880;
  --paper: #fff4dc;
  --card: #ffffff;
  --line: 3px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --radius: 20px;

  --tomato: #ff5a4e;
  --sun: #ffc83d;
  --teal: #19c2a8;
  --grape: #8b5cf6;
  --bubblegum: #ff7ac6;
  --sky: #4cb3ff;
  --lime: #8ad94f;
  --tangerine: #ff9a3c;
  --good: #19b36b;
  --bad: #ff5a4e;

  --font-display: "Fredoka", "Nunito", ui-rounded, system-ui, sans-serif;
  --font-body: "Nunito", ui-rounded, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font: 600 17px/1.45 var(--font-body);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12px 12px, rgb(255 90 78 / .16) 3px, transparent 4px),
    radial-gradient(circle at 42px 38px, rgb(25 194 168 / .16) 3px, transparent 4px),
    radial-gradient(circle at 70px 16px, rgb(139 92 246 / .14) 3px, transparent 4px);
  background-size: 84px 56px;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
p { margin: 0 0 .75em; }
a { color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

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

.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 120px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Colors -------------------------------------------------------------- */

.bg-tomato { background: var(--tomato); }
.bg-sun { background: var(--sun); }
.bg-teal { background: var(--teal); }
.bg-grape { background: var(--grape); }
.bg-bubblegum { background: var(--bubblegum); }
.bg-sky { background: var(--sky); }
.bg-lime { background: var(--lime); }
.bg-tangerine { background: var(--tangerine); }

.bg-soft-tomato { background: #ffe1dc; }
.bg-soft-sun { background: #fff0c2; }
.bg-soft-teal { background: #d3f5ef; }
.bg-soft-grape { background: #ebe2ff; }
.bg-soft-bubblegum { background: #ffe1f1; }
.bg-soft-sky { background: #dbefff; }
.bg-soft-lime { background: #e6f8d6; }
.bg-soft-tangerine { background: #ffe7d0; }

.bd-tomato { --accent: var(--tomato); }
.bd-sun { --accent: var(--sun); }
.bd-teal { --accent: var(--teal); }
.bd-grape { --accent: var(--grape); }
.bd-bubblegum { --accent: var(--bubblegum); }
.bd-sky { --accent: var(--sky); }
.bd-lime { --accent: var(--lime); }
.bd-tangerine { --accent: var(--tangerine); }

/* Building blocks ------------------------------------------------------ */

.card {
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 20px;
}
.card--center { text-align: center; }
.card__title { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; }
.card__title .count { margin-left: auto; font-size: 1rem; color: var(--ink-soft); }

.num {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 1rem;
}

.hint { color: var(--ink-soft); font-size: .92rem; font-weight: 600; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 1.1rem; color: var(--ink-soft); }
.big-emoji { font-size: 3.5rem; line-height: 1; margin-bottom: 8px; }

.callout { padding: 12px 16px; border: var(--line); border-radius: 14px; font-weight: 800; }
.callout--oops { background: #ffe1dc; }

.tile {
  display: inline-grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; color: var(--ink);
  border: var(--line); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink);
  line-height: 1;
}
.tile--xs { width: 30px; height: 30px; font-size: 1.05rem; border-width: 2px; border-radius: 8px; box-shadow: 2px 2px 0 var(--ink); }
.tile--sm { width: 40px; height: 40px; font-size: 1.4rem; }
.tile--md { width: 56px; height: 56px; font-size: 2rem; }
.tile--xl { width: 104px; height: 104px; font-size: 4.2rem; border-width: 4px; border-radius: 22px; box-shadow: 6px 6px 0 var(--ink); }
.tile.is-rolling { transform: rotate(-8deg) scale(.94); }
.tile.is-landed { animation: land .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes land { 0% { transform: scale(.6) rotate(-14deg); } 100% { transform: none; } }

.avatar {
  display: inline-grid; place-items: center; position: relative; flex: none;
  border: var(--line); border-radius: 50%; box-shadow: 2px 2px 0 var(--ink);
  line-height: 1;
}
.avatar--sm { width: 36px; height: 36px; font-size: 1.15rem; border-width: 2px; }
.avatar--md { width: 48px; height: 48px; font-size: 1.6rem; }
.avatar--lg { width: 64px; height: 64px; font-size: 2.2rem; }
.avatar.is-done { opacity: 1; }
.avatar:not(.is-done) { }
.avatar__check {
  position: absolute; right: -6px; bottom: -6px;
  width: 20px; height: 20px; display: grid; place-items: center;
  background: var(--good); color: #fff; font-size: .75rem; font-weight: 900;
  border: 2px solid var(--ink); border-radius: 50%;
}

.chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; min-width: 0; }
.chip__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip__you, .tag {
  font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border: 2px solid var(--ink); border-radius: 999px; background: var(--sun);
}
.tag--you, .chip__you { background: var(--teal); color: #fff; }
.chip__edit { font-size: .85rem; }

/* Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; min-height: 48px;
  font: 700 1.05rem var(--font-display);
  color: var(--ink); background: var(--sky); text-decoration: none;
  border: var(--line); border-radius: 16px; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .08s, box-shadow .08s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn--big { width: 100%; padding: 16px 24px; min-height: 64px; font-size: 1.4rem; border-radius: 20px; }
.btn--go { background: var(--lime); }
.btn--stop { background: var(--tomato); color: #fff; font-size: 1.8rem; letter-spacing: .03em; }
.btn--alt { background: #fff; }
.btn--small { padding: 8px 14px; min-height: 40px; font-size: .95rem; border-radius: 12px; }
.btn--square { width: 64px; min-height: 64px; font-size: 1.4rem; padding: 0; }

form.grow { flex: 1; }
form.button_to { margin: 0; }

/* Home / setup ---------------------------------------------------------- */

.hero { text-align: center; padding: 12px 0 0; }
.hero__tiles { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.hero__tiles .tile { width: min(40px, 8.5vw); height: min(40px, 8.5vw); font-size: min(1.4rem, 5.5vw); }
.hero__tiles .tile { animation: bob 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * .12s); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
.hero__title { font-size: clamp(1.9rem, 7vw, 2.8rem); }
.hero__lead { color: var(--ink-soft); font-size: 1.1rem; max-width: 30em; margin: 0 auto; }

.setup { display: flex; flex-direction: column; gap: 18px; }

.collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pick-card {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: 14px; border: var(--line); border-radius: 16px; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink); opacity: .55; filter: saturate(.4);
  transition: opacity .15s, filter .15s, transform .1s;
}
.pick-card:has(:checked) { opacity: 1; filter: none; transform: rotate(-1deg); }
.pick-card:has(:focus-visible) { outline: 3px dashed var(--grape); outline-offset: 3px; }
.pick-card__emoji { font-size: 2rem; }
.pick-card__name { font-family: var(--font-display); font-size: 1.1rem; }
.pick-card__blurb { font-size: .85rem; color: var(--ink-soft); }
.pick-card__tick {
  position: absolute; top: -10px; right: -10px; width: 28px; height: 28px;
  display: grid; place-items: center; background: var(--good); color: #fff; font-weight: 900;
  border: 2px solid var(--ink); border-radius: 50%; transform: scale(0); transition: transform .15s;
}
.pick-card:has(:checked) .pick-card__tick { transform: scale(1); }

.segmented { display: flex; gap: 8px; margin-bottom: 12px; }
.segmented label { flex: 1; }
.segmented span, .pills span, .option span, .letter-toggle span {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: var(--line); border-radius: 14px; background: #fff; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; transition: background .1s, transform .1s;
}
.segmented span { padding: 12px; font-size: 1.05rem; }
.segmented :checked + span, .pills :checked + span, .option :checked + span { background: var(--sun); box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
:focus-visible + span { outline: 3px dashed var(--grape); outline-offset: 2px; }

.letter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.letter-toggle span { height: 44px; font-size: 1.3rem; opacity: .4; }
.letter-toggle :checked + span { opacity: 1; background: var(--sun); box-shadow: 2px 2px 0 var(--ink); }
.card:has(.letter-mode input[value=random]:checked) .letter-grid { display: none; }
.card:has(.letter-mode input[value=pick]:checked) .letter-mode__random { display: none; }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field__label { font-family: var(--font-display); font-size: 1.1rem; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills span { min-width: 52px; height: 48px; padding: 0 14px; font-size: 1.15rem; }
.options { display: grid; gap: 8px; }
.option span { justify-content: flex-start; padding: 12px 16px; font-size: 1.05rem; }
.number-input {
  width: 110px; height: 48px; padding: 0 14px;
  font: 700 1.2rem var(--font-display); color: var(--ink);
  border: var(--line); border-radius: 14px; background: #fff;
}

.switch { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.switch__track {
  flex: none; position: relative; width: 58px; height: 34px; margin-top: 2px;
  border: var(--line); border-radius: 999px; background: #e9e4f5; transition: background .15s;
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border: 2px solid var(--ink); border-radius: 50%; background: #fff; transition: transform .15s;
}
.switch :checked + .switch__track { background: var(--lime); }
.switch :checked + .switch__track::after { transform: translateX(24px); }

/* Top bar ---------------------------------------------------------------- */

.topbar { display: flex; align-items: center; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 700 1.25rem var(--font-display); }
.topbar__round { font-family: var(--font-display); color: var(--ink-soft); }
.me { position: relative; margin-left: auto; min-width: 0; }
.me summary {
  list-style: none; cursor: pointer; padding: 4px 12px 4px 4px; max-width: 220px;
  background: #fff; border: var(--line); border-radius: 999px; box-shadow: 2px 2px 0 var(--ink);
}
.me summary::-webkit-details-marker { display: none; }
.me summary .chip { max-width: 100%; }
.me__form {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(300px, calc(100vw - 32px));
  padding: 14px; background: #fff; border: var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.me__form label { font-family: var(--font-display); }
.me__row { display: flex; gap: 8px; margin-top: 6px; }
.me__row input, .answer-row input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px;
  font: 700 1.05rem var(--font-body); color: var(--ink);
  border: var(--line); border-radius: 12px; background: #fff;
}

/* Join + lobby ------------------------------------------------------------ */

.join { padding: 32px 20px; }
.avatar-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 20px; }
.avatar-row--status { margin: 0; }

.invite__body { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.invite__qr { width: 140px; padding: 8px; background: #fff; border: var(--line); border-radius: 14px; }
.invite__qr svg { display: block; width: 100%; height: auto; }
.invite__link { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 12px; }
.invite__url {
  display: block; padding: 12px 14px; font-size: 1.05rem; font-weight: 700; word-break: break-all;
  background: var(--paper); border: 2px dashed var(--ink); border-radius: 12px;
}
.invite__buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.roster { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.roster__item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.roster__item.is-new .avatar { animation: pop .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.roster__name { font-weight: 800; line-height: 1.2; }

.rules__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rules__list li { display: flex; gap: 10px; }

.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 720px; margin: 0 auto;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 70%, transparent);
}
.action-bar > form:only-child, .action-bar > .btn:only-child { flex: 1; }
.waiting {
  flex: 1; margin: 0; padding: 14px 18px; text-align: center;
  background: #fff; border: var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.action-bar--stack { flex-direction: column; align-items: stretch; gap: 8px; }
.action-bar--stack > form { width: 100%; }
.waiting-for {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 12px;
  background: #fff; border: 2px solid var(--ink); border-radius: 14px; font-size: .9rem; font-weight: 800;
}
.waiting-for__label { color: var(--ink-soft); }
.waiting-for__who { display: inline-flex; align-items: center; gap: 4px; }
.waiting-for__who .avatar { width: 26px; height: 26px; font-size: .85rem; }
.confirmed-row { display: flex; gap: 10px; }
.confirmed-row .waiting { flex: 1; }
.review { padding-bottom: 90px; }
.tick input:disabled + span { cursor: default; opacity: .6; box-shadow: none; }

.dots::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* Playing ------------------------------------------------------------- */

.play { display: flex; flex-direction: column; gap: 16px; }
.play__sticky { position: sticky; top: 0; z-index: 15; margin: -8px -4px 0; padding: 8px 4px 12px; background: var(--paper); }
.play__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px;
}
.play__letter { display: flex; align-items: center; gap: 12px; }
.play__label { font-family: var(--font-display); color: var(--ink-soft); font-size: 1rem; line-height: 1.15; }
.play__label strong { display: block; color: var(--ink); font-size: 1.15rem; }
.play__head .tile--xl { width: 68px; height: 68px; font-size: 2.8rem; border-width: 3px; border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); }

.timer { position: relative; width: 76px; height: 76px; flex: none; display: grid; place-items: center; }
.timer__ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer__track { fill: none; stroke: #eee6d2; stroke-width: 10; }
.timer__bar { fill: none; stroke: var(--teal); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 100; transition: stroke-dashoffset .25s linear, stroke .3s; }
.timer__text { position: relative; font: 700 1.35rem var(--font-display); font-variant-numeric: tabular-nums; }
.timer.is-urgent .timer__bar { stroke: var(--tomato); }
.timer.is-urgent .timer__text { color: var(--tomato); animation: wobble .5s ease-in-out infinite; }
.timer.is-over .timer__text { color: var(--tomato); }
@keyframes wobble { 0%, 100% { transform: rotate(-4deg) scale(1.05); } 50% { transform: rotate(4deg) scale(1.1); } }

.answer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.answer-row {
  padding: 14px; background: #fff; border: var(--line); border-radius: 18px; box-shadow: var(--shadow);
  transition: transform .1s;
}
.answer-row:focus-within { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); background: #fffdf5; }
.answer-row__prompt { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; font-weight: 800; line-height: 1.3; }
.answer-row__num {
  flex: none; align-self: center; width: 26px; height: 26px; display: grid; place-items: center;
  font-size: .85rem; color: #fff; background: var(--ink); border-radius: 50%;
}
.answer-row__emoji { font-size: 1.25rem; }
.answer-row__input { display: flex; align-items: center; gap: 10px; }
.answer-row input { height: 50px; font-size: 1.15rem; }
.answer-row input:focus { outline: none; border-color: var(--grape); box-shadow: 0 0 0 3px rgb(139 92 246 / .25); }
.answer-row input[readonly] { background: #f3efe4; }

.overlay {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px;
  background: rgb(31 26 61 / .55); backdrop-filter: blur(3px); animation: fade .2s;
}
.overlay__card {
  width: min(360px, 100%); padding: 28px; text-align: center;
  background: var(--sun); border: 4px solid var(--ink); border-radius: 26px; box-shadow: 8px 8px 0 var(--ink);
  animation: land .45s cubic-bezier(.3, 1.8, .5, 1);
}
.wiggle { display: inline-block; animation: wobble .6s ease-in-out infinite; }
@keyframes fade { from { opacity: 0; } }

/* Review --------------------------------------------------------------- */

.review { display: flex; flex-direction: column; gap: 16px; }
.review__intro p { margin: 6px 0 0; }

.review-q { padding: 16px; }
.review-q__title { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; margin-bottom: 12px; }
.review-q__emoji { font-size: 1.5rem; }

.vote-table { display: flex; flex-direction: column; }
.vote-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 10px 4px 10px 12px; position: relative;
  border-top: 2px dashed #e3dccb;
}
.vote-row:first-child { border-top: 0; }
.vote-row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 5px; border-radius: 3px; background: var(--accent); }
.vote-row__who { align-self: start; padding-top: 4px; }
.vote-row__name { font-size: .82rem; font-weight: 800; color: var(--ink-soft); line-height: 1.1; }
.vote-row__answer { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.vote-row__text { font: 700 1.25rem/1.2 var(--font-display); overflow-wrap: anywhere; }
.vote-row__text--blank { color: var(--ink-soft); }
.vote-row.is-bad .vote-row__text { text-decoration: line-through; text-decoration-thickness: 3px; text-decoration-color: rgb(255 90 78 / .75); color: var(--ink-soft); }
.vote-row__badges:empty { display: none; }
.vote-row__badges { display: flex; flex-wrap: wrap; gap: 4px; }
.vote-row__badges .badge { font-size: .72rem; padding: 1px 8px; }
.vote-row__reacts { display: flex; flex-wrap: wrap; gap: 0; margin-left: -4px; }
.vote-row__check { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vote-row__check form { margin: 0; }
.vote-row__nays { font-size: .75rem; font-weight: 800; color: var(--bad); }

.tick { display: block; cursor: pointer; }
.tick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tick span {
  display: grid; place-items: center; width: 44px; height: 44px;
  background: #fff; border: var(--line); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink);
  font: 900 1.5rem var(--font-body); color: transparent; transition: background .1s, transform .1s;
}
.tick span::after { content: "✗"; color: var(--bad); }
.tick input:checked + span { background: var(--good); }
.tick input:checked + span::after { content: "✓"; color: #fff; }
.tick input:active + span, .tick:active span { transform: scale(.9); }
.tick input:focus-visible + span { outline: 3px dashed var(--grape); outline-offset: 2px; }

.score-pill {
  display: inline-grid; place-items: center; min-width: 40px; padding: 2px 8px;
  font: 700 .95rem var(--font-display); color: var(--ink);
  background: #f0ecfb; border: 2px solid var(--ink); border-radius: 999px;
}
button.score-pill { cursor: pointer; }
.score-pill.is-forced { background: var(--sun); }
.vote-row.is-good .score-pill { background: #c9f2da; }
.vote-row.is-bad .score-pill, .vote-row.is-dupe .score-pill { background: #ffe1dc; }

.badge { padding: 3px 10px; font-size: .85rem; font-weight: 800; border: 2px solid var(--ink); border-radius: 999px; background: #fff; }
.badge--dupe { background: var(--sun); }
.badge--note { background: #f0ecfb; }

.react {
  display: inline-flex; align-items: center; gap: 1px; min-height: 28px; padding: 0 3px;
  font: 700 .95rem var(--font-body); color: var(--ink); cursor: pointer;
  background: transparent; border: 2px solid transparent; border-radius: 999px;
  filter: grayscale(.7); opacity: .55; transition: transform .1s;
}
.react span { font-size: .75rem; }
.react.has-some { filter: none; opacity: 1; border-color: var(--ink); background: #fff; }
.react.is-on { background: var(--bubblegum); }
.react:active { transform: scale(1.3); }

/* Results + final ----------------------------------------------------- */

.results, .final { display: flex; flex-direction: column; gap: 16px; }
.leaderboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.leader {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 16px; overflow: hidden;
  background: #fff; border: var(--line); border-radius: 18px; box-shadow: var(--shadow);
  animation: slide .5s backwards; animation-delay: calc(var(--rank) * .1s);
}
@keyframes slide { from { transform: translateX(-30px); opacity: 0; } }
.leader > * { position: relative; z-index: 1; }
.leader__bar { position: absolute; z-index: 0; left: 0; top: 0; bottom: 0; opacity: .22; transition: width .6s; }
.leader__rank { font: 700 1.4rem var(--font-display); width: 1.4em; text-align: center; }
.leader__name { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 800; }
.leader__plus { font: 700 1.1rem var(--font-display); color: var(--good); }
.leader__total { font: 700 1.8rem var(--font-display); min-width: 1.6em; text-align: right; }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding-top: 8px; }
.podium__spot { flex: 1; max-width: 170px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.podium__name { font-weight: 800; font-size: .95rem; line-height: 1.2; }
.podium__block {
  width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; box-shadow: var(--shadow);
  font: 700 1.6rem var(--font-display);
}
.podium__spot--1 .podium__block { height: 140px; }
.podium__spot--2 .podium__block { height: 104px; }
.podium__spot--3 .podium__block { height: 78px; }
.podium__spot--1 .avatar { animation: bob 2s ease-in-out infinite; }

.table-scroll { overflow-x: auto; }
.scorecard { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
.scorecard th, .scorecard td { padding: 10px 8px; text-align: center; border-bottom: 2px dashed #e3dccb; }
.scorecard th:first-child, .scorecard td:first-child { text-align: left; }
.scorecard tr:last-child td { border-bottom: 0; }
.scorecard td:last-child { font: 700 1.3rem var(--font-display); }

.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.award { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; text-align: center; }
.award__emoji { font-size: 2.2rem; }
.award__title { font: 700 1.15rem var(--font-display); }

.confetti { position: fixed; inset: 0; z-index: 50; pointer-events: none; }

@media (max-width: 420px) {
  body { font-size: 16px; }
  .card { padding: 16px; }
  .topbar__round { display: none; }
  .vote-row { gap: 8px; }
  .vote-row__text { font-size: 1.15rem; }
  .me summary { max-width: 200px; }
}

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