:root {
  --bg: #0b0709;
  --bg-raise: #140c10;
  --bg-card: #1a1014;
  --ink: #f4e8ec;
  --muted: #b89aa4;
  --line: rgba(244, 212, 220, 0.12);
  --accent: #e8a0b4;
  --accent-2: #c45c78;
  --gold: #e6c9a8;
  --good: #8fbfa8;
  --danger: #d46a7a;
  --glow: 0 0 40px rgba(196, 92, 120, 0.22);
  --radius: 18px;
  --sidebar: 210px;
  --touch: 48px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(196, 92, 120, 0.18), transparent 55%),
    radial-gradient(800px 500px at 100% 100%, rgba(90, 30, 50, 0.25), transparent 50%),
    var(--bg);
}

button, input { font: inherit; color: inherit; }

.hidden { display: none !important; }

.app {
  min-height: 100dvh;
  min-height: 100svh;
}

.screen.center-stage {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 24px 56px;
}

#screen-setup {
  isolation: isolate;
  overflow: hidden;
  --mx: 48%;
  --my: 42%;
}

#screen-setup::before,
#screen-setup::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.setup-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#screen-setup::before {
  z-index: 0;
  background: url("../assets/bg-4.webp") center / cover no-repeat;
}

#screen-setup::after {
  z-index: 2;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(196, 92, 120, 0.18), transparent 55%),
    radial-gradient(800px 500px at 100% 100%, rgba(90, 30, 50, 0.25), transparent 50%);
  -webkit-mask-image: radial-gradient(ellipse 78vmin 58vmin at var(--mx) var(--my), transparent 6%, rgba(0, 0, 0, 0.4) 36%, #000 66%);
  mask-image: radial-gradient(ellipse 78vmin 58vmin at var(--mx) var(--my), transparent 6%, rgba(0, 0, 0, 0.4) 36%, #000 66%);
}

.setup-glow {
  z-index: 1;
  background:
    radial-gradient(ellipse 78vmin 60vmin at var(--mx) var(--my), rgba(255, 204, 196, 0.38) 0%, rgba(214, 102, 96, 0.16) 34%, rgba(148, 42, 42, 0.07) 58%, transparent 74%);
  mix-blend-mode: soft-light;
  animation: setup-glow-breathe 7.5s ease-in-out infinite;
}

.setup-glow::before {
  content: "";
  position: absolute;
  inset: -18%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  opacity: 0.22;
  mix-blend-mode: overlay;
  animation: setup-grain 22s linear infinite;
}

@keyframes setup-glow-breathe {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}

@keyframes setup-grain {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-6%, -4%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .setup-glow,
  .setup-glow::before {
    animation: none;
  }
  .setup-timeline-burn { animation: none; }
}

#screen-setup .panel {
  z-index: 3;
  position: relative;
}

.kicker {
  margin: 0 0 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold);
}

.lede {
  color: var(--muted);
  line-height: 1.55;
}

.age-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.age-note .chili {
  width: 15px;
  height: 15px;
  color: #c45c58;
  opacity: 0.85;
}

.screen.play {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--sidebar);
  gap: 14px;
  padding: 14px;
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
}

.panel {
  width: min(720px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 40px 42px 32px;
  box-shadow: var(--glow);
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.02em;
}

h1 { margin: 0 0 12px; font-size: 42px; }

.players-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0 24px;
}

.gender-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas:
    "legend legend legend"
    "left toggle right";
  gap: 10px 14px;
  align-items: center;
  margin-top: 6px;
}

.gender-legend {
  grid-area: legend;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.g-end {
  min-height: var(--touch);
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.g-end.is-frau {
  border-color: var(--accent);
  background: rgba(232, 160, 180, 0.18);
  box-shadow: 0 0 18px rgba(232, 160, 180, 0.32);
  color: #f8dce4;
}

.g-end.is-mann {
  border-color: #e23d3d;
  background: rgba(226, 61, 61, 0.2);
  box-shadow: 0 0 18px rgba(226, 61, 61, 0.35);
  color: #ffd6d6;
}

#gender-left { grid-area: left; }
#gender-right { grid-area: right; }

.gender-toggle {
  grid-area: toggle;
  width: 76px;
  height: 40px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0d090b;
  cursor: pointer;
  position: relative;
  touch-action: manipulation;
}

.g-knob {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(232, 160, 180, 0.45);
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.gender-toggle[data-left="penis"] .g-knob {
  transform: translateX(32px);
  background: #e23d3d;
  box-shadow: 0 0 12px rgba(226, 61, 61, 0.5);
}

.setup-error {
  color: var(--danger);
  margin: 0 0 16px;
  font-size: 14px;
}

label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

input[type="text"], input[type="email"], input[type="password"], textarea {
  width: 100%;
  min-height: var(--touch);
  background: #0d090b;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}

input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 160, 180, 0.15);
}

.row-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.level-actions {
  justify-content: space-between;
  flex-wrap: nowrap;
}

.level-actions .btn-ghost {
  margin-left: auto;
}

.btn {
  min-height: var(--touch);
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(244, 212, 220, 0.22);
  background: rgba(244, 232, 236, 0.12);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}

.btn-primary {
  background: linear-gradient(180deg, #d4789a, #a84868);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 24px rgba(168, 72, 104, 0.35);
}

.btn-ghost {
  background: rgba(244, 232, 236, 0.92);
  color: #1a0c10;
  border-color: transparent;
}
.btn-good { background: #2a4a3c; border-color: #3d6a55; }
.btn-warn { background: #3a2228; }

.btn:disabled { opacity: 0.45; }

.level-grid {
  display: grid;
  gap: 14px;
  margin: 28px 0;
}

.how-to {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 18px;
}

.level-card {
  text-align: left;
  width: 100%;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #110b0e;
  min-height: 88px;
}

.level-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 4px;
}

.level-card span { color: var(--muted); font-size: 14px; }

.level-card.heat-1 {
  background: linear-gradient(105deg, rgba(232, 160, 180, 0.1), #110b0e 42%);
  box-shadow: inset 4px 0 0 #c9a8b0;
  border-color: rgba(232, 160, 180, 0.14);
}

.level-card.heat-2 {
  background: linear-gradient(105deg, rgba(196, 92, 120, 0.28), #16080e 48%);
  box-shadow: inset 4px 0 0 #d4789a, 0 0 22px rgba(196, 92, 120, 0.18);
  border-color: rgba(212, 120, 154, 0.32);
}

.level-card.heat-2 strong { color: #f3c4d0; }

.level-card.heat-3 {
  background: linear-gradient(105deg, rgba(226, 61, 61, 0.38), #1a0508 46%);
  box-shadow: inset 4px 0 0 #e23d3d, 0 0 36px rgba(226, 61, 61, 0.28);
  border-color: rgba(226, 61, 61, 0.5);
}

.level-card.heat-3 strong { color: #ffd2d2; }
.level-card.heat-3 span { color: #e8b4b4; }

.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 220, 230, 0.04), transparent 28%),
    rgba(20, 12, 16, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: calc(100dvh - 28px);
  max-height: calc(100dvh - 28px);
  overflow: hidden;
}

.sidebar.active {
  box-shadow: 0 0 0 1px var(--accent), var(--glow);
}

.sidebar.is-champion {
  box-shadow: 0 0 0 1px var(--gold), 0 0 28px rgba(230, 201, 168, 0.28);
}

.sidebar.active .turn-pill {
  animation: pulse-turn 1.8s ease-in-out infinite;
}

.side-name {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0;
}

.turn-pill {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar.active .turn-pill { color: var(--accent); }

.body-tag {
  margin: -8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.score-block {
  text-align: center;
  padding: 4px 0 0;
}

.score-value {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 0.9;
  color: var(--ink);
  --number-flow-mask-height: 0.2em;
}

.score-delta {
  min-height: 22px;
  font-size: 14px;
  color: var(--muted);
}

.score-label {
  margin: 8px 0 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.side-meta {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
}

.side-streak {
  margin: 0;
  min-height: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.side-streak:not(.is-on) { display: none; }

.score-delta.up { color: var(--good); }
.score-delta.down { color: var(--danger); }
.score-delta.is-pop {
  animation: delta-pop 0.45s ease;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.stat-row .stat-flow {
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 16px;
  line-height: 0.9;
}

.extras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.chip .chip-flow {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-family: var(--font-display);
  line-height: 0.9;
}

.token-tray {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  padding: 6px 2px 4px;
}

.token-tray::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.token {
  position: relative;
  width: 100%;
  min-height: 42px;
  flex: 0 0 auto;
  border-radius: 11px;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: rgba(244, 232, 236, 0.42);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), transparent 40%),
    linear-gradient(160deg, #1c1016, #12080c);
  border: 1px solid rgba(244, 212, 220, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -4px 8px rgba(0,0,0,0.35),
    0 4px 8px rgba(0,0,0,0.28);
  opacity: 0.42;
  filter: grayscale(0.55);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
}

.token-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  line-height: 0;
  justify-self: center;
  align-self: center;
}

.token-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  overflow: visible;
}

.token-icon svg.is-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.token-icon svg.is-fill {
  fill: currentColor;
  stroke: none;
}

.token-name {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
}

.token.is-earned {
  opacity: 1;
  filter: none;
  color: #2c1812;
}

.token.is-earned[data-token="first-match"] {
  background:
    radial-gradient(circle at 30% 24%, rgba(255,240,210,0.55), transparent 40%),
    radial-gradient(circle at 50% 100%, #7a4a22, #c4a056 55%, #e6c9a8);
  border-color: #f0d7a4;
}
.token.is-earned[data-token="on-fire"] {
  background:
    radial-gradient(circle at 30% 24%, rgba(255,180,120,0.5), transparent 42%),
    radial-gradient(circle at 50% 100%, #7a2418, #d47848 58%, #f0b888);
  border-color: #f0b48a;
}
.token.is-earned[data-token="daredevil"] {
  background:
    radial-gradient(circle at 30% 24%, rgba(255,236,220,0.45), transparent 40%),
    radial-gradient(circle at 50% 100%, #5a3824, #c4a078 55%, #e8d0b0);
  border-color: #d4b48a;
}
.token.is-earned[data-token="collector"] {
  background:
    radial-gradient(circle at 30% 24%, rgba(255,210,230,0.45), transparent 40%),
    radial-gradient(circle at 50% 100%, #4a1830, #c45c78 58%, #f0c0d0);
  border-color: #f4d4dc;
}
.token.is-earned[data-token="heat"] {
  background:
    radial-gradient(circle at 30% 24%, rgba(255,200,210,0.5), transparent 40%),
    radial-gradient(circle at 50% 100%, #7a1830, #d47890 55%, #f0b8c4);
  border-color: #e8a0b4;
}
.token.is-earned[data-token="peek"] {
  background:
    radial-gradient(circle at 30% 24%, rgba(220,240,255,0.5), transparent 40%),
    radial-gradient(circle at 50% 100%, #142038, #3a6a88 55%, #c8e4f4);
  border-color: #d4eef8;
}
.token.is-earned[data-token="crown"] {
  background:
    radial-gradient(circle at 30% 24%, rgba(255,244,210,0.7), transparent 42%),
    radial-gradient(circle at 50% 100%, #5a3a10, #c4a056 55%, #f4e0b0);
  border-color: #f0d7a4;
}

#side-0 .token.is-enter {
  animation: token-in-left 0.55s cubic-bezier(0.2, 0.85, 0.25, 1);
}
#side-1 .token.is-enter {
  animation: token-in-right 0.55s cubic-bezier(0.2, 0.85, 0.25, 1);
}

@keyframes token-in-left {
  from { transform: translateX(-120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes token-in-right {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes delta-pop {
  0% { transform: translateY(6px); opacity: 0; }
  40% { transform: translateY(-2px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes pulse-turn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.62; }
}

@keyframes pulse-turn-dot {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 8px #efb7bc44;
  }
  50% {
    transform: translateY(0) scale(1.28);
    box-shadow: 0 0 14px #efb7bc88;
  }
}

.stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stage-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.menu-wrap {
  position: relative;
}

.btn-dots {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
}

.play-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 210px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 14px;
  background: linear-gradient(180deg, #2a141c, #16080c);
  border: 1px solid rgba(244, 212, 220, 0.22);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.play-menu button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.play-menu button:hover,
.play-menu button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.play-menu-label {
  margin: 4px 12px 2px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.play-menu-sep {
  height: 1px;
  margin: 6px 8px;
  background: rgba(244, 212, 220, 0.16);
}

.stage-bar h2 {
  margin: 0;
  font-size: 22px;
  color: var(--muted);
  font-weight: 500;
}

.level-name {
  font-weight: 500;
}

.level-index {
  font-weight: 400;
  margin-left: 0.55em;
  opacity: 0.7;
  font-size: 0.78em;
}

.progress-wrap {
  min-width: 160px;
}

.progress-wrap span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.progress {
  height: 6px;
  background: #241418;
  border-radius: 99px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  margin: 0;
}

.board-wrap {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
}

.zoom-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  border-radius: 14px;
  overflow: hidden;
  background: #080306;
}

.zoom-layer img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: contain;
  object-position: center;
}

.zoom-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  font-size: 28px;
  line-height: 1;
  color: #f7e8ee;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.zoom-close:hover,
.zoom-close:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

.board {
  width: 100%;
  height: 100%;
  max-height: calc(100dvh - 110px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 12px;
  perspective: 900px;
}

.board.has-couple {
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.card {
  border: 0;
  padding: 0;
  background: transparent;
  width: 100%;
  height: 100%;
  min-height: 72px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  perspective: 520px;
  -webkit-perspective: 520px;
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.58));
  transition: filter 0.35s ease, transform 0.35s ease;
}

.card-tilt {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transform: translateZ(14px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.45s ease;
  will-change: transform;
}

.card.is-tilting .card-tilt {
  transition: transform 0.08s ease-out;
}

.card.is-flipped,
.card.is-matched {
  filter: drop-shadow(0 14px 18px rgba(80, 20, 36, 0.55)) drop-shadow(0 0 16px rgba(232, 160, 180, 0.18));
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  transition: transform 0.62s cubic-bezier(0.2, 0.75, 0.2, 1);
  border-radius: 14px;
  box-shadow:
    0 1px 0 #5a2c3a,
    0 2px 0 #3a1822,
    0 5px 0 #1a0c10,
    0 12px 22px rgba(0, 0, 0, 0.48),
    0 22px 36px rgba(0, 0, 0, 0.28);
}

.card.is-flipped .card-inner,
.card.is-matched .card-inner {
  -webkit-transform: rotateY(180deg) translateZ(1px);
  transform: rotateY(180deg) translateZ(1px);
}

.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.face-back {
  background-color: #160a10;
  background-image:
    radial-gradient(circle at 28% 18%, rgba(232, 160, 180, 0.22), transparent 42%),
    radial-gradient(circle at 80% 90%, rgba(90, 24, 40, 0.55), transparent 50%),
    repeating-linear-gradient(45deg, transparent 0 11px, rgba(230, 201, 168, 0.045) 11px 12px);
  border: 1px solid rgba(230, 201, 168, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 220, 0.22),
    inset 0 0 0 6px rgba(28, 10, 16, 0.72);
}

.face-back::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(232, 160, 180, 0.22);
  border-radius: 8px;
  pointer-events: none;
}

.face-back::after {
  content: "♥";
  font-size: 26px;
  color: rgba(232, 160, 180, 0.62);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.face-front {
  transform: rotateY(180deg);
  background: #10080c;
  border: 1px solid rgba(230, 201, 168, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 236, 220, 0.16);
}

.face-front img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--card-focus, 50% 50%);
}

.face-front .emoji-face {
  font-size: clamp(36px, 7vw, 72px);
  line-height: 1;
}

.face-front .pair-label {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 46%;
  z-index: 1;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0 8px 14px;
  border-radius: 0 0 12px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff8f4;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  background: linear-gradient(
    180deg,
    rgba(8, 3, 6, 0) 0%,
    rgba(8, 3, 6, 0.18) 38%,
    rgba(8, 3, 6, 0.55) 72%,
    rgba(8, 3, 6, 0.78) 100%
  );
}

.show-pair-labels .face-front .pair-label,
.card.is-couple .pair-label {
  display: flex;
}

.card.is-wir-hint {
  filter: drop-shadow(0 0 14px rgba(230, 201, 168, 0.7));
}

.card.is-wir-hint .face-back {
  border-color: rgba(230, 201, 168, 0.85);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 220, 0.28),
    inset 0 0 0 6px rgba(28, 10, 16, 0.72),
    0 0 0 2px rgba(230, 201, 168, 0.55);
  animation: wir-hint 1.6s ease-in-out infinite;
}

.card.is-wir-hint .face-back::after {
  content: "Wir";
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

@keyframes wir-hint {
  0%, 100% { box-shadow: inset 0 0 0 6px rgba(28, 10, 16, 0.72), 0 0 0 2px rgba(230, 201, 168, 0.4); }
  50% { box-shadow: inset 0 0 0 6px rgba(28, 10, 16, 0.72), 0 0 0 3px rgba(230, 201, 168, 0.95); }
}

.couple-seal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 50% 30%, rgba(230, 201, 168, 0.22), transparent 55%),
    #160a10;
}

.couple-seal-mark {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1;
}


.couple-ask {
  width: 100%;
  margin: 0 0 4px;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.couple-start-line {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 16px;
}

.card.is-matched {
  animation: card-found 0.7s ease;
}

.board.is-cleared .card {
  animation: board-cleared 2.3s ease;
}

.board.is-cleared .card.is-finale {
  animation: finale-hold 2.3s ease;
  z-index: 2;
}

@keyframes card-found {
  0% { transform: scale(1); }
  40% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes board-cleared {
  0% { transform: scale(1); filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.55)); }
  35% { transform: scale(1.03); filter: drop-shadow(0 16px 22px rgba(196, 92, 120, 0.35)); }
  100% { transform: scale(1); filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.55)); }
}

@keyframes finale-hold {
  0% { transform: scale(1); }
  20% { transform: scale(1.08); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1.02); }
}

.burst {
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0;
}

.burst.go {
  animation: burst 700ms ease-out;
}

@keyframes burst {
  0% { opacity: 0; box-shadow: inset 0 0 0 0 rgba(232,160,180,0); }
  30% { opacity: 1; box-shadow: inset 0 0 80px rgba(232,160,180,0.22); }
  100% { opacity: 0; }
}

.clear-toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 16;
  width: min(560px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 16px 16px 16px 22px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 220, 230, 0.08), transparent 50%),
    rgba(20, 12, 16, 0.92);
  border: 1px solid rgba(232, 160, 180, 0.28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(196, 92, 120, 0.18);
  backdrop-filter: blur(16px);
  opacity: 0;
  transform: translate(-50%, 28px);
  pointer-events: none;
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.85, 0.25, 1);
}

.clear-toast.is-in {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.clear-toast.hidden {
  display: none;
}

.clear-toast-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.clear-kicker {
  margin: 0 0 7px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.clear-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  line-height: 1.32;
  text-wrap: pretty;
}

.clear-toast .btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 12px 18px;
}

.btn-arrow {
  font-size: 1.15em;
  line-height: 1;
  translate: 0 -1px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 3, 5, 0.72);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.overlay.is-finale {
  overflow: hidden;
  background: #080306;
}

.overlay.is-finale::before,
.overlay.is-finale::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.overlay.is-finale::before {
  background: var(--finale-art) center 18% / cover no-repeat;
  filter: saturate(1.08);
}

.overlay.is-finale.is-tie::before {
  background-image: var(--finale-art-a), var(--finale-art-b);
  background-position: left 18%, right 18%;
  background-size: 50% auto, 50% auto;
  background-repeat: no-repeat, no-repeat;
}

.overlay.is-finale::after {
  background:
    linear-gradient(180deg, rgba(8, 3, 6, 0.28) 0%, rgba(8, 3, 6, 0.72) 48%, rgba(8, 3, 6, 0.92) 100%);
}

.overlay.is-finale .modal {
  position: relative;
  z-index: 1;
}

.modal {
  width: min(560px, 100%);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--glow);
}

.modal.finale {
  width: min(620px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  text-align: center;
  padding: 14px 22px 24px;
  border-color: rgba(230, 201, 168, 0.42);
  background:
    linear-gradient(180deg, rgba(20, 10, 14, 0.55), rgba(14, 8, 10, 0.92) 42%),
    var(--bg-raise);
  box-shadow: 0 0 80px rgba(230, 201, 168, 0.16), var(--glow);
  backdrop-filter: blur(10px);
}

.finale-layout {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.finale-art {
  margin: 0 0 12px;
}

.finale-heroes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.finale-hero {
  display: block;
  width: 100%;
  height: min(42vh, 340px);
  object-fit: cover;
  border-radius: 16px;
  margin: 0;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.finale-heroes .finale-hero {
  height: min(32vh, 240px);
}

.finale-hero.is-man { object-position: 50% 12%; }
.finale-hero.is-woman { object-position: 50% 18%; }

.modal.finale .finale-name {
  font-family: var(--font-display);
  font-size: clamp(36px, 7vw, 58px);
  margin: 0;
  color: var(--gold);
  line-height: 0.95;
}

.modal.finale .finale-line {
  margin: 10px 0 0;
  font-size: 18px;
  color: var(--ink);
}

.finale-ask {
  font-family: var(--font-display);
  font-size: clamp(22px, 4.2vw, 34px);
  line-height: 1.25;
  color: var(--ink);
  margin: 18px 0 8px;
}

.modal.finale .row-actions {
  justify-content: center;
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 8px;
}

.modal p { color: var(--muted); line-height: 1.5; }

.dare-text {
  font-size: 20px;
  color: var(--ink);
  line-height: 1.45;
  margin: 16px 0 24px;
}

.dare-actions {
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
}

.dare-actions .btn {
  min-height: var(--touch);
  height: var(--touch);
  padding: 0 16px;
}

.dare-actions .btn-primary {
  flex: 0 0 auto;
  width: auto;
}

.dare-actions .btn-compact {
  flex: 1 1 0;
}

.btn-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(244, 232, 236, 0.16);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.btn-ghost .btn-count {
  background: rgba(26, 12, 16, 0.1);
}

@media (min-width: 880px) {
  .overlay:not(.is-finale) {
    padding: 32px;
  }
  .modal:not(.finale) {
    width: min(640px, calc(100vw - 64px));
    padding: 32px;
  }
  .dare-actions {
    gap: 10px;
  }
  .dare-actions .btn {
    white-space: nowrap;
  }
}

.dare-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -8px 0 20px;
  min-height: 58px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(232, 160, 180, 0.28);
  background: rgba(20, 10, 14, 0.85);
  cursor: pointer;
}

.dare-timer-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--muted);
  text-box: trim-both cap alphabetic;
}

.dare-timer-value {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1;
  color: var(--gold);
  text-box: trim-both cap alphabetic;
}

@supports not (text-box-trim: trim-both) {
  .dare-timer-label { margin-top: -0.06em; }
  .dare-timer-value { margin-top: -0.12em; }
}

.dare-timer.is-lead .dare-timer-value { color: var(--muted); }
.dare-timer.is-run .dare-timer-value { color: var(--accent); }
.dare-timer.is-done {
  border-color: rgba(230, 201, 168, 0.45);
  box-shadow: 0 0 24px rgba(230, 201, 168, 0.18);
}
.dare-timer.is-done .dare-timer-label,
.dare-timer.is-done .dare-timer-value { color: var(--gold); }

.who {
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.scoreboard {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 0;
  margin: 18px 0 10px;
  padding: 6px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 50%), #10080c;
  border: 1px solid var(--line);
}

.sb-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 16px 28px 14px;
  border-radius: 14px;
  text-align: center;
  min-width: 0;
}

.sb-side.is-lead {
  background: linear-gradient(180deg, rgba(232, 160, 180, 0.16), rgba(196, 92, 120, 0.06));
  box-shadow: inset 0 0 0 1px rgba(232, 160, 180, 0.28);
}

.sb-name {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-meta {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sb-score {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 0.9;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  --number-flow-mask-height: 0.18em;
}

.sb-side.is-lead .sb-score {
  color: #f4d4dc;
}

.sb-vs {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #140c10;
  border: 1px solid rgba(230, 201, 168, 0.35);
  box-shadow: 0 0 0 4px #10080c;
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--gold);
  pointer-events: none;
}

.sb-status {
  text-align: center;
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: reduce) {
  .card-tilt,
  .card.is-tilting .card-tilt {
    transform: none;
    transition: none;
  }
}

@media (max-width: 980px), (orientation: portrait) {
  .screen.play {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .sidebar {
    min-height: 0;
    height: auto;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .score-value { font-size: 32px; }
  .token-tray {
    flex: 1 1 100%;
    flex-direction: row;
    height: 52px;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .token,
  .token-tray .token {
    width: auto;
    min-width: 128px;
    height: 42px;
    flex: 0 0 auto;
  }
  .token-name { display: block; font-size: 10px; }
  .token-icon svg { width: 16px; height: 16px; }
  .token.is-enter {
    animation: token-slide 0.45s cubic-bezier(0.2, 0.85, 0.25, 1);
  }
  @keyframes token-slide {
    from { transform: translateX(-40%) scale(0.7); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
  }
  .stage-bar {
    grid-template-columns: 1fr 1fr;
  }
  .board {
    max-height: 52dvh;
    gap: 8px;
  }
  .board.has-couple {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(6, 1fr);
  }
}

@media (orientation: portrait) and (max-height: 900px) {
  .overlay.is-finale { padding: 12px; }
  .finale-hero { height: min(26vh, 180px); }
}

@media (orientation: landscape) {
  .overlay.is-finale {
    padding: 0;
    place-items: stretch;
  }
  .overlay.is-finale::before,
  .overlay.is-finale::after {
    display: none;
  }
  .overlay.is-finale .modal.finale {
    width: 100%;
    max-width: none;
    max-height: none;
    height: 100dvh;
    overflow: hidden;
    text-align: left;
    padding: 0;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    background: #080306;
    box-shadow: none;
    backdrop-filter: none;
  }
  .finale-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    height: 100%;
  }
  .finale-art {
    position: relative;
    margin: 0;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }
  .finale-art::after {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: min(18%, 80px);
    background: linear-gradient(90deg, transparent, #080306);
    pointer-events: none;
  }
  .finale-art > .finale-hero,
  .finale-art .finale-heroes {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .finale-heroes {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0;
  }
  .finale-art .finale-hero {
    height: 100%;
    max-height: none;
    object-fit: cover;
    border-radius: 0;
  }
  .finale-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: clamp(20px, 3.5vw, 40px);
  }
  .modal.finale .finale-name { font-size: clamp(28px, 4.2vw, 52px); }
  .finale-ask { font-size: clamp(18px, 2.4vw, 28px); margin: 16px 0 10px; }
  .modal.finale .row-actions { justify-content: flex-start; }
}

@media (max-height: 700px) {
  h1 { font-size: 32px; }
  .panel { padding: 24px; }
}

/* Evening edition: one setup, a quiet scoreboard, and a board that leads. */
:root { --bg: #100e13; --bg-raise: #1b171d; --ink: #f8eee7; --muted: #b6a6ad; --accent: #efb7bc; --gold: #e0c7a5; }
body { background: radial-gradient(ellipse at 50% 0%, #30202b 0, transparent 60%), #100e13; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 1px solid rgba(239, 183, 188, 0.22);
  outline-offset: 1px;
}
.btn { transition: background .2s, transform .2s; }
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn-primary { background: #edb5bc; color: #291820; box-shadow: 0 8px 28px #0002; font-weight: 650; }
.btn-primary:hover:not(:disabled) { background: #f7cbd0; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
#screen-setup { padding: 52px 36px; }
#screen-setup::before { opacity: .56; background-position: center; }
#screen-setup::after {
  background:
    linear-gradient(90deg, #100e13e8, #100e13c4 55%, #100e13ef),
    linear-gradient(0deg, #100e13f0, #100e13a3 42%, #100e13c8);
}
#screen-setup .panel { width: min(1080px, 100%); display: grid; grid-template-columns: 1.1fr 1fr; gap: 70px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.setup-intro { padding: 28px 0; }
.setup-intro .kicker { margin-bottom: 28px; }
.setup-intro h1 { font-size: clamp(64px, 7.2vw, 104px); line-height: .96; letter-spacing: -.055em; }
.setup-intro h1 em { color: var(--accent); font-weight: 400; }
.setup-home {
  color: inherit;
  text-decoration: none;
}
.setup-home:hover,
.setup-home:focus-visible {
  color: inherit;
}
.setup-lede { font-size: 18px; color: #d5c3c8; line-height: 1.6; margin: 28px 0; }
.setup-rules { margin: 30px 0; font-size: 14px; color: #ddcfd2; }
.setup-rules p { display: flex; gap: 16px; margin: 16px 0; align-items: flex-start; }
.setup-rules span {
  flex: 0 0 1.7em;
  width: 1.7em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  padding-top: 2px;
  line-height: 1.2;
}
.setup-rules-icon {
  display: flex;
  justify-content: flex-start;
  padding-top: 1px;
}
.setup-rules-icon svg { width: 15px; height: 15px; display: block; }
.setup-rules-extra { margin: 0 0 8px; }
.setup-rules-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #e8bfc133;
  text-underline-offset: 3px;
}
.setup-rules-link:hover,
.setup-rules-link:focus-visible {
  color: var(--gold);
  text-decoration-color: var(--gold);
}
.setup-levels { margin-top: 28px; max-width: 24rem; overflow: visible; }
.setup-levels-kicker {
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}
.setup-timeline {
  --flame-w: 18px;
  --mark: 26px;
  --overlap: 9px;
  --gap: 16px;
  --cluster-1: var(--flame-w);
  --cluster-2: calc(var(--flame-w) + (var(--flame-w) - var(--overlap)));
  --cluster-3: calc(var(--flame-w) + 2 * (var(--flame-w) - var(--overlap)));
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--gap);
  margin: 0;
  padding: 0;
}
.setup-timeline li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-width: 0;
  overflow: visible;
}
.setup-timeline li:nth-child(1) { --cluster: var(--cluster-1); --next: var(--cluster-2); --burn-h: 24px; --burn-w: calc(var(--cluster) + 8px); }
.setup-timeline li:nth-child(2) { --cluster: var(--cluster-2); --next: var(--cluster-3); --burn-h: 34px; --burn-w: calc(var(--cluster) + 26px); }
.setup-timeline li:nth-child(3) { --cluster: var(--cluster-3); --next: var(--cluster-3); --burn-h: 44px; --burn-w: calc(var(--cluster) + 40px); }
.setup-timeline-num {
  display: block;
  width: var(--flame-w);
  text-align: center;
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--accent);
  margin: 0 0 8px;
  line-height: 1;
  padding-left: 4px;
}
.setup-timeline-track {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--mark);
  margin: 0 0 10px;
  overflow: visible;
}
.setup-timeline-track::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--cluster) / 2);
  right: calc(-1 * (var(--gap) + var(--next) / 2));
  height: 1px;
  background: #e6c9a8aa;
  transform: translateY(-50%);
  z-index: 0;
}
.setup-timeline li:last-child .setup-timeline-track::after { content: none; }
.setup-timeline-burn {
  position: absolute;
  left: calc(var(--cluster) / 2);
  bottom: 1px;
  width: var(--burn-w);
  height: var(--burn-h);
  pointer-events: none;
  z-index: 0;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  opacity: 0;
  transition: opacity .55s ease;
  background:
    radial-gradient(ellipse 70% 85% at 50% 100%, #ff7a3acc, transparent 70%),
    radial-gradient(ellipse 45% 100% at 48% 78%, #ffc08999, transparent 65%);
  filter: blur(3.5px);
  animation: setup-burn 1.7s ease-in-out infinite;
}
.setup-levels:hover .setup-timeline-burn,
.setup-levels:focus-within .setup-timeline-burn {
  opacity: 1;
}
.setup-timeline li:nth-child(1) .setup-timeline-burn {
  filter: blur(3px);
  animation-duration: 2.1s;
  background:
    radial-gradient(ellipse 70% 85% at 50% 100%, #ff9a4ecc, transparent 70%),
    radial-gradient(ellipse 45% 95% at 50% 86%, #e6c9a8aa, transparent 66%);
}
.setup-timeline li:nth-child(2) .setup-timeline-burn {
  filter: blur(3.5px);
  animation-duration: 1.55s;
  animation-delay: -.4s;
  background:
    radial-gradient(ellipse 80% 90% at 50% 100%, #ff5a20cc, transparent 72%),
    radial-gradient(ellipse 55% 100% at 46% 75%, #ffc090bb, transparent 66%);
}
.setup-timeline li:nth-child(3) .setup-timeline-burn {
  filter: blur(4px);
  animation-duration: 1.2s;
  animation-delay: -.7s;
  background:
    radial-gradient(ellipse 88% 95% at 50% 100%, #ff4a1ecc, transparent 72%),
    radial-gradient(ellipse 62% 110% at 48% 70%, #e8a0b4bb, transparent 68%),
    radial-gradient(ellipse 42% 70% at 58% 55%, #ff8a8aaa, transparent 65%);
}
@keyframes setup-burn {
  0%, 100% { transform: translateX(-50%) scaleY(1) scaleX(1); }
  35% { transform: translateX(-50%) scaleY(1.16) scaleX(.92); }
  62% { transform: translateX(-50%) scaleY(.92) scaleX(1.08); }
}
.setup-timeline-heat {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  width: var(--cluster);
  height: var(--mark);
}
.setup-timeline-heat svg {
  position: relative;
  display: block;
  width: var(--flame-w);
  height: var(--mark);
  margin-left: calc(var(--overlap) * -1);
  fill: var(--gold);
  color: var(--gold);
  overflow: visible;
  filter: drop-shadow(0 1px 1.5px #00000073) drop-shadow(1px 2px 2px #00000040);
}
.setup-timeline-heat svg:first-child { margin-left: 0; z-index: 1; }
.setup-timeline-heat svg:nth-child(2) { z-index: 2; fill: #efc4a4; color: #efc4a4; }
.setup-timeline-heat svg:nth-child(3) { z-index: 3; fill: var(--accent); color: var(--accent); }
.setup-timeline strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -.02em;
  color: var(--ink);
}
.setup-timeline em {
  margin-top: 6px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  line-height: 1.35;
  color: #cbb4ba;
}
.setup-fields { align-self: center; padding: 36px; background: #1a151be8; border: 1px solid #e8bfc124; border-radius: 24px; backdrop-filter: blur(20px); box-shadow: 0 24px 80px #0004; }
.setup-fields h2 { font-size: 32px; margin: 12px 0 0; letter-spacing: -.03em; }
.players-form { gap: 12px; margin-top: 28px; }
.players-form label, .gender-legend { letter-spacing: .08em; font-size: 10px; }
.players-form input { width: 100%; min-width: 0; border-radius: 10px; background: #0e0c11a8; }
.gender-bar { margin-top: 2px; }
.g-end { font-size: 13px; min-height: 38px; box-shadow: none !important; background: #ffffff05 !important; border-color: #e8bfc133 !important; }
.gender-toggle { transform: scale(.8); }
.setup-fields .row-actions .btn { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; }
.age-note { font-size: 10px; letter-spacing: 0; gap: 5px; margin-top: 20px; }
.age-note .chili { display: none; }
.screen.play { max-width: 1120px; margin: auto; min-height: 100svh; padding: 24px 28px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; gap: 16px; align-content: start; }
#side-0 { grid-area: 1 / 1; }
#side-1 { grid-area: 3 / 1; }
.stage { grid-area: 2 / 1; }
.sidebar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 16px;
  position: relative;
  border-radius: 16px;
  padding: 14px 18px 12px;
  height: auto;
  max-height: none;
  min-height: 0;
  overflow: visible;
}
.sidebar.active { background: #efb7bc0a; border-color: #efb7bc88; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar.active .turn-pill { color: var(--accent); }
.turn-pill { width: 100%; margin: 0; font-size: 9px; letter-spacing: .12em; }
.side-name { flex: 1 1 auto; min-width: 0; font-size: 25px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-head, .side-foot { display: contents; }
.name-row { display: contents; }
.turn-ind { display: none; }
.body-tag, .sidebar .stat-row, .sidebar .extras { display: none; }
.sidebar .token-tray { display: none; }
.score-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  padding: 0;
  flex: 0 0 auto;
}
.score-block::after { content: none; }
.score-label { margin: 2px 0 0; font-size: 9px; }
.score-value { font-size: 28px; }
.score-delta { position: static; min-height: 14px; font-size: 10px; }
.side-meta { width: 100%; margin: 6px 0 0; font-size: 13px; }
.side-streak { width: auto; margin: 6px 0 0 auto; font-size: 12px; }
.stage-bar { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; margin: 8px 0 12px; }
.stage-bar h2 { font-size: 23px; letter-spacing: -.02em; }
.progress-wrap { min-width: 130px; }
.progress-wrap span { font-size: 10px; letter-spacing: .04em; }
.progress { height: 3px; }
.btn-dots { background: transparent; width: 36px; min-width: 36px; min-height: 36px; height: 36px; border-color: var(--line); }
.turn-guide { display: flex; align-items: center; gap: 9px; color: #dbc9ce; font-size: 12px; min-height: 36px; padding: 0 0 14px; }
.turn-dot { width: 6px; height: 6px; flex: 0 0 6px; align-self: center; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px #efb7bc66; transform-origin: center; }
.board-legend { margin-left: auto; white-space: nowrap; color: var(--gold); font-size: 10px; }
.board-legend span { color: var(--muted); margin: 0 8px; }
.board-wrap { display: block; flex: initial; }
.board, .board.has-couple { height: clamp(330px, calc(100svh - 252px), 650px); max-height: none; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 12px; }
.board:not(.has-couple) { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); }
.card { min-height: 0; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.5)); transition: opacity .25s, filter .25s; }
.card-inner { border-radius: 12px; box-shadow: 0 1px 0 #4a2a34, 0 3px 0 #241016, 0 10px 18px #0008; }
.face { border-radius: 12px; }
.face-back { background: radial-gradient(ellipse at 50% 0%, #51313e55, transparent 80%), #251b25; border-color: #a8839638; box-shadow: inset 0 0 0 5px #120d151f; align-content: center; gap: 12px; }
.face-back::after { content: none; }
.face-back::before { inset: 7px; border-color: #cf9caf20; border-radius: 7px; }
.card[data-kind="gif"] .face-back { background: radial-gradient(ellipse at 50% 0%, #66533d33, transparent 80%), #252124; border-color: #b9a17b38; }
.card-back-mark { color: #d9a5b6; font-family: Georgia, serif; font-size: 32px; line-height: 1; }
.card[data-kind="gif"] .card-back-mark { color: #d5b996; }
.card-back-label { color: #bfa1af; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }
.card[data-kind="gif"] .card-back-label { color: #b7a68e; }
.card.is-unavailable { opacity: .4; cursor: default; }
.card.is-matched { opacity: .58; filter: none; }
.card.is-matched:hover, .board.is-cleared .card { opacity: 1; }
.card.is-matched .face-front { border-color: #c8b39b99; }
.card.is-matched .face-front::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23e6c9a8' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round' d='M3.4 8.3 6.6 11.3 12.6 4.8'/%3E%3C/svg%3E") center / 12px 12px no-repeat,
    radial-gradient(circle at 36% 30%, #3a242c, #140c10 72%);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 220, 0.22),
    0 0 0 1px rgba(230, 201, 168, 0.5),
    0 3px 8px rgba(0, 0, 0, 0.4);
}
.face-front .pair-label { display: flex; font-size: 10px; letter-spacing: .03em; text-transform: none; padding: 0 5px 9px; }
.face-front .emoji-face { font-size: clamp(28px, 4vw, 52px); padding-bottom: 12px; }
.zoom-layer { position: fixed; inset: 24px; z-index: 45; display: grid; place-items: center; background: #100e13f7; border: 1px solid var(--line); box-shadow: 0 0 0 30px #100e13cc; }
.zoom-layer img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: contain;
  object-position: center;
}
.zoom-close { background: #38232d; width: 48px; height: 48px; }
.overlay { backdrop-filter: blur(12px); background: #08060bbc; }
.modal.is-age { width: min(440px, 100%); }
.age-gate-help { margin: 0 0 28px; }
.age-gate-actions { flex-direction: column; gap: 10px; }
.age-gate-actions .btn { width: 100%; }
.modal:has(.rules-arc) { width: min(640px, 100%); max-height: calc(100dvh - 48px); overflow: auto; }
.modal h3 { letter-spacing: -.025em; }
.dare-timer { cursor: pointer; }
.dare-timer.is-ready { background: #ffffff04; border-color: #efb7bc44; }
.rules-lede {
  margin: 6px 0 26px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  line-height: 1.5;
  color: #e8d8dc;
}
.rules-kicker {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.rules-list { color: #d3c2c9; line-height: 1.65; font-size: 14px; margin: 0 0 22px; }
.rules-list strong { color: var(--ink); }
.rules-arc {
  list-style: none;
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0 0 12px;
  padding: 16px 8px 14px;
  border: 1px solid #e8bfc122;
  border-radius: 16px;
  background: #ffffff05;
}
.rules-arc li {
  position: relative;
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 0 12px;
}
.rules-arc li + li::before {
  content: "→";
  position: absolute;
  left: -0.35em;
  top: 1.35em;
  color: var(--gold);
  font-size: 13px;
  opacity: .7;
}
.rules-arc b {
  display: block;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--accent);
}
.rules-arc strong {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -.02em;
  margin: 5px 0 6px;
  color: var(--ink);
}
.rules-arc span {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  line-height: 1.35;
  color: #cbb4ba;
}
.rules-arc-note {
  margin: 0 0 22px;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  line-height: 1.45;
  color: #cbb4ba;
}
@media (max-width: 520px) {
  .rules-arc { flex-direction: column; gap: 16px; padding: 16px 14px; }
  .rules-arc li + li::before {
    content: "↓";
    left: 50%;
    top: -14px;
    transform: translateX(-50%);
  }
}
.clear-toast { z-index: 30; }
@media (min-width: 1500px) { .screen.play { max-width: 1280px; } }
@media (max-width: 700px) {
  #screen-setup { padding: 28px 20px 40px; }
  #screen-setup .panel { grid-template-columns: 1fr; gap: 24px; max-width: 480px; }
  .setup-intro { padding: 0; }
  .setup-intro .kicker { margin-bottom: 16px; }
  .setup-intro h1 { font-size: 65px; }
  .setup-intro h1 br { display: none; }
  .setup-lede { margin: 18px 0; font-size: 15px; }
  .setup-lede br { display: none; }
  .setup-rules { margin: 20px 0 0; font-size: 12px; }
  .setup-rules p { margin: 10px 0; }
  .setup-levels { margin-top: 22px; }
  .setup-levels-kicker { margin-bottom: 10px; }
  .setup-timeline strong { font-size: 17px; }
  .setup-timeline em { font-size: 12px; }
  .setup-fields { padding: 26px 22px; }
  .setup-fields h2 { font-size: 27px; }
  .screen.play { padding: 14px 12px max(22px, env(safe-area-inset-bottom)); gap: 10px; }
  .sidebar { padding: 12px 14px 18px; min-height: 78px; gap: 6px; border-radius: 12px; }
  .side-name { font-size: 20px; }
  .score-value { font-size: 29px; }
  .score-block { gap: 4px; }
  .score-block::after { content: ''; }
  .score-delta { position: static; font-size: 9px; }
  .stage-bar { gap: 10px; margin-top: 6px; }
  .stage-bar h2 { font-size: 19px; }
  .progress-wrap { min-width: 76px; }
  .turn-guide { font-size: 11px; line-height: 1.45; align-items: center; min-height: 40px; padding-bottom: 12px; }
  .board-legend { display: none; }
  .board, .board.has-couple { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); gap: 8px; height: max(420px, calc(100svh - 330px)); }
  .board:not(.has-couple) { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); }
  .face-back { gap: 7px; }
  .card-back-mark { font-size: 24px; }
  .card-back-label { font-size: 8px; }
  .face-front .emoji-face { font-size: 29px; }
  .face-front .pair-label { font-size: 9px; padding-bottom: 5px; }
  .zoom-layer { inset: 12px; }
  .modal:not(.finale) { padding: 26px 22px; }
  .modal .row-actions { gap: 8px; }
  .modal .row-actions .btn-primary { width: 100%; }
  .modal .dare-actions .btn-primary { width: auto; }
  .modal .row-actions .btn { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.overlay { z-index: 60; }

/* From landscape tablets onward, each player owns one side of the board. */
@media (min-width: 960px) and (orientation: landscape) {
  .screen.play {
    max-width: none;
    width: 100%;
    height: max(480px, 100svh);
    grid-template-columns: clamp(140px, 11vw, 180px) minmax(0, 1fr) clamp(140px, 11vw, 180px);
    grid-template-rows: minmax(0, 1fr);
    padding: 12px;
    gap: 12px;
  }
  #side-0 { grid-area: 1 / 1; }
  .stage { grid-area: 1 / 2; }
  #side-1 { grid-area: 1 / 3; }
  .sidebar {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    align-content: start;
    justify-content: flex-start;
    gap: 8px;
    padding: 28px 14px 20px;
    text-align: center;
  }
  .sidebar .turn-pill { width: auto; justify-content: center; }
  .sidebar .side-name { flex: 0 0 auto; width: 100%; font-size: clamp(22px, 2vw, 30px); }
  .sidebar .score-block {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 0 4px;
  }
  .sidebar .score-value { font-size: clamp(34px, 3.6vw, 44px); }
  .sidebar .score-label { margin: 0; font-size: 10px; letter-spacing: 0.16em; }
  .sidebar .score-delta { position: static; min-height: 16px; font-size: 11px; }
  .sidebar .side-meta {
    width: 100%;
    margin: 8px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 13px;
  }
  .sidebar .side-streak {
    width: 100%;
    margin: 0;
    text-align: center;
  }
  .stage { min-height: 0; }
  .board-wrap { flex: 1; min-height: 0; }
  .board, .board.has-couple { height: 100%; }
  .face-front .emoji-face { font-size: clamp(36px, 4vw, 96px); }
  .face-front .pair-label { font-size: clamp(11px, .8vw, 16px); }
  .card-back-mark { font-size: clamp(32px, 2.5vw, 60px); }
  .progress-wrap { min-width: 90px; }
  .board-legend { display: none; }
}

/* The cards share one playing surface; player standings sit outside it. */
.sidebar,
.sidebar.active,
.sidebar.is-champion {
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
}
.sidebar .turn-pill { display: flex; align-items: center; gap: 8px; line-height: 1; }
.sidebar .turn-pill::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
  opacity: .35;
  transform-origin: center;
}
.sidebar.active .turn-pill {
  animation: pulse-turn 1.8s ease-in-out infinite;
}
.sidebar.active .turn-pill::before {
  background: var(--accent);
  opacity: 1;
  animation: pulse-turn-dot 1.8s ease-in-out infinite;
}
.turn-dot {
  animation: pulse-turn-dot 1.8s ease-in-out infinite;
}
.sidebar.active .side-name { color: var(--accent); }
.sidebar.is-champion .side-name { color: var(--gold); }
.stage {
  padding: 16px;
  border: 1px solid #d6bbc526;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 50% 0%, #57364322, transparent 65%),
    linear-gradient(135deg, #ffffff03, transparent 50%),
    #1a151c;
  box-shadow: inset 0 1px 0 #ffffff08, 0 12px 36px #0003;
}
.stage-bar { margin-top: 0; }
@media (max-width: 700px) {
  .stage { padding: 10px; border-radius: 16px; }
  .sidebar { padding-top: 6px; padding-bottom: 12px; min-height: 72px; }
  .board, .board.has-couple { height: max(420px, calc(100svh - 330px)); }
}

@media (min-width: 960px) and (orientation: landscape) {
  .screen.play {
    grid-template-columns: minmax(148px, 13vw) minmax(0, 1fr) minmax(148px, 13vw);
  }
  .sidebar {
    align-self: center;
    height: auto;
    max-height: calc(100svh - 40px);
    justify-content: center;
    gap: 18px;
    padding: 28px 10px;
  }
  .sidebar.active {
    background: radial-gradient(ellipse at 50% 42%, #efb7bc1c, transparent 70%);
    box-shadow: none;
    border-color: transparent;
  }
  .sidebar .side-head,
  .sidebar .side-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 6px;
  }
  .sidebar .score-block {
    padding: 4px 0 2px;
  }
  .sidebar .side-meta {
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid #e8bfc122;
  }
  .sidebar .token-tray {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-content: start;
    flex: 0 0 auto;
    width: 100%;
    max-height: none;
    overflow: visible;
    gap: 6px;
    padding: 4px 0 0;
  }
  .sidebar .token-tray:empty {
    display: none;
  }
  .sidebar .token {
    width: 34px;
    height: 34px;
    min-height: 34px;
    grid-template-columns: 1fr;
    place-items: center;
    justify-items: center;
    align-content: center;
    padding: 0;
    border-radius: 10px;
    overflow: visible;
  }
  .sidebar .token .token-icon {
    width: 20px;
    height: 20px;
  }
  .sidebar .token .token-icon svg {
    width: 20px;
    height: 20px;
  }
  .sidebar .token-name {
    display: none;
  }
}

.token {
  cursor: pointer;
  appearance: none;
  font: inherit;
  color: inherit;
  text-align: inherit;
}
.tippy-box[data-theme~="m42"] {
  background: #1c161b;
  border: 0;
  box-shadow: none;
  color: #d5c3c8;
  font-size: 12px;
  filter:
    drop-shadow(0 0 0.4px #e6c9a8)
    drop-shadow(0 0 10px #e6c9a838)
    drop-shadow(0 14px 28px #00000080);
}
.tippy-box[data-theme~="m42"] > .tippy-arrow {
  color: #1c161b;
}
.tippy-box[data-theme~="m42"] > .tippy-content {
  padding: 10px 13px 11px;
}
.tippy-box[data-theme~="m42"] .tip-name {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: -.01em;
  margin-bottom: 4px;
}
.tippy-box[data-theme~="m42"] .tip-desc {
  display: block;
  line-height: 1.4;
}
:root {
  --foot-size: 13.5px;
}
.lang-bar {
  position: relative;
}
.lang-switch,
.site-foot-credit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: #8f7c82;
  font: inherit;
  font-size: var(--foot-size);
  line-height: 1.2;
  letter-spacing: .01em;
  cursor: pointer;
  opacity: .68;
}
.site-foot-credit {
  gap: .3em;
  text-decoration: none;
}
.site-foot-credit b {
  font-weight: 600;
}
.lang-switch:hover,
.lang-switch:focus-visible,
.site-foot-credit:hover,
.site-foot-credit:focus-visible {
  opacity: 1;
  color: var(--gold);
}
.lang-globe {
  display: block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.lang-menu {
  position: absolute;
  left: 8px;
  bottom: 100%;
  margin: 0 0 4px;
  padding: 4px 0;
  list-style: none;
  min-width: 8.5rem;
  background: #1c161bee;
  border-radius: 10px;
  box-shadow: 0 12px 28px #00000073;
}
.lang-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 7px 12px;
  border: 0;
  background: none;
  color: #d5c3c8;
  font: inherit;
  font-size: var(--foot-size);
  text-align: left;
  cursor: pointer;
}
.lang-option.is-active,
.lang-option:hover,
.lang-option:focus-visible {
  color: var(--gold);
}
html[data-screen="play"]:not(.is-intro) .site-foot {
  display: none;
}
.play-menu button.is-active {
  color: var(--gold);
}
.play-menu .made-by {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.play-menu .made-by b {
  color: var(--ink);
  font-weight: 600;
}
.play-menu .made-by:hover,
.play-menu .made-by:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.intro {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #050203;
  place-items: stretch;
}
html.is-intro,
html.is-intro body {
  overflow: hidden;
}
html.is-intro .intro,
html.is-intro-leaving .intro {
  display: grid;
}
html.is-intro .site-foot .lang-switch,
html.is-intro .site-foot-credit {
  color: rgba(244, 232, 236, 0.88);
  opacity: 0.9;
}
.intro-frame {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
}
.intro-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  transform: scale(1.04);
  transform-origin: 50% 58%;
}
.intro-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(8, 4, 6, 0.88) 0%, rgba(8, 4, 6, 0.35) 38%, rgba(8, 4, 6, 0.12) 58%, transparent 78%),
    radial-gradient(ellipse 90% 55% at 50% 100%, rgba(8, 4, 6, 0.55), transparent 70%);
  pointer-events: none;
}
.intro-copy {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 24px 24px max(48px, calc(28px + env(safe-area-inset-bottom) + 36px));
  color: #f6ecef;
}
.intro-copy h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(32px, 6.4vw, 72px);
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.intro-copy h1 em {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}
.intro-note {
  margin: 0 0 22px;
  color: rgba(244, 232, 236, 0.72);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.intro-copy .btn-primary {
  min-width: 220px;
}
html.is-intro-leaving .intro-copy {
  animation: intro-copy-out 0.32s ease forwards;
}
html.is-intro-leaving .intro-frame {
  animation: intro-collapse 1.05s cubic-bezier(0.62, 0.02, 0.28, 1) 0.12s forwards;
}
html.is-intro-leaving .intro-art {
  animation: intro-art-out 1.12s ease 0.08s forwards;
}
@keyframes intro-copy-out {
  to {
    opacity: 0;
    transform: translateY(-18px);
    filter: blur(6px);
  }
}
@keyframes intro-collapse {
  0% { clip-path: circle(140% at 50% 62%); }
  62% { clip-path: circle(22% at 50% 62%); }
  100% { clip-path: circle(0 at 50% 62%); }
}
@keyframes intro-art-out {
  to {
    transform: scale(1.16);
    filter: blur(10px) saturate(1.2);
  }
}
@media (prefers-reduced-motion: reduce) {
  html.is-intro-leaving .intro-copy,
  html.is-intro-leaving .intro-frame,
  html.is-intro-leaving .intro-art {
    animation: none;
    opacity: 0;
  }
}
@media (max-width: 640px) {
  .intro-copy h1 { font-size: clamp(28px, 8.5vw, 40px); }
}


/* Standalone pages: contact and privacy */
textarea { font: inherit; color: inherit; resize: vertical; min-height: 150px; line-height: 1.5; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.page-body { display: block; }
.page-shell {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 20px max(36px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.page-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.back-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(244, 212, 220, 0.3);
  background: rgba(244, 232, 236, 0.09);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
.back-pill svg { width: 18px; height: 18px; color: var(--gold); transition: transform .2s; }
.back-pill:hover, .back-pill:focus-visible { background: rgba(244, 232, 236, 0.16); border-color: var(--gold); }
.back-pill:hover svg, .back-pill:focus-visible svg { transform: translateX(-3px); }
.page-lang { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: #8f7c82; }
.page-lang a { padding: 10px 8px; color: inherit; text-decoration: none; }
.page-lang a:hover, .page-lang a.is-active { color: var(--gold); }
.page-lang-sep { opacity: .5; }

.panel.page-panel { width: 100%; padding: 36px 34px 32px; border-radius: 26px; }
@media (max-width: 520px) { .panel.page-panel { padding: 28px 22px 26px; border-radius: 22px; } }
.page-panel h1 { margin: 0 0 12px; font-size: clamp(34px, 7vw, 44px); line-height: 1.05; }
.page-panel .lede { margin: 0; font-size: 15.5px; }

.contact-form { display: grid; gap: 16px; margin-top: 28px; }
.contact-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.page-cta {
  width: 100%;
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  font-size: 16px;
  text-decoration: none;
}
.page-cta svg { width: 18px; height: 18px; }
.contact-note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.form-alert {
  margin: 22px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(212, 106, 122, 0.42);
  background: rgba(212, 106, 122, 0.09);
  color: #f0b4bd;
  font-size: 14px;
  line-height: 1.45;
}
.sent-mark {
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(143, 191, 168, 0.12);
  border: 1px solid rgba(143, 191, 168, 0.35);
  color: var(--good);
}

.privacy-panel h2 { margin: 28px 0 6px; font-size: 20px; }
.privacy-panel p { margin: 0 0 8px; color: var(--muted); line-height: 1.6; }
.privacy-panel .lede { margin-bottom: 4px; }
.privacy-panel .contact-note { margin-top: 24px; }
.privacy-link { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.privacy-link:hover { color: var(--ink); }

/* Setup: friendly data notice */
.consent-row { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 0 10px; align-items: start; margin: 14px -10px 8px; padding: 8px 10px; border-radius: 12px; border: 1px solid transparent; font-size: 13px; line-height: 1.4; color: var(--muted); transition: border-color .25s, background .25s; }
.consent-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.consent-box { display: grid; place-items: center; width: 20px; height: 20px; margin: 0; border-radius: 6px; border: 1px solid rgba(244, 212, 220, 0.38); background: rgba(14, 12, 17, 0.66); color: transparent; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.consent-box svg { width: 14px; height: 14px; }
.consent-row:hover .consent-box { border-color: var(--accent); }
.consent-input:checked + .consent-box { background: var(--accent); border-color: var(--accent); color: #291820; }
.consent-input:focus-visible + .consent-box { outline: 2px solid var(--gold); outline-offset: 2px; }
.consent-line { margin: 1px 0 0; }
.consent-text { display: inline; margin: 0; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: inherit; color: inherit; }
.consent-link { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 0 8px; padding: 2px 0; border: 0; background: none; color: var(--gold); font: inherit; white-space: nowrap; cursor: pointer; opacity: .9; }
.consent-link svg { width: 14px; height: 14px; flex: none; }
.consent-link span { text-decoration: underline; text-decoration-color: rgba(230, 201, 168, 0.4); text-underline-offset: 3px; }
.consent-link:hover, .consent-link:focus-visible { color: var(--ink); opacity: 1; }
.consent-link:hover span, .consent-link:focus-visible span { text-decoration-color: currentColor; }
.consent-row.is-need { border-color: rgba(212, 106, 122, 0.55); background: rgba(212, 106, 122, 0.08); color: var(--ink); }
.consent-row.is-need .consent-box { border-color: var(--danger); }
.modal.is-privacy { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(244, 212, 220, 0.28) transparent; }
.privacy-modal-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 20px; font-size: 14px; }
.privacy-modal-links a { color: var(--gold); text-underline-offset: 3px; }
.privacy-modal-links a:hover { color: var(--ink); }

/* Imprint page */
[hidden] { display: none !important; }
.imprint-box { display: grid; gap: 12px; margin-top: 26px; }
.imprint-lines { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.03); }
.imprint-lines p { margin: 0 0 4px; color: var(--ink); line-height: 1.55; overflow-wrap: anywhere; }
.imprint-lines p:last-child { margin-bottom: 0; }
.imprint-lines .imprint-head { margin-bottom: 10px; font-family: var(--font-display); font-size: 21px; font-weight: 500; letter-spacing: 0.02em; }
.imprint-more { margin: 22px 0 0; font-size: 14px; }

/* Site footer: language popup and legal links on the first row, the credit on the second row. */
.site-foot-links { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 0 2px; }
.site-foot-links .lang-switch { text-decoration: none; }
.site-foot-credit { white-space: nowrap; }

/* Wide screens: a compact bar fixed to the bottom edge, language and links left, credit right. */
.site-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  pointer-events: none;
}
.site-foot > *, .site-foot-row > * { pointer-events: auto; }
.site-foot-row { display: flex; align-items: center; gap: 2px; }

/* Stacked page layouts (narrower than a wide landscape screen): a normal footer below the content, still on one row. */
@media (max-width: 980px), (orientation: portrait) {
  .site-foot {
    position: static;
    align-items: center;
    justify-content: space-between;
    width: min(720px, 100%);
    margin: 0 auto;
    padding: 4px 16px max(18px, env(safe-area-inset-bottom));
    pointer-events: auto;
  }
  /* On the full-screen intro the footer stays on top of the picture and gets a soft backdrop. */
  html.is-intro .site-foot {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    margin: 0;
    padding-top: 28px;
    background: linear-gradient(to top, rgba(5, 2, 3, 0.9), rgba(5, 2, 3, 0));
  }
  html.is-intro .intro-copy { padding-bottom: max(96px, calc(76px + env(safe-area-inset-bottom))); }
}

/* Smartphones only: two rows, language popup and links on the first, the credit on the second. */
@media (max-width: 700px) {
  .site-foot { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; }
  .site-foot-row { justify-content: space-between; flex-wrap: wrap; gap: 0 4px; }
  .site-foot-links { flex-wrap: nowrap; margin-left: auto; }
  .site-foot .lang-switch, .site-foot-credit { padding: 10px 6px; font-size: 13px; opacity: .8; }
  .site-foot .lang-bar .lang-switch { padding-left: 2px; }
  .site-foot-credit { align-self: center; justify-content: center; }
  html.is-intro .intro-copy { padding-bottom: max(112px, calc(92px + env(safe-area-inset-bottom))); }
}

/* Standalone pages (contact, privacy, imprint) */
.page-foot { display: grid; gap: 0; color: #8f7c82; font-size: 13px; }
.page-foot-row { display: flex; align-items: center; justify-content: center; gap: 4px 2px; flex-wrap: wrap; }
.page-foot a, .page-foot summary { padding: 10px 8px; color: inherit; text-decoration: none; }
.page-foot a:hover, .page-foot a:focus-visible, .page-foot summary:hover, .page-foot summary:focus-visible, .page-foot a[aria-current="page"] { color: var(--gold); }
.page-foot-links { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 0 2px; }
.page-foot-credit { justify-self: center; }
.page-foot b { font-weight: 600; }
.foot-lang { position: relative; display: none; }
.foot-lang summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; }
.foot-lang summary::-webkit-details-marker { display: none; }
.foot-lang svg { width: 15px; height: 15px; flex: none; opacity: .8; }
.foot-lang-menu { position: absolute; left: 0; bottom: 100%; margin: 0 0 4px; padding: 4px 0; list-style: none; min-width: 8.5rem; background: #1c161b; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 28px #00000073; z-index: 5; }
.foot-lang-menu a { display: block; padding: 8px 14px; }
@media (max-width: 700px) {
  .foot-lang { display: block; }
  .page-foot-row { justify-content: space-between; }
  .page-lang { display: none; }
}

/* Smartphones only: name, turn and points are enough. Tablets and desktops keep the pairs found, the streak and the score change. */
@media (max-width: 700px) {
  .sidebar .side-foot, .score-delta { display: none; }
}

/* Smartphones: both players share one bar at the bottom, player 1 left and player 2 right. Name and points only,
   the active player is clearly highlighted and a divider separates the two halves. */
@media (max-width: 700px) {
  .screen.play {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    gap: 10px 0;
    padding: 12px 12px max(14px, env(safe-area-inset-bottom));
  }
  .stage { grid-area: 1 / 1 / 2 / 3; }
  #side-0 { grid-area: 2 / 1; }
  #side-1 { grid-area: 2 / 2; }

  .sidebar {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    min-height: 74px;
    padding: 10px 16px 12px;
    background: #ffffff05;
    border: 1px solid var(--line);
    transition: background .25s, opacity .25s, box-shadow .25s, border-color .25s;
  }
  #side-0 { border-radius: 16px 0 0 16px; border-right-width: 0; }
  #side-1 { border-radius: 0 16px 16px 0; align-items: flex-end; text-align: right; border-left: 1px solid rgba(244, 212, 220, 0.3); }

  /* Name and points only. The turn text stays available to screen readers. */
  .turn-pill {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .score-label { display: none; }
  .score-block, #side-0 .score-block { align-items: flex-start; padding: 0; background: none; border: 0; box-shadow: none; }
  #side-1 .score-block { align-items: flex-end; }
  .name-row { display: flex; align-items: center; gap: 7px; max-width: 100%; min-width: 0; }
  .side-name { flex: 0 1 auto; min-width: 0; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
  .side-name { flex: 0 1 auto; max-width: calc(100% + 20px); padding: 10px; margin: -10px; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
  /* The number-flow element pads its digits by the fade mask height above and below, so cancel that to keep the bar compact. */
  .score-value { font-size: 30px; line-height: 1; margin: calc(var(--number-flow-mask-height, 0.2em) * -1) 0; }

  /* Whose turn it is: a warmer, lighter background on the active half and a dimmed other half. No strong border. */
  .sidebar:not(.active) { opacity: .6; }
  .sidebar.active {
    background: linear-gradient(180deg, #623744, #4a2a34);
    border-color: rgba(244, 212, 220, 0.14);
    box-shadow: none;
  }
  .sidebar.active .side-name { color: var(--ink); }
  /* Turn indicator: a solid dot with a static glow and a ring that expands and fades. The ring animates only
     transform and opacity, so the browser runs it on the compositor instead of repainting every frame. */
  .sidebar.active .turn-ind {
    display: block;
    position: relative;
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px 1px rgba(239, 183, 188, 0.7);
  }
  .sidebar.active .turn-ind::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    opacity: 0;
    will-change: transform, opacity;
    animation: turn-ring 1.9s ease-out infinite;
  }
  @keyframes turn-ring {
    0% { transform: scale(1); opacity: .75; }
    100% { transform: scale(3.4); opacity: 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    .sidebar.active .turn-ind::after { animation: none; }
  }
  .board, .board.has-couple { height: max(420px, calc(100svh - 220px)); }
  /* The turn hint moves below the board, between the board and the player bar, and is centred like a caption. */
  .turn-guide { order: 1; justify-content: center; text-align: center; min-height: 40px; padding: 12px 4px 0; }
  .turn-guide #turn-message { text-align: center; }
}

/* Score count-up: a short pop with a green or red flash. Defined here because the number-flow library is not shipped. */
.score-value, .sb-score { display: inline-block; transform-origin: center; font-variant-numeric: tabular-nums; }
.score-value.flow-up, .sb-score.flow-up { animation: score-up .75s ease-out; }
.score-value.flow-down, .sb-score.flow-down { animation: score-down .75s ease-out; }
@keyframes score-up {
  0% { transform: scale(1); }
  25% { transform: scale(1.2); color: var(--good); }
  100% { transform: scale(1); }
}
@keyframes score-down {
  0% { transform: scale(1); }
  25% { transform: scale(.9); color: var(--danger); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .score-value.flow-up, .score-value.flow-down, .sb-score.flow-up, .sb-score.flow-down { animation: none; }
}

/* Smartphones: while a dare is open the player bar stays above the dimmed overlay, so score changes can be seen. */
@media (max-width: 700px) {
  html.dare-open #side-0, html.dare-open #side-1 { z-index: 61; }
}

/* With the number-flow element defined the digits already roll, so only the colour flashes. */
number-flow:defined.score-value.flow-up, number-flow:defined.sb-score.flow-up { animation-name: score-tint-up; }
number-flow:defined.score-value.flow-down, number-flow:defined.sb-score.flow-down { animation-name: score-tint-down; }
@keyframes score-tint-up { 0%, 100% { color: var(--ink); } 25% { color: var(--good); } }
@keyframes score-tint-down { 0%, 100% { color: var(--ink); } 25% { color: var(--danger); } }

/* Smartphones: cheaper turn animations. The turn label is hidden here, so it does not animate, and the dot beside the hint pulses
   with transform and opacity only instead of an animated box-shadow, which the browser has to repaint every frame. */
@media (max-width: 700px) {
  .sidebar.active .turn-pill, .sidebar.active .turn-pill::before { animation: none; }
  .turn-dot { animation: turn-dot-soft 1.8s ease-in-out infinite; }
  @keyframes turn-dot-soft {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.28); opacity: .7; }
  }
  @media (prefers-reduced-motion: reduce) {
    .turn-dot { animation: none; }
  }
}
