:root {
  color-scheme: light;
  --paper: #f4e8ca;
  --paper-deep: #e7d5ae;
  --paper-light: #fff9e9;
  --ink: #142c2b;
  --ink-soft: #38514e;
  --tomato: #b83b2e;
  --tomato-dark: #84271f;
  --teal: #176f66;
  --teal-dark: #0e504a;
  --mustard: #d9a425;
  --good: #12634f;
  --bad: #a52e25;
  --line: rgba(20, 44, 43, 0.66);
  --line-soft: rgba(20, 44, 43, 0.22);
  --shadow: 8px 9px 0 rgba(20, 44, 43, 0.92);
  --shadow-small: 4px 5px 0 rgba(20, 44, 43, 0.9);
  --radius: 4px;
  --font-body: "Avenir Next", Avenir, "Century Gothic", Futura, sans-serif;
  --font-display: Impact, Haettenschweiler, "Franklin Gothic Condensed", sans-serif;
  --font-editorial: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

* {
  box-sizing: border-box;
}

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

html {
  min-height: 100%;
  background: var(--paper-deep);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  padding: clamp(10px, 2.5vw, 28px);
  display: grid;
  align-items: center;
  color: var(--ink);
  font-family: var(--font-body);
  background-color: var(--paper-deep);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(184, 59, 46, 0.13) 0 1px, transparent 1.5px),
    radial-gradient(circle at 82% 78%, rgba(20, 44, 43, 0.11) 0 1px, transparent 1.5px),
    linear-gradient(rgba(20, 44, 43, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 44, 43, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #f3e6c5 0%, #e8d5ac 52%, #f0dfba 100%);
  background-size: 11px 11px, 13px 13px, 40px 40px, 40px 40px, auto;
}

button,
input,
select {
  font: inherit;
}

button,
select,
label,
input[type="checkbox"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.35);
}

a {
  color: var(--teal-dark);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

:where(button, input, select, a):focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--ink);
}

#fx {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  width: min(780px, calc(100% - 8px));
  margin: auto;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.ball {
  position: relative;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 47%, var(--ink) 47% 53%, transparent 53%),
    linear-gradient(0deg, transparent 47%, var(--ink) 47% 53%, transparent 53%),
    var(--mustard);
  box-shadow: var(--shadow-small);
  transform: rotate(-5deg);
}

.ball::before {
  content: "¿?";
  position: absolute;
  inset: 7px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.03rem;
  letter-spacing: 0.04em;
  line-height: 1;
  background: var(--paper-light);
}

.ball::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed var(--ink);
  border-radius: 50%;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 5.5vw, 2.35rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.subtitle {
  margin-top: 5px;
  color: var(--ink-soft);
  font-family: var(--font-editorial);
  font-size: clamp(0.72rem, 2.4vw, 0.9rem);
  font-style: italic;
  line-height: 1.15;
}

.icon-btn,
.ghost {
  min-width: 46px;
  min-height: 46px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 9px 13px;
  color: var(--ink);
  font-weight: 900;
  background: var(--paper-light);
  box-shadow: var(--shadow-small);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: panel-in 340ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.panel {
  position: relative;
  isolation: isolate;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle, rgba(20, 44, 43, 0.09) 0 1px, transparent 1.2px),
    linear-gradient(102deg, transparent 0 68%, rgba(184, 59, 46, 0.055) 68% 69%, transparent 69%);
  background-size: 9px 9px, 100% 100%;
  box-shadow: var(--shadow);
}

.panel::after {
  content: "CLASIFICA / ?";
  position: absolute;
  z-index: -1;
  right: 17px;
  bottom: 12px;
  color: rgba(20, 44, 43, 0.12);
  font-family: var(--font-display);
  font-size: clamp(1rem, 4vw, 1.55rem);
  letter-spacing: 0.12em;
  transform: rotate(-3deg);
  pointer-events: none;
}

.setup {
  padding: clamp(22px, 5.5vw, 42px);
}

.setup h2,
.finish h2 {
  max-width: 680px;
  margin: 6px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 9vw, 4.5rem);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.lede {
  max-width: 62ch;
  margin: 0 0 25px;
  color: var(--ink-soft);
  font-family: var(--font-editorial);
  font-size: clamp(0.98rem, 2.2vw, 1.1rem);
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.field {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

fieldset.field {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field[hidden] {
  display: none !important;
}

.team-mode {
  border-block: 1px solid var(--line-soft);
  padding-block: 8px;
}

.team-toggle {
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border-radius: var(--radius);
  padding: 4px 5px;
  cursor: pointer;
}

.team-toggle input {
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
  margin: 0;
  appearance: none;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background-color: var(--paper-light);
  background-image: radial-gradient(circle, var(--ink) 0 6px, transparent 6.5px);
  background-position: left 3px center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
  box-shadow: inset 2px 2px 0 rgba(20, 44, 43, 0.1);
  cursor: pointer;
  transition: background-color 140ms ease, background-position 140ms ease;
}

.team-toggle input:checked {
  background-color: var(--mustard);
  background-position: right 3px center;
}

.team-toggle span::after {
  content: " / NO";
  color: var(--tomato-dark);
}

.team-toggle:has(input:checked) span::after {
  content: " / SÍ";
  color: var(--teal-dark);
}

.team-toggle:has(input:focus-visible) {
  outline: 3px solid var(--mustard);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--ink);
}

.team-toggle input:focus-visible {
  outline: 0;
  box-shadow: inset 2px 2px 0 rgba(20, 44, 43, 0.1);
}

label,
.legend {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  line-height: 1.25;
  text-transform: uppercase;
}

input[type="text"],
select {
  width: 100%;
  min-height: 48px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 11px 13px;
  color: var(--ink);
  background: rgba(255, 249, 233, 0.9);
  box-shadow: inset 3px 3px 0 rgba(20, 44, 43, 0.08);
}

input[type="text"]::placeholder {
  color: rgba(20, 44, 43, 0.56);
}

select {
  appearance: none;
  padding-right: 48px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position:
    calc(100% - 29px) calc(50% - 2px),
    calc(100% - 22px) calc(50% - 2px);
  background-repeat: no-repeat;
  background-size: 7px 7px;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.check {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.035em;
  line-height: 1.25;
  text-transform: uppercase;
  background: rgba(255, 249, 233, 0.75);
  box-shadow: 3px 3px 0 rgba(20, 44, 43, 0.28);
}

.check:has(input:checked) {
  background: rgba(217, 164, 37, 0.36);
}

.check input {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--teal);
}

.primary {
  width: 100%;
  min-height: 52px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 13px 18px;
  color: var(--paper-light);
  font-weight: 950;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  background: var(--ink);
  box-shadow: 5px 6px 0 var(--mustard);
}

.note {
  max-width: 68ch;
  margin: 17px 0 0;
  color: var(--ink-soft);
  font-family: var(--font-editorial);
  font-size: 0.78rem;
  line-height: 1.5;
}

.error-page {
  width: min(620px, calc(100% - 8px));
}

.error-panel {
  overflow: hidden;
  text-align: center;
}

.error-panel::after {
  content: "404 / ?";
}

.error-code {
  margin-inline: auto;
}

.error-panel h2,
.error-panel .lede {
  margin-inline: auto;
}

.error-actions {
  width: min(100%, 290px);
  margin: 24px auto 0;
  display: grid;
}

.error-actions .primary {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 13px;
}

.stat {
  min-width: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 9px 8px;
  color: var(--paper-light);
  text-align: center;
  background: var(--ink);
}

.stat:nth-child(2) {
  color: var(--ink);
  background: var(--mustard);
}

.stat span {
  display: block;
  color: inherit;
  font-size: clamp(0.58rem, 2vw, 0.7rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.1;
  text-transform: uppercase;
  opacity: 0.76;
}

.stat strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-size: clamp(0.83rem, 2.6vw, 1.04rem);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card {
  min-height: min(590px, calc(100dvh - 170px));
  padding: clamp(22px, 5vw, 39px);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  text-align: center;
}

.card::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -90px;
  right: -86px;
  width: 260px;
  aspect-ratio: 1;
  border: 18px double rgba(184, 59, 46, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(20, 44, 43, 0.04);
  transform: rotate(-13deg);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--tomato-dark);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 7px;
  border-block: 2px solid currentColor;
}

.name {
  max-width: 100%;
  margin: clamp(32px, 8vh, 74px) 0 clamp(30px, 7vh, 64px);
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 15vw, 7.6rem);
  font-weight: 900;
  letter-spacing: 0.015em;
  line-height: 0.82;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 var(--paper-light), 6px 6px 0 rgba(217, 164, 37, 0.72);
}

.question {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-family: var(--font-editorial);
  font-size: clamp(0.9rem, 2.8vw, 1.03rem);
  font-style: italic;
}

.question-view {
  width: 100%;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
}

.answers {
  width: 100%;
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.answer {
  min-height: 64px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 15px 10px;
  color: #fffdf3;
  font-size: clamp(0.94rem, 3vw, 1.08rem);
  font-weight: 950;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-transform: uppercase;
  box-shadow: var(--shadow-small);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.answer.pokemon {
  background: var(--tomato);
}

.answer.person {
  background: var(--teal);
}

.kbd {
  display: inline-block;
  margin-left: 4px;
  border: 1px solid currentColor;
  padding: 2px 5px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 0.8;
}

.reveal {
  display: none;
  width: 100%;
}

.reveal.visible {
  display: block;
  animation: reveal-stamp 300ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.verdict {
  width: fit-content;
  margin: 0 auto 15px;
  border: 3px double currentColor;
  padding: 7px 12px 5px;
  font-family: var(--font-display);
  font-size: clamp(1rem, 3.4vw, 1.35rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

.verdict.good {
  color: var(--good);
}

.verdict.bad {
  color: var(--bad);
  transform: rotate(2deg);
}

.media {
  position: relative;
  width: min(248px, 66vw);
  aspect-ratio: 1;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(20, 44, 43, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 44, 43, 0.08) 1px, transparent 1px),
    var(--paper-light);
  background-size: 18px 18px;
  box-shadow: var(--shadow-small);
}

.media::after {
  content: "FIG. ?";
  position: absolute;
  right: 6px;
  bottom: 5px;
  border: 1px solid var(--ink);
  padding: 2px 4px;
  color: var(--ink);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: rgba(244, 232, 202, 0.88);
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.media.person-photo img {
  object-fit: cover;
  filter: saturate(0.86) contrast(1.04);
}

.fallback {
  width: 108px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 5px double var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  background: var(--mustard);
  transform: rotate(-4deg);
}

.reveal h2,
.reveal h3 {
  margin: 0 0 7px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3.3rem);
  font-weight: 900;
  letter-spacing: 0.015em;
  line-height: 0.95;
  text-transform: uppercase;
}

.reveal p {
  max-width: 56ch;
  margin: 0 auto 13px;
  color: var(--ink-soft);
  font-family: var(--font-editorial);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  line-height: 1.5;
}

.reveal .community-stat {
  width: fit-content;
  max-width: min(100%, 56ch);
  margin: 2px auto 13px;
  border-block: 1px solid var(--line-soft);
  padding: 7px 10px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(0.72rem, 2.2vw, 0.8rem);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.025em;
  line-height: 1.35;
  overflow-wrap: anywhere;
  background: rgba(255, 249, 233, 0.48);
}

.reveal .community-stat.is-loading {
  color: var(--ink-soft);
  border-block-style: dashed;
  background: transparent;
}

.reveal .community-stat.is-unavailable {
  color: var(--ink-soft);
  border-block-style: dashed;
  font-family: var(--font-editorial);
  font-weight: 700;
  background: transparent;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 13px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: var(--paper-light);
}

.source {
  display: inline-block;
  font-size: 0.78rem;
  line-height: 1.35;
}

.next {
  margin-top: 17px;
}

.progress {
  height: 12px;
  margin-top: 17px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper-light);
  box-shadow: 3px 3px 0 var(--ink);
}

.progress div {
  width: 0;
  height: 100%;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.26) 0 5px, transparent 5px 10px),
    var(--teal);
  transition: width 250ms ease;
}

.finish {
  padding: clamp(25px, 6vw, 46px);
  text-align: center;
}

.finish .eyebrow {
  margin-inline: auto;
}

.finish h2,
.finish .lede {
  margin-inline: auto;
}

.leaderboard {
  margin: 24px 0;
  display: grid;
  gap: 10px;
  text-align: left;
  counter-reset: rank;
}

.player-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 13px;
  background: var(--paper-light);
  box-shadow: 3px 3px 0 rgba(20, 44, 43, 0.34);
}

.player-row:first-child {
  background: rgba(217, 164, 37, 0.42);
  transform: rotate(-0.35deg);
}

.rank {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--paper-light);
  font-family: var(--font-display);
  font-weight: 900;
  background: var(--ink);
}

.player-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-row strong:last-child {
  color: var(--tomato-dark);
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.finish-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dialog {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  overflow-y: auto;
  padding: clamp(12px, 3vw, 26px);
  background:
    radial-gradient(circle, rgba(244, 232, 202, 0.08) 0 1px, transparent 1.5px),
    rgba(20, 44, 43, 0.88);
  background-size: 9px 9px;
  backdrop-filter: blur(4px);
}

.dialog.open {
  display: grid;
  animation: veil-in 180ms ease-out both;
}

.dialog-box {
  width: min(630px, calc(100% - 8px));
  max-height: min(86dvh, 760px);
  overflow: auto;
  padding: clamp(20px, 5vw, 34px);
  overscroll-behavior: contain;
}

.dialog-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 3px double var(--ink);
}

#closeInfoBtn {
  min-width: 44px;
  min-height: 44px;
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  color: var(--paper-light);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--ink);
}

#closeInfoBtn:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--ink);
}

.dialog h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3.4rem);
  letter-spacing: 0.02em;
  line-height: 0.95;
  text-transform: uppercase;
}

.dialog p,
.dialog li {
  color: var(--ink-soft);
  font-family: var(--font-editorial);
  line-height: 1.55;
}

.dialog ul {
  padding-left: 1.35rem;
}

.dialog li::marker {
  color: var(--tomato);
  font-weight: 900;
}

.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: max-content;
  max-width: min(90vw, 520px);
  border: 2px solid var(--paper-light);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--paper-light);
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
  background: var(--ink);
  box-shadow: 5px 5px 0 var(--mustard);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.shake {
  animation: shake 280ms linear;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(10px) rotate(0.4deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes reveal-stamp {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes veil-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-7px) rotate(-0.4deg); }
  50% { transform: translateX(7px) rotate(0.4deg); }
  75% { transform: translateX(-3px); }
}

@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover,
  .ghost:hover {
    color: var(--paper-light);
    background: var(--teal);
    transform: translate(-1px, -1px);
    box-shadow: 6px 7px 0 var(--ink);
  }

  .primary:hover {
    color: var(--ink);
    background: var(--mustard);
    box-shadow: 5px 6px 0 var(--tomato);
    transform: translateY(-1px);
  }

  .answer:hover:not(:disabled) {
    filter: saturate(1.12) brightness(1.06);
    transform: translate(-2px, -2px);
    box-shadow: 7px 8px 0 var(--ink);
  }

  a:hover {
    color: var(--tomato-dark);
  }
}

:where(.icon-btn, .ghost, .primary, .answer):active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

@media (max-width: 620px) {
  body {
    align-items: start;
    padding: 10px 8px 22px;
  }

  .app {
    width: calc(100% - 7px);
  }

  header {
    margin-bottom: 12px;
  }

  .ball {
    width: 43px;
    height: 43px;
  }

  .ball::before {
    inset: 6px;
    font-size: 0.83rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }

  .card {
    min-height: calc(100dvh - 155px);
  }

  .finish-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .subtitle {
    max-width: 20ch;
  }

  .icon-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 7px 10px;
  }

  .setup,
  .card,
  .finish {
    padding-inline: 17px;
  }

  .team-toggle {
    width: 100%;
  }

  .hud {
    gap: 5px;
  }

  .stat {
    padding-inline: 5px;
  }

  .name {
    margin-block: clamp(30px, 8vh, 58px);
    font-size: clamp(2.8rem, 17vw, 4.2rem);
  }

  .answers {
    gap: 8px;
  }

  .answer {
    min-height: 60px;
    padding-inline: 6px;
    letter-spacing: 0.035em;
  }

  .kbd {
    display: none;
  }

  .media {
    width: min(220px, 68vw);
  }

  .reveal .community-stat {
    width: 100%;
    padding-inline: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (forced-colors: active) {
  :root {
    --shadow: none;
    --shadow-small: none;
  }

  body,
  .panel,
  .media,
  .dialog {
    background: Canvas;
  }

  select {
    appearance: auto;
    padding-right: 13px;
    background-image: none;
  }

  .team-toggle input {
    width: 24px;
    height: 24px;
    appearance: auto;
    accent-color: Highlight;
    background: Canvas;
    box-shadow: none;
  }

  .team-toggle:has(input:focus-visible) {
    outline-color: Highlight;
    box-shadow: none;
  }

  .team-toggle input:focus-visible {
    outline: 0;
    box-shadow: none;
  }

  .stat,
  .primary,
  .answer,
  .rank,
  .toast {
    color: ButtonText;
    background: ButtonFace;
    forced-color-adjust: auto;
  }

  .reveal .community-stat,
  .reveal .community-stat.is-loading,
  .reveal .community-stat.is-unavailable {
    border-color: CanvasText;
    color: CanvasText;
    background: Canvas;
    forced-color-adjust: auto;
  }

  .ball,
  .panel::after,
  .card::before,
  .media::after,
  #fx {
    display: none;
  }

  :where(button, input, select, a):focus-visible {
    outline: 3px solid Highlight;
    box-shadow: none;
  }
}
