/* ===== Noche de Juegos ALG ===== */
:root {
    --bg: #0b0e1a;
    --bg2: #131735;
    --card: #1a1f3d;
    --text: #f1f5ff;
    --muted: #98a0c8;
    --line: rgba(255, 255, 255, .08);
    --accent: #8b5cf6;
    --accent2: #f472b6;
    --amber: #fbbf24;
    --red: #f87171;
    --grad: linear-gradient(135deg, #8b5cf6, #f472b6 55%, #fbbf24);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
    background:
        radial-gradient(1200px 800px at 20% -10%, #1d2452 0%, transparent 55%),
        radial-gradient(1000px 700px at 110% 10%, #3b1d52 0%, transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
    min-height: 100dvh;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: var(--text); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
h1, h2, h3 { margin: .4em 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid var(--amber); outline-offset: 2px;
}

/* ---------- Botones ---------- */
.ghost {
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
}
.ghost:hover { background: rgba(255, 255, 255, .12); }
.primary {
    background: var(--grad);
    color: #0b0e1a;
    border: none;
    border-radius: 16px;
    padding: 16px 22px;
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: 0 10px 30px rgba(139, 92, 246, .35);
}
.primary:disabled { opacity: .5; }
.primary.big { font-size: 1.3rem; padding: 18px 26px; }

/* ---------- Landing ---------- */
.landing {
    max-width: 820px; margin: 0 auto;
    padding: clamp(20px, 5vw, 60px) 20px;
    display: flex; flex-direction: column; gap: 30px;
    min-height: 100dvh; justify-content: center;
}
.landing-head h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.25rem); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.big-card {
    display: flex; flex-direction: column; gap: 8px;
    background: linear-gradient(160deg, #1b2148, #12162e);
    border: 1px solid var(--line); border-radius: 24px; padding: 26px;
    text-decoration: none; color: var(--text);
    transition: transform .15s, border-color .15s;
}
.big-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.big-card .ico { font-size: 2.6rem; }
.big-card h2 { margin: 0; }
.big-card p { color: var(--muted); margin: 0; flex: 1; }
.big-card .go, a.go { font-weight: 800; color: var(--amber); }
.landing-foot { color: var(--muted); text-align: center; font-size: .95rem; }

/* ---------- TV ---------- */
.tv { min-height: 100dvh; display: flex; flex-direction: column; padding: clamp(12px, 2.5vmin, 28px); gap: 2vmin; }
.tv-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: clamp(16px, 2.4vmin, 26px); letter-spacing: .5px; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand.small { font-size: 1.25rem; }
.room { color: var(--muted); font-weight: 600; letter-spacing: .12em; font-size: clamp(13px, 1.8vmin, 20px); }
.room b { color: var(--amber); letter-spacing: .18em; }
.tv-actions { display: flex; gap: 8px; }

.join-box {
    display: flex; gap: 4vmin; align-items: center; justify-content: center;
    flex-wrap: wrap; padding: 3vmin; margin-top: 1vmin;
    background: linear-gradient(160deg, #171c3d, #10142b);
    border: 1px solid var(--line); border-radius: 28px;
}
.join-label { color: var(--muted); letter-spacing: .32em; font-size: clamp(11px, 1.6vmin, 17px); font-weight: 700; }
.join-label.second { margin-top: 2.4vmin; }
.join-url { font-size: clamp(20px, 3.4vmin, 40px); font-weight: 700; }
.join-url span { color: var(--accent2); }
.code-mega {
    font-size: clamp(58px, 13vmin, 150px); font-weight: 900; letter-spacing: .16em;
    background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
    line-height: 1.05;
}
.join-qr { text-align: center; }
.join-qr #qr {
    background: #fff; padding: 10px; border-radius: 18px;
    display: inline-grid; place-items: center; min-width: 130px; min-height: 130px;
}
.join-qr #qr img, .join-qr #qr canvas { display: block; }
.qr-cap { color: var(--muted); margin-top: 8px; font-size: clamp(12px, 1.6vmin, 16px); }

.section-title { font-size: clamp(18px, 2.6vmin, 30px); text-align: center; }
.count { color: var(--muted); font-weight: 600; font-size: .75em; }
.players-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pchip {
    padding: 10px 18px; border-radius: 999px;
    background: var(--card); border: 1px solid var(--line);
    font-weight: 700; font-size: clamp(14px, 2vmin, 22px);
    transition: transform .2s;
}
.pchip.off { opacity: .45; }
.pchip.empty { opacity: .22; font-style: italic; font-weight: 500; }
.pchip .w { color: var(--amber); font-size: .85em; }
.hint { color: var(--muted); text-align: center; }
.hint.small { font-size: .85rem; }

/* Escenario de juego TV */
.stage {
    display: flex; align-items: center; justify-content: center;
    gap: clamp(14px, 5vmin, 70px); flex-wrap: wrap; padding: 1vmin 0;
}
.ring-wrap { position: relative; display: grid; place-items: center; }
.ring { width: clamp(84px, 13vmin, 160px); height: auto; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .09); stroke-width: 9; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; }
.ring-label {
    position: absolute; font-weight: 900; font-size: clamp(15px, 2.4vmin, 26px);
}
.ball-wrap { display: grid; place-items: center; }
.ball {
    width: clamp(190px, 36vmin, 420px); aspect-ratio: 1; border-radius: 50%;
    position: relative; display: grid; place-items: center;
    background:
        linear-gradient(180deg, transparent 0 35%, #ef4444 35% 65%, transparent 65%),
        radial-gradient(circle at 35% 30%, #ffffff, #dfe6f5 70%);
    box-shadow: 0 24px 70px rgba(255, 255, 255, .16), inset 0 -14px 34px rgba(15, 23, 42, .18);
}
.ball span {
    font-size: clamp(84px, 17vmin, 210px);
    font-weight: 900; color: #0b0e1a; line-height: 1;
}
.ball.pop { animation: ballPop .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes ballPop {
    0% { transform: scale(.55) rotate(-9deg); }
    60% { transform: scale(1.07); }
    100% { transform: scale(1); }
}
.round-meta { display: flex; flex-direction: column; gap: 8px; font-weight: 700; font-size: clamp(14px, 2vmin, 24px); color: var(--muted); }
.rm.warn { color: var(--red); }
.history-title { text-align: center; color: var(--muted); font-weight: 700; letter-spacing: .2em; font-size: clamp(12px, 1.6vmin, 16px); margin-top: 1vmin; }
.history { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; min-height: 60px; }
.hball {
    min-width: clamp(40px, 6vmin, 66px); height: clamp(40px, 6vmin, 66px);
    display: grid; place-items: center; border-radius: 50%;
    background: #fff; color: #0b0e1a; font-weight: 900;
    font-size: clamp(17px, 2.8vmin, 30px);
}
.hball.fresh { outline: 3px solid var(--amber); animation: popIn .4s; }
.strip { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* Overlay de celebración */
.overlay {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(5, 7, 15, .76); backdrop-filter: blur(4px);
    display: grid; place-items: center;
}
.overlay-card {
    background: linear-gradient(160deg, #1b2148, #12162e);
    border: 1px solid var(--line); border-radius: 28px;
    padding: clamp(24px, 5vmin, 60px); text-align: center;
    animation: popIn .45s cubic-bezier(.2, 1.4, .4, 1);
    max-width: min(90vw, 760px);
}
.win-emoji { font-size: clamp(52px, 10vmin, 110px); }
.win-title {
    font-size: clamp(36px, 7.5vmin, 88px); font-weight: 900;
    background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.win-name { font-size: clamp(24px, 4vmin, 46px); font-weight: 800; margin-top: 6px; }
.win-sub { color: var(--muted); margin-top: 10px; font-size: clamp(14px, 2vmin, 20px); }

/* Emojis flotantes */
.reactLayer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.float {
    position: fixed; bottom: 12vh; font-size: clamp(34px, 5vmin, 60px);
    animation: floatUp 3s ease-out forwards; pointer-events: none;
}
@keyframes floatUp {
    0% { transform: translateY(0) scale(.6); opacity: 0; }
    15% { opacity: 1; transform: scale(1.12); }
    100% { transform: translateY(-58vh) scale(1); opacity: 0; }
}

/* Toasts */
.toasts {
    position: fixed; left: 0; right: 0; bottom: 14px; z-index: 70;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    pointer-events: none; padding: 0 12px;
}
.toast {
    background: rgba(35, 42, 82, .92); border: 1px solid var(--line);
    padding: 10px 18px; border-radius: 999px; font-weight: 600;
    backdrop-filter: blur(6px); animation: popIn .3s;
    transition: opacity .5s, transform .5s; max-width: 92vw; text-align: center;
}
.toast.out { opacity: 0; transform: translateY(6px); }

/* Panel presentador (TV) */
.ctl {
    position: fixed; right: 16px; bottom: 16px; z-index: 40;
    width: min(310px, 92vw);
    background: rgba(21, 26, 54, .96); border: 1px solid var(--line);
    border-radius: 18px; padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
}
.ctl h3 { margin: 0; font-size: 1.05rem; }
.ctl-row { display: flex; gap: 8px; flex-wrap: wrap; }
.field-sm { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); font-weight: 600; }
select, input {
    background: #141833; border: 1px solid var(--line); border-radius: 12px;
    padding: 12px 14px; outline: none;
}
select:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 246, .25); }

/* ---------- Página jugador ---------- */
.play { min-height: 100dvh; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; padding: 14px; gap: 14px; }
.play-head { display: flex; justify-content: space-between; align-items: center; }
.me { font-weight: 700; color: var(--amber); font-size: .95rem; text-align: right; }
.view { display: flex; flex-direction: column; gap: 14px; }
.view h1 { font-size: 1.7rem; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, label { color: var(--muted); font-weight: 600; font-size: .95rem; }
.field input { font-size: 1.15rem; }
#inpCode { text-transform: uppercase; letter-spacing: .4em; font-weight: 800; text-align: center; font-size: 1.6rem; }
#inpPin { text-align: center; letter-spacing: .5em; font-size: 1.3rem; }
.subhint { color: var(--muted); font-size: .85rem; margin: 0; }

.players-list { display: flex; flex-direction: column; gap: 8px; }
.prow {
    display: flex; justify-content: space-between;
    background: var(--card); border: 1px solid var(--line);
    border-radius: 14px; padding: 12px 16px; font-weight: 600;
}
.prow.off { opacity: .5; }

.host-panel {
    background: linear-gradient(160deg, #1b2148, #141833);
    border: 1px solid var(--line); border-radius: 20px; padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
}
.host-panel.compact { padding: 10px; }
.row-label { display: flex; justify-content: space-between; align-items: center; color: var(--text); gap: 10px; flex-wrap: wrap; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
    width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid var(--line); background: rgba(255, 255, 255, .06);
    font-size: 1.4rem; font-weight: 800;
}
.stepper b { min-width: 2ch; text-align: center; font-size: 1.3rem; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }

.top-strip { display: flex; align-items: center; gap: 14px; }
.ball-chip {
    width: 64px; height: 64px; border-radius: 50%;
    display: grid; place-items: center; flex: 0 0 auto;
    background: radial-gradient(circle at 35% 30%, #fff, #dfe6f5);
    color: #0b0e1a; font-weight: 900; font-size: 1.5rem;
    box-shadow: 0 6px 20px rgba(255, 255, 255, .15);
}
.mini-info { display: flex; flex-direction: column; font-weight: 700; font-size: 1rem; }
.mini-info .warn, .warn { color: var(--red) !important; }

.card-grid {
    display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px;
    background: #10142b; border: 1px solid var(--line);
    border-radius: 20px; padding: 10px; touch-action: manipulation;
}
.cell {
    aspect-ratio: 1 / 1.05; display: grid; place-items: center;
    border-radius: 10px; background: var(--card); border: 1px solid var(--line);
    font-weight: 800; font-size: clamp(.85rem, 4.2vw, 1.35rem);
    color: var(--text); padding: 0; user-select: none;
}
.cell.empty { background: transparent; border-color: transparent; }
.cell.drawn { box-shadow: inset 0 0 0 2px rgba(251, 191, 36, .55); }
.cell.marked { background: var(--grad); color: #0b0e1a; border-color: transparent; }
.cell.pulse { animation: pulse .9s; }
@keyframes pulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.18); }
    100% { transform: scale(1); }
}
.claim-row { display: flex; gap: 12px; }
.claim {
    flex: 1; padding: 18px; border-radius: 18px; border: none;
    font-weight: 900; font-size: 1.25rem; color: #0b0e1a;
}
.claim.line { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.claim.bingo { background: var(--grad); }
.claim:disabled { opacity: .35; filter: grayscale(.4); }
.reactions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.reactions button { font-size: 1.6rem; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.reactions button:active { transform: scale(.9); }

.shake { animation: shake .5s; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@keyframes popIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Confeti */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 65; overflow: hidden; }
.confetti-layer i { position: absolute; top: -30px; display: block; border-radius: 2px; animation: confettiFall linear forwards; }
@keyframes confettiFall { to { transform: translateY(112vh) rotate(var(--rx)); opacity: .85; } }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
    .stage { gap: 14px; }
    .join-box { padding: 18px; }
    .join-qr { display: none; }
    .ctl { right: 8px; bottom: 8px; }
}
@media (min-width: 701px) and (max-width: 1100px) {
    .join-qr #qr { min-width: 110px; min-height: 110px; }
}

/* ---------- Chatbot ALG Bot ---------- */
.chat-fab {
    position: fixed; left: 16px; bottom: 16px; z-index: 80;
    width: 56px; height: 56px; border-radius: 50%;
    border: 1px solid var(--line);
    background: linear-gradient(160deg, #1b2148, #141833);
    font-size: 1.5rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.chat-panel {
    position: fixed; left: 16px; bottom: 84px; z-index: 80;
    width: min(360px, calc(100vw - 32px)); max-height: min(62vh, 540px);
    display: flex; flex-direction: column;
    background: rgba(21, 26, 54, .97); border: 1px solid var(--line);
    border-radius: 18px; overflow: hidden; backdrop-filter: blur(8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.chat-head {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 800;
}
.chat-sub { color: var(--muted); font-weight: 500; font-size: .8rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-close { background: transparent; border: none; font-size: 1rem; color: var(--muted); }
.chat-close:hover { color: var(--text); }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: .95rem; line-height: 1.35; white-space: pre-wrap; }
.chat-msg.user { align-self: flex-end; background: var(--accent); color: #fff; }
.chat-msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); }
.chat-msg.typing { opacity: .65; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; background: #141833; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--text); min-width: 0; }
.chat-form button { width: 46px; border: none; border-radius: 12px; background: var(--grad); color: #0b0e1a; font-weight: 900; font-size: 1.1rem; }

/* ---------- Juegos v2 ---------- */
.gstage { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.gstage-top { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 700; }
.chip.warn { color: var(--amber); border-color: rgba(251, 191, 36, .4); }
.quiz-question { font-size: clamp(20px, 3.4vmin, 40px); font-weight: 800; text-align: center; line-height: 1.25; min-height: 1.6em; display: flex; align-items: center; justify-content: center; }
.quiz-emojis { font-size: clamp(40px, 9vmin, 110px); text-align: center; line-height: 1.2; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 1000px; margin: 0 auto; }
.qopt { display: flex; align-items: center; gap: 12px; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 14px 18px; font-weight: 700; font-size: clamp(14px, 2vmin, 24px); transition: transform .15s; }
.qopt .qletter { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; flex: 0 0 auto; color: #0b0e1a; }
.qopt .qtext { flex: 1; }
.qopt .qcount { font-weight: 900; color: var(--muted); }
.qopt:nth-child(1) .qletter { background: #ef4444; }
.qopt:nth-child(2) .qletter { background: #3b82f6; }
.qopt:nth-child(3) .qletter { background: #f59e0b; }
.qopt:nth-child(4) .qletter { background: #10b981; }
.qopt.correct { border-color: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .25); }
.qopt.dim { opacity: .45; }
.quiz-scores { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.score-chip { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: clamp(12px, 1.7vmin, 18px); }
.ml-results { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 800px; margin: 0 auto; }
.ml-row { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.ml-name { flex: 0 0 min(180px, 32%); }
.ml-bar { flex: 1; height: 26px; background: rgba(255, 255, 255, .06); border-radius: 999px; overflow: hidden; }
.ml-bar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .5s; }
.ml-row.top .ml-bar i { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.ml-count { width: 2.5ch; text-align: right; }
.wheel-title { font-size: clamp(22px, 4vmin, 48px); font-weight: 900; text-align: center; }
.wheel-names { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.wname { background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 10px 20px; font-weight: 800; font-size: clamp(14px, 2.2vmin, 24px); transition: transform .1s; }
.wname.active { border-color: var(--amber); box-shadow: 0 0 20px rgba(251, 191, 36, .35); transform: scale(1.06); }
.wname.landed { background: var(--grad); color: #0b0e1a; border-color: transparent; animation: popIn .4s; }
.wheel-result { text-align: center; }
.win-challenge { font-size: clamp(18px, 3vmin, 34px); font-weight: 800; margin-top: 8px; max-width: 900px; margin-left: auto; margin-right: auto; }
.podium-row { font-size: clamp(20px, 3.2vmin, 40px); font-weight: 800; margin: 8px 0; }
.podium-row b { color: var(--amber); }
.quiz-question-sm { font-weight: 800; font-size: 1.05rem; text-align: center; min-height: 1.4em; }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ans { display: flex; align-items: center; gap: 10px; padding: 14px 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--text); font-weight: 700; font-size: .95rem; text-align: left; }
.ans b { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; color: #0b0e1a; }
.ans.a b { background: #ef4444; }
.ans.b b { background: #3b82f6; }
.ans.c b { background: #f59e0b; }
.ans.d b { background: #10b981; }
.ans.chosen { border-color: var(--accent); }
.ans.correct { border-color: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .25); }
.ans.wrong { border-color: #f87171; opacity: .85; }
.ans.dim { opacity: .45; }
.ans:disabled { cursor: default; }
.quiz-feedback { text-align: center; font-weight: 700; min-height: 1.4em; }
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.vote { padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--text); font-weight: 800; font-size: 1rem; }
.vote.chosen { border-color: var(--accent); background: rgba(139, 92, 246, .25); }

/* ---------- v3: categorías y Basta / Stop ---------- */
.cat-area { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cat-title { font-size: .85rem; color: var(--muted); width: 100%; }
.catchip { border: 2px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: .9rem; }
.catchip.sel { border-color: var(--accent); background: rgba(139, 92, 246, .25); }
.basta-letter { font-size: clamp(70px, 18vmin, 200px); font-weight: 900; text-align: center; line-height: 1.1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.basta-cats { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.basta-cat { background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 8px 18px; font-weight: 800; font-size: clamp(13px, 1.9vmin, 20px); }
.basta-stopped { text-align: center; font-weight: 900; font-size: clamp(18px, 3vmin, 34px); animation: popIn .4s; }
.basta-table { width: 100%; overflow-x: auto; }
.basta-tbl { width: 100%; border-collapse: collapse; font-weight: 700; }
.basta-tbl th, .basta-tbl td { border: 1px solid var(--line); padding: 6px 10px; font-size: clamp(11px, 1.6vmin, 17px); text-align: center; }
.basta-tbl td.ok { color: #34d399; }
.basta-tbl td.half { color: #fbbf24; }
.basta-tbl td.bad { color: #f87171; opacity: .85; }
.basta-tbl td.tot { background: rgba(255, 255, 255, .06); font-weight: 900; }
.basta-grid { display: flex; flex-direction: column; gap: 8px; }
.basta-item { display: flex; align-items: center; gap: 10px; }
.basta-item span { flex: 0 0 86px; font-weight: 800; font-size: .9rem; }
.basta-item input { flex: 1; padding: 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--text); font-size: 1rem; font-weight: 700; }
.basta-item input:disabled { opacity: .55; }
.basta-reveal { display: flex; flex-direction: column; gap: 6px; }
.basta-reveal-title { text-align: center; font-weight: 900; }
.basta-row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.basta-row b { flex: 0 0 86px; font-size: .85rem; }
.basta-row span { flex: 1; font-weight: 700; }
.basta-row i { font-style: normal; font-weight: 900; color: var(--amber); }

/* ---------- v5: El Impostor y Lotería ---------- */
.impostor-title { font-size: clamp(20px, 3.6vmin, 44px); font-weight: 900; text-align: center; min-height: 1.4em; }
.impostor-order { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.imp-turn { background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 10px 20px; font-weight: 800; font-size: clamp(14px, 2.2vmin, 24px); }
.imp-card { background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 20px; text-align: center; }
.imp-card.impostor { border-color: #ef4444; background: rgba(239, 68, 68, .14); }
.imp-role { font-weight: 900; font-size: 1.05rem; letter-spacing: .4px; }
.imp-word { font-size: clamp(26px, 6vmin, 52px); font-weight: 900; margin: 8px 0; }
.imp-hint { color: var(--muted); font-size: .9rem; }
.imp-line { text-align: center; font-weight: 700; }
.loto-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 430px; margin: 0 auto; }
.loto-cell { aspect-ratio: 1; display: grid; place-items: center; font-size: clamp(24px, 7vmin, 42px); background: var(--card); border: 2px solid var(--line); border-radius: 14px; transition: transform .15s, background .2s; }
.loto-cell.marked { background: var(--grad); border-color: transparent; transform: scale(.95); }
.loto-card { text-align: center; }
.loto-card #lotoEmoji { font-size: clamp(80px, 20vmin, 200px); line-height: 1.1; display: block; }
.loto-card #lotoName { font-size: clamp(24px, 4.6vmin, 52px); font-weight: 900; }
.loto-card.pop { animation: popIn .4s; }
.hball.loto { font-size: 1.35rem; }
