:root {
  --felt: #16352c;
  --felt-deep: #0f241e;
  --felt-light: #1e4538;
  --cream: #f4efe4;
  --cream-shadow: #d9d0c0;
  --ink: #1a1a1a;
  --gold: #c4a574;
  --gold-soft: #d4b896;
  --foam: #f3f7f2;
  --mist: #b8c9be;
  --acid: #c8f542;
  --sky: #5ec8c0;
  --coral: #ff5c4d;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(6, 24, 18, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--felt-deep);
  color: var(--foam);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

.felt {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 30% 20%, #1f4a3c 0%, transparent 55%),
    radial-gradient(ellipse at 80% 80%, #0c1f18 0%, transparent 50%),
    linear-gradient(160deg, #1a3d32 0%, #0f241e 100%);
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 1.25rem clamp(0.75rem, 3vw, 2rem) 3rem;
  min-height: 100dvh;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.animate-in {
  animation: fadeUp 0.55s ease both;
}
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }

.view-home.active {
  display: grid;
  min-height: calc(100dvh - 2.5rem);
  align-content: center;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.4rem, 14vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin: 0 0 1rem;
  background: linear-gradient(120deg, var(--cream) 10%, var(--gold) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 4vw, 2rem);
  margin: 0 0 0.75rem;
}

.lede {
  margin: 0 0 1.75rem;
  color: var(--mist);
  font-size: 1.05rem;
  max-width: 30ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 1.35rem;
  border-radius: 999px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--gold);
  color: var(--felt-deep);
}

.btn-primary:hover:not(:disabled) {
  background: var(--gold-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--foam);
  outline: 2px solid rgba(244, 239, 228, 0.28);
  outline-offset: -2px;
}

.btn-ghost:hover {
  background: rgba(244, 239, 228, 0.08);
}

.btn-sm {
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}

.btn-text {
  background: transparent;
  color: var(--mist);
  padding: 0.5rem;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--foam);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem 0.4rem;
}

.panel {
  margin-top: 1.5rem;
  padding: 1.35rem;
  background: rgba(15, 36, 30, 0.75);
  border: 1px solid rgba(196, 165, 116, 0.25);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.panel.hidden { display: none; }

.panel h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.field span {
  font-size: 0.85rem;
  color: var(--mist);
}

.field input,
.field select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(196, 165, 116, 0.3);
  background: rgba(255, 255, 255, 0.04);
  color: var(--foam);
  font-family: var(--font-body);
  font-size: 1.05rem;
}

.field select option {
  background: var(--felt-deep);
  color: var(--foam);
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.code-input {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 700;
  font-size: 1.25rem !important;
}

.error {
  color: #ffb4ab;
  margin-top: 0.85rem;
  font-size: 0.95rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.brand-mini {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
  color: var(--gold);
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(196, 165, 116, 0.25);
  font-size: 0.85rem;
}

.code-chip strong {
  letter-spacing: 0.15em;
  font-size: 1rem;
}

.lobby-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .lobby-grid {
    grid-template-columns: 1.3fr 1fr;
    align-items: start;
  }
}

.lobby-main h2 {
  font-family: var(--font-display);
  margin: 0 0 1rem;
}

.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.player-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(196, 165, 116, 0.15);
}

.player-list li.offline { opacity: 0.45; }

.player-list .li-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(196, 165, 116, 0.18);
  color: var(--gold-soft);
  white-space: nowrap;
}

.badge.bot {
  background: rgba(94, 200, 192, 0.18);
  color: var(--sky);
}

.badge.team-a {
  background: rgba(94, 200, 192, 0.2);
  color: var(--sky);
}

.badge.team-b {
  background: rgba(255, 92, 77, 0.2);
  color: #ff8f84;
}

.badge.ready {
  background: rgba(200, 245, 66, 0.18);
  color: var(--acid);
}

.team-pick {
  display: inline-flex;
  gap: 0.25rem;
}

.team-pick button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--mist);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  cursor: pointer;
}

.team-pick button.active.team-a,
.team-pick button[data-team="A"].active {
  background: rgba(94, 200, 192, 0.25);
  border-color: var(--sky);
  color: var(--sky);
}

.team-pick button.active.team-b,
.team-pick button[data-team="B"].active {
  background: rgba(255, 92, 77, 0.25);
  border-color: #ff8f84;
  color: #ff8f84;
}

.team-tools {
  margin-bottom: 0.25rem;
}

.lobby-settings {
  padding: 1.2rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(196, 165, 116, 0.18);
}

.lobby-settings h3 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
}

.hint {
  color: var(--mist);
  font-size: 0.85rem;
  margin: 0 0 1rem;
}

.waiting-host {
  grid-column: 1 / -1;
  color: var(--mist);
  text-align: center;
}

/* ——— Table / ranking ——— */
.view-table {
  max-width: 920px;
  margin: 0 auto;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.manche-label {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  flex: 1;
  text-align: center;
}

.timer-ring {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(196, 165, 116, 0.4);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--cream);
  font-size: 0.95rem;
}

.timer-ring.urgent {
  border-color: var(--coral);
  color: #ffb4ab;
  animation: pulse 0.8s ease infinite;
}

@keyframes pulse {
  50% { opacity: 0.7; }
}

.view-table {
  position: relative;
}

.score-pill {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(196, 165, 116, 0.15);
  color: var(--gold-soft);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.question-box {
  margin: 0 auto 1.25rem;
  padding: 1.1rem 1.35rem 1.25rem;
  border-radius: 16px;
  background: rgba(22, 53, 44, 0.85);
  border: 1px solid rgba(196, 165, 116, 0.35);
  text-align: center;
  max-width: 640px;
}

.question-box.compact {
  padding: 0.85rem 1.1rem;
  margin-bottom: 1rem;
}

.question-label {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--gold);
  font-weight: 700;
}

.question-text {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 3.5vw, 1.55rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.question-text.muted {
  color: var(--mist);
  font-size: 1.05rem;
}

.players-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.players-status.status-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.65rem;
  align-items: stretch;
  width: 100%;
  margin-bottom: 1rem;
}

.team-status-group {
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  display: grid;
  gap: 0.5rem;
}

.team-status-group.team-a-group {
  background: rgba(94, 200, 192, 0.18);
  border: 1px solid rgba(94, 200, 192, 0.45);
}

.team-status-group.team-b-group {
  background: rgba(255, 92, 77, 0.16);
  border: 1px solid rgba(255, 143, 132, 0.45);
}

.team-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.team-status-label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}

.team-status-score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
}

.team-a-group .team-status-label,
.team-a-group .team-status-score { color: var(--sky); }

.team-b-group .team-status-label,
.team-b-group .team-status-score { color: #ff8f84; }

.team-status-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.team-status-vs {
  align-self: center;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--gold);
  font-size: 0.85rem;
}

.status-chip.chip-team-a {
  background: rgba(94, 200, 192, 0.2);
  border-color: rgba(94, 200, 192, 0.55);
}

.status-chip.chip-team-b {
  background: rgba(255, 92, 77, 0.18);
  border-color: rgba(255, 143, 132, 0.55);
}

.team-tag {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 800;
  opacity: 0.9;
}

.score-row.score-team-a {
  background: rgba(94, 200, 192, 0.16);
  border-left: 4px solid var(--sky);
}

.score-row.score-team-b {
  background: rgba(255, 92, 77, 0.14);
  border-left: 4px solid #ff8f84;
}

@media (max-width: 620px) {
  .players-status.status-teams {
    grid-template-columns: 1fr;
  }
  .team-status-vs {
    text-align: center;
  }
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}

.status-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7c72;
}

.status-chip.done {
  border-color: rgba(200, 245, 66, 0.45);
}

.status-chip.done .dot {
  background: var(--acid);
  box-shadow: 0 0 8px rgba(200, 245, 66, 0.6);
}

.status-chip.waiting .dot {
  background: var(--gold);
  animation: blink 1.2s ease infinite;
}

@keyframes blink {
  50% { opacity: 0.35; }
}

/* Playing cards */
.cards-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.2rem, 1.2vw, 0.85rem);
  flex-wrap: nowrap;
  padding: 0.5rem 0 1rem;
  overflow-x: hidden;
  min-height: 200px;
  width: 100%;
}

.play-card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 128px;
  width: auto;
  aspect-ratio: 2.4 / 3.5;
  border: none;
  border-radius: 12px;
  background:
    linear-gradient(160deg, #faf6ee 0%, var(--cream) 45%, #ebe4d6 100%);
  color: var(--ink);
  box-shadow:
    0 2px 0 var(--cream-shadow),
    0 14px 28px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  padding: 0.55rem 0.4rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-body);
}

.play-card:nth-child(1) { transform: rotate(-7deg) translateY(8px); }
.play-card:nth-child(2) { transform: rotate(-3deg) translateY(2px); }
.play-card:nth-child(3) { transform: rotate(0deg); }
.play-card:nth-child(4) { transform: rotate(3deg) translateY(2px); }
.play-card:nth-child(5) { transform: rotate(7deg) translateY(8px); }

.play-card:hover:not(:disabled) {
  z-index: 2;
  box-shadow:
    0 2px 0 var(--cream-shadow),
    0 18px 36px rgba(0, 0, 0, 0.45);
}

.play-card:nth-child(1):hover:not(:disabled) { transform: rotate(-7deg) translateY(0) scale(1.04); }
.play-card:nth-child(2):hover:not(:disabled) { transform: rotate(-3deg) translateY(-4px) scale(1.04); }
.play-card:nth-child(3):hover:not(:disabled) { transform: translateY(-6px) scale(1.04); }
.play-card:nth-child(4):hover:not(:disabled) { transform: rotate(3deg) translateY(-4px) scale(1.04); }
.play-card:nth-child(5):hover:not(:disabled) { transform: rotate(7deg) translateY(0) scale(1.04); }

.play-card.selected {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

.play-card.filled {
  outline: 2px solid rgba(196, 165, 116, 0.7);
  outline-offset: 2px;
}

.play-card:disabled {
  cursor: default;
  opacity: 0.95;
}

.card-corner {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1;
  color: #2a2a2a;
}

.card-corner.tl {
  top: 0.45rem;
  left: 0.5rem;
}

.card-corner.br {
  bottom: 0.45rem;
  right: 0.5rem;
  transform: rotate(180deg);
}

.card-corner.empty {
  color: #b0a898;
  font-size: 0.85rem;
}

.card-word {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.4rem 0.35rem;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.78rem, 2.2vw, 1.05rem);
  line-height: 1.15;
  word-break: break-word;
}

.rank-tray {
  margin: 0.5rem auto 0;
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(196, 165, 116, 0.18);
  max-width: 420px;
}

.tray-label {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--mist);
  text-align: center;
}

.rank-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

.rank-chip {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: none;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--cream-shadow);
  transition: transform 0.15s, opacity 0.15s;
}

.rank-chip:hover:not(:disabled) {
  transform: translateY(-3px);
}

.rank-chip.used {
  opacity: 0.28;
  pointer-events: none;
}

.rank-chip.picked {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}

.footer-actions {
  margin-top: 1.35rem;
  display: flex;
  justify-content: center;
}

/* Reveal */
.reveal-board {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0;
}

.reveal-card {
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(196, 165, 116, 0.18);
  animation: fadeUp 0.4s ease both;
}

.reveal-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.reveal-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--cream);
}

.rank-groups {
  display: grid;
  gap: 0.45rem;
}

.rank-group {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.65rem;
  align-items: center;
}

.rank-big {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 3px 0 var(--cream-shadow);
}

.rank-names {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
}

.rank-name {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.rank-name.name-team-a {
  background: rgba(94, 200, 192, 0.22);
  color: var(--sky);
  border: 1px solid rgba(94, 200, 192, 0.4);
}

.rank-name.name-team-b {
  background: rgba(255, 92, 77, 0.18);
  color: #ff8f84;
  border: 1px solid rgba(255, 143, 132, 0.4);
}

.rank-name.is-scorer {
  outline: 2px solid var(--acid);
  outline-offset: 1px;
}

.word-team-pts {
  display: inline-flex;
  gap: 0.4rem;
}

.wtp {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  opacity: 0.55;
}

.wtp.team-a {
  background: rgba(94, 200, 192, 0.15);
  color: var(--sky);
}

.wtp.team-b {
  background: rgba(255, 92, 77, 0.15);
  color: #ff8f84;
}

.wtp.hit {
  opacity: 1;
  outline: 1px solid currentColor;
}

.votes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.vote-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--pcolor, #fff) 45%, transparent);
}

.vote-pill .pdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pcolor, #fff);
  flex-shrink: 0;
}

.vote-pill.scorer {
  background: color-mix(in srgb, var(--pcolor, #c8f542) 22%, transparent);
  color: var(--foam);
}

.player-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pcolor, #fff);
  margin-right: 0.45rem;
  vertical-align: middle;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--pcolor, #fff) 35%, transparent);
}

.status-chip {
  border-color: color-mix(in srgb, var(--pcolor, #fff) 40%, transparent);
}

.status-chip .dot {
  background: var(--pcolor, #6b7c72);
}

.status-chip.done .dot {
  background: var(--pcolor, var(--acid));
  box-shadow: 0 0 8px color-mix(in srgb, var(--pcolor, #c8f542) 60%, transparent);
}

.status-chip.waiting .dot {
  background: var(--pcolor, var(--gold));
}

.score-row {
  border-left: 3px solid var(--pcolor, transparent);
}

.player-list li {
  border-left: 3px solid var(--pcolor, transparent);
}

.player-list li.in-team-a {
  background: rgba(94, 200, 192, 0.22);
  border: 1px solid rgba(94, 200, 192, 0.55);
  border-left: 4px solid var(--sky);
}

.player-list li.in-team-b {
  background: rgba(255, 92, 77, 0.2);
  border: 1px solid rgba(255, 143, 132, 0.55);
  border-left: 4px solid #ff8f84;
}

#reveal-actions {
  gap: 0.75rem;
  flex-wrap: wrap;
}

.majority-line {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  color: var(--mist);
}

.scoreboard {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.score-row {
  display: flex;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.view-finished.active {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 2.5rem);
}

.winner-block {
  text-align: center;
  max-width: 28rem;
}

.crown {
  font-size: 3rem;
  margin: 0;
  animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.president {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9vw, 3.6rem);
  margin: 0.25rem 0 0.75rem;
  letter-spacing: -0.03em;
  color: var(--gold);
}

.winner-names {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 700;
  box-shadow: var(--shadow);
  animation: fadeUp 0.25s ease both;
}

@media (max-width: 520px) {
  .cards-row {
    gap: 0.2rem;
    padding: 0.35rem 0 0.75rem;
    min-height: 160px;
    overflow: hidden;
  }
  .play-card {
    max-width: none;
    border-radius: 9px;
  }
  .play-card:nth-child(1) { transform: rotate(-5deg) translateY(6px); }
  .play-card:nth-child(2) { transform: rotate(-2deg) translateY(2px); }
  .play-card:nth-child(4) { transform: rotate(2deg) translateY(2px); }
  .play-card:nth-child(5) { transform: rotate(5deg) translateY(6px); }
  .card-word {
    font-size: clamp(0.62rem, 3.2vw, 0.78rem);
    padding: 1rem 0.15rem;
  }
  .card-corner {
    font-size: 0.75rem;
  }
}
