/* ===== mystoia — concurso genérico (tema configurable) ===== */
:root {
  --primary: #2563EB;
  --accent: #F59E0B;
  --bg: #0F172A;
  --paper: #F8FAFC;
  --ink: #0F172A;
  --muted: #64748B;
  --line: #E2E8F0;
  --ok: #16A34A;
  --bad: #DC2626;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --head: 'Poppins', var(--sans);
  --opt0: #E11D48; --opt1: #2563EB; --opt2: #F59E0B; --opt3: #16A34A;
  /* Tinta de la pantalla grande: se recalcula según el brillo del fondo (ver pantalla.html) */
  --screen-ink: #ffffff;
  --screen-ink-soft: rgba(255,255,255,0.82);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--ink);
  background: var(--paper); min-height: 100vh; }

.wrap { max-width: 680px; margin: 0 auto; padding: 20px 16px 40px; }
.center { text-align: center; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* Cabecera */
.brand { text-align: center; padding: 8px 0 4px; }
.brand img.logo { max-height: 230px; max-width: 74%; margin: 0 auto 10px; display: block; }
body.playing .brand img.logo { max-height: 72px; max-width: 60%; }  /* pequeño durante el juego */
.brand h1 { font-family: var(--head); font-weight: 800; font-size: 30px; color: var(--primary); margin: 0; }
.brand .sub { color: var(--muted); font-size: 15px; margin-top: 2px; }
.rule { height: 4px; width: 60px; background: var(--accent); border-radius: 999px; margin: 12px auto; }

/* Tarjetas */
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; margin-bottom: 18px; box-shadow: 0 6px 20px rgba(15,23,42,0.06); }
.card h2 { font-family: var(--head); font-weight: 700; font-size: 22px; margin: 0 0 6px; color: var(--ink); }
.lede { color: var(--muted); line-height: 1.5; margin: 0 0 12px; }

/* Campos y botones */
.field { margin: 12px 0; }
.field label { display: block; font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink);
  border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--primary); }
.btn { font-family: var(--head); font-weight: 700; font-size: 16px; border: none;
  border-radius: 12px; padding: 13px 22px; cursor: pointer; color: #fff; background: var(--primary);
  transition: transform 100ms, filter 100ms; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: #1a1206; }
.btn-ghost { background: #fff; color: var(--primary); border: 2px solid var(--primary); }
.btn-danger { background: var(--bad); }
.btn-sm { font-size: 13px; padding: 8px 14px; border-radius: 10px; }
.btn-full { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.msg { margin-top: 10px; font-family: var(--head); font-size: 14px; }
.msg.err { color: var(--bad); } .msg.ok { color: var(--ok); }

/* ===== Jugador ===== */
.pmeta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.timer { font-family: var(--head); font-weight: 800; font-size: 44px; color: var(--primary); text-align: center; margin: 2px 0 8px; }
.q-text { font-family: var(--head); font-weight: 700; font-size: 22px; line-height: 1.3; text-align: center; margin: 8px 0 16px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opts.tf { grid-template-columns: 1fr 1fr; }
.opt-btn { font-family: var(--head); font-weight: 700; font-size: 17px; color: #fff; border: none;
  border-radius: 14px; padding: 22px 14px; cursor: pointer; text-align: left; min-height: 76px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 4px 0 rgba(0,0,0,0.15); }
.opt-btn .letter { font-weight: 800; opacity: 0.85; }
.opt-btn.o0 { background: var(--opt0); } .opt-btn.o1 { background: var(--opt1); }
.opt-btn.o2 { background: var(--opt2); color: #1a1206; } .opt-btn.o3 { background: var(--opt3); }
.opt-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.15); }
.opt-btn.dim { opacity: 0.4; }
.opt-btn.correct { outline: 4px solid var(--ok); }
.opt-btn.wrong { outline: 4px solid var(--bad); opacity: 0.6; }
.reveal-badge { font-family: var(--head); font-weight: 800; font-size: 20px; text-align: center;
  padding: 16px; border-radius: 14px; margin: 6px 0; }
.reveal-badge.ok { background: #DCFCE7; color: var(--ok); }
.reveal-badge.no { background: #FEE2E2; color: var(--bad); }
.reveal-badge.neutral { background: #F1F5F9; color: var(--muted); }
.score-chip { display: inline-block; font-family: var(--head); font-weight: 700; font-size: 18px;
  background: var(--accent); color: #1a1206; border-radius: 999px; padding: 8px 18px; margin: 6px auto; }
.score-chip.big { display: block; width: fit-content; font-size: 22px; }
.mini-board { list-style: none; padding: 0; margin: 14px 0 0; }
.mini-board li { display: flex; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.mini-board .pos { font-weight: 800; color: var(--primary); width: 24px; }
.mini-board .pts { margin-left: auto; font-weight: 700; }

/* ===== Pantalla grande ===== */
body.screen { background: var(--bg); color: var(--screen-ink); }
body.screen.lobby .screen-head img { display: none; }   /* en la sala, el logo va grande y centrado */
.lobby-logo { max-height: 190px; max-width: 55%; width: auto; margin-bottom: 4px; }
.screen-wrap { max-width: 1180px; margin: 0 auto; padding: 26px 30px; min-height: 100vh; display: flex; flex-direction: column; }
.screen-head { display: flex; align-items: center; gap: 16px; border-bottom: 3px solid var(--accent); padding-bottom: 12px; margin-bottom: 18px; }
.screen-head .st { font-family: var(--head); font-weight: 800; font-size: 26px; }
.screen-head img { max-height: 46px; }
.screen-qnum { margin-left: auto; font-family: var(--head); font-weight: 700; font-size: 22px; color: var(--accent); }
.scstate { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 20px; }
.sc-big { font-family: var(--head); font-weight: 800; font-size: clamp(34px, 6vw, 64px); }
.sc-lede { font-size: clamp(16px,2.4vw,22px); color: var(--screen-ink-soft); }
.sc-timer { font-family: var(--head); font-weight: 800; font-size: clamp(56px,12vw,130px); color: var(--accent); }
.sc-timer.low { color: #f87171; }
.sc-qtext { font-family: var(--head); font-weight: 700; font-size: clamp(26px,4vw,52px); line-height: 1.25; max-width: 1000px; }
.sc-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: min(1000px, 96%); }
.sc-opt { font-family: var(--head); font-weight: 700; font-size: clamp(18px,2.4vw,30px); color: #fff;
  border-radius: 16px; padding: 22px; text-align: left; display: flex; gap: 12px; align-items: center; }
.sc-opt .letter { font-weight: 800; opacity: 0.9; }
.sc-opt.o0 { background: var(--opt0); } .sc-opt.o1 { background: var(--opt1); }
.sc-opt.o2 { background: var(--opt2); color: #1a1206; } .sc-opt.o3 { background: var(--opt3); }
.sc-opt.correct { outline: 6px solid #fff; }
.sc-opt.faded { opacity: 0.35; }
.sc-opt .cnt { margin-left: auto; font-weight: 800; }
.sc-expl { font-size: clamp(15px,2vw,22px); color: var(--screen-ink-soft); max-width: 900px; font-style: italic; }
/* Sala de espera en dos zonas: logo (izq) · instrucciones + QR (der) */
.lobby-2col { display: flex; align-items: center; justify-content: center; gap: 5vw; width: 100%; flex-wrap: wrap; }
.lobby-col-left { flex: 1 1 360px; display: flex; align-items: center; justify-content: center; max-width: 560px; }
.lobby-col-right { flex: 1 1 360px; display: flex; flex-direction: column; align-items: center; gap: 16px;
  max-width: 560px; padding-left: 5vw; border-left: 2px solid var(--screen-ink-soft); }
.lobby-logo-lg { max-width: 100%; max-height: 52vh; width: auto; }
.lobby-heading { font-family: var(--head); font-weight: 800; font-size: clamp(26px, 3.6vw, 46px); }
.lobby-join { display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap; }
@media (max-width: 900px) { .lobby-col-right { border-left: none; padding-left: 0; } }
.wait-join { display: flex; align-items: center; justify-content: center; gap: 48px; flex-wrap: wrap; }
.qr-box { background: #fff; border-radius: 20px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr-box img { width: clamp(200px, 26vw, 320px); height: auto; display: block; image-rendering: pixelated; }
.qr-url { font-family: var(--head); font-weight: 700; color: #0F172A; font-size: 15px; word-break: break-all; max-width: 320px; text-align: center; }
.roomcode { font-family: var(--head); font-weight: 800; letter-spacing: 4px; font-size: clamp(28px,5vw,56px);
  color: var(--accent); background: rgba(255,255,255,0.06); border: 2px dashed var(--accent);
  border-radius: 16px; padding: 10px 28px; }
.screen-board { list-style: none; padding: 0; margin: 0; width: min(760px, 92%); }
.screen-board li { display: flex; gap: 14px; font-family: var(--head); font-size: clamp(18px,2.4vw,26px); padding: 12px 18px; border-radius: 12px; }
.screen-board li:nth-child(odd) { background: rgba(255,255,255,0.06); }
.screen-board li.lead { background: rgba(245,158,11,0.25); }
.screen-board .pos { font-weight: 800; color: var(--accent); width: 34px; }
.screen-board .pts { margin-left: auto; font-weight: 800; }
.screen-board .empty { justify-content: center; color: var(--screen-ink-soft); }

/* Podio */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; margin: 16px 0; }
.pod { flex: 0 1 150px; text-align: center; font-family: var(--head); }
.pod-medal { font-size: 40px; }
.pod-name { font-weight: 700; }
.pod-pts { color: var(--screen-ink-soft); font-size: 15px; }
.pod-bar { margin-top: 8px; border-radius: 10px 10px 0 0; background: var(--primary); }
.pod.first .pod-bar { height: 120px; background: var(--accent); }
.pod.second .pod-bar { height: 84px; }
.pod.third .pod-bar { height: 56px; background: #94a3b8; }

/* Fin de tiempo (overlay) */
.timeup-overlay { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center;
  justify-content: center; background: rgba(15,23,42,0.6); }
.timeup { font-family: var(--head); font-weight: 800; font-size: clamp(40px,9vw,90px); color: #fff;
  background: var(--bad); padding: 16px 42px; border-radius: 18px; transform: rotate(-3deg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5); }

/* Preview ribbon */
.preview-ribbon { text-align: center; font-family: var(--head); font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em; color: #1a1206; background: var(--accent);
  border-radius: 999px; padding: 6px 14px; margin: 0 auto 12px; width: fit-content; }

/* ===== Admin ===== */
.stat-row { display: flex; gap: 20px; flex-wrap: wrap; font-family: var(--head); color: var(--primary); margin-top: 8px; }
.stat-row b { font-size: 20px; }
.phase-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.ph-step { font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 999px; border: 2px solid var(--line); color: var(--muted); }
.ph-step.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.ph-arrow { color: var(--muted); }
.qitem { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.qitem.discarded { opacity: 0.5; }
.qtag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; color: #fff; }
.qtag.mc4 { background: var(--primary); } .qtag.tf { background: var(--accent); color: #1a1206; }
.qmeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.qopts { list-style: none; padding: 0; margin: 6px 0; }
.qopts li { padding: 4px 8px; border-radius: 8px; font-size: 14px; }
.qopts li.ok { background: #DCFCE7; font-weight: 700; }
.qbtns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.color-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.color-row label { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; gap: 4px; }
.pax-row { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.pax-num { font-weight: 800; color: var(--primary); min-width: 30px; }
.pax-name { flex: 1; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }
