/* ¡STOP! — estilo arcade, móvil primero */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0d0620;
  --bg2: #180b36;
  --card: rgba(255, 255, 255, 0.055);
  --card-border: rgba(255, 255, 255, 0.11);
  --card-hi: rgba(255, 255, 255, 0.16);   /* filo superior, da relieve */
  --ink: #fdfbff;
  --ink-dim: rgba(253, 251, 255, 0.62);
  --pink: #ff4d8d;
  --pink-dark: #d92e6e;
  --yellow: #ffd34d;
  --teal: #37e6c3;
  --violet: #8b5cf6;
  --red: #ff3b30;
  --ok: #37e678;
  --radius: 20px;
  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}

html { height: 100%; }
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* el fondo vivo se pinta en canvas */
#bg-canvas { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
#bg-veil {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255,255,255,.05), transparent 60%),
    radial-gradient(100% 60% at 50% 110%, rgba(0,0,0,.55), transparent 55%);
}


#app { max-width: 520px; margin: 0 auto; padding: 24px 18px calc(28px + env(safe-area-inset-bottom)); }

.screen { display: none; }
.screen.active { display: block; animation: entrada 0.45s cubic-bezier(.2,.9,.25,1); }
@keyframes entrada { from { opacity: 0; transform: translateY(18px) scale(0.985); filter: blur(6px); } }

.hidden { display: none !important; }

/* ===== inicio ===== */
.hero { text-align: center; padding: 22px 0 24px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.brand-cheese {
  width: 104px; height: 104px; filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.55));
  animation: giro-lento 26s linear infinite;
}
@keyframes giro-lento { to { transform: rotate(360deg); } }
.brand-name {
  font: 700 clamp(31px, 9.4vw, 54px) var(--font-display); line-height: 0.95;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff 30%, #ffd9a8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(255, 211, 77, 0.25));
}
.tagline { margin-top: 14px; color: var(--ink); font-weight: 800; font-size: 15px; line-height: 1.5; }
.tagline span { color: var(--ink-dim); font-size: 13px; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .brand-cheese { animation: none; } }

.card {
  position: relative; border-radius: var(--radius); padding: 24px 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.03));
  border: 1px solid var(--card-border);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.75), inset 0 1px 0 var(--card-hi);
  backdrop-filter: blur(14px) saturate(1.25);
}
.field-label { display: block; font-weight: 800; font-size: 14px; margin-bottom: 8px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.06em; }

.input {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--card-border);
  background: rgba(0, 0, 0, 0.25); color: var(--ink); font: 800 17px var(--font-body); outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--pink); }
.input::placeholder { color: rgba(253, 251, 255, 0.32); font-weight: 700; }

.home-actions { margin-top: 18px; }
.btn {
  border: 0; cursor: pointer; border-radius: 16px; font-family: var(--font-display);
  font-weight: 700; color: #fff; transition: transform 0.08s, filter 0.15s;
  user-select: none;
}
.btn:active { transform: translateY(2px) scale(0.99); }
.btn-primary {
  background: linear-gradient(180deg, #ff6aa0, var(--pink) 45%, var(--pink-dark));
  box-shadow: 0 5px 0 #8e1c48, 0 12px 26px -10px rgba(255,77,141,.75), inset 0 1px 0 rgba(255,255,255,.35);
  position: relative; overflow: hidden;
}
/* destello que cruza el botón cada pocos segundos */
.btn-primary::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: translateX(-160%); animation: brillo 4.5s ease-in-out infinite;
}
@keyframes brillo { 0%, 62% { transform: translateX(-160%); } 78%, 100% { transform: translateX(300%); } }
.btn-secondary { background: linear-gradient(180deg, var(--violet), #6d3fe0); box-shadow: 0 5px 0 #4b2a9e; padding: 14px 20px; font-size: 17px; }
.btn-big { width: 100%; padding: 16px; font-size: 20px; }
.btn:disabled { filter: grayscale(0.6) brightness(0.7); cursor: not-allowed; }

.divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--ink-dim); font-weight: 800; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--card-border); }

.join-row { display: flex; gap: 10px; }
.input-code { flex: 1; text-transform: uppercase; text-align: center; letter-spacing: 0.35em; font-size: 20px; font-weight: 900; }

.foot-note { text-align: center; margin-top: 16px; color: var(--ink-dim); font-size: 14px; font-weight: 700; }

/* ===== sala ===== */
.lobby-card { text-align: center; margin-top: 30px; }
.lobby-label { font-weight: 800; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; }
.room-code {
  display: inline-block; margin: 12px 0 4px; padding: 12px 24px; border-radius: 18px; border: 2px dashed var(--yellow);
  background: rgba(255, 211, 77, 0.1); color: var(--yellow); cursor: pointer;
  font: 700 44px var(--font-display); letter-spacing: 0.3em; text-indent: 0.3em;
}
.lobby-hint { color: var(--ink-dim); font-size: 13px; font-weight: 700; }

.players-row { display: flex; justify-content: center; gap: 14px; margin: 24px 0 8px; flex-wrap: wrap; }
.player-chip {
  display: flex; align-items: center; gap: 9px; padding: 10px 18px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--card-border); font-weight: 900; font-size: 16px;
  animation: pop-in 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.player-chip .avatar { font-size: 22px; }
.player-chip.you { border-color: var(--teal); }

.waiting-msg { margin: 18px 0; color: var(--ink-dim); font-weight: 800; }
.dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }
.dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--pink); animation: dot 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-7px); opacity: 1; } }

.btn-link { display: block; margin: 22px auto 0; background: none; border: 0; color: var(--ink-dim); font: 800 15px var(--font-body); cursor: pointer; text-decoration: underline; }

/* ===== ruleta ===== */
.round-label { text-align: center; font-weight: 900; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.1em; font-size: 14px; }
.letter-stage { display: flex; justify-content: center; padding: 60px 0 30px; }
.letter-wheel {
  width: 170px; height: 170px; border-radius: 36px; display: grid; place-items: center;
  font: 700 96px var(--font-display); color: #1c0d38;
  background: linear-gradient(160deg, var(--yellow), #ffb84d);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.3), 0 0 60px rgba(255, 211, 77, 0.35);
}
.letter-wheel.spinning { animation: wheel-shake 0.09s infinite; }
@keyframes wheel-shake { 0% { transform: rotate(-3deg) scale(0.98); } 50% { transform: rotate(3deg) scale(1.02); } 100% { transform: rotate(-3deg) scale(0.98); } }
.letter-wheel.landed { animation: wheel-land 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes wheel-land { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
.spin-caption { text-align: center; font-weight: 900; font-size: 20px; }

.spin-cats { margin-top: 26px; text-align: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.spin-cats-label { width: 100%; color: var(--ink-dim); font-weight: 900; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 4px; }
.cat-chip { background: rgba(255, 255, 255, 0.09); border: 1px solid var(--card-border); border-radius: 999px; padding: 7px 13px; font-weight: 800; font-size: 13px; }

/* ===== jugar ===== */
.play-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.play-letter {
  width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; flex-shrink: 0;
  font: 700 38px var(--font-display); color: #1c0d38;
  background: linear-gradient(160deg, var(--yellow), #ffb84d); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}
.play-mid { flex: 1; }
.play-mid .round-label { text-align: left; }
.play-vs { font-weight: 900; font-size: 15px; margin-top: 3px; }

.timer-ring { position: relative; width: 62px; height: 62px; flex-shrink: 0; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 5; }
.ring-fg { fill: none; stroke: var(--teal); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 119.4; transition: stroke-dashoffset 1s linear, stroke 0.3s; }
.timer-ring.hurry .ring-fg { stroke: var(--red); }
.timer-ring.hurry #timer-num, .timer-ring.hurry #q-timer-num { color: var(--red); animation: pulse-num 1s infinite; }
@keyframes pulse-num { 50% { transform: translate(-50%, -50%) scale(1.25); } }
#timer-num, #q-timer-num { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font: 900 19px var(--font-body); }

.answers { display: flex; flex-direction: column; gap: 10px; }
.answer-row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; padding: 8px 8px 8px 14px; }
.answer-row .cat { display: flex; align-items: center; gap: 8px; width: 128px; flex-shrink: 0; font-weight: 900; font-size: 14px; line-height: 1.15; }
.answer-row .cat .emoji { font-size: 20px; }
.answer-row input {
  flex: 1; min-width: 0; padding: 11px 13px; border-radius: 11px; border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.28); color: var(--ink); font: 800 16px var(--font-body); outline: none;
}
.answer-row input:focus { border-color: var(--teal); }
.answer-row input.filled { border-color: rgba(55, 230, 195, 0.5); }

.stop-bar { position: sticky; bottom: 10px; margin-top: 20px; text-align: center; }
.btn-stop { background: none; border: 0; cursor: pointer; transition: transform 0.08s; }
.btn-stop:active { transform: scale(0.93); }
.stop-octagon {
  display: grid; place-items: center; width: 118px; height: 118px;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  background: linear-gradient(180deg, #ff5148, #d31510); color: #fff;
  font: 700 30px var(--font-display); letter-spacing: 0.03em;
  box-shadow: 0 0 0 6px #fff inset, 0 0 34px rgba(255, 59, 48, 0.55);
  animation: stop-glow 1.6s ease-in-out infinite;
}
@keyframes stop-glow { 50% { box-shadow: 0 0 0 6px #fff inset, 0 0 54px rgba(255, 59, 48, 0.9); } }
.stop-hint { margin-top: 8px; color: var(--ink-dim); font-size: 13px; font-weight: 700; }

/* ===== revelación ===== */
.reveal-header { text-align: center; margin-bottom: 14px; }
.reveal-header b { color: var(--yellow); }
.reveal-stopper { margin-top: 6px; font-weight: 900; font-size: 17px; }

.reveal-table { display: flex; flex-direction: column; gap: 9px; }
.reveal-cat { background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; padding: 10px 12px; }
.reveal-cat .cat-name { font-weight: 900; font-size: 13px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 7px; }
.reveal-answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; }
.ans-cell {
  border-radius: 11px; padding: 8px 10px; background: rgba(0, 0, 0, 0.26); cursor: pointer;
  border: 2px solid transparent; transition: border-color 0.15s, opacity 0.15s; min-height: 54px;
}
.ans-cell .who { font-size: 11px; font-weight: 900; color: var(--ink-dim); text-transform: uppercase; }
.ans-cell .word { font-weight: 900; font-size: 16px; word-break: break-word; }
.ans-cell .pts { float: right; font-weight: 900; font-size: 13px; }
.ans-cell.p100 { border-color: rgba(55, 230, 120, 0.55); } .ans-cell.p100 .pts { color: var(--ok); }
.ans-cell.p50 { border-color: rgba(255, 211, 77, 0.55); } .ans-cell.p50 .pts { color: var(--yellow); }
.ans-cell.p0 { opacity: 0.55; } .ans-cell.p0 .pts { color: var(--red); }
.ans-cell.vetoed .word { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 3px; }

.reveal-tip { text-align: center; color: var(--ink-dim); font-size: 12.5px; font-weight: 700; margin: 12px 0; }

.reveal-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; margin-bottom: 16px; }
.total-box { text-align: center; background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; padding: 12px; }
.total-box .tname { font-weight: 900; font-size: 14px; }
.total-box .tround { font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--teal); }
.total-box .ttotal { font-size: 12.5px; font-weight: 800; color: var(--ink-dim); }
.total-box.leading { border-color: var(--yellow); box-shadow: 0 0 24px rgba(255, 211, 77, 0.18); }

.reveal-actions { text-align: center; }

/* ===== final ===== */
.final-card { text-align: center; margin-top: 34px; }
.final-emoji { font-size: 64px; animation: bounce 2s infinite; }
.final-title { font-family: var(--font-display); font-size: 32px; margin: 8px 0 4px; }
.final-sub { color: var(--ink-dim); font-weight: 800; margin-bottom: 18px; }
.final-scores { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.final-row { display: flex; justify-content: space-between; align-items: center; background: rgba(0, 0, 0, 0.25); border-radius: 14px; padding: 13px 16px; font-weight: 900; font-size: 17px; }
.final-row .fs { font-family: var(--font-display); font-size: 22px; color: var(--yellow); }

/* ===== selector de juego (sala) ===== */
.game-picker { margin: 18px 0 6px; }
.picker-label { font-weight: 900; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.07em; font-size: 12.5px; margin-bottom: 10px; }
.picker-row { display: grid; gap: 9px; }
.game-card {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 3px 13px; cursor: pointer;
  padding: 13px 15px; border-radius: 16px; text-align: left;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 2px solid var(--card-border); color: var(--ink); transition: 0.15s; font-family: inherit;
}
.game-card.selected { border-color: var(--pink); background: linear-gradient(180deg, rgba(255,77,141,.2), rgba(255,77,141,.08)); }
.game-card .game-emoji { font-size: 30px; grid-row: 1 / 3; }
.game-card .game-name { font: 700 16px var(--font-display); }
.game-card .game-desc { font-size: 11.5px; font-weight: 700; color: var(--ink-dim); line-height: 1.3; }

/* ===== ruleta de categorías ===== */
.wheel-stage { position: relative; display: flex; justify-content: center; padding: 26px 0 10px; }
.wheel-pointer {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  font-size: 26px; color: var(--yellow); z-index: 3; filter: drop-shadow(0 3px 5px rgba(0,0,0,.6));
}
.wheel-holder { position: relative; width: min(80vw, 310px); aspect-ratio: 1; perspective: 900px; }
.wheel-holder::after {   /* brillo de cristal sobre la rueda */
  content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: linear-gradient(150deg, rgba(255,255,255,.22), transparent 42%, transparent 70%, rgba(0,0,0,.25));
}
.wheel {
  width: 100%; height: 100%; border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(255,255,255,.09), 0 0 0 10px rgba(0,0,0,.35), 0 22px 50px -14px rgba(0,0,0,.8);
  transform: rotate(0deg);
}
.wheel.spinning { transition: transform 4.2s cubic-bezier(0.16, 0.86, 0.22, 1); }
.wheel-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 26%; height: 26%; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(160deg, #2a1550, #17092f); border: 3px solid rgba(255,255,255,.18);
  font-size: 26px; box-shadow: 0 4px 14px rgba(0,0,0,.5);
}
.wheel-landed { animation: wheel-pop 0.55s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes wheel-pop { 0% { transform: scale(1); } 45% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* ===== duelo: elegir tema ===== */
.topic-title { font-family: var(--font-display); font-size: 30px; text-align: center; margin: 10px 0 4px; }
.topic-sub { text-align: center; color: var(--ink-dim); font-weight: 800; margin-bottom: 22px; }
.topic-grid { display: grid; gap: 12px; }
.topic-card {
  display: flex; align-items: center; gap: 14px; width: 100%; cursor: pointer; text-align: left;
  padding: 18px 18px; border-radius: 18px; background: var(--card); color: var(--ink);
  border: 2px solid var(--card-border); font-family: inherit; transition: 0.15s;
}
.topic-card:active { transform: scale(0.98); }
.topic-card .t-emoji { font-size: 32px; }
.topic-card .t-label { font: 700 21px var(--font-display); }
.topic-card[disabled] { opacity: 0.55; cursor: default; }
.topic-card.picked { border-color: var(--yellow); box-shadow: 0 0 26px rgba(255, 211, 77, 0.25); }

/* ===== duelo: pregunta ===== */
.q-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.q-topic { font-weight: 900; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-count { font-weight: 900; font-size: 13px; color: var(--ink-dim); background: rgba(0, 0, 0, 0.3); padding: 5px 11px; border-radius: 999px; }
.timer-ring.small { width: 48px; height: 48px; }
.timer-ring.small #q-timer-num { font-size: 16px; }

.q-flag-wrap { display: flex; justify-content: center; margin-bottom: 14px; min-height: 0; }
.q-flag {
  width: 190px; max-width: 62vw; border-radius: 12px; display: block;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45); border: 2px solid rgba(255, 255, 255, 0.18);
}
.q-flag-emoji { font-size: 92px; line-height: 1.1; }

.q-text {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(21px, 6vw, 26px);
  line-height: 1.25; text-align: center; margin: 6px 0 22px; text-wrap: balance;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.5);
}

.q-options { display: grid; gap: 10px; }
.q-opt {
  width: 100%; text-align: left; cursor: pointer; padding: 16px 16px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  border: 2px solid var(--card-border); color: var(--ink);
  font: 800 16.5px var(--font-body); display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 18px -12px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.1);
  transition: border-color .18s, background .18s, transform .1s;
}
.q-opt:active { transform: scale(.985); }
.q-opt:active { transform: scale(0.99); }
.q-opt .badge {
  width: 29px; height: 29px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.1); font: 900 14px var(--font-body);
  border: 1px solid rgba(255,255,255,.12);
}
.q-opt.mine { border-color: var(--violet); background: rgba(139, 92, 246, 0.2); }
.q-opt.right {
  border-color: var(--ok); background: linear-gradient(180deg, rgba(55,230,120,.26), rgba(55,230,120,.12));
  box-shadow: 0 0 26px -4px rgba(55, 230, 120, .5);
}
.q-opt.right .badge { background: var(--ok); color: #06280f; }
.q-opt.wrong { border-color: var(--red); background: linear-gradient(180deg, rgba(255,59,48,.22), rgba(255,59,48,.08)); }
.q-opt[disabled] { cursor: default; }
.q-opt .who-picked { margin-left: auto; font-size: 11.5px; font-weight: 900; color: var(--ink-dim); text-align: right; }

.q-status { text-align: center; margin-top: 16px; font-weight: 900; font-size: 15px; min-height: 22px; }

/* ===== pregunta numérica: gana quien más se acerca ===== */
.num-input-wrap { display: flex; align-items: baseline; gap: 10px; justify-content: center; margin-bottom: 16px; }
.num-input {
  width: 100%; max-width: 230px; text-align: center; border: 0; border-bottom: 3px solid var(--pink);
  background: transparent; color: var(--ink); font: 700 46px var(--font-display); outline: none; padding: 4px 0;
  -moz-appearance: textfield;
}
.num-input::-webkit-outer-spin-button, .num-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-input::placeholder { color: rgba(253, 251, 255, 0.22); }
.num-input:disabled { border-bottom-color: var(--card-border); opacity: 0.7; }
.num-unit { color: var(--ink-dim); font-weight: 900; font-size: 15px; white-space: nowrap; }

.num-real { text-align: center; margin-bottom: 18px; }
.num-real-label { display: block; color: var(--ink-dim); font-weight: 900; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.08em; }
.num-real-value { font: 700 46px var(--font-display); color: var(--yellow); line-height: 1.15; }
.num-real-unit { display: block; color: var(--ink-dim); font-weight: 800; font-size: 14px; }

.num-rank { display: flex; flex-direction: column; gap: 8px; }
.num-row {
  display: grid; gap: 2px 10px; align-items: center;
  grid-template-columns: 1fr auto auto;
  grid-template-areas: 'who guess pts' 'diff diff pts';
  padding: 10px 13px; border-radius: 13px; background: rgba(0, 0, 0, 0.26);
  border: 2px solid transparent; font-weight: 900;
}
.num-row .num-who { grid-area: who; }
.num-row .num-guess { grid-area: guess; }
.num-row.winner { border-color: var(--ok); background: rgba(55, 230, 120, 0.14); }
.num-row.skipped { opacity: 0.5; }
.num-row .num-who { font-size: 14.5px; }
.num-row .num-guess { font: 700 21px var(--font-display); color: var(--teal); }
.num-row .num-diff { grid-area: diff; font-size: 12px; font-weight: 800; color: var(--ink-dim); }
.num-row.winner .num-diff { color: var(--ok); }
.num-row .num-pts { grid-area: pts; font: 700 19px var(--font-display); color: var(--yellow); text-align: right; }

/* bonus por rapidez, cayendo en directo */
.q-bonus {
  font: 900 13.5px var(--font-body); padding: 5px 11px; border-radius: 999px;
  background: rgba(55, 230, 195, 0.16); color: var(--teal); border: 1px solid rgba(55, 230, 195, 0.4);
  white-space: nowrap;
}
.q-bonus.hot { background: rgba(255, 211, 77, 0.2); color: var(--yellow); border-color: rgba(255, 211, 77, 0.5); animation: bonus-pulse 0.9s ease-in-out infinite; }
@keyframes bonus-pulse { 50% { transform: scale(1.09); } }
.q-breakdown { font-size: 12.5px; font-weight: 800; color: var(--ink-dim); }

.lobby-rules { margin: 18px 0 6px; padding: 14px 16px; border-radius: 16px; background: rgba(0,0,0,.24); border: 1px solid var(--card-border); }
.rules-title { font-weight: 900; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 6px; }
.rules-text { font-size: 13.5px; font-weight: 700; line-height: 1.45; color: rgba(253,251,255,.85); }
.rules-text b { color: var(--yellow); }

/* ===== prueba de velocidad ===== */
.speed-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.speed-progress { display: flex; align-items: baseline; gap: 8px; }
.sp-label { color: var(--ink-dim); font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.sp-count { font: 700 30px var(--font-display); color: var(--yellow); }
.speed-clock { font: 700 30px var(--font-display); color: var(--teal); font-variant-numeric: tabular-nums; }
.speed-clock small { font-size: 15px; opacity: .7; margin-left: 1px; }
.speed-clock.hurry { color: var(--red); animation: pulse-num 1s infinite; }

.speed-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.09); overflow: hidden; margin-bottom: 26px; }
.speed-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--teal), var(--yellow)); transition: width .35s cubic-bezier(.2,.9,.25,1); }

.speed-stage { min-height: 40vh; display: grid; place-items: center; padding: 10px 0 24px; }
.speed-claim {
  font: 600 clamp(24px, 7.5vw, 34px) var(--font-display); text-align: center; line-height: 1.22;
  text-wrap: balance; text-shadow: 0 4px 22px rgba(0,0,0,.55);
}
.speed-stage.ok .speed-claim { color: var(--ok); }
.speed-stage.ko .speed-claim { color: var(--red); }

.speed-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sp-btn {
  padding: 22px 10px; border-radius: 20px; border: 2px solid transparent; cursor: pointer;
  font: 700 21px var(--font-display); color: #fff; transition: transform .08s, filter .15s;
}
.sp-btn:active { transform: scale(.97); }
.sp-btn:disabled { opacity: .45; }
.sp-false { background: linear-gradient(180deg, #ff6b62, #d31510); box-shadow: 0 5px 0 #8f0f0b, inset 0 1px 0 rgba(255,255,255,.3); }
.sp-true { background: linear-gradient(180deg, #4dea87, #16a34a); box-shadow: 0 5px 0 #0d6b32, inset 0 1px 0 rgba(255,255,255,.3); }

.speed-note { text-align: center; margin-top: 14px; color: var(--ink-dim); font-size: 13px; font-weight: 800; }
.speed-rivals { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.speed-rivals .sr { display: flex; align-items: center; gap: 7px; font-weight: 900; font-size: 13px; color: var(--ink-dim); }
.speed-rivals .sr b { color: var(--ink); }
.speed-rivals .sr.done { color: var(--ok); }

/* ===== quesitos ===== */
.queso { flex-shrink: 0; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45)); }
.cheese-row { gap: 10px; }
.cheese-row .cheese-name { display: flex; align-items: center; gap: 11px; text-align: left; min-width: 0; flex: 1; }
.cheese-row .cn-text { display: flex; flex-direction: column; min-width: 0; }
.cheese-row .cn-nombre { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cheese-row .cheese-name small { font-weight: 800; font-size: 11.5px; opacity: 0.7; white-space: nowrap; }
.cheese-row .fs { white-space: nowrap; }
.cheese-row.just-won { border: 2px solid var(--yellow); box-shadow: 0 0 22px rgba(255, 211, 77, 0.25); }
.cheese-bar {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 20px;
  padding-top: 16px; border-top: 1px solid var(--card-border);
}
.cheese-bar .cb-player { display: flex; align-items: center; gap: 7px; font-weight: 900; font-size: 13px; }
.cheese-bar .cb-count { color: var(--ink-dim); font-size: 12px; }

/* ===== historial ===== */
.hist-title { font: 700 19px var(--font-display); margin: 6px 0 12px; text-align: center; }
.hist-title + * { margin-bottom: 22px; }
.hist-list { display: flex; flex-direction: column; gap: 7px; }
.hist-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.24); font-size: 13.5px; font-weight: 700;
}
.hist-row .hist-game { font-size: 17px; }
.hist-row .hist-when { color: var(--ink-dim); font-size: 12px; min-width: 52px; }
.hist-row .hist-players { flex: 1; text-align: right; font-weight: 800; }

/* ===== efectos ===== */
.fx-capa { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.fx-chispa { position: absolute; width: 9px; height: 9px; border-radius: 2px; transform: translate(-50%, -50%); }
.fx-cartel {
  position: fixed; top: 42%; left: 50%; z-index: 61; pointer-events: none;
  font: 700 clamp(30px, 9vw, 46px) var(--font-display); text-align: center; width: 90%;
  text-shadow: 0 6px 26px rgba(0, 0, 0, 0.75);
}

/* toast + confetti */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(80px);
  background: #fff; color: #1c0d38; font-weight: 900; padding: 12px 20px; border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); opacity: 0; transition: 0.25s; z-index: 50; pointer-events: none;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

@media (max-width: 380px) {
  .q-topic { font-size: 13px; }
  .q-header { gap: 8px; }
  .q-bonus { font-size: 12.5px; padding: 5px 9px; }
  .answer-row .cat { width: 104px; font-size: 12.5px; }
  .tile { font-size: 42px; padding: 10px 11px; }
}

/* ===== botón de sonido ===== */
/* abajo a la izquierda: la esquina que ninguna pantalla usa */
.btn-sound {
  position: fixed; left: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 40;
  width: 38px; height: 38px; border-radius: 12px; cursor: pointer; font-size: 17px; line-height: 1;
  background: rgba(0,0,0,.32); border: 1px solid var(--card-border); color: var(--ink);
  backdrop-filter: blur(8px); transition: .15s; opacity: .75;
}
.btn-sound:active { transform: scale(.92); }
.btn-sound.mute { opacity: .5; }

/* ===== comodines ===== */
.comodines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.comodin {
  display: grid; justify-items: center; gap: 1px; cursor: pointer; padding: 9px 4px 7px;
  border-radius: 14px; font-family: inherit; color: var(--ink);
  background: linear-gradient(180deg, rgba(255,211,77,.16), rgba(255,211,77,.05));
  border: 2px solid rgba(255,211,77,.4);
  transition: transform .12s, opacity .15s, border-color .15s;
}
.comodin:active { transform: scale(.94); }
.comodin[disabled] {
  cursor: default; opacity: .34; border-color: var(--card-border);
  background: rgba(255,255,255,.04);
}
.comodin.usado { opacity: .85; border-color: var(--ok); background: rgba(55,230,120,.14); }
.comodin .cm-emoji { font-size: 19px; line-height: 1; }
.comodin .cm-label { font: 700 12px var(--font-display); }
.comodin .cm-n { font-size: 10.5px; font-weight: 900; color: var(--ink-dim); }
.comodin.usado .cm-n { color: var(--ok); }

/* opción tachada por el 50/50: sigue ahí, pero descartada */
.q-opt.tachada {
  opacity: .3; text-decoration: line-through; border-style: dashed;
  border-color: rgba(255,255,255,.14);
}

/* ===== ronda comodín ===== */
.wild-badge {
  display: block; margin: 0 auto 12px; width: fit-content; padding: 6px 15px; border-radius: 99px;
  font: 700 13px var(--font-display); letter-spacing: .04em;
  color: #2a1c00; background: linear-gradient(180deg, #ffe9a3, var(--yellow));
  box-shadow: 0 6px 20px -8px rgba(255,211,77,.9);
}
#screen-elegir.active { display: flex; flex-direction: column; justify-content: center; min-height: calc(100dvh - 76px); }
.elegir-title { font: 700 clamp(26px, 8vw, 34px) var(--font-display); text-align: center; }
.elegir-sub { text-align: center; color: var(--ink-dim); font-weight: 700; font-size: 14px; margin: 8px 0 22px; line-height: 1.45; }
.elegir-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.elegir-card {
  display: grid; justify-items: center; gap: 6px; cursor: pointer; padding: 18px 8px;
  border-radius: 16px; font-family: inherit; color: var(--ink);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 26%, transparent), color-mix(in srgb, var(--c) 9%, transparent));
  border: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
  transition: transform .12s, opacity .15s;
}
.elegir-card:active { transform: scale(.96); }
.elegir-card[disabled] { cursor: default; opacity: .55; }
.elegir-card.elegida { opacity: 1; box-shadow: 0 0 30px -6px var(--c); transform: scale(1.03); }
.elegir-card .ec-emoji { font-size: 30px; line-height: 1; }
.elegir-card .ec-label { font: 700 13.5px var(--font-display); text-align: center; line-height: 1.2; }
.elegir-wait { text-align: center; margin-top: 20px; }

/* ===== castigo de la contrarreloj ===== */
.speed-clock { position: relative; }
.sp-penal {
  display: block; font: 900 12px var(--font-body); color: var(--red);
  letter-spacing: .02em; margin-top: -4px;
}
.sp-penal-fly {
  position: absolute; top: 0; right: 0; pointer-events: none;
  font: 900 17px var(--font-display); color: var(--red);
  text-shadow: 0 2px 8px rgba(0,0,0,.7);
}

/* ===== prueba de ordenar ===== */
.orden-list { display: grid; gap: 9px; margin-bottom: 12px; }
.orden-item {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 13px 14px; border-radius: 15px; cursor: pointer;
  font: 800 15.5px var(--font-body); color: var(--ink); font-family: inherit;
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  border: 2px solid var(--card-border);
  transition: transform .12s, border-color .15s, background .15s;
}
.orden-item:active { transform: scale(.985); }
.orden-item[disabled] { cursor: default; }
.orden-item .orden-num {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center; font: 700 15px var(--font-display);
  background: rgba(255, 255, 255, 0.1); color: var(--ink-dim);
  border: 1.5px dashed rgba(255, 255, 255, 0.25);
}
.orden-item.marcada { border-color: var(--violet); background: rgba(139, 92, 246, 0.18); }
.orden-item.marcada .orden-num { background: var(--violet); color: #fff; border-style: solid; border-color: transparent; }
.orden-item.revelada { cursor: default; }
.orden-item.revelada .orden-num { background: var(--yellow); color: #2a1c00; border-style: solid; border-color: transparent; }
.orden-item.revelada.ok { border-color: var(--ok); background: linear-gradient(180deg, rgba(55, 230, 120, 0.2), rgba(55, 230, 120, 0.06)); }
.orden-item.revelada.ko { border-color: rgba(255, 59, 48, 0.5); }
.orden-item .orden-texto { flex: 1; }
.orden-item .orden-quien { font: 800 11.5px var(--font-body); color: var(--ok); flex-shrink: 0; }
.orden-send { width: 100%; }
.orden-send.hidden { display: none; }

/* ===== palabra oculta ===== */
.cadena-word {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  margin: 6px 0 16px; min-height: 44px;
}
.cl {
  width: clamp(24px, 7.2vw, 38px); height: clamp(34px, 9.6vw, 48px);
  display: grid; place-items: center; border-radius: 9px;
  font: 700 clamp(17px, 5vw, 24px) var(--font-display); text-transform: uppercase;
  background: rgba(255, 255, 255, 0.07); border: 2px solid var(--card-border);
}
.cl.vista {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.32), rgba(56, 189, 248, 0.12));
  border-color: rgba(56, 189, 248, 0.65); color: #fff;
  animation: cl-pop .3s cubic-bezier(.2, 1.5, .4, 1);
}
.cl.oculta::after { content: ''; width: 45%; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); }
@keyframes cl-pop { from { transform: scale(.6); } to { transform: scale(1); } }
.cadena-input-wrap { margin-bottom: 12px; }
.cadena-input {
  max-width: 300px; font-size: clamp(20px, 6.4vw, 27px);
  letter-spacing: .05em; text-transform: uppercase;
}

/* ===== por encima o por debajo ===== */
.pico-corte { text-align: center; margin: 10px 0 18px; line-height: 1.5; }
.pico-corte .pico-pregunta { display: block; color: var(--ink-dim); font-weight: 800; font-size: 14.5px; }
.pico-corte .pico-valor { font: 700 clamp(38px, 11vw, 52px) var(--font-display); color: var(--yellow); margin-right: 8px; }
.pico-corte .pico-unidad { color: var(--ink-dim); font-weight: 900; font-size: 15px; }
.pico-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.pico-btn {
  display: grid; justify-items: center; gap: 6px; padding: 20px 10px; cursor: pointer;
  border-radius: 18px; font: 700 16.5px var(--font-display); color: var(--ink); font-family: inherit;
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  border: 2px solid var(--card-border); transition: transform .12s, border-color .15s;
}
.pico-btn:active { transform: scale(.96); }
.pico-btn[disabled] { cursor: default; }
.pico-btn .pico-emoji { font-size: 30px; line-height: 1; }
.pico-btn.mine { border-color: var(--violet); background: rgba(139, 92, 246, 0.2); }
.pico-btn.right { border-color: var(--ok); background: linear-gradient(180deg, rgba(55, 230, 120, 0.24), rgba(55, 230, 120, 0.07)); }
.pico-btn.wrong { border-color: var(--red); background: linear-gradient(180deg, rgba(255, 59, 48, 0.22), rgba(255, 59, 48, 0.08)); }
.q-pico-real { margin-top: 4px; }

/* ===== adivina con emojis ===== */
.cadena-emoji {
  text-align: center; font-size: clamp(40px, 13vw, 58px); line-height: 1.25;
  letter-spacing: .08em; margin: 2px 0 14px;
}

/* hueco entre palabras de la palabra oculta */
.cl-hueco { width: clamp(10px, 3vw, 18px); }

/* ===== memoriza la secuencia (Simon) ===== */
.seq-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.seq-nivel-box { display: grid; }
.seq-nivel { font: 700 34px var(--font-display); color: var(--yellow); line-height: 1; }
.seq-reloj { font: 700 22px var(--font-display); color: var(--ink-dim); }
.seq-reloj.hurry { color: var(--red); }
.seq-msg { text-align: center; font-weight: 900; font-size: 16.5px; min-height: 24px; margin: 10px 0 16px; }
.seq-fichas {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  max-width: 340px; margin: 0 auto 16px;
}
.seq-ficha {
  aspect-ratio: 1; border-radius: 20px; cursor: pointer; font-size: clamp(34px, 10vw, 46px);
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  border: 2px solid var(--card-border);
  transition: transform .1s, border-color .15s, box-shadow .15s, filter .15s;
}
.seq-ficha:active { transform: scale(.94); }
.seq-ficha[disabled] { cursor: default; filter: saturate(.55) brightness(.8); }
.seq-ficha.on {
  border-color: var(--yellow); filter: none;
  box-shadow: 0 0 26px -4px var(--yellow), inset 0 0 18px rgba(255, 211, 77, .25);
  transform: scale(1.07);
}

/* ===== marcador de ronda que se explica ===== */
.qround-nota {
  margin: -6px 0 14px; padding: 9px 14px; border-radius: 12px;
  background: rgba(255, 211, 77, 0.09); border: 1px solid rgba(255, 211, 77, 0.3);
  color: var(--yellow); font-weight: 800; font-size: 13.5px; line-height: 1.45;
}
.tenia-chip {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 99px;
  font: 800 10.5px var(--font-body); color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--card-border);
  vertical-align: middle;
}
.fs-ronda { display: grid; justify-items: end; line-height: 1.15; }
.fs-ronda small { font-size: 10px; font-weight: 800; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .05em; }
.fs-ronda .fs-quesos { font-size: 12.5px; font-weight: 800; color: var(--ink-dim); margin-top: 4px; }
.qround-ayuda {
  display: block; margin: 14px auto 0; background: none; border: 0; cursor: pointer;
  color: var(--ink-dim); font: 800 13px var(--font-body); text-decoration: underline dotted;
}
.qround-reglas {
  margin-top: 12px; padding: 13px 15px; border-radius: 14px; text-align: left;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--card-border);
  font-size: 13.5px; line-height: 1.5; color: var(--ink-dim); font-weight: 700;
  display: grid; gap: 8px;
}
.qround-reglas b { color: var(--ink); }
