@font-face {
  font-family: 'Bricolage';
  src: url('/fonts/bricolage-grotesque.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: 'Cinzel';
  src: url('/fonts/cinzel.woff2') format('woff2-variations');
  font-weight: 400 900;
  font-display: swap;
}

:root {
  /* Plataforma: negro y dorado, como el logo. Cada juego suma sus propios colores
     (el rojo y el azul vienen de la tapa de Espía). */
  --bg: #090807;
  --panel: #15120e;
  --panel-2: #211c15;
  --line: #3a3021;
  --text: #f6ecd6;
  --muted: #a89c84;
  --accent: #dcb057;
  --accent-hi: #f6dc97;
  --accent-deep: #8a6420;
  --accent-ink: #1d1404;
  --wine: #6d0f0f;
  --display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --bad: #ff3b30;
  --ok: #4fd08b;
  --fuego: #e6301c;
  --fuego-deep: #9c1709;
  --marea: #1b8fe6;
  --marea-deep: #0a579f;
  --paper: #feefdb;
  --paper-edge: #c8b08a;
  --ink: #1a1420;
  --r: 16px;
  --font: 'Bricolage', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font: 16px/1.4 var(--font);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body.offline::after {
  content: 'Sin conexión · reconectando…';
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  padding: calc(4px + env(safe-area-inset-top)) 8px 4px;
  background: var(--bad);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.screen {
  position: relative;
  width: 100%;
  max-width: 540px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 12px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.screen.home {
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* Luz de fondo: neutra en la plataforma, del color del equipo en turno durante el juego. */
.screen::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(90% 45% at 15% 0%, color-mix(in srgb, var(--glow-a, var(--wine)) 20%, transparent), transparent 70%),
    radial-gradient(90% 45% at 85% 0%, color-mix(in srgb, var(--glow-b, var(--accent-deep)) 18%, transparent), transparent 70%);
  transition: opacity 0.4s;
}
.game[data-turn='fuego'] {
  --glow-a: var(--fuego);
  --glow-b: var(--fuego);
}
.game[data-turn='marea'] {
  --glow-a: var(--marea);
  --glow-b: var(--marea);
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}
h1 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.05;
}
h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}
h3 {
  font-size: 15px;
}
ul {
  list-style: none;
  padding: 0;
}

.muted {
  color: var(--muted);
}
.center {
  text-align: center;
}
.small {
  font-size: 13px;
}
.grow {
  flex: 1;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}
.hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.section-title {
  margin: 4px 2px 8px;
}
.section-title small {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.section-head .section-title {
  margin-bottom: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  transition: border-color 0.15s;
}
input::placeholder {
  color: #5d6173;
  font-weight: 400;
}
input:focus {
  outline: none;
  border-color: var(--accent);
}
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.shake {
  animation: shake 0.35s;
}
@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  border: 1.5px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 0 18px;
  border-radius: 12px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition:
    transform 0.08s,
    background 0.15s,
    opacity 0.15s;
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.btn.primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent) 55%, #c4953f);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 0 var(--accent-deep);
}
.btn.primary:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--accent-deep);
}
.btn.primary:disabled {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--muted);
  box-shadow: none;
  opacity: 1;
}
.btn.danger {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 0 10px;
}
.btn.block {
  display: flex;
  width: 100%;
}
.btn.big {
  min-height: 56px;
  font-size: 18px;
}
.btn.small {
  min-height: 38px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: 10px;
}

.row {
  display: flex;
  gap: 8px;
}

/* ---------- Inicio ---------- */
.hero {
  text-align: center;
  padding: 26px 0 8px;
  display: grid;
  justify-items: center;
  gap: 10px;
}
.hero.compact {
  padding: 8px 0 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--fuego), var(--accent));
  color: #1c1203;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -1px;
  transform: rotate(-6deg);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}
.brand-mark.xl {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  font-size: 34px;
  margin-bottom: 6px;
}
.code-input {
  text-transform: uppercase;
  letter-spacing: 10px;
  font-weight: 800;
  font-size: 24px;
  text-align: center;
  padding-left: 24px;
}
.code-input::placeholder {
  letter-spacing: 10px;
}
.invited {
  display: grid;
  gap: 14px;
  text-align: center;
}
.invited .field {
  text-align: left;
}
.games {
  display: grid;
  gap: 10px;
}
.game-tile {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: linear-gradient(120deg, color-mix(in srgb, var(--wine) 38%, var(--panel)), var(--panel) 70%);
  border: 1.5px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--r);
  padding: 14px;
  cursor: pointer;
  transition: transform 0.08s;
}
.game-tile:active {
  transform: scale(0.98);
}
.game-info {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.game-info strong {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}
.game-info span {
  font-size: 14px;
}
.game-info small {
  color: var(--muted);
  margin-top: 2px;
}
.game-go {
  font-size: 22px;
  color: var(--accent);
}
.game-art {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 16px);
  gap: 3px;
  transform: rotate(-6deg);
}
.game-art i {
  height: 16px;
  border-radius: 4px;
  background: var(--paper);
}
.game-art i:nth-child(1),
.game-art i:nth-child(6),
.game-art i:nth-child(8) {
  background: var(--fuego);
}
.game-art i:nth-child(3),
.game-art i:nth-child(4) {
  background: var(--marea);
}
.game-art i:nth-child(5) {
  background: #05050a;
}
.game-tile.soon {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  cursor: default;
}
.game-tile.soon strong {
  font-size: 16px;
}

/* ---------- Sala ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
}
.topbar .btn.ghost:first-child {
  margin-left: -8px;
}
.topbar-title {
  font-weight: 800;
  font-size: 18px;
}
.topbar-actions {
  display: flex;
  margin-right: -8px;
}
.invite {
  display: flex;
  align-items: center;
  gap: 16px;
}
.qr-btn {
  appearance: none;
  border: 0;
  padding: 6px;
  background: #fff;
  border-radius: 12px;
  cursor: zoom-in;
  flex: none;
  line-height: 0;
}
.qr {
  width: 104px;
  height: 104px;
}
.invite-info {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-width: 0;
}
.code {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 46px;
  font-weight: 800;
  letter-spacing: 6px;
  line-height: 1.05;
  color: var(--accent);
  cursor: pointer;
}
.invite-info .code {
  margin-bottom: 6px;
}
.qr-big {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}
.qr-big img {
  width: min(78vw, 340px);
  background: #fff;
  padding: 10px;
  border-radius: 16px;
}

.teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.team {
  background: color-mix(in srgb, var(--tc) 9%, var(--panel));
  border: 1.5px solid color-mix(in srgb, var(--tc) 35%, var(--line));
  border-radius: var(--r);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.team.mine {
  border-color: var(--tc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 25%, transparent);
}
.team h3 {
  color: var(--tc);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}
.team-fuego,
.t-fuego {
  --tc: var(--fuego);
  --tc-deep: var(--fuego-deep);
}
.team-marea,
.t-marea {
  --tc: var(--marea);
  --tc-deep: var(--marea-deep);
}
b.t-fuego,
b.t-marea {
  color: var(--tc);
}
.slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-content: start;
}
.slot-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.slot-label small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  line-height: 1.25;
}
.slot ul:empty {
  display: none;
}
.slot-btn {
  appearance: none;
  min-height: 44px;
  border: 1.5px dashed color-mix(in srgb, var(--tc) 60%, var(--line));
  border-radius: 12px;
  background: transparent;
  color: var(--tc);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  touch-action: manipulation;
}
.slot-btn:active {
  background: color-mix(in srgb, var(--tc) 18%, transparent);
}
.player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
}
.player.off {
  opacity: 0.5;
}
.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: hsl(var(--h) 65% 42%);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.player.me .avatar {
  box-shadow: 0 0 0 2px var(--accent);
}
.pname {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.pname small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.x {
  appearance: none;
  flex: none;
  width: 32px;
  height: 32px;
  margin-right: -6px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.loose ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin-top: 6px;
}
.loose .pname {
  flex: none;
}

/* Barra de acción fija abajo, al alcance del pulgar. */
.dock {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: auto -12px 0;
  padding: 16px 12px max(14px, env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
  background: linear-gradient(to bottom, transparent, var(--bg) 22px);
}
.ready {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.ready.ok {
  color: var(--ok);
}

/* ---------- Espía ---------- */
.game {
  gap: 10px;
}
.who {
  font-weight: 800;
  font-size: 17px;
  white-space: nowrap;
}
.who small {
  margin-left: 4px;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--tc);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  vertical-align: 2px;
}
.scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.score {
  display: grid;
  gap: 3px;
  padding: 9px 12px 8px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--tc) 12%, var(--panel));
  border: 1.5px solid transparent;
  min-width: 0;
  transition:
    opacity 0.3s,
    border-color 0.3s;
  opacity: 0.6;
}
.score.active,
.score.won {
  opacity: 1;
  border-color: var(--tc);
  box-shadow: 0 0 22px -8px var(--tc);
}
.score-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.score-name {
  color: var(--tc);
  font-weight: 800;
  font-size: 17px;
}
.extras {
  font-size: 12px;
  letter-spacing: -2px;
}
.score-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.score-n {
  font-size: 38px;
  font-weight: 800;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}
.score-sub {
  font-size: 13px;
  color: var(--muted);
}
.score-roster {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pips {
  display: flex;
  gap: 3px;
}
.pips i {
  flex: 1;
  max-width: 14px;
  height: 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--tc) 28%, transparent);
}
.pips i.on {
  background: var(--tc);
}
.pips.inline {
  display: inline-flex;
  vertical-align: 2px;
  margin-left: 2px;
}
.pips.inline i {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status {
  display: grid;
  gap: 2px;
  justify-items: center;
  align-content: center;
  min-height: 68px;
  padding: 8px 12px;
  text-align: center;
  border-radius: 14px;
  background: var(--panel);
  border: 1.5px solid var(--line);
}
.status.mine {
  border-color: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 20%, transparent);
  }
}
.status-title {
  font-size: 19px;
  font-weight: 800;
}
.status-sub {
  font-size: 13px;
  color: var(--muted);
}
.dots::after {
  content: '…';
  display: inline-block;
  width: 1em;
  text-align: left;
  animation: dots 1.4s steps(4, end) infinite;
  clip-path: inset(0 100% 0 0);
}
@keyframes dots {
  to {
    clip-path: inset(0 -10% 0 0);
  }
}
.clue {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.5px;
  overflow-wrap: anywhere;
  animation: pop 0.25s;
}
.clue b {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--tc);
  color: #fff;
  font-size: 24px;
}
.status.result {
  padding: 16px 12px;
  background: color-mix(in srgb, var(--tc) 22%, var(--panel));
  border-color: var(--tc);
  animation: pop 0.35s;
}
.result-emoji {
  font-size: 40px;
  line-height: 1;
}
.result-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
}
.result-sub {
  font-size: 14px;
}

.board {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-auto-rows: minmax(50px, 1fr);
  gap: 6px;
  max-height: 440px;
  perspective: 800px;
}
.wcard {
  appearance: none;
  position: relative;
  min-width: 0;
  padding: 0 2px 3px;
  border: 0;
  border-radius: 10px;
  background: var(--paper);
  box-shadow:
    inset 0 -4px 0 var(--paper-edge),
    0 1px 2px rgba(0, 0, 0, 0.4);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  font-stretch: 82%;
  font-size: clamp(11.5px, 3.45vw, 17px);
  line-height: 1;
  text-transform: uppercase;
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  opacity: 1;
  transition:
    transform 0.1s,
    box-shadow 0.1s;
}
.wcard.long {
  font-stretch: 75%;
  font-size: clamp(10.5px, 3.05vw, 15px);
}
.wcard:disabled {
  cursor: default;
}
.wcard:active:not(:disabled) {
  transform: translateY(2px);
}
.wcard.sel {
  transform: translateY(-3px) scale(1.05);
  z-index: 1;
  box-shadow:
    inset 0 -4px 0 var(--paper-edge),
    0 0 0 3px var(--accent),
    0 8px 16px rgba(0, 0, 0, 0.5);
}

/* Descubiertas: las de equipo resaltan, las de nadie se apagan. */
.wcard.rev {
  padding-bottom: 0;
}
.wcard.rev.k-fuego,
.wcard.rev.k-marea {
  background: var(--kc);
  color: #fff;
  box-shadow: inset 0 -4px 0 var(--kc-deep);
}
.k-fuego {
  --kc: var(--fuego);
  --kc-deep: var(--fuego-deep);
}
.k-marea {
  --kc: var(--marea);
  --kc-deep: var(--marea-deep);
}
.wcard.rev.k-nadie {
  background: #22242f;
  color: #6f7386;
  box-shadow: inset 0 0 0 1.5px #2e3140;
}
.wcard.rev.k-trampa {
  background: #05050a;
  color: #fff;
  box-shadow:
    inset 0 0 0 2px var(--bad),
    0 0 18px -2px var(--bad);
}
.wcard.k-trampa::before {
  content: '⚠';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 11px;
  color: var(--bad);
}
.wcard.flip {
  animation: flip 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes flip {
  0% {
    transform: rotateX(88deg) scale(1.12);
    filter: brightness(1.6);
  }
}

/* Mapa secreto del Cerebro: las cartas sin descubrir, teñidas de su color. */
.wcard.secret.k-fuego,
.wcard.secret.k-marea {
  background: color-mix(in srgb, var(--kc) 34%, var(--paper));
  box-shadow: inset 0 -7px 0 var(--kc);
}
.wcard.secret.k-nadie {
  background: #cfc9bb;
  color: #5d5a52;
  box-shadow: inset 0 -4px 0 #a39c89;
}
.wcard.secret.k-trampa {
  background: #1b1b22;
  color: #fff;
  box-shadow: inset 0 0 0 2px var(--bad);
}
.brain .wcard.rev {
  opacity: 0.32;
}
.brain .wcard.rev span {
  text-decoration: line-through;
}

.legend-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}
.sw {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 5px;
  border-radius: 3px;
  background: var(--kc);
  vertical-align: -1px;
}
.sw.k-nadie {
  background: #cfc9bb;
}
.sw.k-trampa {
  background: #05050a;
  box-shadow: inset 0 0 0 1.5px var(--bad);
}

.wait {
  min-height: 56px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}
.wait.small {
  min-height: 0;
  font-weight: 400;
}
.clue-form {
  display: flex;
  gap: 8px;
}
.clue-form input {
  flex: 1;
  text-transform: uppercase;
  font-weight: 800;
  font-size: 20px;
}
.clue-form input::placeholder {
  text-transform: none;
}
.stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}
.stepper .btn {
  width: 42px;
  min-height: 49px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 22px;
}
.stepper output {
  width: 26px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.log {
  margin-bottom: max(14px, env(safe-area-inset-bottom));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
}
.log summary {
  cursor: pointer;
  padding: 12px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.log summary small {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--panel-2);
}
.log li {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.log-clue {
  font-weight: 800;
  color: var(--tc);
  letter-spacing: 0.3px;
}
.log-clue b {
  margin-left: 2px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--tc);
  color: #fff;
}
.log-guesses {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.pill {
  font-size: 12px;
  font-weight: 700;
  font-stretch: 85%;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
  color: #fff;
  background: var(--kc);
}
.pill.k-nadie {
  background: var(--panel-2);
  color: var(--muted);
}
.pill.k-trampa {
  background: #05050a;
  box-shadow: inset 0 0 0 1.5px var(--bad);
}

/* ---------- Marca Gatti Games ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
h2,
.section-title,
.topbar-title,
.brand,
.who,
.game-info strong,
.modal-body h2 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.section-title,
.card > h2 {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 15px;
  letter-spacing: 2px;
}
.section-title small {
  font-family: var(--font);
  text-transform: none;
  letter-spacing: 0;
}
.eyebrow,
.modal-body h3 {
  color: var(--accent);
}
.hero.hero-banner {
  margin: calc(-1 * max(12px, env(safe-area-inset-top))) -12px 0;
  padding: 0 12px 4px;
  gap: 0;
}
.hero.hero-banner img {
  display: block;
  width: calc(100% + 24px);
  max-width: none;
  margin: 0 -12px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, #000 78%, transparent);
}
.hero.hero-banner p {
  margin-top: -14px;
  position: relative;
}
img.brand-mark {
  transform: none;
  background: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent);
}
.brand {
  font-size: 22px;
  color: var(--accent-hi);
  text-transform: uppercase;
  letter-spacing: 2px;
}
.card {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
}
.code,
.game-go {
  color: var(--accent-hi);
}
.code {
  font-family: var(--display);
  font-weight: 800;
}
.code-input {
  font-family: var(--display);
}
.game-info strong {
  color: var(--accent-hi);
}
.who,
.topbar-title {
  color: var(--accent-hi);
}

/* ---------- Instalar como app ---------- */
.install {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px 12px 12px;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.install img {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  flex: none;
}
.install div {
  flex: 1;
  min-width: 0;
  display: grid;
  line-height: 1.25;
}
.install span {
  font-size: 13px;
  color: var(--muted);
}
.install .x {
  margin-right: -4px;
}
.modal-body ol.steps li {
  margin: 8px 0;
}
.ios-share {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--panel-2);
  color: #4aa3ff;
  font-size: 14px;
}

/* ---------- Dispositivo compartido y opciones ---------- */
[hidden] {
  display: none !important;
}
.chips.left {
  justify-content: flex-start;
}
.chip.add {
  border-style: dashed;
  background: transparent;
  color: var(--accent);
}
.device .chips {
  margin-top: 8px;
}
.options {
  display: grid;
  gap: 14px;
}
.opt {
  display: grid;
  gap: 6px;
}
.opt-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.opt .hint {
  margin: 0;
}
.opt-value {
  font-weight: 700;
}
.seg {
  display: flex;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.seg button {
  appearance: none;
  flex: 1;
  min-height: 44px;
  border: 0;
  border-left: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.seg button:first-child {
  border-left: 0;
}
.seg button.on {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: var(--accent-ink);
}
.seg button:disabled {
  cursor: default;
}
select {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 700;
}
#seatbar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: calc(6px + env(safe-area-inset-top)) 12px 6px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
#seatbar button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  padding: 4px 6px;
  cursor: pointer;
}
.handoff {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  background: var(--bg);
  text-align: center;
  overflow-y: auto;
}
.handoff .brand-mark {
  width: 84px;
  height: 84px;
  border-radius: 22px;
}
.handoff-list {
  display: grid;
  gap: 10px;
  width: min(100%, 340px);
}
.handoff .btn.big {
  font-size: 22px;
  min-height: 64px;
}

/* ---------- Estilo de afiche (tapa de Espía) ---------- */
.poster,
.g-espia .topbar-title,
.g-espia .team h3,
.espia .who,
.espia .score-name,
.espia .status-title,
.espia .clue span,
.espia .result-title,
.espia .log-clue,
.game-tile.g-espia strong {
  font-family: var(--font);
  font-style: italic;
  font-stretch: 75%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.game-tile.g-espia strong,
.espia .who,
.g-espia .topbar-title {
  color: var(--text);
}
.game-cover {
  flex: none;
  width: 76px;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  transform: rotate(-3deg);
}
.game-tile.g-espia {
  background: linear-gradient(105deg, #7a1408 0 46%, #0a3d73 54%);
  border-color: transparent;
}
.game-tile.g-espia strong {
  font-size: 34px;
  line-height: 0.95;
}
.lobby-cover {
  position: relative;
  height: 136px;
  border-radius: var(--r);
  overflow: hidden;
  flex: none;
}
.lobby-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 14%;
  display: block;
}
.lobby-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 -50px 40px -20px var(--bg);
  border-radius: inherit;
}
.rules-cover {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  object-position: 50% 14%;
  border-radius: 14px;
  margin-bottom: 14px;
}
.modal-body h2.poster {
  font-size: 38px;
  line-height: 1;
}
/* En la sala y en la partida, rojo a la izquierda y azul a la derecha, como en la tapa. */
.g-espia {
  --glow-a: var(--fuego);
  --glow-b: var(--marea);
}
.espia .who {
  font-size: 20px;
}
.espia .score-name {
  font-size: 21px;
}
.espia .status-title {
  font-size: 22px;
}
.espia .clue {
  font-size: 34px;
}
.espia .score {
  background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 38%, var(--panel)), color-mix(in srgb, var(--tc-deep) 22%, var(--panel)));
}
.espia .score-name {
  color: var(--text);
}
.g-espia .team {
  background: linear-gradient(170deg, color-mix(in srgb, var(--tc) 30%, var(--panel)), color-mix(in srgb, var(--tc-deep) 14%, var(--panel)) 60%);
}
.g-espia .team h3 {
  color: var(--text);
  font-size: 30px;
}
.g-espia .slot-btn {
  color: var(--text);
  border-color: color-mix(in srgb, var(--tc) 80%, #fff);
}
.espia .status.result {
  background: linear-gradient(160deg, var(--tc), var(--tc-deep));
}

.espia .score.active,
.espia .score.won {
  border-color: var(--text);
}
.espia .score .pips i {
  background: rgba(255, 255, 255, 0.22);
}
.espia .score .pips i.on {
  background: var(--text);
}
.espia .score-sub,
.espia .score-roster {
  color: color-mix(in srgb, var(--text) 75%, transparent);
}

/* ---------- El Impostor ---------- */
.game-art.masks {
  display: grid;
  grid-template-columns: repeat(2, 26px);
  gap: 2px;
  transform: rotate(-6deg);
}
.game-art.masks i {
  height: 26px;
  display: grid;
  place-items: center;
  background: none;
  font-style: normal;
  font-size: 22px;
}
.game[data-turn='imp'] {
  --glow-a: var(--marea);
  --glow-b: var(--fuego);
}
.scard {
  appearance: none;
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1.5px dashed var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}
.scard.big {
  padding: 34px 16px;
}
.scard.open {
  border-style: solid;
  border-color: var(--marea);
  background: linear-gradient(160deg, color-mix(in srgb, var(--marea) 45%, var(--panel)), color-mix(in srgb, var(--marea-deep) 30%, var(--panel)));
}
.scard.open.bad {
  border-color: var(--fuego);
  background: linear-gradient(160deg, color-mix(in srgb, var(--fuego) 55%, var(--panel)), color-mix(in srgb, var(--fuego-deep) 35%, var(--panel)));
}
.scard-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  opacity: 0.8;
}
.scard-word {
  font-size: 26px;
  font-weight: 800;
  font-style: italic;
  font-stretch: 75%;
  text-transform: uppercase;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.scard.big .scard-word {
  font-size: 48px;
}
.scard-word.hidden {
  font-style: normal;
}
.scard-sub {
  font-size: 14px;
}
.scard-toggle {
  font-size: 12px;
  color: var(--muted);
}
.scard-toggle:empty {
  display: none;
}
.plist {
  display: grid;
  gap: 6px;
}
.prow {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
}
button.prow {
  cursor: pointer;
  touch-action: manipulation;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.prow.now {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}
.prow.sel {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--panel));
  box-shadow: 0 0 0 2px var(--accent);
}
.prow.out {
  opacity: 0.45;
}
.prow.unmasked {
  opacity: 1;
  border-color: var(--fuego);
}
.prow.out .prow-name {
  text-decoration: line-through;
}
.prow-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}
.prow-name {
  font-weight: 700;
  line-height: 1.1;
}
.prow-name em {
  font-style: normal;
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
}
.prow-clues {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.prow-clues .pill {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}
.mark {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.mark.ok {
  color: var(--ok);
}
.mark.bad {
  color: var(--fuego);
  font-weight: 800;
}
.mark.votes {
  color: var(--text);
}
.reveal-word {
  display: grid;
  margin-top: 8px;
  font-size: 34px;
  font-weight: 800;
  font-style: italic;
  font-stretch: 75%;
  text-transform: uppercase;
  line-height: 1.05;
}
.reveal-word small {
  font-size: 12px;
  font-style: normal;
  font-stretch: 100%;
  letter-spacing: 1.2px;
  opacity: 0.8;
}
.votes-line {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.banner:has(> .votes-line:only-child) {
  padding-top: 6px;
}
.imp .status.result {
  background: linear-gradient(160deg, var(--tc), var(--tc-deep));
}
.imp .clue-form .btn {
  min-height: 52px;
}

/* ---------- ¿Qué preferís? ---------- */
.game-art.wyr {
  display: flex;
  align-items: center;
  gap: 3px;
  transform: rotate(-6deg);
}
.game-art.wyr i,
.game-art.wyr b {
  display: grid;
  place-items: center;
  font-style: normal;
  font-weight: 800;
}
.game-art.wyr i {
  width: 22px;
  height: 30px;
  border-radius: 6px;
  color: #fff;
  font-size: 15px;
}
.game-art.wyr i:first-child {
  background: var(--fuego);
}
.game-art.wyr i:last-child {
  background: var(--marea);
}
.game-art.wyr b {
  font-size: 12px;
  color: var(--accent);
}
.game[data-turn='wyr'] {
  --glow-a: var(--fuego);
  --glow-b: var(--marea);
}
.wyr-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.wyr-meta .pill {
  background: var(--panel-2);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--line);
}
.wyr {
  display: grid;
  gap: 6px;
}
.wyr-or {
  justify-self: center;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.wyr-opt {
  appearance: none;
  position: relative;
  display: grid;
  gap: 6px;
  justify-items: center;
  width: 100%;
  min-height: 140px;
  padding: 18px 16px 14px;
  border-radius: 20px;
  border: 2px solid transparent;
  background: linear-gradient(160deg, color-mix(in srgb, var(--oc) 70%, var(--panel)), color-mix(in srgb, var(--oc-deep) 55%, var(--panel)));
  color: #fff;
  font: inherit;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.12s,
    opacity 0.2s,
    border-color 0.2s;
}
.opt-a {
  --oc: var(--fuego);
  --oc-deep: var(--fuego-deep);
}
.opt-b {
  --oc: var(--marea);
  --oc-deep: var(--marea-deep);
}
.wyr-opt:active:not(:disabled) {
  transform: scale(0.98);
}
.wyr-opt:disabled {
  cursor: default;
}
.wyr-opt.on {
  border-color: var(--accent-hi);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
}
.wyr-opt.off {
  opacity: 0.45;
}
.wyr-letter {
  position: absolute;
  top: 8px;
  left: 12px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  opacity: 0.55;
}
.wyr-text {
  align-self: center;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  text-wrap: balance;
}
.wyr-mine {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent-hi);
}
/* Resultados: barra de fondo con el porcentaje. */
.wyr-opt.shown {
  cursor: default;
  min-height: 0;
  background: color-mix(in srgb, var(--oc-deep) 30%, var(--panel));
}
.wyr-bar {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: var(--p);
  background: linear-gradient(90deg, color-mix(in srgb, var(--oc) 75%, var(--panel)), var(--oc));
  animation: grow 0.7s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes grow {
  from {
    width: 0;
  }
}
.wyr-opt.shown:not(.win) .wyr-text {
  opacity: 0.85;
}
.wyr-opt.win {
  border-color: color-mix(in srgb, #fff 55%, var(--oc));
}
.wyr-result {
  font-size: 14px;
}
.wyr-result b {
  font-size: 30px;
  font-weight: 800;
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
}
.faces {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.faces .avatar {
  width: 28px;
  height: 28px;
  margin-left: -6px;
  font-size: 12px;
  box-shadow: 0 0 0 2px var(--bg);
}
.faces .avatar:first-child {
  margin-left: 0;
}
.voted-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.awards ul {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}
.awards li {
  display: flex;
  gap: 10px;
  line-height: 1.3;
}
.awards li > span {
  font-size: 22px;
}
.awards li b {
  display: block;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent);
}
.awards i,
.hist-q i {
  color: var(--muted);
}
.log li.hist {
  gap: 6px;
}
.hist-q {
  font-size: 14px;
}
.hist-q .lead {
  font-weight: 700;
}
.hist-bar {
  display: flex;
  justify-content: space-between;
  height: 20px;
  padding: 0 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--fuego) var(--p), var(--marea) var(--p));
  color: #fff;
  font-size: 12px;
  line-height: 20px;
}
.custom-q {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.custom-q .wyr-or {
  font-size: 15px;
}
@media (max-height: 720px) {
  .wyr-opt {
    min-height: 110px;
    padding: 14px 12px 10px;
  }
  .wyr-text {
    font-size: 19px;
  }
}

/* ---------- Confesionario ---------- */
.game-art.sf {
  display: grid;
  grid-template-columns: repeat(2, 26px);
  gap: 3px;
  transform: rotate(-6deg);
}
.game-art.sf i {
  display: grid;
  place-items: center;
  height: 26px;
  border-radius: 7px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-style: normal;
  font-size: 15px;
}
.chip:disabled {
  cursor: default;
  opacity: 0.85;
}
.mode-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--mc) 32%, var(--panel)), var(--panel) 80%);
  border: 1.5px solid color-mix(in srgb, var(--mc) 60%, var(--line));
}
.mode-icon {
  font-size: 34px;
  line-height: 1;
}
.mode-badge b {
  display: block;
  font-family: var(--display);
  font-size: 18px;
  color: var(--text);
}
.mode-badge small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.3;
}
.m-preferis {
  --mc: var(--accent);
}
.m-yonunca {
  --mc: #a463f2;
}
.m-debate {
  --mc: #2fb67c;
}
.m-probable {
  --mc: #f08a24;
}
.m-vyc {
  --mc: #e0457b;
}
.pill.lvl-picante {
  color: #ff8a65;
}
.prompt {
  display: grid;
  gap: 6px;
  padding: 18px 16px;
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
.prompt small {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #7a6a4f;
}
.wyr.pair {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.wyr-opt.compact {
  min-height: 96px;
  padding: 14px 10px 12px;
}
.wyr-opt.compact .wyr-text {
  font-size: 20px;
}
.wyr-opt.compact.shown .wyr-text {
  font-size: 16px;
}
.ppl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ppl-btn {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  min-width: 0;
}
.ppl-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ppl-btn em {
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}
.ppl-btn.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--panel));
  box-shadow: 0 0 0 2px var(--accent);
}
.rank {
  display: grid;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.rank li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 6px 14px 6px 10px;
  border-radius: 14px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}
.rank li.top {
  border-color: #f08a24;
}
.rank-bar {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: var(--p);
  background: color-mix(in srgb, #f08a24 35%, transparent);
  animation: grow 0.7s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.rank-name {
  flex: 1;
  font-weight: 700;
}
.rank li > b {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.rank .faces {
  justify-content: flex-end;
}
.vyc-who {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 22px;
}
.vyc-who .avatar {
  width: 64px;
  height: 64px;
  font-size: 28px;
}
.vyc-card {
  display: grid;
  gap: 10px;
  padding: 22px 18px;
  border-radius: 20px;
  text-align: center;
  color: #fff;
  background: linear-gradient(160deg, var(--marea), var(--marea-deep));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  animation: flip 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.vyc-card.reto {
  background: linear-gradient(160deg, var(--fuego), var(--fuego-deep));
}
.vyc-card small {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.85;
}
.vyc-card p {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  text-wrap: balance;
}
.mode-tally {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  font-weight: 700;
}
/* Ruleta al empezar cada ronda */
.splash {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  animation: splash-out 2.2s forwards;
}
@keyframes splash-out {
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.splash-box {
  display: grid;
  justify-items: center;
  gap: 10px;
}
.reel {
  width: 120px;
  height: 120px;
  overflow: hidden;
  border-radius: 28px;
  background: var(--panel);
  border: 2px solid var(--accent);
  box-shadow: 0 0 40px -6px var(--accent);
}
.reel-strip {
  transform: translateY(calc(var(--n) * -120px));
  animation: reel 1.2s cubic-bezier(0.12, 0.75, 0.25, 1);
}
@keyframes reel {
  from {
    transform: translateY(0);
  }
}
.reel-strip span {
  display: grid;
  place-items: center;
  height: 120px;
  font-size: 64px;
}
.splash-name {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  color: var(--accent-hi);
  animation: name-in 1.6s;
}
@keyframes name-in {
  0%,
  70% {
    opacity: 0;
    transform: translateY(8px);
  }
}
@media (max-height: 720px) {
  .prompt {
    font-size: 20px;
    padding: 14px;
  }
  .vyc-card p {
    font-size: 20px;
  }
}

/* ---------- Ring of Fire ---------- */
.game-art.ring {
  position: relative;
  display: block;
  width: 54px;
  height: 54px;
  transform: none;
}
.game-art.ring i {
  position: absolute;
  left: 21px;
  top: 19px;
  width: 12px;
  height: 16px;
  border-radius: 3px;
  background: var(--paper);
  transform: rotate(calc(var(--i) * 45deg)) translateY(-19px);
}
.game-art.ring i:nth-child(1) { --i: 0; background: var(--fuego); }
.game-art.ring i:nth-child(2) { --i: 1; }
.game-art.ring i:nth-child(3) { --i: 2; background: var(--accent); }
.game-art.ring i:nth-child(4) { --i: 3; }
.game-art.ring i:nth-child(5) { --i: 4; background: var(--fuego); }
.game-art.ring i:nth-child(6) { --i: 5; }
.game-art.ring i:nth-child(7) { --i: 6; background: var(--accent); }
.game-art.ring i:nth-child(8) { --i: 7; }
.game-art.ring b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
}
.game[data-turn='rof'] {
  --glow-a: var(--fuego);
  --glow-b: var(--accent);
}
.order {
  display: flex;
  gap: 6px;
  margin: 0 -12px;
  padding: 2px 12px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.order li {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 4px;
  border-radius: 99px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.order li.now {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
}
.order .avatar {
  width: 24px;
  height: 24px;
  font-size: 12px;
}
.stage {
  display: grid;
  gap: 8px;
  justify-items: center;
}
.ring {
  position: relative;
  width: min(100%, 52dvh, 400px);
  aspect-ratio: 1;
  container-type: inline-size;
}
.rcard {
  appearance: none;
  position: absolute;
  left: calc(50% - 5cqw);
  top: calc(50% - 7.5cqw);
  width: 10cqw;
  height: 15cqw;
  padding: 0;
  border: 0.6cqw solid #fff;
  border-radius: 1.6cqw;
  background:
    repeating-linear-gradient(45deg, transparent 0 1.2cqw, rgba(255, 255, 255, 0.16) 1.2cqw 2.4cqw),
    linear-gradient(160deg, var(--fuego), #b3261e);
  box-shadow: 0 0.4cqw 1.2cqw rgba(0, 0, 0, 0.5);
  transform: rotate(var(--a)) translateY(-40cqw);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s;
}
.rcard:disabled {
  cursor: default;
}
.rcard.risky {
  border-color: var(--bad);
  filter: saturate(0.5) brightness(0.75);
}
.rcard.sel {
  transform: rotate(var(--a)) translateY(-45cqw) scale(1.12);
  border-color: var(--accent);
  filter: none;
  box-shadow: 0 0 0 0.8cqw var(--accent);
  z-index: 2;
}
.cup {
  position: absolute;
  inset: 27cqw;
  display: grid;
  place-content: center;
  justify-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #2c3040, var(--panel));
  border: 1.5px solid var(--line);
  box-shadow: inset 0 0 0 2.2cqw rgba(255, 255, 255, 0.04);
}
.cup-kings {
  font-size: 4.6cqw;
  letter-spacing: -0.5cqw;
}
.cup-kings span {
  filter: grayscale(1);
  opacity: 0.3;
}
.cup-kings span.on {
  filter: none;
  opacity: 1;
}
.cup-n {
  font-size: 14cqw;
  font-weight: 800;
  line-height: 1;
}
.cup-l {
  font-size: 3.6cqw;
  color: var(--muted);
}
.ring-hint {
  font-size: 13px;
  color: var(--muted);
}
.sw.risky {
  background: #8a3a2c;
  box-shadow: inset 0 0 0 1.5px var(--bad);
}
.drawn {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 12px;
  animation: pop 0.3s;
}
.pcard {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  aspect-ratio: 5 / 7;
  border-radius: 14px;
  background: #fffdf6;
  color: #17171d;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  animation: flip 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.pcard.red {
  color: #d92b2b;
}
.pc-corner {
  position: absolute;
  top: 8px;
  left: 10px;
  display: grid;
  justify-items: center;
  font-size: 26px;
  font-weight: 800;
  line-height: 0.95;
}
.pc-corner i {
  font-style: normal;
  font-size: 20px;
}
.pc-corner.flip {
  inset: auto 10px 8px auto;
  transform: rotate(180deg);
}
.pc-icon {
  font-size: 58px;
}
.drawn-info {
  display: grid;
  gap: 6px;
  text-align: center;
  max-width: 420px;
}
.drawn-info .eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.drawn-info .avatar {
  width: 22px;
  height: 22px;
  font-size: 11px;
}
.drawn-info h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
}
.banner {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
  border: 1.5px solid var(--accent);
  font-weight: 700;
  text-align: center;
}
.banner.bad {
  background: color-mix(in srgb, var(--bad) 22%, var(--panel));
  border-color: var(--bad);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.chip {
  appearance: none;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 99px;
  border: 1.5px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.live {
  margin-bottom: max(14px, env(safe-area-inset-bottom));
}
.live ul {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.live li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.3;
}
.live li > div {
  flex: 1;
}
.live li .btn {
  align-self: center;
}
.duel {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--fuego) 45%, var(--bg)), var(--bg) 75%);
}
.duel-icon {
  font-size: 84px;
  line-height: 1;
}
.duel-title {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  color: var(--accent-hi);
}
.duel-btns {
  display: grid;
  gap: 12px;
  width: min(100%, 360px);
}
.duel-btn {
  appearance: none;
  min-height: 120px;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  box-shadow: 0 8px 0 var(--accent-deep);
  color: var(--accent-ink);
  font: inherit;
  font-size: 34px;
  font-weight: 800;
  touch-action: manipulation;
  user-select: none;
  cursor: pointer;
}
.duel-btn:disabled {
  opacity: 0.4;
  box-shadow: none;
  transform: translateY(8px);
}
.timer {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.timer.warn {
  background: color-mix(in srgb, var(--bad) 35%, var(--panel-2));
}
.timer.late {
  background: var(--bad);
  color: #fff;
  animation: pulse 1s ease-in-out infinite;
}
.live li > span {
  font-size: 20px;
  line-height: 1.2;
}
.live li b {
  display: block;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}
.rof .status.result {
  --tc: var(--accent);
}
/* Acá la acción va debajo de la carta, sin taparle el texto. */
.rof .dock {
  position: static;
  margin-top: 0;
  padding: 4px 12px;
  background: none;
}
.modal-body .rank {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  margin-right: 4px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}

/* ---------- Modal (hoja inferior) y avisos ---------- */
dialog {
  width: 100%;
  max-width: 540px;
  max-height: 88dvh;
  margin: auto auto 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: var(--panel);
  color: var(--text);
  padding: 20px 16px max(16px, env(safe-area-inset-bottom));
}
dialog[open] {
  animation: sheet 0.22s ease-out;
}
@keyframes sheet {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}
dialog::backdrop {
  background: rgba(5, 5, 10, 0.7);
}
.modal-body {
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.5;
}
.modal-body h2 {
  font-size: 28px;
  font-weight: 800;
}
.modal-body h3 {
  margin: 16px 0 4px;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}
.modal-body ul,
.modal-body ol {
  list-style: revert;
  padding-left: 20px;
}
.modal-body ul.legend {
  list-style: none;
  padding: 0;
}
.modal-body li {
  margin: 4px 0;
}
.confirm-text {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  padding: 8px 0;
}

#toast {
  position: fixed;
  left: 50%;
  top: max(14px, env(safe-area-inset-top));
  transform: translate(-50%, -24px);
  width: max-content;
  max-width: calc(100vw - 24px);
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  padding: 11px 18px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 50;
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast.bad {
  background: var(--bad);
  color: #fff;
}
#toast.k-fuego,
#toast.k-marea {
  background: var(--kc);
  color: #fff;
}
#toast.k-nadie {
  background: #cfc9bb;
}
#toast.k-trampa {
  background: #05050a;
  color: #fff;
  box-shadow: 0 0 0 2px var(--bad);
}

/* Pantallas bajas: se compacta el marcador para que el tablero y la acción entren sin scroll. */
@media (max-height: 720px) {
  .game {
    gap: 8px;
  }
  .score-roster {
    display: none;
  }
  .score-n {
    font-size: 30px;
  }
  .status {
    min-height: 60px;
  }
  .clue {
    font-size: 26px;
  }
  .board {
    grid-auto-rows: minmax(44px, 1fr);
    gap: 5px;
  }
  .dock {
    padding-top: 12px;
  }
}

@media (min-width: 560px) {
  dialog {
    margin: auto;
    border-radius: 22px;
    border-bottom: 1px solid var(--line);
  }
}

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