/* Ignia — hoja de estilos. Colores del logo: rojo llama, naranja fuego y negro. */
:root {
  --brasa: #F2441D; --brasa-2: #C9161F; --ambar: #FF8205; --magma: #E0102A; --noche: #0B0B10; --crema: #FFFAF6;
  --bg: var(--crema); --surface: #FFFFFF; --surface-2: #FFF0E3; --text: #111114; --muted: #5F5F6B; --line: #F0E2D6;
  --ok: #14A06B; --bad: #E0102A;
  --a1: #E0102A; --a2: #2E5BFF; --a3: #E06F00; --a4: #14A06B;
  --shadow: 0 10px 30px rgba(17, 17, 20, .08); --radius: 20px;
  --grad: linear-gradient(135deg, #FF8205 0%, #F2441D 55%, #E0102A 100%);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0B0B10; --surface: #17171F; --surface-2: #22222C; --text: #F7F3EF; --muted: #B4B0BC; --line: #2C2C38;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45); color-scheme: dark;
}
.wordmark { font-family: "Questrial", "Century Gothic", "DM Sans", sans-serif; font-weight: 400; letter-spacing: .06em; font-size: 1.45rem; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px; line-height: 1.5; min-height: 100vh; -webkit-font-smoothing: antialiased; transition: background .25s, color .25s;
}
h1, h2, h3, .display { font-family: "Plus Jakarta Sans", system-ui, sans-serif; font-weight: 800; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--brasa); }
.muted { color: var(--muted); }
.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 96px; }
.wide { max-width: 1100px; margin: 0 auto; padding: 16px; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrapme { flex-wrap: wrap; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }

/* Marca */
.brand { display: inline-flex; align-items: flex-end; gap: 1px; text-decoration: none; color: var(--text); line-height: 1; }
.brand svg { height: 30px; width: auto; }
.brand .wordmark { padding-bottom: 1px; }
.flame-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Barra superior */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: .9rem; }
.lang-badge { display: inline-grid; place-items: center; min-width: 2.2em; height: 1.6em; padding: 0 .4em; border-radius: 8px; background: var(--grad); color: #fff; font-family: "Questrial", sans-serif; font-weight: 700; font-size: .85em; letter-spacing: .05em; vertical-align: middle; }
.iconbtn { text-decoration: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; font-size: 1.1rem; }
.iconbtn:hover { border-color: var(--brasa); }

/* Botones */
.btn { appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; border-radius: 999px; padding: 14px 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: transform .08s, box-shadow .2s, filter .2s; }
.btn:active { transform: translateY(2px); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(242, 68, 29, .25); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: var(--surface); color: var(--text); border: 2px solid var(--line); }
.btn.ghost:hover { border-color: var(--brasa); }
.btn.dark { background: var(--noche); color: #fff; }
:root[data-theme="dark"] .btn.dark { background: #FFF3E8; color: var(--noche); }
.btn.block { width: 100%; }
.btn.small { padding: 8px 14px; font-size: .9rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--brasa); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }

/* Tarjetas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.soft { background: var(--surface-2); box-shadow: none; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--surface-2); color: var(--brasa); }
.badge.ok { color: var(--ok); }
.banner { border-radius: 16px; padding: 12px 14px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.banner.warn { background: #FFF0C2; color: #6B4A00; }
.banner.info { background: var(--surface-2); color: var(--text); }
.banner.bad { background: #FFE0E4; color: #7A0F1E; }
:root[data-theme="dark"] .banner.warn { background: #4A3A10; color: #FFE7A3; }
:root[data-theme="dark"] .banner.bad { background: #4D1622; color: #FFC9D1; }

/* Formularios */
label { display: block; font-weight: 700; margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 1rem;
}
input:focus, select:focus { outline: none; border-color: var(--brasa); }
.field + .field { margin-top: 14px; }
.error { color: var(--bad); font-weight: 600; min-height: 1.4em; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg button { padding: 12px 8px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.seg button.on { border-color: var(--brasa); background: var(--surface-2); color: var(--brasa); }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.opt.on, .opt:hover { border-color: var(--brasa); }
.opt .big { font-size: 1.6rem; }

/* Interruptor modo oscuro */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle { width: 56px; height: 32px; border-radius: 999px; background: var(--line); position: relative; border: 0; cursor: pointer; transition: background .2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.toggle[aria-checked="true"] { background: var(--brasa); }
.toggle[aria-checked="true"]::after { transform: translateX(24px); }

/* Avatar */
.avatar { display: inline-block; border-radius: 50%; flex: none; }
.avatar svg { display: block; width: 100%; height: 100%; }
.avatar-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.avatar-pick button { border: 3px solid var(--line); border-radius: 24px; background: var(--surface); padding: 14px; cursor: pointer; color: var(--text); font: inherit; font-weight: 700; }
.avatar-pick button.on { border-color: var(--brasa); background: var(--surface-2); }
.skins { display: flex; gap: 10px; justify-content: center; }
.skins button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.skins button.on { border-color: var(--brasa); }
.bubble { position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 12px 14px; font-weight: 600; }
.bubble::before { content: ""; position: absolute; left: -9px; top: 22px; width: 14px; height: 14px; background: var(--surface); border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg); }
.coach { display: flex; gap: 12px; align-items: flex-start; }
.coach .bubble { flex: 1; }
.coach .who { font-size: .8rem; color: var(--brasa); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }

/* Respuestas: color + forma */
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ans { position: relative; border: 0; border-radius: 18px; color: #fff; font: inherit; font-weight: 700; font-size: 1.05rem; padding: 18px 14px 18px 52px; min-height: 84px; text-align: left; cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.18); transition: transform .08s, opacity .2s, filter .2s; word-break: break-word; }
.ans:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.ans .shape { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; }
.ans.a0 { background: var(--a1); } .ans.a1 { background: var(--a2); } .ans.a2 { background: var(--a3); } .ans.a3 { background: var(--a4); }
.ans.dim { opacity: .35; filter: saturate(.4); }
.ans.right { outline: 4px solid var(--ok); outline-offset: 3px; }
.ans.wrong { outline: 4px solid var(--bad); outline-offset: 3px; }
.ans[disabled] { cursor: default; }
@media (max-width: 380px) { .answers { grid-template-columns: 1fr; } }

/* Pregunta y temporizador */
.qcard { text-align: center; padding: 22px 18px; }
.qcard .qtext { font-family: "Plus Jakarta Sans", sans-serif; font-size: clamp(1.3rem, 4.5vw, 1.8rem); font-weight: 600; }
.timer { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.timer > i { display: block; height: 100%; width: 100%; background: var(--grad); transform-origin: left; }
.progressdots { display: flex; gap: 4px; }
.progressdots i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.progressdots i.ok { background: var(--ok); } .progressdots i.bad { background: var(--bad); } .progressdots i.cur { background: var(--brasa); }

/* Camino de niveles */
.path { display: grid; gap: 14px; position: relative; }
.lvl { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 20px; background: var(--surface); border: 2px solid var(--line); text-decoration: none; color: var(--text); }
.lvl .num { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; flex: none; background: var(--surface-2); }
.lvl.done .num { background: var(--ok); color: #fff; }
.lvl.current { border-color: var(--brasa); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brasa) 18%, transparent); }
.lvl.current .num { background: var(--grad); color: #fff; }
.lvl.locked { opacity: .55; pointer-events: none; }


/* Portada */
.hero { display: grid; gap: 28px; align-items: center; padding: 28px 0 10px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.1fr .9fr; } }
.hero .art { position: relative; aspect-ratio: 1; max-width: 420px; margin: 0 auto; width: 100%; }
.glow { position: absolute; inset: 8%; border-radius: 50%; background: var(--grad); filter: blur(40px); opacity: .35; }
.features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 24px 0; }
.feature .ico { font-size: 1.8rem; }
.steps { counter-reset: s; display: grid; gap: 12px; }
.steps li { list-style: none; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { counter-increment: s; content: counter(s); flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; }
.footer { text-align: center; color: var(--muted); padding: 30px 16px 40px; font-size: .9rem; }

/* Menú inferior móvil */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
.tabbar a { color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 700; display: grid; justify-items: center; gap: 2px; padding: 4px 8px; border-radius: 12px; }
.tabbar a .i { font-size: 1.3rem; }
.tabbar a.on { color: var(--brasa); background: var(--surface-2); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--noche); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; opacity: 0; transition: .25s; z-index: 100; max-width: calc(100% - 32px); text-align: center; }
:root[data-theme="dark"] .toast { background: #FFF3E8; color: var(--noche); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Pantalla grande (presentador) */
.stage { min-height: calc(100vh - 60px); display: flex; flex-direction: column; }
.pinbox { display: grid; gap: 20px; align-items: center; justify-items: center; grid-template-columns: 1fr; }
@media (min-width: 860px) { .pinbox { grid-template-columns: 1.2fr .8fr; } }
.pin { font-family: "Plus Jakarta Sans", sans-serif; font-size: clamp(3rem, 10vw, 6.5rem); font-weight: 700; letter-spacing: .08em; }
.qr { width: 220px; height: 220px; background: #fff; border-radius: 20px; padding: 10px; }
.players { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pl { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; animation: pop .3s; }
.pl.off { opacity: .45; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.bigq { font-family: "Plus Jakarta Sans", sans-serif; font-size: clamp(1.8rem, 4.2vw, 3.2rem); font-weight: 600; text-align: center; margin: 10px 0 24px; }
.stage .answers { gap: 16px; }
.stage .ans { font-size: clamp(1.1rem, 2.4vw, 1.8rem); min-height: 120px; padding-left: 70px; }
.stage .ans .shape { width: 38px; height: 38px; left: 18px; }
.countdown { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-family: "Plus Jakarta Sans", sans-serif; font-size: 2.4rem; font-weight: 700; background: var(--grad); color: #fff; flex: none; }
.bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: end; height: 180px; margin: 10px 0 20px; }
.bars .bar { border-radius: 14px 14px 6px 6px; display: flex; align-items: flex-start; justify-content: center; color: #fff; font-weight: 800; padding-top: 8px; min-height: 36px; transition: height .5s; }
.leader { display: grid; gap: 8px; }
.leader .r { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 1.1rem; }
.leader .r .pos { width: 32px; text-align: center; font-family: "Plus Jakarta Sans", sans-serif; font-size: 1.3rem; color: var(--brasa); }
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; align-items: end; max-width: 760px; margin: 20px auto; }
.podium .step { text-align: center; }
.podium .block { border-radius: 18px 18px 8px 8px; background: var(--grad); color: #fff; font-family: "Plus Jakarta Sans", sans-serif; font-size: 2.4rem; font-weight: 700; display: grid; place-items: center; }

/* Jugador (móvil) */
.player-ans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.player-ans .ans { min-height: 120px; font-size: 1.05rem; }
.result-screen { min-height: 70vh; display: grid; place-items: center; text-align: center; border-radius: 28px; padding: 24px; }
.result-screen.good { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); }
.result-screen.bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.points { font-family: "Plus Jakarta Sans", sans-serif; font-size: 2.6rem; font-weight: 700; }

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

/* ===== Estilo «app de aprendizaje» (v2) ===== */
.answers.cards { grid-template-columns: 1fr; gap: 10px; }
.answers.cards .ans { background: var(--surface); color: var(--text); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line); min-height: 64px; padding: 14px 16px 14px 64px; font-weight: 600; }
.answers.cards .ans:hover:not([disabled]) { border-color: var(--brasa); }
.answers.cards .ans .shape { left: 14px; width: 34px; height: 34px; padding: 7px; border-radius: 10px; }
.answers.cards .ans.a0 .shape { background: var(--a1); } .answers.cards .ans.a1 .shape { background: var(--a2); }
.answers.cards .ans.a2 .shape { background: var(--a3); } .answers.cards .ans.a3 .shape { background: var(--a4); }
.answers.cards .ans.right { outline: 0; border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.answers.cards .ans.wrong { outline: 0; border-color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
.answers.cards .ans.dim { opacity: .5; filter: none; }
.ans { box-shadow: none; }
.tutor-photo { border-radius: 50%; overflow: hidden; background: var(--surface-2); position: relative; flex: none; display: inline-block; }
.tutor-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tutor-photo.live::after { content: ""; position: absolute; right: 6%; bottom: 6%; width: 18%; height: 18%; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }
.initials { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; flex: none; }
.chat { display: grid; gap: 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-weight: 500; }
.msg.tutor { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 6px; }
.msg.me { background: var(--grad); color: #fff; justify-self: end; border-top-right-radius: 6px; }
.phone { width: min(320px, 100%); margin: 0 auto; background: var(--surface-2); border-radius: 36px; padding: 18px 14px; border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; }
.phone .head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lvl { border-width: 1px; }
.lvl .num { border-radius: 14px; }
.progressbar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progressbar > i { display: block; height: 100%; background: var(--grad); }
.coach .bubble { border-width: 1px; }
