/**
 * smgr/css/pages/trivial.css — estilos del mini-juego "Trivial ACB" portado
 * al chrome "Foco". Mismo recipe que masomenos.css / j340.css:
 *   · El bloque :root con las variables --trivia-* queda SIN scope (custom props
 *     globales inofensivas; el juego las necesita, y las usa hasta el toast que
 *     se anexa a document.body).
 *   · body { background } del original pasa a .game-scope { background } para que
 *     el fondo del juego cubra solo el área de juego, no toda la página.
 *   · TODO el resto de selectores va prefijado con ".game-scope " para aislar el
 *     juego de rincon.css y viceversa. Excepciones dejadas SIN scope:
 *       - .share-toast(.show): el JS lo crea y lo anexa a document.body (fuera
 *         de .game-scope), así que debe seguir estilándose global.
 *       - body.is-mobile ...: la clase is-mobile se añade a <body>; se reescribe
 *         a "body.is-mobile .game-scope ..." para conservar el ancestro.
 *   · @keyframes intactos (sus selectores 0%/50%/… no se prefijan).
 *   · Reset de aislamiento arriba (img/button) para neutralizar rincon.css.
 *   · Se elimina la regla .logo-main del original (chrome del menú antiguo).
 */

/* ===== Variables del juego (globales, sin scope) ===== */
:root {
    --trivia-navy:   #1e3a5f;
    --trivia-navy2:  #2c5282;
    --trivia-orange: #ed8936;
    --trivia-green:  #22c55e;
    --trivia-red:    #ef4444;
    --trivia-gold:   #facc15;
    --trivia-bg:     #f0f4f9;
    --trivia-surface: #ffffff;
    --trivia-border: #e2e8f0;
    --trivia-muted:  #64748b;
    --trivia-ink:    #0f172a;
}

/* ===== Reset de aislamiento (contrarresta rincon.css dentro del juego) ===== */
.game-scope img { max-width: none; }
.game-scope button { font: inherit; }

/* Fondo del juego (antes en body). Solo cubre el área de juego. */
.game-scope { background: var(--trivia-bg); }

.game-scope #trivia-app {
    max-width: 960px; margin: 24px auto 32px; padding: 0 14px;
    font-family: Roboto, sans-serif;
}
.game-scope .trivia-card {
    background: var(--trivia-surface); border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    padding: 28px;
}

/* ================== Landing ================== */
.game-scope .trivia-landing {
    text-align: center; padding: 0; overflow: hidden;
    border-radius: 14px; background: var(--trivia-surface);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}
.game-scope .trivia-landing-hero {
    background: linear-gradient(135deg, var(--trivia-navy) 0%, var(--trivia-navy2) 100%);
    color: white; padding: 36px 30px 30px; text-align: center; position: relative;
}
.game-scope .trivia-landing-hero::after {
    content: ''; position: absolute; right: -60px; top: -60px;
    width: 200px; height: 200px; border-radius: 50%;
    background: radial-gradient(circle, rgba(237, 137, 54, 0.22) 0%, transparent 70%);
    pointer-events: none;
}
.game-scope .trivia-landing-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 6px;
    font-weight: 700; letter-spacing: -0.02em; color: white;
}
/* Trivial ACB lockup — mark as inline SVG, wordmark as HTML text so
   html2canvas can render Space Grotesk correctly (SVG <text> + web fonts
   is unreliable in html2canvas; HTML text with CSS font-family works). */
.game-scope .tm-lockup {
    display: inline-flex; align-items: center; gap: 0.18em;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 700; letter-spacing: -0.03em; line-height: 1;
    font-size: 48px; /* per-context overrides below */
}
.game-scope .tm-lockup-mark {
    display: inline-block; width: 1.8em; height: 1.3em; flex-shrink: 0;
}
.game-scope .tm-lockup-mark svg { display: block; width: 100%; height: 100%; }
.game-scope .tm-lockup-word { display: inline-flex; align-items: baseline; gap: 0.14em; }
.game-scope .tm-lockup-trivial { color: #fff; }
.game-scope .tm-lockup-acb { color: var(--trivia-orange); letter-spacing: -0.01em; }

.game-scope .trivia-landing-hero .tm-lockup { font-size: clamp(36px, 5.2vw, 52px); margin-bottom: 10px; }
.game-scope .tm-lockup-share { font-size: 40px; }
.game-scope .trivia-landing-hero h1 .fa-basketball-ball,
.game-scope .trivia-landing-hero h1 .fa-flask { color: var(--trivia-orange); margin-right: 8px; }
.game-scope .trivia-landing-hero .subtitle {
    color: rgba(255, 255, 255, 0.8); font-size: 15px;
    margin: 0 auto; max-width: 540px;
}
.game-scope .trivia-landing-body { padding: 24px 28px 28px; }

.game-scope .rules-pills {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
    margin: 4px 0 22px;
}
.game-scope .rule-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; background: #f1f5f9; border: 1px solid var(--trivia-border);
    border-radius: 10px; font-size: 13.5px; color: #334155;
}
.game-scope .rule-pill i { color: var(--trivia-navy2); font-size: 14px; }
.game-scope .rule-pill .hl-green { color: #15803d; font-weight: 600; }
.game-scope .rule-pill .hl-red   { color: #b91c1c; font-weight: 600; }
.game-scope .rule-pill .hl-orange{ color: #c2410c; font-weight: 600; }

.game-scope .btn-start {
    font-size: 18px; font-weight: 600; padding: 14px 38px;
    background: linear-gradient(135deg, var(--trivia-navy2) 0%, var(--trivia-navy) 100%);
    color: white; border: none; border-radius: 10px; cursor: pointer;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
    transition: transform .15s, box-shadow .15s;
}
.game-scope .btn-start:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(30, 58, 95, 0.35); }
.game-scope .btn-start:active { transform: translateY(0); }
.game-scope .btn-start i { margin-right: 8px; }
.game-scope .guest-note { font-size: 13px; color: var(--trivia-muted); margin-top: 14px; }
.game-scope .guest-note a { color: var(--trivia-navy2); font-weight: 500; }

/* Guest nickname input — lets invitados appear on the leaderboard */
.game-scope .guest-name-block {
    background: #f8fafc; border: 1px solid var(--trivia-border);
    border-radius: 10px; padding: 12px 14px;
    margin: 0 0 16px; text-align: left;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.game-scope .guest-name-block label {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.6px; color: var(--trivia-navy2); margin: 0;
}
.game-scope .guest-name-block input {
    flex: 1; min-width: 160px;
    font-family: inherit; font-size: 15px;
    padding: 8px 12px; border: 1px solid var(--trivia-border);
    border-radius: 8px; background: #fff; color: var(--trivia-ink);
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.game-scope .guest-name-block input:focus {
    border-color: var(--trivia-navy2);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.12);
}
.game-scope .guest-name-block.error input {
    border-color: var(--trivia-red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}
.game-scope .guest-name-hint {
    flex-basis: 100%; font-size: 12px; color: var(--trivia-muted);
    margin-top: 2px;
}
.game-scope .guest-name-block.error .guest-name-hint { color: var(--trivia-red); font-weight: 500; }

/* Guest pill — small chip used in landing top-5 lists */
.game-scope .guest-pill-sm {
    display: inline-block; margin-left: 4px;
    padding: 1px 6px; border-radius: 9px;
    font-size: 10px; font-weight: 600; letter-spacing: 0.3px;
    background: #fef3c7; color: #854d0e;
    vertical-align: 1px;
}

/* ================== Mode picker ================== */
.game-scope .mode-picker {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    margin: 4px 0 8px;
}
.game-scope .mode-card {
    background: #f8fafc; border: 2px solid var(--trivia-border);
    border-radius: 12px; padding: 20px 18px; text-align: left;
    cursor: pointer; font-family: inherit; color: inherit;
    display: flex; flex-direction: column; gap: 12px;
    transition: transform .12s, border-color .12s, box-shadow .12s, background .12s;
}
.game-scope .mode-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 58, 95, 0.12);
}
.game-scope .mode-card.mode-normal:hover { border-color: var(--trivia-navy2); background: #fff; }
.game-scope .mode-card.mode-chill:hover  { border-color: var(--trivia-orange); background: #fff; }
.game-scope .mode-card-header {
    display: flex; align-items: center; gap: 10px; font-weight: 700;
    color: var(--trivia-ink);
}
.game-scope .mode-card-header i {
    font-size: 20px; width: 28px; height: 28px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
}
.game-scope .mode-normal .mode-card-header i { background: #dbeafe; color: var(--trivia-navy2); }
.game-scope .mode-chill  .mode-card-header i { background: #fed7aa; color: #c2410c; }
.game-scope .mode-name { font-size: 17px; letter-spacing: -0.01em; }
.game-scope .mode-tag {
    margin-left: auto; font-size: 11px; font-weight: 600;
    padding: 3px 8px; border-radius: 6px; background: #e2e8f0; color: #475569;
}
.game-scope .mode-desc { font-size: 13.5px; color: #475569; line-height: 1.45; }
.game-scope .mode-rules {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.game-scope .mrule {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; color: #64748b;
    padding: 4px 9px; background: #fff; border: 1px solid var(--trivia-border);
    border-radius: 6px;
}
.game-scope .mrule i { font-size: 11px; color: var(--trivia-navy2); }
.game-scope .mode-chill .mrule i { color: var(--trivia-orange); }
.game-scope .mode-pb {
    font-size: 13px; color: #475569; padding: 6px 10px;
    background: #fff; border-radius: 6px; border: 1px dashed #cbd5e1;
}
.game-scope .mode-pb strong { color: var(--trivia-navy2); font-size: 16px; font-variant-numeric: tabular-nums; }
.game-scope .mode-chill .mode-pb strong { color: #c2410c; }
.game-scope .mode-pb-label { color: var(--trivia-muted); margin-right: 4px; }
.game-scope .mode-pb-meta { color: #94a3b8; margin-left: 6px; font-size: 12px; }
.game-scope .mode-pb-empty { color: #94a3b8; font-style: italic; }
.game-scope .mode-start {
    margin-top: auto; align-self: flex-start;
    font-weight: 600; font-size: 13px; color: var(--trivia-navy2);
    display: inline-flex; align-items: center; gap: 6px;
}
.game-scope .mode-chill .mode-start { color: #c2410c; }
.game-scope .mode-start i { font-size: 11px; }
.game-scope .mode-card:hover .mode-start { text-decoration: underline; }

/* Side cards — one top5 per mode, side-by-side on desktop, stacked on mobile */
.game-scope .landing-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.game-scope .top5-chill h3 i { color: var(--trivia-orange); }
.game-scope .top5-chill .top-list li:nth-child(1) .rank { background: var(--trivia-orange); color: #fff7ed; }
.game-scope .top5-chill .top-list .score { color: #c2410c; }
.game-scope .landing-sides > div {
    background: #f8fafc; border: 1px solid var(--trivia-border);
    border-radius: 10px; padding: 16px 18px; text-align: left;
}
.game-scope .landing-sides h3 {
    font-size: 11px; color: var(--trivia-muted); text-transform: uppercase;
    letter-spacing: 0.8px; margin: 0 0 12px; font-weight: 600;
    display: flex; align-items: center; gap: 6px;
}
.game-scope .landing-sides h3 i { color: var(--trivia-orange); font-size: 12px; }
.game-scope .pb-card .pb-best {
    font-size: 38px; font-weight: 700; color: var(--trivia-navy2);
    line-height: 1; font-variant-numeric: tabular-nums;
}
.game-scope .pb-card .pb-best .pts-unit {
    font-size: 14px; font-weight: 500; color: var(--trivia-muted); margin-left: 4px;
}
.game-scope .pb-card .pb-meta { font-size: 12.5px; color: var(--trivia-muted); margin-top: 8px; }
.game-scope .pb-card .pb-empty { font-size: 13px; color: #94a3b8; }
.game-scope .top-list { margin: 0; padding: 0; list-style: none; }
.game-scope .top-list li {
    display: flex; align-items: center; gap: 10px; padding: 7px 0;
    font-size: 13.5px; border-bottom: 1px dashed #e2e8f0;
}
.game-scope .top-list li:last-child { border-bottom: none; }
.game-scope .top-list .rank {
    width: 24px; height: 24px; border-radius: 50%; background: #e2e8f0;
    color: #64748b; font-weight: 700; font-size: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.game-scope .top-list li:nth-child(1) .rank { background: var(--trivia-gold); color: #78350f; }
.game-scope .top-list li:nth-child(2) .rank { background: #cbd5e1; color: #334155; }
.game-scope .top-list li:nth-child(3) .rank { background: #f59e0b; color: #7c2d12; }
.game-scope .top-list .name { flex: 1; color: var(--trivia-ink); font-weight: 500; }
.game-scope .top-list .score { color: var(--trivia-navy2); font-weight: 700; font-variant-numeric: tabular-nums; }
.game-scope .top-empty { font-size: 13px; color: #94a3b8; }
.game-scope .see-all {
    display: block; text-align: center; font-size: 13px;
    margin-top: 14px; color: var(--trivia-navy2); font-weight: 500;
}

/* ================== Countdown ================== */
.game-scope .trivia-countdown {
    text-align: center; padding: 60px 20px; min-height: 380px;
    display: flex; flex-direction: column; justify-content: center;
    background: linear-gradient(135deg, var(--trivia-navy) 0%, var(--trivia-navy2) 100%);
    color: white; border-radius: 14px;
}
.game-scope .trivia-countdown .num {
    font-size: clamp(5rem, 22vw, 11rem); font-weight: 800; line-height: 1;
    color: white; letter-spacing: -0.04em;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    animation: countdownPop .5s ease-out;
}
.game-scope .trivia-countdown .num.go {
    color: var(--trivia-orange); font-size: clamp(3rem, 13vw, 7rem);
    word-break: break-word; max-width: 100%;
}
@keyframes countdownPop {
    0% { transform: scale(0.6); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}
.game-scope .trivia-countdown .label {
    font-size: 15px; color: rgba(255, 255, 255, 0.75);
    margin-top: 16px; letter-spacing: 0.02em;
}

/* ================== Playing ================== */
.game-scope .trivia-topbar {
    display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px;
    padding: 14px 22px; background: var(--trivia-surface);
    border-radius: 14px; margin-bottom: 16px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.game-scope .trivia-topbar-cell { display: flex; flex-direction: column; justify-content: center; }
.game-scope .trivia-topbar-cell.left   { text-align: left;   align-items: flex-start; }
.game-scope .trivia-topbar-cell.center { text-align: center; align-items: center; }
.game-scope .trivia-topbar-cell.right  { text-align: right;  align-items: flex-end; }
.game-scope .cell-label {
    font-size: 10.5px; color: var(--trivia-muted); text-transform: uppercase;
    letter-spacing: 0.8px; font-weight: 600; line-height: 1;
}
.game-scope .trivia-score {
    font-size: 30px; font-weight: 800; color: var(--trivia-navy2);
    font-variant-numeric: tabular-nums; line-height: 1.1;
    transition: transform .25s cubic-bezier(.5, 1.6, .5, 1);
}
.game-scope .trivia-score .pts-unit { font-size: 14px; font-weight: 500; color: var(--trivia-muted); margin-left: 3px; }
.game-scope .trivia-score.bump { transform: scale(1.3); color: var(--trivia-orange); }
.game-scope .trivia-clock {
    font-size: 32px; font-weight: 800; color: var(--trivia-ink);
    font-variant-numeric: tabular-nums; line-height: 1.1;
    transition: color .2s;
}
.game-scope .trivia-clock.warning { color: var(--trivia-orange); }
.game-scope .trivia-clock.danger  { color: var(--trivia-red); animation: clockPulse .8s infinite; }
@keyframes clockPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.7; transform: scale(1.08); }
}

/* Chill mode bonus flash — floats "+1 pregunta" above the question counter
   when the user gets a 1pt question right (only 1pt earns the extra question). */
.game-scope .bonus-flash {
    position: absolute; top: -24px; left: 50%;
    transform: translateX(-50%);
    font-size: 12px; font-weight: 700;
    color: #c2410c; background: #fff7ed;
    padding: 4px 10px; border-radius: 14px;
    white-space: nowrap; letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.25);
    opacity: 0; pointer-events: none;
}
.game-scope .bonus-flash.show { animation: bonusPop 1.6s ease-out forwards; }
@keyframes bonusPop {
    0%   { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.85); }
    15%  { opacity: 1; transform: translateX(-50%) translateY(-2px) scale(1.15); }
    30%  { transform: translateX(-50%) translateY(-2px) scale(1); }
    75%  { opacity: 1; transform: translateX(-50%) translateY(-10px); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-30px); }
}

/* Chill mode per-question progress bar — sits at the top of the question card.
   Width transitions smoothly via CSS from 100% → 0% over the per-question deadline. */
.game-scope .chill-progress {
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: #e2e8f0; border-radius: 14px 14px 0 0; overflow: hidden;
}
.game-scope .chill-progress-fill {
    height: 100%; width: 100%; background: var(--trivia-orange);
    transition: width 0.1s linear;
}
.game-scope .chill-progress-fill.warning { background: #f59e0b; }
.game-scope .chill-progress-fill.danger  { background: var(--trivia-red); }

.game-scope .trivia-question {
    font-size: clamp(18px, 2.2vw, 22px); font-weight: 500;
    color: var(--trivia-ink); line-height: 1.4; margin: 20px 0 22px;
    min-height: 76px;
}
.game-scope .trivia-point-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: #dbeafe; color: #1e3a8a; padding: 5px 12px;
    border-radius: 14px; font-size: 12px; font-weight: 700;
    margin-bottom: 12px; letter-spacing: 0.02em;
}
.game-scope .trivia-point-badge::before { content: '●'; font-size: 8px; }
.game-scope .trivia-point-badge.pt-1 { background: #dcfce7; color: #166534; }
.game-scope .trivia-point-badge.pt-3 { background: #fef3c7; color: #854d0e; }

.game-scope .trivia-options { display: flex; flex-direction: column; gap: 12px; }
.game-scope .trivia-option {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px; background: var(--trivia-surface);
    border: 2px solid var(--trivia-border); border-radius: 12px;
    font-size: 15.5px; color: var(--trivia-ink);
    cursor: pointer; min-height: 60px; text-align: left;
    transition: all .15s cubic-bezier(.4, 0, .2, 1);
    font-family: inherit;
}
.game-scope .trivia-option:hover:not(:disabled) {
    border-color: var(--trivia-navy2); background: #f1f5f9;
    transform: translateX(2px);
}
.game-scope .trivia-option:disabled { cursor: default; }
.game-scope .trivia-option .letter {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
    background: #f1f5f9; color: var(--trivia-muted);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px;
    transition: all .15s;
}
.game-scope .trivia-option:hover:not(:disabled) .letter {
    background: var(--trivia-navy2); color: white;
}
.game-scope .trivia-option.correct {
    border-color: var(--trivia-green);
    background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
    animation: correctPop .4s cubic-bezier(.5, 1.6, .5, 1);
}
.game-scope .trivia-option.correct .letter { background: var(--trivia-green); color: white; }
.game-scope .trivia-option.incorrect {
    border-color: var(--trivia-red);
    background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%);
    animation: wrongShake .4s;
}
.game-scope .trivia-option.incorrect .letter { background: var(--trivia-red); color: white; }
.game-scope .trivia-option.dim { opacity: 0.45; }
.game-scope .trivia-option.pending {
    animation: optionPending 1.2s ease-in-out infinite;
    border-color: var(--trivia-navy2);
}
@keyframes optionPending {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(44, 82, 130, 0.35); }
    50%      { opacity: 0.85; box-shadow: 0 0 0 6px rgba(44, 82, 130, 0); }
}
/* Recoverable network error notice — appears below options when answer
   submission fails. Non-blocking; user re-taps the option to retry. */
.game-scope .trivia-retry-notice {
    margin-top: 12px; padding: 10px 14px; border-radius: 8px;
    background: #fef3c7; color: #854d0e; font-size: 14px;
    border: 1px solid #fcd34d; display: none;
}
.game-scope .trivia-retry-notice.show { display: block; }
.game-scope .trivia-retry-notice .fa { margin-right: 6px; }
@keyframes correctPop {
    0% { transform: scale(0.98); }
    60% { transform: scale(1.02); }
    100% { transform: scale(1); }
}
@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Feedback flash */
.game-scope .trivia-flash {
    position: absolute; right: 22px; top: 22px;
    font-weight: 800; font-size: 18px;
    padding: 6px 12px; border-radius: 8px;
    opacity: 0; transform: translateY(-4px);
    transition: opacity .2s, transform .2s; pointer-events: none;
}
.game-scope .trivia-flash.show { opacity: 1; transform: translateY(0); }
.game-scope .trivia-flash.good { color: #166534; background: #dcfce7; }
.game-scope .trivia-flash.bad  { color: #b91c1c; background: #fee2e2; }

/* ================== End state ================== */
.game-scope .trivia-end { text-align: center; padding: 36px 28px; }
.game-scope .trivia-end .final-label {
    font-size: 11px; color: var(--trivia-muted); text-transform: uppercase;
    letter-spacing: 1.5px; font-weight: 600;
}
.game-scope .final-mode-badge {
    display: inline-block; margin-left: 8px;
    padding: 2px 8px; border-radius: 6px; font-size: 10px;
    letter-spacing: 0.4px; vertical-align: 1px;
}
.game-scope .final-mode-badge.mode-normal { background: #dbeafe; color: #1e3a8a; }
.game-scope .final-mode-badge.mode-chill  { background: #fed7aa; color: #c2410c; }
.game-scope .trivia-end .final-score {
    font-size: clamp(4rem, 13vw, 7rem); font-weight: 800;
    background: linear-gradient(135deg, var(--trivia-navy2) 0%, var(--trivia-orange) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    line-height: 1; margin: 10px 0 8px; font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
}
.game-scope .trivia-end .stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
    max-width: 520px; margin: 30px auto 20px;
}
.game-scope .trivia-end .stat {
    background: #f8fafc; border: 1px solid var(--trivia-border);
    border-radius: 10px; padding: 14px 10px; text-align: center;
}
.game-scope .trivia-end .stat-num {
    font-size: 26px; font-weight: 800; color: var(--trivia-ink);
    font-variant-numeric: tabular-nums;
}
.game-scope .trivia-end .stat-label {
    font-size: 10.5px; color: var(--trivia-muted); text-transform: uppercase;
    letter-spacing: 0.6px; font-weight: 600; margin-top: 2px;
}
.game-scope .pb-delta {
    margin: 4px auto 16px; font-size: 15px; color: #475569;
    max-width: 480px;
}
.game-scope .pb-delta.new-record {
    color: #166534; font-weight: 700;
    background: #dcfce7; padding: 10px 18px; border-radius: 10px;
    display: inline-block;
}
.game-scope .btn-replay {
    background: linear-gradient(135deg, var(--trivia-navy2) 0%, var(--trivia-navy) 100%);
    color: white; border: none; padding: 12px 28px; border-radius: 10px;
    font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 6px;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.22);
    transition: transform .15s, box-shadow .15s;
}
.game-scope .btn-replay:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(30, 58, 95, 0.32); }
.game-scope .btn-replay i { margin-right: 6px; }

.game-scope .btn-review {
    background: white; color: var(--trivia-navy2); border: 1.5px solid var(--trivia-border);
    padding: 10px 22px; border-radius: 10px; font-size: 14px; font-weight: 500;
    cursor: pointer; margin: 0 8px 6px; transition: all .15s;
}
.game-scope .btn-review:hover { background: #f1f5f9; border-color: var(--trivia-navy2); }
.game-scope .btn-review i { margin-right: 6px; }

/* Session review list */
.game-scope .review-list { text-align: left; margin: 22px auto 0; max-width: 680px; }
.game-scope .review-q {
    background: #f8fafc; border: 1px solid var(--trivia-border);
    border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
    border-left: 4px solid #cbd5e1;
}
.game-scope .review-q.correct { border-left-color: var(--trivia-green); }
.game-scope .review-q.wrong   { border-left-color: var(--trivia-red); }
.game-scope .review-q.skipped { border-left-color: #cbd5e1; }
.game-scope .review-q-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.game-scope .review-q-num { font-weight: 700; color: var(--trivia-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.game-scope .review-q-text { flex: 1 1 200px; color: var(--trivia-ink); font-weight: 500; font-size: 14.5px; line-height: 1.35; }
.game-scope .review-q-score { font-size: 12px; color: var(--trivia-muted); font-weight: 600; flex-shrink: 0; }
.game-scope .review-q-score .ic { margin-right: 4px; }
.game-scope .review-q.correct .review-q-score { color: #166534; }
.game-scope .review-q.wrong   .review-q-score { color: #b91c1c; }
.game-scope .review-opts { list-style: none; padding: 0; margin: 0; }
.game-scope .review-opt {
    display: flex; gap: 10px; align-items: center; padding: 5px 8px;
    font-size: 13.5px; color: #475569; border-radius: 6px; margin: 2px 0;
}
.game-scope .review-opt .letter {
    font-weight: 700; color: #94a3b8; width: 22px; text-align: center; flex-shrink: 0;
}
.game-scope .review-opt .opt-text { flex: 1; }
.game-scope .review-opt .marker {
    font-size: 11px; color: var(--trivia-muted); font-weight: 500; font-style: italic;
}
.game-scope .review-opt.picked-correct { background: #dcfce7; color: #166534; }
.game-scope .review-opt.picked-correct .letter { color: var(--trivia-green); }
.game-scope .review-opt.picked-correct .marker { color: #166534; font-style: normal; }
.game-scope .review-opt.picked-wrong { background: #fee2e2; color: #b91c1c; text-decoration: line-through; }
.game-scope .review-opt.picked-wrong .letter { color: var(--trivia-red); text-decoration: none; }
.game-scope .review-opt.picked-wrong .marker { color: #b91c1c; text-decoration: none; font-style: normal; }
.game-scope .review-opt.correct-not-picked { background: rgba(34, 197, 94, 0.1); color: #166534; }
.game-scope .review-opt.correct-not-picked .letter { color: var(--trivia-green); }
.game-scope .review-opt.correct-not-picked .marker { color: #166534; font-style: normal; }

/* Tag scorecard */
.game-scope .tag-scorecard {
    max-width: 520px; margin: 18px auto 22px; text-align: left;
    background: #f8fafc; border: 1px solid var(--trivia-border);
    border-radius: 12px; padding: 16px 18px;
}
.game-scope .tag-scorecard h4 {
    font-size: 11px; color: var(--trivia-muted); text-transform: uppercase;
    letter-spacing: 0.8px; margin: 0 0 12px; font-weight: 600;
    display: flex; align-items: center; gap: 6px;
}
.game-scope .tag-scorecard h4 i { color: var(--trivia-orange); font-size: 12px; }
.game-scope .tag-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; font-size: 13.5px;
    border-bottom: 1px dashed #e2e8f0;
}
.game-scope .tag-row:last-child { border-bottom: none; }
.game-scope .tag-row .tag-icon {
    width: 22px; color: var(--trivia-navy2); font-size: 14px; text-align: center;
    flex-shrink: 0;
}
.game-scope .tag-row .tag-label {
    color: var(--trivia-ink); font-weight: 500; flex-shrink: 0; min-width: 0;
}
.game-scope .tag-row .tag-bar {
    position: relative; height: 8px; background: #e2e8f0; border-radius: 4px;
    overflow: hidden; flex: 1; min-width: 60px;
}
.game-scope .tag-row .tag-bar-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    background: linear-gradient(90deg, var(--trivia-navy2), var(--trivia-orange));
    border-radius: 4px;
}
.game-scope .tag-row.perfect .tag-bar-fill { background: linear-gradient(90deg, #16a34a, #22c55e); }
.game-scope .tag-row.rough .tag-bar-fill { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.game-scope .tag-row .tag-count {
    font-size: 12px; color: var(--trivia-muted); font-variant-numeric: tabular-nums;
    font-weight: 600; flex-shrink: 0;
}
.game-scope .tag-row .tag-pct {
    font-weight: 700; color: var(--trivia-ink); text-align: right;
    font-variant-numeric: tabular-nums; font-size: 13px;
    flex-shrink: 0; min-width: 38px;
}
@media (max-width: 640px) {
    .game-scope .tag-scorecard { padding: 14px; }
    .game-scope .tag-row { font-size: 12.5px; gap: 8px; }
    .game-scope .tag-row .tag-label { font-size: 12.5px; }
    .game-scope .tag-row .tag-bar { min-width: 40px; }
}

/* Challenge landing hero */
.game-scope .trivia-landing-hero.challenge-mode {
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 55%, #f59e0b 100%);
    padding-top: 28px;
}
.game-scope .challenge-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, 0.2); color: #fff;
    padding: 5px 14px; border-radius: 20px;
    font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
    margin-bottom: 10px;
    backdrop-filter: blur(6px);
}
.game-scope .challenge-badge i { font-size: 11px; }
.game-scope .self-challenge-notice {
    margin-top: 14px; padding: 10px 14px;
    background: rgba(255, 255, 255, 0.16); color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    font-size: 13px; font-weight: 500;
    display: inline-flex; align-items: center; gap: 8px;
}
.game-scope .self-challenge-notice i { color: #fed7aa; }
.game-scope .trivia-landing-hero.challenge-mode h1 {
    font-size: clamp(1.6rem, 4vw, 2.1rem); margin-bottom: 14px;
}
.game-scope .challenge-summary {
    display: inline-flex; align-items: baseline; gap: 4px;
    background: rgba(0, 0, 0, 0.25); padding: 10px 22px; border-radius: 12px;
    margin-bottom: 14px; backdrop-filter: blur(4px);
}
.game-scope .challenge-score {
    font-size: clamp(2.2rem, 6vw, 3rem); font-weight: 800;
    color: #fff; font-variant-numeric: tabular-nums; line-height: 1;
}
.game-scope .challenge-score-unit { font-size: 14px; color: rgba(255,255,255,0.85); font-weight: 500; margin-left: 2px; }
.game-scope .challenge-qcount { font-size: 13px; color: rgba(255,255,255,0.8); margin-left: 10px; }
.game-scope .trivia-landing-hero.challenge-mode::after {
    background: radial-gradient(circle, rgba(254, 240, 138, 0.28) 0%, transparent 70%);
}

/* Challenge result (end screen) */
.game-scope .challenge-result {
    max-width: 520px; margin: 10px auto 18px; padding: 16px 20px;
    border-radius: 12px; text-align: center;
    font-size: 15px; line-height: 1.5;
}
.game-scope .challenge-result.win {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1.5px solid #22c55e; color: #15803d;
}
.game-scope .challenge-result.lose {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1.5px solid #ef4444; color: #b91c1c;
}
.game-scope .challenge-result.tie {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1.5px solid #f59e0b; color: #b45309;
}
.game-scope .challenge-result .verdict {
    font-size: 18px; font-weight: 700; display: block; margin-bottom: 4px;
}
.game-scope .challenge-result .verdict i { margin-right: 6px; }
.game-scope .challenge-result .detail { font-size: 13.5px; }

/* End-screen action buttons */
.game-scope .end-actions {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
    align-items: center; margin-top: 12px;
}
.game-scope .end-actions-secondary {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
    align-items: center; margin-top: 10px;
}
.game-scope .btn-share {
    background: linear-gradient(135deg, var(--trivia-orange) 0%, #c2410c 100%);
    color: white; border: none; padding: 12px 26px; border-radius: 10px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
    transition: transform .15s, box-shadow .15s;
}
.game-scope .btn-share:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(237, 137, 54, 0.42); }
.game-scope .btn-share:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.game-scope .btn-share i { margin-right: 6px; }

/* Share panel — same 5-app row + utility row on desktop and mobile. */
.game-scope .share-panel {
    max-width: 560px; margin: 22px auto 16px; padding: 16px 18px;
    background: #f8fafc; border: 1px solid var(--trivia-border);
    border-radius: 12px;
}
.game-scope .share-panel-label {
    font-size: 11px; color: var(--trivia-muted); text-transform: uppercase;
    letter-spacing: 0.8px; font-weight: 600; margin-bottom: 10px; text-align: center;
}
.game-scope .share-btns {
    display: grid; gap: 8px; align-items: stretch;
}
.game-scope .share-btns.share-apps { grid-template-columns: repeat(5, 1fr); }
.game-scope .share-btns.share-utils { grid-template-columns: repeat(3, 1fr); margin-top: 8px; }
.game-scope .share-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px;
    background: transparent; border: none; outline: none;
    padding: 10px 4px; border-radius: 10px;
    min-height: 70px;
    cursor: pointer;
    font-family: inherit;
    /* Kill the mobile tap-highlight overlay — combined with the near-black
       X/Twitter icon color it otherwise reads as a solid black tile on tap. */
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none; appearance: none;
}
.game-scope .share-btn:focus, .game-scope .share-btn:active { outline: none; background: transparent; }
.game-scope .share-btn i {
    font-size: 22px; color: var(--trivia-navy2); line-height: 1;
    transition: transform .15s, color .15s;
}
.game-scope .share-btn span {
    font-size: 11.5px; font-weight: 600; color: var(--trivia-ink);
    line-height: 1.15; text-align: center;
}
.game-scope .share-btn:hover i { transform: scale(1.15); }
.game-scope .share-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.game-scope .share-btn.busy { pointer-events: none; }
.game-scope .share-btn.busy i { opacity: 0.4; }
/* Brand accents */
.game-scope .share-btn.share-x  i { color: #0f172a; }
.game-scope .share-btn.share-wa i { color: #22c55e; }
.game-scope .share-btn.share-tg i { color: #0088cc; }
.game-scope .share-btn.share-fb i { color: #1877f2; }
.game-scope .share-btn.share-ig i { color: #e1306c; }

/* Desktop vs mobile panels — show one or the other based on userAgent class on <body>.
   is-mobile se añade a <body> (fuera de .game-scope), así que conservamos el
   ancestro body.is-mobile y añadimos .game-scope al descendiente. */
.game-scope .share-panel-mobile { display: none; text-align: center; }
.game-scope .share-panel-mobile .btn-share { width: 100%; max-width: 320px; }
body.is-mobile .game-scope .share-panel-desktop { display: none; }
body.is-mobile .game-scope .share-panel-mobile { display: block; }

/* Mobile tightening */
@media (max-width: 560px) {
    .game-scope .share-panel { padding: 14px 12px; }
    .game-scope .share-btns.share-apps { gap: 6px; }
    .game-scope .share-btns.share-utils { gap: 6px; }
    .game-scope .share-btn { padding: 8px 3px; min-height: 64px; gap: 5px; }
    .game-scope .share-btn i { font-size: 18px; }
    .game-scope .share-btn span { font-size: 11px; }
}
.game-scope .btn-copy-link {
    background: white; color: var(--trivia-navy2); border: 1.5px solid var(--trivia-border);
    padding: 10px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
    cursor: pointer; transition: all .15s;
}
.game-scope .btn-copy-link:hover { background: #f1f5f9; border-color: var(--trivia-navy2); }
.game-scope .btn-copy-link.copied {
    background: #dcfce7; border-color: #22c55e; color: #166534;
}
.game-scope .btn-copy-link i { margin-right: 6px; }

/* Share card (offscreen, rendered at 1200x675, captured by html2canvas) */
.game-scope .share-card {
    position: fixed; top: 0; left: -20000px;
    width: 1200px; height: 675px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #2c5282 100%);
    color: white; font-family: Roboto, sans-serif;
    padding: 52px 60px 46px; box-sizing: border-box;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.game-scope .share-card::before {
    content: ''; position: absolute;
    top: -150px; right: -150px; width: 520px; height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(237, 137, 54, 0.25) 0%, transparent 70%);
    pointer-events: none;
}
.game-scope .share-card-top {
    display: flex; justify-content: space-between; align-items: center;
    position: relative; z-index: 1;
}
.game-scope .share-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.game-scope .share-brand-site {
    font-size: 13.5px; color: rgba(255, 255, 255, 0.55); letter-spacing: 0.02em;
}
.game-scope .share-card-meta { display: flex; align-items: center; gap: 12px; }
.game-scope .share-card-date {
    font-size: 14px; color: rgba(255, 255, 255, 0.55); letter-spacing: 0.04em;
}
.game-scope .share-card-mode {
    padding: 5px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    background: rgba(59, 130, 246, 0.22); color: #bfdbfe;
    border: 1px solid rgba(59, 130, 246, 0.5);
}
.game-scope .share-card-mode.mode-chill {
    background: rgba(237, 137, 54, 0.22); color: #fed7aa;
    border-color: rgba(237, 137, 54, 0.5);
}
.game-scope .share-card-score-wrap {
    position: relative; z-index: 1;
    margin: 14px 0 12px; text-align: center;
}
.game-scope .share-card-label {
    font-size: 13px; color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase; letter-spacing: 2px; font-weight: 600;
}
.game-scope .share-card-score {
    /* Solid color — gradient-text via background-clip doesn't render in html2canvas
       (it draws the full background rect because color:transparent + bg-clip:text isn't
       supported). Drop the gradient, keep the big bold orange. */
    font-size: 130px; font-weight: 800; line-height: 1;
    color: var(--trivia-orange);
    letter-spacing: -0.04em; margin: 4px 0 4px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 4px 30px rgba(237, 137, 54, 0.3);
}
.game-scope .share-card-stats {
    display: flex; justify-content: center; gap: 30px;
    font-size: 19px; color: rgba(255, 255, 255, 0.85); font-weight: 500;
}
.game-scope .share-card-stats i { color: var(--trivia-orange); margin-right: 6px; font-size: 16px; }

.game-scope .share-card-buckets {
    display: flex; flex-direction: column; gap: 5px;
    margin: 4px 20px 0; position: relative; z-index: 1;
}
.game-scope .share-bucket-row {
    display: flex; align-items: center; gap: 14px;
    background: rgba(255, 255, 255, 0.08); border-radius: 8px;
    padding: 6px 16px;
}
.game-scope .share-bucket-row .sb-icon { width: 26px; color: var(--trivia-orange); font-size: 15px; }
.game-scope .share-bucket-row .sb-label { flex: 1; font-size: 15px; font-weight: 500; }
.game-scope .share-bucket-row .sb-count {
    font-size: 13px; color: rgba(255, 255, 255, 0.65); font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.game-scope .share-bucket-row .sb-pct {
    font-size: 15px; font-weight: 700; min-width: 46px; text-align: right;
    font-variant-numeric: tabular-nums;
}

.game-scope .share-card-cta {
    position: relative; z-index: 1; margin-top: auto; text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 12px;
}
.game-scope .share-card-cta-line1 {
    font-size: 22px; font-weight: 700; color: var(--trivia-orange);
    letter-spacing: 0.01em;
}
.game-scope .share-card-cta-line2 {
    font-size: 16px; color: rgba(255, 255, 255, 0.85); font-weight: 500;
    margin-top: 4px; letter-spacing: 0.03em; word-break: break-all;
}

/* Share toast (desktop only — tells user to attach the downloaded PNG).
   El JS lo crea con document.createElement y lo anexa a document.body, FUERA
   de .game-scope: por eso esta regla queda SIN scope. Usa --trivia-ink de :root. */
.share-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--trivia-ink); color: white;
    padding: 12px 20px; border-radius: 10px;
    font-size: 14px; font-weight: 500; font-family: Roboto, sans-serif;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0; pointer-events: none; z-index: 9999;
    transition: opacity .25s, transform .25s;
    max-width: 90vw; text-align: center;
}
.share-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.game-scope .hidden { display: none !important; }

/* ================== Mobile ================== */
@media (max-width: 640px) {
    .game-scope #trivia-app { margin: 14px auto; padding: 0 10px; }
    .game-scope .trivia-card { padding: 20px; border-radius: 12px; }
    .game-scope .trivia-landing-hero { padding: 26px 18px 22px; }
    .game-scope .trivia-landing-body { padding: 18px 18px 22px; }
    .game-scope .landing-sides { grid-template-columns: 1fr; gap: 10px; }
    .game-scope .rule-pill { font-size: 12.5px; padding: 6px 10px; }
    .game-scope .btn-start { font-size: 16px; padding: 12px 28px; width: 100%; max-width: 320px; }
    .game-scope .mode-picker { grid-template-columns: 1fr; gap: 10px; }
    .game-scope .mode-card { padding: 16px 14px; gap: 10px; }
    .game-scope .mode-name { font-size: 16px; }
    .game-scope .mode-desc { font-size: 13px; }
    .game-scope .mrule { font-size: 11.5px; padding: 3px 7px; }
    .game-scope .trivia-topbar { padding: 10px 14px; gap: 8px; border-radius: 12px; }
    .game-scope .trivia-score { font-size: 24px; }
    .game-scope .trivia-score .pts-unit { font-size: 11px; }
    .game-scope .trivia-clock { font-size: 26px; }
    .game-scope .cell-label { font-size: 9.5px; }
    .game-scope .trivia-question { font-size: 16px; min-height: 56px; margin: 14px 0 16px; }
    .game-scope .trivia-option { padding: 12px 14px; font-size: 14.5px; min-height: 54px; }
    .game-scope .trivia-option .letter { width: 28px; height: 28px; font-size: 12px; }
    .game-scope .trivia-countdown { min-height: 280px; padding: 40px 16px; }
    .game-scope .trivia-countdown .label { font-size: 13px; }
    .game-scope .trivia-end { padding: 24px 16px; }
    .game-scope .trivia-end .stat-num { font-size: 22px; }
    .game-scope .trivia-end .stat-label { font-size: 9.5px; }
    .game-scope .trivia-flash { font-size: 15px; right: 14px; top: 14px; padding: 4px 8px; }
}
