/* Trivia Netlife — identidad tomada de netlife.ec */
:root {
  --orange: #ff6b00;
  --orange-dk: #e55a00;
  --amber: #f7ab12;
  --yellow: #ffd700;
  --magenta: #d81b60;
  --violet: #6c3bd9;
  --green: #22c55e;
  --green-strong: #15803d; /* fondo verde con texto blanco (contraste AA) */
  --ink: #1a1206; /* texto sobre naranja/ámbar */
  --bg: #0b0b12;
  --bg-2: #1a1a2e;
  --text: #ffffff;
  --muted: #b9b9cc;
  --card: rgba(255, 255, 255, 0.07);
  --card-border: rgba(255, 255, 255, 0.14);
  --radius: 20px;
  --grad: linear-gradient(90deg, var(--orange) 0%, var(--amber) 55%, var(--yellow) 100%);
  --grad-hot: linear-gradient(100deg, var(--yellow) 0%, var(--orange) 45%, #e3174a 82%, #a3195b 100%); /* cinta del logo */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-display: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.5;
  color: var(--text);
  background: radial-gradient(120% 90% at 50% 0%, #2a1a2e 0%, var(--bg-2) 35%, var(--bg) 100%) fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.1; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#bg, #confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#bg { z-index: 0; }
#confetti { z-index: 60; }

/* Cortinilla entre pantallas */
.wipe { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.wipe i { position: absolute; top: -10%; left: -30%; width: 160%; height: 120%; transform: translateX(-115%) skewX(-14deg); will-change: transform; }
.wipe i:nth-child(1) { background: var(--yellow); }
.wipe i:nth-child(2) { background: var(--orange); }
.wipe i:nth-child(3) { background: var(--bg-2); }

/* Pantallas */
#app { position: relative; z-index: 1; min-height: 100dvh; display: grid; }
.screen {
  grid-area: 1 / 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 20px 36px;
  text-align: center;
  min-height: 100dvh;
}
.screen.active { display: flex; }

/* Logo con brillo */
.logo-wrap { position: relative; width: min(78vw, 400px); aspect-ratio: 780 / 154; }
.logo-wrap img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 10px 28px rgba(255, 107, 0, 0.45)); }
.logo-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.85) 50%, transparent 60%) no-repeat;
  background-size: 250% 100%;
  -webkit-mask: url(../assets/netlife-logo-blanco.png) center / contain no-repeat;
  mask: url(../assets/netlife-logo-blanco.png) center / contain no-repeat;
  animation: shine 4.5s ease-in-out infinite;
}
.logo-wrap.small { width: 120px; }
@keyframes shine { 0%, 55% { background-position: 150% 0; } 100% { background-position: -100% 0; } }

.title {
  font-size: clamp(2.4rem, 10vw, 4.6rem);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.title .ch { display: inline-block; will-change: transform; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.title .grad .ch { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin: 0; max-width: 34ch; color: var(--muted); font-size: 1.05rem; line-height: 1.45; }

/* Tarjetas y formularios */
.card {
  width: min(100%, 440px);
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  text-align: left;
}
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; font-family: var(--font-display); font-weight: 500; font-size: 0.85rem; color: var(--muted); }
.input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.input::placeholder { color: rgba(255, 255, 255, 0.55); }
.input:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.25); transform: translateY(-1px); }
.input.bad { border-color: var(--magenta); }
textarea.input { resize: vertical; min-height: 84px; }
.error { min-height: 1.3em; margin: 2px 0 10px; color: #ff9db4; font-size: 0.9rem; }
.field-error { display: block; min-height: 1.25em; margin-top: 4px; color: #ff9db4; font-size: 0.85rem; }
.field-error:not(:empty)::before { content: '! '; font-weight: 700; }
.form-note { margin: 0 0 12px; font-size: 0.85rem; color: var(--muted); }

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 28px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  color: #1a1206;
  background: var(--grad);
  border: 0; border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(255, 107, 0, 0.45);
  transition: transform 0.18s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.18s, filter 0.18s;
  text-decoration: none;
}
.btn::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: skewX(-20deg);
  animation: btn-shine 2.8s ease-in-out infinite;
}
@keyframes btn-shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
@media (hover: hover) { .btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 14px 38px rgba(255, 107, 0, 0.6); } }
.btn:active { transform: scale(0.97); }
.btn:disabled { filter: grayscale(0.6) brightness(0.8); cursor: wait; }
.btn.loading::before { content: ''; width: 18px; height: 18px; border: 3px solid rgba(26, 18, 6, 0.3); border-top-color: var(--ink); border-radius: 50%; animation: spin 0.7s linear infinite; }
.btn.loading::after { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.block { width: 100%; }
.btn.big { padding: 18px 44px; font-size: 1.25rem; }
.btn.ghost { color: var(--text); background: rgba(255, 255, 255, 0.08); border: 1px solid var(--card-border); box-shadow: none; }
.btn.ghost::after, .btn.sm::after { display: none; }
.btn.danger { color: #fff; background: var(--magenta); box-shadow: none; }
.btn.sm { padding: 8px 14px; font-size: 0.85rem; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* Intro */
.hello { font-size: clamp(2rem, 8vw, 3.4rem); font-weight: 900; font-style: italic; }
.rules { display: grid; gap: 12px; width: min(100%, 440px); padding: 0; margin: 6px 0; list-style: none; }
.rules li {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; text-align: left;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 16px;
}
.rules b { font-family: var(--font-display); }
.rules .ico svg { width: 24px; height: 24px; fill: currentColor; }
.rules .ico {
  flex: 0 0 44px; height: 44px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 900; font-size: 1.1rem; color: #1a1206;
  background: var(--grad); border-radius: 12px;
}

/* Cuenta regresiva */
#count-num {
  font-family: var(--font-display); font-weight: 900; font-style: italic;
  font-size: clamp(7rem, 40vw, 16rem); line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 12px 40px rgba(255, 107, 0, 0.55));
}
.count-ring { position: absolute; width: 60vmin; height: 60vmin; border: 6px solid var(--orange); border-radius: 50%; opacity: 0; }

/* Juego */
#s-game { position: relative; justify-content: flex-start; gap: 22px; padding-top: 18px; }
.big-num { /* número fantasma de fondo */
  position: absolute; top: 3%; right: 6%; z-index: -1;
  font-family: var(--font-display); font-weight: 900; font-style: italic;
  font-size: clamp(11rem, 36vw, 30rem); line-height: 0.82; letter-spacing: -0.04em;
  color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, 0.09);
  pointer-events: none;
}
.hud { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(100%, 1080px); }
.hud .logo-wrap { flex: none; }
.hud-right { display: flex; align-items: center; gap: 10px; }
.segments { display: flex; gap: 8px; flex: 1; max-width: 420px; }
.seg { flex: 1; height: 6px; background: rgba(255, 255, 255, 0.16); border-radius: 99px; overflow: hidden; }
.seg i { display: block; height: 100%; background: var(--grad-hot); transform: scaleX(0); transform-origin: left; }
.seg:not(.is-current) i { transition: transform 0.4s var(--ease); }
.icon-btn {
  width: 48px; height: 48px; flex: none; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 50%;
  cursor: pointer; transition: transform 0.15s var(--ease), background 0.2s;
}
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn:active { transform: scale(0.9); }
.pill {
  padding: 8px 16px;
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 999px;
  white-space: nowrap;
}
.pill.score { color: var(--ink); background: var(--grad); border: 0; box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4); }

.q-wrap { display: flex; flex-direction: column; gap: 16px; width: min(100%, 1080px); text-align: left; }
.q-meta { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.q-badge {
  padding: 6px 16px 5px;
  font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.3rem);
  flex: none; text-transform: uppercase; white-space: nowrap; color: var(--ink);
  background: var(--grad-hot); border-radius: 8px;
  box-shadow: 0 8px 22px rgba(255, 107, 0, 0.4);
  transform: skewX(-8deg);
}
.q-kicker {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(0.8rem, 0.74rem + 0.4vw, 1.1rem);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--yellow);
}
.timer { position: relative; width: 64px; height: 64px; flex: none; margin-left: auto; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 9; }
.timer .track { stroke: rgba(255, 255, 255, 0.14); }
.timer .bar { stroke: var(--amber); stroke-linecap: round; transition: stroke 0.3s; }
.timer span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 900; font-size: 1.4rem; font-variant-numeric: tabular-nums;
}
.timer.hurry .bar { stroke: #ff5470; }
.timer.hurry { animation: hurry 0.5s ease-in-out infinite; }
@keyframes hurry { 50% { transform: scale(1.1); } }

.question {
  max-width: 30ch;
  font-size: clamp(1.4rem, 1rem + 2.2vw, 2.9rem); font-weight: 700; line-height: 1.18;
  text-shadow: 0 4px 26px rgba(0, 0, 0, 0.55);
}
.question .w { display: inline-block; white-space: pre; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt {
  position: relative; isolation: isolate;
  display: flex; align-items: center; gap: 16px;
  min-height: 84px; padding: 14px 20px 14px 14px;
  font-family: var(--font-body); font-weight: 500; font-size: clamp(1rem, 0.92rem + 0.5vw, 1.4rem); line-height: 1.3;
  text-align: left; color: #fff;
  background:
    radial-gradient(120% 170% at 0% 50%, rgba(255, 107, 0, 0.2), transparent 58%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
  border: 1.5px solid rgba(255, 255, 255, 0.16); border-radius: 18px;
  backdrop-filter: blur(12px) saturate(1.3); -webkit-backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  cursor: pointer; overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.25s, background 0.25s, opacity 0.3s, filter 0.3s, transform 0.2s var(--ease);
  will-change: transform;
}
.opt::before { /* brillo que barre la tarjeta */
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.18) 50%, transparent 65%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease);
  pointer-events: none;
}
.opt::after { /* aro degradado al elegir */
  content: ''; position: absolute; inset: -1.5px; border-radius: inherit; padding: 2.5px;
  background: var(--grad-hot);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.2s;
  pointer-events: none;
}
.opt .key {
  flex: 0 0 48px; height: 48px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 1.35rem; color: var(--ink);
  background: var(--grad-hot); border-radius: 13px;
  box-shadow: 0 8px 18px rgba(255, 107, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: background 0.25s, color 0.25s, transform 0.3s var(--ease);
}
.opt .key svg { width: 26px; height: 26px; fill: currentColor; }
.opt .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
@media (hover: hover) {
  .opt:hover:not(:disabled) { transform: translateY(-3px); border-color: rgba(255, 210, 31, 0.7); box-shadow: 0 18px 44px rgba(255, 107, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
  .opt:hover:not(:disabled)::before { transform: translateX(100%); }
  .opt:hover:not(:disabled) .key { transform: rotate(-6deg) scale(1.08); }
}
.opt:active:not(:disabled) { transform: scale(0.975); border-color: rgba(255, 210, 31, 0.8); }
.opt:active:not(:disabled)::before { transform: translateX(100%); }
.opt:disabled { cursor: default; }
.opt.picked { box-shadow: 0 0 40px rgba(255, 107, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.opt.picked::after { opacity: 1; }
.opt.dim { opacity: 0.38; filter: saturate(0.3); }
.opt.is-correct {
  background: rgba(46, 230, 160, 0.26);
  border-color: #6ff0c0; box-shadow: 0 0 44px rgba(46, 230, 160, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.opt.is-wrong {
  background: rgba(255, 84, 112, 0.28);
  border-color: #ff8fa3; box-shadow: 0 0 34px rgba(255, 84, 112, 0.35);
}
.opt.is-correct::after, .opt.is-wrong::after { opacity: 0; }
.opt.is-correct .key { background: #2ee6a0; color: #04261a; box-shadow: 0 8px 18px rgba(46, 230, 160, 0.45); }
.opt.is-wrong .key { background: #ff5470; color: #2a030c; box-shadow: 0 8px 18px rgba(255, 84, 112, 0.45); }

/* Destello de acierto / error en los bordes de la pantalla */
.flash { position: fixed; inset: 0; z-index: 15; opacity: 0; pointer-events: none; }
.flash.is-ok { background: radial-gradient(ellipse at center, transparent 40%, rgba(46, 230, 160, 0.34) 100%); }
.flash.is-bad { background: radial-gradient(ellipse at center, transparent 40%, rgba(255, 84, 112, 0.36) 100%); }

/* Cortinilla "PREGUNTA 0X" entre preguntas */
.stinger { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; visibility: hidden; }
.stinger__bar { position: absolute; top: -10%; bottom: -10%; left: -25%; width: 150%; transform-origin: left center; }
.stinger__bar--a { background: var(--grad-hot); }
.stinger__bar--b { background: #12061c; }
.stinger__label {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-display); font-style: italic; text-transform: uppercase; line-height: 0.85; color: #1b0a05;
}
.stinger__label small { font-weight: 800; font-size: clamp(1.3rem, 4.6vw, 3.2rem); letter-spacing: 0.3em; margin-right: -0.3em; }
.stinger__label b { font-weight: 900; font-size: clamp(8rem, 34vw, 24rem); color: #fff; text-shadow: 0 10px 0 rgba(27, 10, 5, 0.28); }

.feedback {
  position: fixed; left: 0; right: 0; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 20;
  width: fit-content; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: min(88vw, 360px); padding: 16px 28px;
  font-family: var(--font-display);
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  visibility: hidden;
}
/* Letrero translúcido: tinte plano sobre vidrio, sin degradados */
.feedback { backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); border: 1.5px solid transparent; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55); }
.feedback.good { background: rgba(16, 110, 72, 0.5); border-color: #6ff0c0; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(46, 230, 160, 0.3); }
.feedback.bad { background: rgba(150, 24, 58, 0.5); border-color: #ff8fa3; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 84, 112, 0.3); }
.feedback b { font-size: 1.6rem; font-weight: 900; font-style: italic; text-transform: uppercase; }
.feedback span { font-weight: 700; font-size: 1.15rem; }
.feedback small { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 500; }
.feedback small svg { width: 18px; height: 18px; fill: currentColor; }

/* Final y ranking */
.final-score {
  font-family: var(--font-display); font-weight: 900; font-style: italic;
  font-size: clamp(4rem, 20vw, 8rem); line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 10px 34px rgba(255, 107, 0, 0.5));
}
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.board { display: grid; gap: 8px; width: min(100%, 480px); padding: 0; margin: 0; list-style: none; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  font-family: var(--font-display); font-weight: 700;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 16px;
}
.row .pos { flex: 0 0 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.12); font-weight: 900; }
.row .name { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .pts { font-weight: 900; font-variant-numeric: tabular-nums; }
.row.top1 .pos { background: var(--yellow); color: #1a1206; }
.row.top2 .pos { background: #d9dbe3; color: #1a1206; }
.row.top3 .pos { background: #e08a45; color: #1a1206; }
.row.me { background: rgba(255, 107, 0, 0.28); border-color: var(--orange); }
.gap-row { color: var(--muted); letter-spacing: 0.3em; }

.toast {
  position: fixed; top: -70px; left: 0; right: 0; z-index: 70;
  width: fit-content; max-width: 90vw; margin: 0 auto;
  padding: 10px 18px; font-weight: 500;
  background: #2a2a44; border: 1px solid var(--card-border); border-radius: 12px;
}

/* Pantalla de ranking (proyector) */
.rank-page { min-height: 100dvh; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2vh; padding: 3vh 4vw; }
.rank-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: min(100%, 1100px); flex-wrap: wrap; }
.rank-head .title { font-size: clamp(2rem, 5vw, 4rem); }
.rank-list { position: relative; width: min(100%, 1100px); flex: 1; }
/* Todo se dimensiona a partir del alto de fila (--row-h, lo fija ranking.js) para que nada se salga */
.rank-list { --row-h: 64px; }
.rank-list .row {
  position: absolute; left: 0; right: 0; top: 0;
  gap: calc(var(--row-h) * 0.26); padding: 0 calc(var(--row-h) * 0.36) 0 calc(var(--row-h) * 0.15);
  font-size: calc(var(--row-h) * 0.36);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
  border: 1.5px solid rgba(255, 255, 255, 0.16); border-radius: calc(var(--row-h) * 0.26);
  backdrop-filter: blur(12px) saturate(1.3); -webkit-backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden; will-change: transform;
}
.rank-list .row .pos {
  flex: 0 0 calc(var(--row-h) * 0.7); width: calc(var(--row-h) * 0.7); height: calc(var(--row-h) * 0.7);
  font-size: calc(var(--row-h) * 0.4); font-style: italic; line-height: 1;
  color: #fff; background: rgba(255, 255, 255, 0.1); border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 28%;
}
.rank-list .row .pts { font-size: calc(var(--row-h) * 0.42); }
.rank-list .row .unit { margin-left: calc(var(--row-h) * -0.16); font-size: calc(var(--row-h) * 0.22); font-weight: 700; color: var(--muted); }
.rank-list .row.top1 { background: rgba(255, 215, 0, 0.14); border-color: rgba(255, 215, 0, 0.75); box-shadow: 0 0 40px rgba(255, 190, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.rank-list .row.top2 { border-color: rgba(217, 219, 227, 0.55); }
.rank-list .row.top3 { border-color: rgba(224, 138, 69, 0.6); }
.rank-list .row.top1 .pos { background: var(--yellow); border-color: transparent; color: var(--ink); box-shadow: 0 6px 18px rgba(255, 200, 0, 0.5); }
.rank-list .row.top2 .pos { background: #d9dbe3; border-color: transparent; color: var(--ink); }
.rank-list .row.top3 .pos { background: #e08a45; border-color: transparent; color: var(--ink); }
.rank-list .row.top1 .pts { color: var(--yellow); }
.rank-empty { margin-top: 12vh; font-family: var(--font-display); font-size: clamp(1.2rem, 3vw, 2rem); color: var(--muted); }
.rank-foot { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; font-size: clamp(0.95rem, 1.6vw, 1.3rem); }
.live { display: inline-flex; align-items: center; gap: 8px; }
.live::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--magenta); animation: live 1.2s ease-in-out infinite; }
@keyframes live { 50% { opacity: 0.25; transform: scale(0.7); } }

/* Administrador */
.admin { position: relative; z-index: 1; width: min(100%, 1040px); margin: 0 auto; padding: 22px 18px 60px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 10px 20px; font-family: var(--font-display); font-weight: 700; background: var(--card); border: 1px solid var(--card-border); border-radius: 999px; cursor: pointer; transition: transform 0.15s; }
@media (hover: hover) { .tab:hover { transform: translateY(-2px); } }
.tab.active { color: #1a1206; background: var(--grad); border-color: transparent; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .muted, .muted { color: var(--muted); }
.q-list { display: grid; gap: 12px; }
.q-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; padding: 18px; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); backdrop-filter: blur(10px); }
.q-num { width: 42px; height: 42px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 900; color: #1a1206; background: var(--grad); border-radius: 12px; }
.q-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; line-height: 1.3; overflow-wrap: anywhere; }
.q-opts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 8px; list-style: none; }
.q-opts li { padding: 6px 12px; font-size: 0.9rem; background: rgba(255, 255, 255, 0.08); border-radius: 10px; }
.q-opts li.ok { background: rgba(34, 197, 94, 0.25); outline: 1px solid var(--green); font-weight: 700; }
.q-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; max-width: 190px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { padding: 12px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
th { font-family: var(--font-display); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--amber); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { padding: 3px 10px; font-size: 0.78rem; font-weight: 700; border-radius: 99px; background: rgba(255, 255, 255, 0.12); }
.badge.ok { background: rgba(34, 197, 94, 0.25); color: #86efac; }

dialog { width: min(94vw, 560px); max-height: 92dvh; overflow-y: auto; padding: 0; color: var(--text); background: var(--bg-2); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); }
dialog::backdrop { background: rgba(5, 5, 10, 0.7); backdrop-filter: blur(4px); }
dialog form { padding: 24px; }
dialog h2 { margin-bottom: 16px; font-size: 1.4rem; }
.opt-edit { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.opt-edit input[type='radio'] { width: 22px; height: 22px; accent-color: var(--green); cursor: pointer; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.hint { margin: -2px 0 12px; font-size: 0.85rem; color: var(--muted); }

/* ---------- Texto y estados ---------- */
.title, .hello, .question, .lead { text-wrap: balance; }
.question { overflow-wrap: break-word; }
.pill.score, .final-score, .row .pts { font-variant-numeric: tabular-nums; }
.tab:active { transform: scale(0.96); }
.screen h1:focus, .screen h2:focus { outline: none; }

/* ---------- Touch ---------- */
html { touch-action: manipulation; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, td { -webkit-user-select: text; user-select: text; }
.input { min-height: 52px; }
.btn, .tab { min-height: 48px; }
.btn.sm { min-height: 44px; min-width: 44px; }
.screen { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); padding-bottom: max(36px, env(safe-area-inset-bottom)); }

/* ---------- Pantallas grandes (tótem vertical, TV o kiosco horizontal) ---------- */
@media (min-width: 900px) and (min-height: 800px) {
  .hud, .q-wrap { width: min(100%, 1280px); }
  #s-game { gap: 5vh; padding-top: 36px; }
  .q-wrap { gap: 26px; }
  .q-meta { min-height: 112px; gap: 20px; }
  .q-badge { font-size: 1.6rem; padding: 9px 24px 8px; }
  .q-kicker { font-size: 1.25rem; }
  .question { font-size: clamp(2.4rem, 3.4vmin + 1.1rem, 4.2rem); }
  .options { gap: 20px; margin-top: 10px; }
  .opt { min-height: clamp(112px, 13vh, 190px); padding: 22px 30px 22px 22px; gap: 24px; font-size: clamp(1.35rem, 1.8vmin + 0.7rem, 2.1rem); border-radius: 24px; }
  .opt .key { flex-basis: 70px; height: 70px; font-size: 2rem; border-radius: 18px; }
  .opt .key svg { width: 38px; height: 38px; }
  .timer { width: 112px; height: 112px; }
  .timer span { font-size: 2.5rem; }
  .segments { max-width: 600px; gap: 10px; }
  .seg { height: 8px; }
  .icon-btn { width: 60px; height: 60px; }
  .icon-btn svg { width: 28px; height: 28px; }
  .pill { padding: 12px 24px; font-size: 1.3rem; }
  .card { width: min(100%, 560px); padding: 34px; }
  .input { min-height: 64px; font-size: 1.25rem; }
  .field > span { font-size: 1.05rem; }
  .lead { font-size: 1.4rem; }
  .logo-wrap { width: min(60vw, 560px); }
  .logo-wrap.small { width: 200px; }
  .rules, .board { width: min(100%, 620px); }
  .rules li, .row { font-size: 1.25rem; padding: 18px 22px; }
  .btn.big { padding: 24px 60px; font-size: 1.6rem; }
  .feedback { padding: 22px 44px; }
  .feedback b { font-size: 2.4rem; }
  .feedback span { font-size: 1.5rem; }
}
/* Vertical ancho: respuestas en una columna de botones grandes */
@media (min-width: 900px) and (min-height: 800px) and (orientation: portrait) {
  .options { grid-template-columns: 1fr; }
}

/* ---------- Horizontal con poca altura (celular acostado) ---------- */
@media (orientation: landscape) and (max-height: 560px) {
  .screen { justify-content: flex-start; gap: 10px; padding-top: 12px; padding-bottom: 14px; }
  #s-register.active { display: grid; grid-template-columns: 1fr 1.15fr; grid-template-areas: 'logo form' 'title form' 'lead form'; align-content: center; justify-items: center; column-gap: 28px; }
  #s-register .logo-wrap { grid-area: logo; width: min(34vw, 300px); align-self: end; }
  #s-register .title { grid-area: title; font-size: clamp(1.8rem, 6vw, 3rem); }
  #s-register .lead { grid-area: lead; align-self: start; }
  #s-register .card { grid-area: form; padding: 14px 18px; }
  #s-register .field { margin-bottom: 8px; }
  #s-register .field > span { margin-bottom: 3px; font-size: 0.78rem; }
  #s-register .input { min-height: 44px; padding: 9px 14px; }
  #s-register .error { min-height: 0; margin: 0 0 4px; }
  #s-register .form-note { display: none; }
  #s-register .field { margin-bottom: 5px; }
  #s-register .field-error { min-height: 0; margin-top: 2px; font-size: 0.78rem; }
  #s-register .btn.big { padding: 11px 28px; font-size: 1.05rem; }
  #s-intro .logo-wrap, #s-final .logo-wrap { display: none; }
  .hello { font-size: clamp(1.5rem, 5vw, 2.2rem); }
  .rules { grid-template-columns: repeat(3, 1fr); width: min(100%, 900px); }
  .rules li { flex-direction: column; text-align: center; padding: 10px; font-size: 0.9rem; }
  .btn.big { padding: 12px 36px; font-size: 1.1rem; }
  #s-game { gap: 8px; padding-top: 10px; }
  .hud .logo-wrap.small { width: 84px; }
  .icon-btn { width: 44px; height: 44px; }
  .q-wrap { flex: 1; display: grid; grid-template-columns: 1fr 1.3fr; grid-template-areas: 'meta opts' 'q opts'; grid-template-rows: auto 1fr; column-gap: 18px; row-gap: 6px; }
  .q-meta { grid-area: meta; min-height: 50px; gap: 10px; }
  .q-kicker { display: none; }
  .question { grid-area: q; font-size: clamp(1.05rem, 2.7vw, 1.6rem); }
  .options { grid-area: opts; align-self: center; gap: 8px; }
  .opt { min-height: 60px; padding: 8px 12px 8px 8px; gap: 10px; font-size: clamp(0.9rem, 2vw, 1.05rem); border-radius: 14px; }
  .opt .key { flex-basis: 36px; height: 36px; font-size: 1.05rem; border-radius: 10px; }
  .opt .key svg { width: 20px; height: 20px; }
  .timer { width: 50px; height: 50px; }
  .timer span { font-size: 1.1rem; }
  .big-num { font-size: 70vh; }
  .pill { padding: 6px 14px; font-size: 0.85rem; }
  .feedback { flex-direction: row; gap: 12px; align-items: baseline; padding: 10px 22px; bottom: calc(8px + env(safe-area-inset-bottom)); }
  .feedback b { font-size: 1.15rem; }
  .feedback span { font-size: 1rem; }
  .final-score { font-size: clamp(3rem, 14vh, 5rem); }
}

@media (max-width: 600px) {
  .options { grid-template-columns: 1fr; }
  .opt { min-height: 68px; padding: 12px 16px 12px 12px; gap: 12px; }
  .opt .key { flex-basis: 42px; height: 42px; font-size: 1.15rem; }
  .hud { flex-wrap: wrap; row-gap: 12px; }
  .hud .logo-wrap.small { width: 96px; }
  .segments { order: 3; flex-basis: 100%; max-width: none; gap: 6px; }
  .q-kicker { letter-spacing: 0.08em; }
  .q-card { grid-template-columns: auto 1fr; }
  .q-actions { grid-column: 1 / -1; max-width: none; justify-content: flex-start; }
  .feedback { bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-wrap::after, .btn::after, .timer.hurry, .live::before { animation: none; }
}

/* ---------- Dashboard del administrador ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); backdrop-filter: blur(10px); }
.tile-label { font-family: var(--font-display); font-weight: 500; font-size: 0.85rem; color: var(--muted); }
.tile b { font-family: var(--font-display); font-weight: 900; font-size: 2.3rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tile small { min-height: 1.2em; font-size: 0.78rem; color: var(--muted); }
.tile:first-child { background: var(--grad); border-color: transparent; color: #1a1206; }
.tile:first-child .tile-label, .tile:first-child small { color: rgba(26, 18, 6, 0.75); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel-card { min-width: 0; padding: 20px; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); backdrop-filter: blur(10px); }
.panel-card.wide { grid-column: 1 / -1; }
.panel-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.panel-card .hint { margin: 0 0 16px; }
.meter { height: 22px; background: rgba(255, 255, 255, 0.1); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--orange); transform: scaleX(0); transform-origin: left; transition: transform 0.9s cubic-bezier(0.25, 0.8, 0.25, 1); }
.meter-label { margin: 12px 0 0; }
.meter-label b { font-family: var(--font-display); font-weight: 900; font-size: 1.8rem; margin-right: 6px; }
.hbars { display: grid; gap: 10px; color: var(--muted); }
.hbar { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) 3.2em; gap: 12px; align-items: center; color: var(--text); }
.hbar-label { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 16px; background: rgba(255, 255, 255, 0.08); border-radius: 4px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; background: var(--orange); transform: scaleX(0); transform-origin: left; transition: transform 0.9s cubic-bezier(0.25, 0.8, 0.25, 1); }
.hbar-value { font-family: var(--font-display); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.hbar:hover .hbar-track i, .col:hover i { background: var(--amber); }
.cols { display: flex; align-items: flex-end; gap: 6px; height: 170px; overflow-x: auto; color: var(--muted); }
.col { flex: 1 0 38px; max-width: 72px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; color: var(--text); }
.col b { font-family: var(--font-display); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.col i { width: 70%; max-width: 28px; background: var(--orange); border-radius: 4px 4px 0 0; transition: height 0.9s cubic-bezier(0.25, 0.8, 0.25, 1); }
.col span { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.rk { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-family: var(--font-display); font-weight: 900; background: rgba(255, 255, 255, 0.12); }
.rk1 { background: var(--yellow); color: #1a1206; }
.rk2 { background: #d9dbe3; color: #1a1206; }
.rk3 { background: #e08a45; color: #1a1206; }
tr.podium td { font-weight: 700; }
.admin h2 { font-size: 1.5rem; }
@media (max-width: 760px) {
  .dash-grid { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 1fr 3.2em; }
  .hbar-label { grid-column: 1 / -1; }
  .tile b { font-size: 1.9rem; }
}

#s-count { overflow: hidden; }

.rank-list.board { width: min(100%, 1100px); }
