/* Hat — design round 1. One layout, two skins (paper / night), two themes (dark / light). */

:root {
  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur: .6s;
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Skin A: Paper slips ---------- */
:root[data-skin="paper"] {
  --font-display: "Caveat", "Segoe Print", cursive;
  --font-word: "Caveat", "Segoe Print", cursive;
  --word-size: clamp(44px, 12vw, 64px);
  --word-case: none;
  --word-track: 0;
  --title-size: 34px;
  --radius: 14px;
  --t1: #4f7fc4; --t2: #cf5548; --t3: #5c9a5a; --t4: #d6a63c; --t5: #8d62a6; --t6: #3a9b9b;
  --slip: #f4ead6; --slip-ink: #2b2219; --slip-line: rgba(80, 56, 24, .16);
}
:root[data-skin="paper"][data-theme="dark"] {
  --bg: #13261e;
  --bg-art:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 240, 200, .07), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --panel: #1b3429; --panel-line: rgba(255, 245, 220, .08); --field: #142a20;
  --ink: #f0e8d6; --ink-2: #a8b6a4;
  --accent: #e2b14e; --accent-ink: #1f1a10;
  --got: #e2b14e; --got-ink: #1f1a10;
  --hat: #17151a; --hat-top: #24212a; --hat-brim: #0f0e12;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .65);
}
:root[data-skin="paper"][data-theme="light"] {
  --bg: #ebe2cf;
  --bg-art:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, .55), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .2 0 0 0 0 .1 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --panel: #faf5ea; --panel-line: rgba(70, 48, 20, .12); --field: #fffdf8;
  --ink: #2a231a; --ink-2: #6f6656;
  --accent: #1f5c45; --accent-ink: #f7f1e3;
  --got: #1f5c45; --got-ink: #f7f1e3;
  --hat: #1c1a1f; --hat-top: #2c2930; --hat-brim: #111013;
  --shadow: 0 18px 36px -20px rgba(70, 48, 20, .45);
}

/* ---------- Skin B: Night party ---------- */
:root[data-skin="night"] {
  --font-display: "Unbounded", "Manrope", sans-serif;
  --font-word: "Unbounded", "Manrope", sans-serif;
  --word-size: clamp(28px, 8vw, 40px);
  --word-case: uppercase;
  --word-track: .02em;
  --title-size: 22px;
  --radius: 20px;
  --t1: #4d7cff; --t2: #ff4d6d; --t3: #22c97a; --t4: #ffb020; --t5: #b26bff; --t6: #19c6d1;
}
:root[data-skin="night"][data-theme="dark"] {
  --bg: #0b0912;
  --bg-art: radial-gradient(90% 60% at 20% -10%, rgba(120, 80, 255, .16), transparent 60%),
            radial-gradient(70% 50% at 100% 0%, rgba(255, 70, 120, .10), transparent 60%);
  --panel: #15121e; --panel-line: rgba(255, 255, 255, .08); --field: #0f0d17;
  --ink: #f3f0fa; --ink-2: #9a93ad;
  --accent: #c6f24e; --accent-ink: #12160a;
  --got: #c6f24e; --got-ink: #12160a;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .8);
}
:root[data-skin="night"][data-theme="light"] {
  --bg: #f2f0f8;
  --bg-art: radial-gradient(90% 60% at 20% -10%, rgba(120, 80, 255, .12), transparent 60%);
  --panel: #ffffff; --panel-line: rgba(20, 15, 40, .09); --field: #f7f6fb;
  --ink: #16131f; --ink-2: #686277;
  --accent: #5b3cf5; --accent-ink: #ffffff;
  --got: #5b3cf5; --got-ink: #ffffff;
  --shadow: 0 24px 50px -28px rgba(40, 20, 90, .35);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image: var(--bg-art);
  background-attachment: fixed;
  color: var(--ink);
  font: 500 16px/1.45 var(--font-ui);
  overflow-x: clip;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }

.preview-strip {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: center;
  padding: 8px 16px; font-size: 13px; color: var(--ink-2);
  border-bottom: 1px dashed var(--panel-line);
}
.preview-strip__nav { display: flex; gap: 4px; flex-wrap: wrap; }
.preview-strip__nav button {
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--panel-line);
  transition: background-color .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease);
}
.preview-strip__nav button:hover { border-color: var(--ink-2); color: var(--ink); }
.preview-strip__nav button.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.topbar {
  max-width: 1120px; margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.brand__hat { width: 38px; height: 30px; --team: var(--accent); transition: transform .6s var(--ease); }
.brand:hover .brand__hat { transform: rotate(-8deg) translateY(-2px); }
.brand__name { font: 700 30px/1 var(--font-display); }
[data-skin="night"] .brand__name { font-size: 20px; letter-spacing: .04em; text-transform: uppercase; }
.topbar__tools { display: flex; align-items: center; gap: 8px; }
.icon-btn, .lang-btn {
  height: 38px; min-width: 38px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--panel-line); display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  transition: border-color .4s var(--ease), background-color .4s var(--ease);
}
.icon-btn:hover, .lang-btn:hover { border-color: var(--ink-2); background: var(--panel); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-btn .i-moon { fill: currentColor; stroke: none; }
[data-theme="dark"] .icon-btn .i-moon { display: none; }
[data-theme="light"] .icon-btn .i-sun { display: none; }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }

.screen { display: none; }
.screen.is-on { display: block; animation: screenIn .7s var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Controls ---------- */
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px;
  background: var(--field); border: 1px solid var(--panel-line);
}
.seg button {
  padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
  transition: background-color .45s var(--ease), color .45s var(--ease), transform .45s var(--ease);
}
.seg button:hover { color: var(--ink); }
.seg button:active { transform: scale(.97); }
.seg button.is-on { background: var(--accent); color: var(--accent-ink); }
.seg--skin button { padding: 9px 12px; font-size: 13px; }
.seg--small button { padding: 6px 12px; font-size: 14px; }

.mini-num {
  width: 56px; padding: 2px 6px; border-radius: 8px; border: 1px solid var(--panel-line);
  background: var(--panel); text-align: center; font-weight: 700;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px; font-weight: 800; font-size: 15px;
  transition: transform .5s var(--ease), background-color .5s var(--ease), color .5s var(--ease),
              border-color .5s var(--ease), box-shadow .5s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn--primary:hover { transform: translateY(-2px); }
.btn--ghost { border: 1.5px solid var(--panel-line); }
.btn--ghost:hover { border-color: var(--ink-2); background: var(--panel); }
.btn--dashed { width: 100%; border: 1.5px dashed var(--panel-line); color: var(--ink-2); margin-top: 10px; }
.btn--dashed:hover { color: var(--ink); border-color: var(--ink-2); }
.btn--big { padding: 16px 26px; font-size: 17px; }
.link-btn {
  font-size: 14px; font-weight: 700; color: var(--ink-2); padding: 8px 10px; border-radius: 10px;
  transition: color .4s var(--ease), background-color .4s var(--ease);
}
.link-btn:hover:not(:disabled) { color: var(--ink); background: var(--panel); }
.link-btn:disabled { opacity: .4; cursor: default; }

.toggle {
  appearance: none; width: 46px; height: 28px; border-radius: 999px; margin: 0; flex: none;
  background: var(--field); border: 1px solid var(--panel-line); position: relative; cursor: pointer;
  transition: background-color .45s var(--ease);
}
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink-2); transition: transform .45s var(--ease), background-color .45s var(--ease);
}
.toggle:checked { background: var(--accent); }
.toggle:checked::after { transform: translateX(18px); background: var(--accent-ink); }

/* ---------- Setup ---------- */
.mode-tabs { display: flex; gap: 22px; margin: 6px 0 18px; border-bottom: 1px solid var(--panel-line); }
.mode-tabs button {
  padding: 10px 2px 12px; font-weight: 800; font-size: 16px; color: var(--ink-2);
  position: relative; transition: color .4s var(--ease);
}
.mode-tabs button::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px;
  background: var(--accent); transform: scaleX(0); transition: transform .6s var(--ease);
}
.mode-tabs button:hover { color: var(--ink); }
.mode-tabs button.is-on { color: var(--ink); }
.mode-tabs button.is-on::after { transform: scaleX(1); }

.setup-grid { display: grid; gap: 16px; }
.setup-side { display: grid; gap: 16px; align-content: start; }
@media (min-width: 900px) { .setup-grid { grid-template-columns: 1.3fr 1fr; gap: 20px; } }

.panel {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); min-width: 0;
}
.panel__title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font: 700 var(--title-size)/1.1 var(--font-display);
}
.panel__sub { margin: 20px 0 8px; font-size: 14px; color: var(--ink-2); font-weight: 700; }
.step {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font: 800 15px/1 var(--font-ui); background: var(--accent); color: var(--accent-ink);
}
[data-skin="paper"] .step { transform: rotate(-6deg); border-radius: 46% 54% 50% 50%; }

.field-label { display: block; font-size: 14px; color: var(--ink-2); margin: 14px 0 8px; }
.src { display: none; }
.src.is-on { display: block; animation: screenIn .5s var(--ease) both; }
textarea, input[type="url"] {
  width: 100%; border-radius: 12px; border: 1px solid var(--panel-line); background: var(--field);
  padding: 12px 14px; font-size: 15px; line-height: 1.55; resize: vertical;
  transition: border-color .4s var(--ease);
}
textarea:focus, input[type="url"]:focus { outline: none; border-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > input[type="url"] { flex: 1 1 220px; }
.row--tight { gap: 14px; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.row--split { display: grid; grid-template-columns: 1fr 1fr; }
.row--center { justify-content: center; margin-top: 24px; }
.drop {
  display: grid; gap: 4px; place-items: center; text-align: center; padding: 28px 16px; margin-top: 14px;
  border: 1.5px dashed var(--panel-line); border-radius: 14px; color: var(--ink-2); cursor: pointer;
  transition: border-color .4s var(--ease), background-color .4s var(--ease);
}
.drop:hover { border-color: var(--accent); background: var(--field); }
.drop input { display: none; }
.drop strong { color: var(--ink); }

.words-summary { margin: 14px 0 10px; font-size: 14px; color: var(--ink-2); }
.words-summary b { color: var(--ink); font-size: 18px; }
.dot { opacity: .5; padding: 0 2px; }

.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 12px;
  animation: chipIn .55s var(--ease) both;
}
@keyframes chipIn { from { opacity: 0; transform: translateY(6px) scale(.96); } }
.chip__x {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 15px;
  opacity: .55; transition: opacity .3s var(--ease), background-color .3s var(--ease);
}
.chip__x:hover { opacity: 1; background: rgba(127, 127, 127, .18); }
.chip small { opacity: .6; font: 600 12px var(--font-ui); }
.chip.is-dupe { opacity: .45; text-decoration: line-through; }
[data-skin="paper"] .chip {
  background: var(--slip); color: var(--slip-ink); font: 700 21px/1.1 var(--font-word);
  border-radius: 3px; box-shadow: 0 2px 0 var(--slip-line), 0 6px 12px -8px rgba(0, 0, 0, .5);
}
[data-skin="paper"] .chip:nth-child(3n) { transform: rotate(-1.4deg); }
[data-skin="paper"] .chip:nth-child(3n+1) { transform: rotate(1deg); }
[data-skin="night"] .chip {
  border: 1px solid var(--panel-line); background: var(--field); border-radius: 999px; font-weight: 700; font-size: 14px;
}

.subpanel { margin-top: 18px; padding-top: 4px; border-top: 1px dashed var(--panel-line); }
.more { margin-top: 12px; font-size: 14px; }
.more summary { cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; }
.more summary::before { content: "+ "; color: var(--accent); }
.more[open] summary::before { content: "− "; }
.hint { font-size: 13px; color: var(--ink-2); margin: 10px 0 0; font-weight: 500; }
.hint--inline { display: block; margin: 2px 0 0; }

.teams { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.team {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "dot name add" "dot players add";
  align-items: center; column-gap: 12px; padding: 12px 12px 12px 14px; border-radius: 12px;
  background: var(--field); border: 1px solid var(--panel-line); border-left: 4px solid var(--team);
}
.team__dot { grid-area: dot; width: 14px; height: 14px; border-radius: 50%; background: var(--team); flex: none; }
.team__name { grid-area: name; border: 0; background: none; font-weight: 800; font-size: 17px; padding: 0; width: 100%; }
.team__name:focus { outline: none; }
.team__players { grid-area: players; font-size: 14px; color: var(--ink-2); }
.team__add {
  grid-area: add; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--panel-line);
  font-size: 18px; transition: background-color .4s var(--ease), transform .4s var(--ease);
}
.team__add:hover { background: var(--team); color: #fff; transform: rotate(90deg); }

.rule {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--panel-line); font-weight: 600;
}
.rule:last-child { border-bottom: 0; }
.rule--toggle { cursor: pointer; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--panel-line); border-radius: 999px; background: var(--field); }
.stepper button {
  width: 36px; height: 36px; border-radius: 50%; font-size: 18px; font-weight: 700;
  transition: background-color .35s var(--ease);
}
.stepper button:hover { background: var(--panel); }
.stepper output { min-width: 52px; text-align: center; font-weight: 800; }

.start-bar {
  margin-top: 22px; padding: 18px 20px; border-radius: var(--radius); background: var(--panel);
  border: 1px solid var(--panel-line); display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center; justify-content: space-between;
}
.start-bar__sum { margin: 0; color: var(--ink-2); }
.start-bar__sum b { color: var(--ink); }
@media (max-width: 520px) { .start-bar .btn { width: 100%; } }

/* ---------- Turn ---------- */
.turn {
  max-width: 500px; margin: 0 auto; display: flex; flex-direction: column;
  min-height: calc(100dvh - 190px);
}
.turn__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 8px; }
.turn__team { display: flex; align-items: center; gap: 12px; }
.turn__team .team__dot { width: 18px; height: 18px; }
.turn__team p { margin: 0; }
.turn__team-name { font: 700 calc(var(--title-size) * .95)/1.1 var(--font-display); display: flex; align-items: baseline; gap: 10px; }
.turn__score {
  font: 800 15px/1 var(--font-ui); padding: 4px 9px; border-radius: 999px; background: var(--team); color: #fff;
  display: inline-block;
}
.turn__who { font-size: 14px; color: var(--ink-2); }
.turn__who b { color: var(--ink); }

.timer { position: relative; width: 84px; height: 84px; flex: none; display: grid; place-items: center; }
.timer__ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer__track, .timer__bar { fill: none; stroke-width: 8; }
.timer__track { stroke: var(--panel-line); }
.timer__bar {
  stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke .4s var(--ease);
}
.timer__num { position: relative; font: 800 26px/1 var(--font-ui); font-variant-numeric: tabular-nums; }
[data-skin="paper"] .timer__track { stroke-dasharray: 2 7; stroke-width: 3; stroke: var(--ink-2); }
[data-skin="paper"] .timer__bar { stroke-width: 5; }
[data-skin="paper"] .timer__num { font: 700 40px/1 var(--font-display); }
[data-skin="night"] .timer__bar { filter: drop-shadow(0 0 6px var(--accent)); }
.timer.is-low .timer__bar { stroke: var(--t2); }
.timer.is-low .timer__num { animation: pulse 1s var(--ease) infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }

.stage {
  position: relative; flex: 1; min-height: 330px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; touch-action: pan-y; user-select: none;
}
.slip-wrap { width: 100%; display: grid; place-items: center; position: relative; z-index: 2; }
.slip {
  position: relative; display: grid; gap: 6px; place-items: center; text-align: center; cursor: grab;
  will-change: transform;
}
.slip:active { cursor: grabbing; }
.slip__word {
  font: 700 var(--word-size)/1.05 var(--font-word); text-transform: var(--word-case);
  letter-spacing: var(--word-track); overflow-wrap: anywhere;
}
.slip__trans { font-size: 15px; font-weight: 600; opacity: .7; display: none; }
:root[data-trans="on"] .slip__trans { display: block; }

[data-skin="paper"] .slip-wrap { filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .35)); margin-bottom: -26px; }
[data-skin="paper"] .slip {
  width: min(86%, 360px); min-height: 150px; padding: 30px 22px; color: var(--slip-ink);
  background:
    linear-gradient(180deg, transparent 49.4%, var(--slip-line) 50%, transparent 50.6%),
    linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(0, 0, 0, .03) 50%, rgba(255, 255, 255, .2) 50.5%, rgba(0, 0, 0, .05)),
    var(--slip);
  clip-path: polygon(0 3%, 6% 0, 14% 2%, 23% 0, 31% 2.5%, 42% .5%, 51% 2%, 60% 0, 70% 2%, 79% .5%, 88% 2.5%, 96% 0, 100% 3%,
                     99% 50%, 100% 97%, 93% 100%, 84% 98%, 74% 100%, 63% 98.5%, 52% 100%, 41% 98%, 30% 100%, 19% 98.5%, 9% 100%, 0 97%, 1% 50%);
  transform: rotate(-2deg);
}
[data-skin="night"] .slip {
  width: 100%; min-height: 300px; padding: 28px 22px; border-radius: 28px; color: #fff;
  background: linear-gradient(150deg, color-mix(in srgb, var(--team) 82%, #fff), var(--team) 45%, color-mix(in srgb, var(--team) 70%, #000));
  box-shadow: 0 30px 60px -30px var(--team), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.hat { display: grid; place-items: center; gap: 4px; position: relative; z-index: 1; }
.hat svg { width: 150px; height: 112px; }
.hat__count { font-size: 13px; color: var(--ink-2); }
.hat__count b { color: var(--ink); }
.hat-crown { fill: var(--hat); }
.hat-top { fill: var(--hat-top); }
.hat-brim { fill: var(--hat-brim); }
.hat-band { fill: var(--team, var(--accent)); }
[data-skin="night"] .hat svg { display: none; }
[data-skin="night"] .hat { margin-top: 14px; }
/* SVG <use> clones ignore descendant selectors, so the night hat is coloured through variables */
:root[data-skin="night"] { --hat: var(--ink); --hat-top: var(--ink); --hat-brim: var(--ink); }

.swipe-hint {
  display: flex; justify-content: space-between; width: min(100%, 360px); margin: 10px 0 0;
  font-size: 12px; color: var(--ink-2); letter-spacing: .04em; text-transform: uppercase; font-weight: 700;
}

.turn__actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; margin-top: 12px; }
.btn--skip, .btn--got {
  min-height: 66px; border-radius: 18px; font-size: 19px; flex-direction: column; gap: 0; line-height: 1.1;
}
.btn--skip small, .btn--got small { font-size: 12px; font-weight: 600; opacity: .7; }
.btn--skip { border: 1.5px solid var(--panel-line); background: var(--panel); }
.btn--skip:hover { border-color: var(--ink-2); }
.btn--skip:disabled { opacity: .4; cursor: default; }
.btn--got { background: var(--got); color: var(--got-ink); box-shadow: var(--shadow); }
.btn--got:hover { transform: translateY(-2px); }
.turn__tools { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.lastword {
  margin-top: 12px; padding: 16px; border-radius: var(--radius); background: var(--panel);
  border: 1.5px solid var(--accent); text-align: center; animation: screenIn .6s var(--ease) both;
}
.lastword__title { margin: 0; font: 700 calc(var(--title-size) * .85)/1.1 var(--font-display); }
.lastword .row { margin-top: 12px; }

/* ---------- Final ---------- */
#final { position: relative; }
.final { max-width: 900px; margin: 0 auto; }
.final__hero { text-align: center; padding: 18px 0 22px; }
.final__kicker { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); font-weight: 800; }
.final__title {
  margin: 8px 0 0; display: inline-flex; align-items: center; gap: 14px;
  font: 700 clamp(46px, 11vw, 76px)/1 var(--font-display);
}
[data-skin="night"] .final__title { font-size: clamp(32px, 8vw, 54px); text-transform: uppercase; }
.final__title .team__dot { width: 22px; height: 22px; }
.final__grid { display: grid; gap: 16px; }
@media (min-width: 800px) { .final__grid { grid-template-columns: 1.2fr 1fr; } }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.board li { display: grid; grid-template-columns: 70px 1fr 40px; align-items: center; gap: 12px; font-weight: 800; }
.board b { text-align: right; font-size: 20px; }
.board__bar { height: 14px; border-radius: 99px; background: var(--field); position: relative; overflow: hidden; }
.board__bar::after {
  content: ""; position: absolute; inset: 0; width: var(--w); border-radius: 99px; background: var(--team);
  transform-origin: left; animation: grow 1.2s .25s var(--ease) both;
}
@keyframes grow { from { transform: scaleX(0); } }
.people, .tricky { list-style: none; margin: 0; padding: 0; }
.people li, .tricky li {
  display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--panel-line);
}
.people li:last-child, .tricky li:last-child { border-bottom: 0; }
.people b { color: var(--ink-2); font-weight: 700; }
.tricky { margin: 12px 0 16px; }
.tricky span { font-weight: 700; }
[data-skin="paper"] .tricky span { font: 700 23px/1 var(--font-word); }
.tricky i { font-style: normal; color: var(--ink-2); font-size: 13px; }
.badge {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px;
  background: var(--accent); color: var(--accent-ink); font: 800 13px/1 var(--font-ui);
}
.confetti { position: absolute; inset: 0 0 auto 0; height: 100vh; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; display: block; border-radius: 2px; will-change: transform, opacity; }

/* ---------- Solo ---------- */
.solo { max-width: 520px; margin: 0 auto; }
.seg--solo { display: flex; width: fit-content; margin: 0 auto 16px; }
.solo__progress { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; font-size: 13px; color: var(--ink-2); font-weight: 700; }
.bar { height: 8px; border-radius: 99px; background: var(--field); border: 1px solid var(--panel-line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transform-origin: left; animation: grow 1s var(--ease) both; }
.card3d { perspective: 1400px; margin: 22px 0 6px; }
.card3d__inner {
  position: relative; display: block; width: 100%; min-height: 320px; transform-style: preserve-3d;
  transition: transform .8s var(--ease);
}
.card3d.is-flipped .card3d__inner { transform: rotateY(180deg); }
.card3d__face {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; padding: 24px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--radius);
}
.card3d__back { transform: rotateY(180deg); }
[data-skin="paper"] .card3d__face {
  background: linear-gradient(180deg, rgba(255, 255, 255, .3), transparent 40%), var(--slip); color: var(--slip-ink);
  border-radius: 4px; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .6);
  background-image: linear-gradient(transparent 31px, var(--slip-line) 32px), linear-gradient(180deg, rgba(255,255,255,.3), transparent 40%);
  background-size: 100% 32px, 100% 100%;
}
[data-skin="paper"] .card3d__face .hint { color: color-mix(in srgb, var(--slip-ink) 60%, transparent); }
[data-skin="night"] .card3d__face {
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 30%, var(--panel)), var(--panel) 60%);
  border: 1px solid var(--panel-line); box-shadow: var(--shadow);
}

/* ---------- Motion off ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
