/* Utilidades — landing y componentes compartidos */

.utiles-hero {
    padding: 120px 24px 40px;
    position: relative; z-index: 5;
}
.utiles-hero .container { max-width: var(--max); margin: 0 auto; text-align: left; }
.utiles-title {
    font-family: 'Syne', sans-serif;
    font-weight: 800; font-size: clamp(40px, 6vw, 68px);
    line-height: 1.05; letter-spacing: -1px; margin: 14px 0 18px;
    background: linear-gradient(135deg, #fff 0%, #c4d4ff 60%, var(--cyan) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.utiles-sub {
    font-size: 18px; color: var(--text-secondary);
    line-height: 1.7; max-width: 720px; font-weight: 300;
}

.utiles-grid-section { padding: 30px 24px 90px; position: relative; z-index: 5; }
.utiles-grid-section .container { max-width: var(--max); margin: 0 auto; }

.utiles-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
@media (max-width: 980px) { .utiles-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .utiles-grid { grid-template-columns: 1fr; } }

.util-card {
    position: relative; display: flex; flex-direction: column;
    padding: 26px 24px; border-radius: 18px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    transition: all .3s; min-height: 200px;
}
.util-card--active:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 212, 255, .35);
    background: rgba(0, 212, 255, .04);
    box-shadow: 0 14px 40px rgba(0, 212, 255, .12);
}
.util-card--soon { opacity: .55; cursor: default; }

.util-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.util-card-icon { font-size: 34px; line-height: 1; }
.util-card-tag {
    font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
    padding: 4px 10px; border-radius: 999px;
    background: rgba(255, 255, 255, .05); color: var(--text-muted);
    border: 1px solid var(--glass-border); font-weight: 600;
}
.util-card-tag--live {
    color: #10B981; border-color: rgba(16, 185, 129, .3); background: rgba(16, 185, 129, .08);
}
.util-card-tag--diag {
    color: var(--violet); border-color: rgba(167, 78, 250, .35); background: rgba(167, 78, 250, .08);
}
.util-card-title {
    font-family: 'Syne', sans-serif; font-weight: 700; font-size: 20px;
    color: var(--text-primary); margin-bottom: 8px;
}
.util-card-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; flex: 1; margin-bottom: 14px; }
.util-card-cta {
    font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
    color: var(--cyan); font-weight: 600;
}
.util-card--soon .util-card-cta { color: var(--text-muted); }

/* Entrada por código */
.join-card {
    max-width: 540px; margin: 10px auto 0;
    padding: 28px 26px; border-radius: 22px;
    background: linear-gradient(135deg, rgba(0, 212, 255, .06), rgba(167, 78, 250, .06));
    border: 1px solid rgba(0, 212, 255, .25);
    text-align: center;
}
.join-card-label {
    font-size: 14px; letter-spacing: 1px;
    color: var(--text-secondary); font-weight: 600;
    margin-bottom: 14px;
}
.join-form { display: flex; gap: 10px; max-width: 420px; margin: 0 auto; }
.join-input {
    flex: 1; padding: 14px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .06);
    border: 2px solid var(--glass-border);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(24px, 5vw, 34px);
    font-weight: 800; letter-spacing: clamp(4px, 1.5vw, 10px);
    text-align: center; outline: none;
    transition: all .2s; font-variant-numeric: tabular-nums;
    min-width: 0;
}
.join-input::placeholder { color: var(--text-muted); opacity: .4; letter-spacing: clamp(4px, 1.5vw, 10px); }
.join-input:focus { border-color: var(--cyan); background: rgba(0, 212, 255, .08); }
.join-btn {
    padding: 0 22px; border: 0; border-radius: 14px;
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    color: #0a0a14; font-family: 'Syne', sans-serif;
    font-weight: 700; font-size: 14px; letter-spacing: 1.5px;
    text-transform: uppercase; cursor: pointer;
    transition: all .2s; flex-shrink: 0;
}
.join-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 212, 255, .35); }
.join-card-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 14px; line-height: 1.5; }

.join-divider {
    max-width: 540px; margin: 30px auto 18px;
    display: flex; align-items: center; gap: 14px;
    color: var(--text-muted); font-size: 12px;
    letter-spacing: 2px; text-transform: uppercase; font-weight: 600;
}
.join-divider::before,
.join-divider::after {
    content: ''; flex: 1; height: 1px;
    background: var(--glass-border);
}

@media (max-width: 420px) {
    .join-form { flex-direction: column; }
    .join-btn { padding: 12px; }
}

/* Selector de deporte (marcador/index) */
.marcador-sport-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px;
    max-width: 720px; margin: 30px auto 0;
}
@media (max-width: 620px) { .marcador-sport-grid { grid-template-columns: 1fr; } }

.sport-card {
    padding: 36px 24px; border-radius: 20px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    text-align: center; cursor: pointer;
    transition: all .3s;
}
.sport-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 212, 255, .4);
    background: rgba(0, 212, 255, .05);
}
.sport-card-icon { font-size: 64px; line-height: 1; margin-bottom: 14px; }
.sport-card-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 24px; color: var(--text-primary); margin-bottom: 6px; }
.sport-card-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }

/* Formulario crear partido */
.marcador-form-wrap {
    max-width: 560px; margin: 30px auto 0;
    padding: 32px; border-radius: 22px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
}
.marcador-form-wrap h2 {
    font-family: 'Syne', sans-serif; font-weight: 700; font-size: 24px;
    margin-bottom: 22px; color: var(--text-primary);
}

/* Marcador live page */
.marcador-page { padding-top: 90px; padding-bottom: 60px; }
.marcador-bar {
    max-width: 1100px; margin: 0 auto 18px;
    padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.marcador-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px; letter-spacing: 3px;
    padding: 8px 16px; border-radius: 999px;
    background: rgba(255, 255, 255, .05); border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}
.marcador-code strong { color: var(--cyan); margin-left: 6px; }
.marcador-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.marcador-btn {
    padding: 8px 16px; border-radius: 10px;
    background: rgba(255, 255, 255, .05); border: 1px solid var(--glass-border);
    color: var(--text-secondary); font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .25s; display: inline-flex; align-items: center; gap: 6px;
}
.marcador-btn:hover { color: var(--cyan); border-color: rgba(0, 212, 255, .35); background: rgba(0, 212, 255, .05); }
.marcador-btn--primary { background: rgba(16, 185, 129, .12); border-color: rgba(16, 185, 129, .4); color: #10B981; }
.marcador-btn--primary:hover { background: rgba(16, 185, 129, .2); }
.marcador-btn--danger:hover { color: var(--rose); border-color: rgba(251, 113, 133, .35); }

.scoreboard {
    max-width: 1100px; margin: 0 auto; padding: 0 20px;
    display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px;
    align-items: stretch;
}
.scoreboard-team {
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    border-radius: 22px; padding: 28px 24px;
    display: flex; flex-direction: column; align-items: center;
    min-height: 380px; text-align: center;
}
.scoreboard-team[data-team="a"] { border-top: 4px solid #10B981; }
.scoreboard-team[data-team="b"] { border-top: 4px solid #3B82F6; }
.team-name {
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 22px; color: var(--text-primary); margin-bottom: 14px;
    border: 1px dashed transparent; padding: 4px 10px; border-radius: 8px;
    transition: all .2s; min-width: 120px;
}
.is-admin .team-name { cursor: text; }
.is-admin .team-name:hover { border-color: rgba(0, 212, 255, .3); }
.team-score {
    font-family: 'Syne', sans-serif; font-weight: 800;
    font-size: clamp(110px, 16vw, 200px); line-height: 1;
    color: var(--text-primary); margin: auto 0;
    background: linear-gradient(180deg, #fff 0%, #c4d4ff 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    font-variant-numeric: tabular-nums;
}
.team-controls { display: flex; gap: 10px; margin-top: 10px; }
.score-btn {
    width: 56px; height: 56px; border-radius: 14px;
    border: 1px solid var(--glass-border); background: rgba(255, 255, 255, .05);
    color: var(--text-primary); font-size: 28px; font-weight: 700;
    cursor: pointer; transition: all .2s;
    display: inline-flex; align-items: center; justify-content: center;
}
.score-btn:hover { background: rgba(0, 212, 255, .12); border-color: rgba(0, 212, 255, .4); }
.score-btn--plus { background: rgba(16, 185, 129, .12); border-color: rgba(16, 185, 129, .35); color: #10B981; }
.score-btn--plus:hover { background: rgba(16, 185, 129, .25); }
.score-btn--triple { background: rgba(249, 115, 22, .12); border-color: rgba(249, 115, 22, .4); color: #F97316; }
.score-btn--triple:hover { background: rgba(249, 115, 22, .25); }

.team-controls--basquet {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.team-controls--basquet .score-btn {
    width: auto; height: 50px;
    font-size: 16px; border-radius: 12px;
}
@media (max-width: 720px) {
    .team-controls--basquet .score-btn { height: 44px; font-size: 14px; }
}
.team-sets {
    display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; justify-content: center;
    font-size: 13px; color: var(--text-muted);
}
.team-sets-count {
    font-family: 'JetBrains Mono', monospace; font-weight: 700;
    font-size: 22px; color: var(--cyan);
    padding: 4px 14px; border-radius: 8px;
    background: rgba(0, 212, 255, .08); border: 1px solid rgba(0, 212, 255, .3);
}

.scoreboard-center {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; min-width: 140px;
}
.vs-label {
    font-family: 'Syne', sans-serif; font-weight: 800;
    font-size: 34px; color: var(--text-muted); letter-spacing: 3px;
}
.match-clock {
    font-family: 'JetBrains Mono', monospace; font-weight: 700;
    font-size: clamp(36px, 5vw, 56px); color: var(--text-primary);
    padding: 12px 22px; border-radius: 16px;
    background: rgba(0, 212, 255, .06); border: 1px solid rgba(0, 212, 255, .25);
    font-variant-numeric: tabular-nums; min-width: 180px; text-align: center;
    transition: color .25s, border-color .25s, background .25s;
}
.match-clock.is-running { color: #10B981; border-color: rgba(16, 185, 129, .45); }
.match-clock.is-overtime {
    color: #FBBF24;
    border-color: rgba(251, 191, 36, .55);
    background: rgba(251, 191, 36, .08);
    animation: clockOvertime 1.4s ease-in-out infinite;
}
@keyframes clockOvertime {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
    50%      { box-shadow: 0 0 30px 4px rgba(251, 191, 36, .35); }
}

.period-badge {
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
    padding: 6px 16px; border-radius: 999px;
    background: rgba(0, 212, 255, .08);
    border: 1px solid rgba(0, 212, 255, .35);
    color: var(--cyan);
}
.period-badge[data-period="2"] {
    background: rgba(167, 78, 250, .08);
    border-color: rgba(167, 78, 250, .4);
    color: var(--violet);
}
.period-target {
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    letter-spacing: 1.5px; color: var(--text-muted); font-weight: 500;
}
.period-target strong { color: var(--text-secondary); font-weight: 700; }
.clock-controls { display: flex; gap: 8px; }
.match-set-label {
    font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--text-muted); font-weight: 600;
}

@media (max-width: 720px) {
    .scoreboard { grid-template-columns: 1fr; gap: 14px; }
    .scoreboard-center { order: 3; min-height: auto; }
    .scoreboard-team { min-height: 280px; padding: 20px 16px; }
}

.viewer-banner {
    max-width: 1100px; margin: 0 auto 16px;
    padding: 12px 20px; border-radius: 12px;
    background: rgba(0, 212, 255, .06); border: 1px solid rgba(0, 212, 255, .25);
    color: var(--text-secondary); font-size: 13px; text-align: center;
}

/* Winner banner + team states */
.match-winner-banner {
    max-width: 1100px; margin: 0 auto 18px;
    padding: 14px 22px; border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 215, 0, .14), rgba(249, 115, 22, .12));
    border: 1px solid rgba(255, 215, 0, .4);
    display: flex; align-items: center; gap: 18px;
    box-shadow: 0 8px 28px rgba(255, 215, 0, .12);
    animation: winnerBannerIn .5s ease-out;
}
@keyframes winnerBannerIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.match-winner-banner-icon { font-size: 36px; line-height: 1; flex-shrink: 0; }
.match-winner-banner-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.match-winner-banner-label {
    font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
    color: #FCD34D; font-weight: 700;
}
.match-winner-banner-result {
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 16px; color: var(--text-primary);
}
.match-winner-banner-result strong {
    background: linear-gradient(135deg, #FFD700, #F97316);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    font-weight: 800;
}
.match-winner-banner-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px; color: var(--text-muted);
    letter-spacing: .5px; margin-top: 2px;
}

/* Finish reason modal */
.finish-reasons {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    margin-top: 8px;
}
@media (max-width: 460px) { .finish-reasons { grid-template-columns: 1fr; } }
.finish-reason-btn {
    padding: 12px 14px; border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    color: var(--text-primary); font-size: 14px;
    cursor: pointer; transition: all .2s;
    text-align: left; font-family: inherit;
    line-height: 1.4;
}
.finish-reason-btn:hover {
    border-color: rgba(0, 212, 255, .35);
    background: rgba(0, 212, 255, .05);
}
.finish-reason-btn.is-selected {
    border-color: var(--cyan); background: rgba(0, 212, 255, .12);
    color: var(--cyan); font-weight: 600;
}
.finish-reason-input {
    width: 100%; margin-top: 10px;
    padding: 12px 16px; border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--glass-border);
    color: var(--text-primary); font-family: inherit;
    font-size: 14px; outline: none;
}
.finish-reason-input:focus { border-color: var(--cyan); }

.scoreboard-team.is-team-winner {
    border-top-color: #FCD34D !important;
    box-shadow: 0 0 60px rgba(255, 215, 0, .25), inset 0 0 0 1px rgba(255, 215, 0, .3);
    background: rgba(255, 215, 0, .04);
    position: relative;
}
.scoreboard-team.is-team-winner::before {
    content: '🏆';
    position: absolute; top: -12px; right: 16px;
    font-size: 30px; line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(255, 215, 0, .6));
    animation: trophyBounce .8s ease-out;
}
@keyframes trophyBounce {
    0%   { transform: translateY(-20px) rotate(-15deg); opacity: 0; }
    60%  { transform: translateY(4px) rotate(8deg); opacity: 1; }
    100% { transform: translateY(0) rotate(0); opacity: 1; }
}
.scoreboard-team.is-team-winner .team-name {
    color: #FCD34D;
}
.scoreboard-team.is-team-winner .team-score {
    background: linear-gradient(135deg, #FFD700 0%, #F97316 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.scoreboard-team.is-team-loser { opacity: .55; }
.scoreboard-team.is-team-loser .team-name,
.scoreboard-team.is-team-loser .team-score { filter: grayscale(.5); }

body.is-match-finished .team-controls,
body.is-match-finished .clock-controls,
body.is-match-finished #btnNextPeriod {
    opacity: .4; pointer-events: none;
}

/* Sets history strip (vóley) */
.sets-history {
    max-width: 1100px; margin: 0 auto 18px; padding: 0 20px;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
}
.sets-history-label {
    font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--text-muted); font-weight: 600;
}
.sets-history-list { display: flex; flex-wrap: wrap; gap: 8px; }
.set-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--glass-border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px; font-weight: 600; color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.set-chip-num {
    font-size: 10px; letter-spacing: 1px; color: var(--text-muted);
    padding: 2px 5px; border-radius: 4px; background: rgba(255, 255, 255, .04);
}
.set-chip-score { padding: 0 2px; }
.set-chip-score.win { color: var(--cyan); font-weight: 800; }
.set-chip-sep { color: var(--text-muted); opacity: .5; }

/* Score pulse animation */
@keyframes scoreBump {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.22); }
    60%  { transform: scale(.97); }
    100% { transform: scale(1); }
}
@keyframes panelFlashA {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); border-color: var(--glass-border); }
    40%      { box-shadow: 0 0 80px 8px rgba(16, 185, 129, .4); border-color: rgba(16, 185, 129, .5); }
}
@keyframes panelFlashB {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); border-color: var(--glass-border); }
    40%      { box-shadow: 0 0 80px 8px rgba(59, 130, 246, .4); border-color: rgba(59, 130, 246, .5); }
}
.team-score.is-pulse-a,
.team-score.is-pulse-b {
    animation: scoreBump 700ms cubic-bezier(.34, 1.56, .64, 1);
}
.scoreboard-team.is-pulse-a { animation: panelFlashA 700ms ease-out; }
.scoreboard-team.is-pulse-b { animation: panelFlashB 700ms ease-out; }

/* ===== Goal / Set celebration overlay ===== */
.goal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    display: none; align-items: center; justify-content: center;
    pointer-events: none;
    overflow: hidden;
}
.goal-overlay.is-active { display: flex; pointer-events: auto; }

.goal-flash {
    position: absolute; inset: 0;
    opacity: 0;
    background: radial-gradient(circle at center, rgba(16, 185, 129, .35) 0%, rgba(10, 10, 20, .85) 70%);
}
.goal-overlay.is-team-b .goal-flash {
    background: radial-gradient(circle at center, rgba(59, 130, 246, .35) 0%, rgba(10, 10, 20, .85) 70%);
}
.goal-overlay.is-active .goal-flash { animation: goalFlash 2.5s ease-out; }

@keyframes goalFlash {
    0%   { opacity: 0; }
    8%   { opacity: 1; }
    85%  { opacity: 1; }
    100% { opacity: 0; }
}

.goal-content {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    text-align: center; padding: 0 20px;
}

.goal-text {
    font-family: 'Syne', sans-serif; font-weight: 800;
    font-size: clamp(74px, 18vw, 220px); line-height: 1;
    letter-spacing: clamp(2px, .8vw, 8px);
    background: linear-gradient(135deg, #FFD700 0%, #FF6B6B 40%, #FFD700 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    text-shadow: 0 0 60px rgba(255, 215, 0, .4);
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, .5));
    opacity: 0; transform: scale(0) rotate(-30deg);
}
.goal-overlay.is-active .goal-text { animation: goalBurst 2.5s cubic-bezier(.34, 1.56, .64, 1); }

@keyframes goalBurst {
    0%   { opacity: 0; transform: scale(0) rotate(-30deg); }
    18%  { opacity: 1; transform: scale(1.25) rotate(8deg); }
    32%  { transform: scale(.92) rotate(-3deg); }
    44%  { transform: scale(1.05) rotate(2deg); }
    58%  { transform: scale(1) rotate(0deg); }
    85%  { opacity: 1; transform: scale(1) rotate(0deg); }
    100% { opacity: 0; transform: scale(.85) translateY(-30px); }
}

.goal-team {
    font-family: 'Syne', sans-serif; font-weight: 800;
    font-size: clamp(22px, 4.5vw, 44px);
    letter-spacing: clamp(4px, 1.2vw, 10px);
    color: #FFFFFF;
    text-shadow: 0 4px 20px rgba(0, 0, 0, .8);
    opacity: 0; transform: translateY(30px);
}
.goal-overlay.is-active .goal-team { animation: goalTeamIn 2.5s ease-out; }

@keyframes goalTeamIn {
    0%   { opacity: 0; transform: translateY(40px); }
    30%  { opacity: 0; transform: translateY(40px); }
    50%  { opacity: 1; transform: translateY(0); }
    85%  { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-15px); }
}

/* Confetti */
.goal-confetti {
    position: absolute; inset: 0; overflow: hidden; z-index: 1;
}
.confetti-piece {
    position: absolute;
    top: -30px;
    border-radius: 2px;
    --rot: 0deg;
    --drift: 0px;
    animation: confettiFall linear forwards;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
@keyframes confettiFall {
    0%   { transform: translate(0, -30px) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--drift), 110vh) rotate(var(--rot)); opacity: .6; }
}

@media (prefers-reduced-motion: reduce) {
    .goal-text, .goal-team, .confetti-piece, .goal-flash {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============== TORNEO ============== */
.torneo-page {
    max-width: 1100px; margin: 0 auto;
    padding: 90px 20px 40px;
}
.torneo-header {
    display: flex; justify-content: space-between; align-items: flex-end; gap: 18px;
    flex-wrap: wrap; margin-bottom: 24px;
    padding-bottom: 20px; border-bottom: 1px solid var(--glass-border);
}
.torneo-head-main { display: flex; flex-direction: column; gap: 10px; }
.torneo-name {
    font-family: 'Syne', sans-serif; font-weight: 800;
    font-size: clamp(26px, 4vw, 38px); line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, var(--cyan) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.torneo-meta {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    font-size: 13px; color: var(--text-muted);
}
.torneo-meta-sport {
    padding: 4px 10px; border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary); font-weight: 500;
}

.torneo-section-title {
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 18px; letter-spacing: 1px;
    text-transform: uppercase; color: var(--text-primary);
    margin: 30px 0 14px;
}
.torneo-section-sub {
    font-weight: 400; color: var(--text-muted); letter-spacing: 0;
    text-transform: none; font-size: 14px;
}

/* Standings table */
.standings-wrap {
    overflow-x: auto;
    border-radius: 18px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
}
.standings {
    width: 100%; border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
.standings thead {
    background: rgba(0, 212, 255, .04);
    border-bottom: 1px solid var(--glass-border);
}
.standings th {
    text-align: center; padding: 14px 10px;
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 11px; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--text-secondary);
}
.standings th.col-pos, .standings td.col-pos { width: 40px; }
.standings th.col-team, .standings td.col-team {
    text-align: left; min-width: 130px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary); font-weight: 600;
}
.standings th.col-pts, .standings td.col-pts {
    color: var(--cyan); font-weight: 800; font-size: 15px;
    border-left: 1px solid var(--glass-border);
}
.standings td {
    text-align: center; padding: 14px 10px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, .03);
}
.standings tr:last-child td { border-bottom: 0; }
.standings tr:hover td { background: rgba(255, 255, 255, .02); }
.standings tr.is-leader td { background: rgba(0, 212, 255, .04); }
.standings tr.is-leader td.col-team { color: var(--cyan); }
.standings tr.is-leader td.col-pos::before { content: '🏆 '; }
.dg-pos { color: #10B981; font-weight: 700; }
.dg-neg { color: #fb7185; font-weight: 700; }

@media (max-width: 640px) {
    .standings { font-size: 12px; }
    .standings th, .standings td { padding: 10px 6px; }
    .standings th.col-team, .standings td.col-team { min-width: 100px; font-size: 13px; }
}

/* Fixture */
.fixture { display: flex; flex-direction: column; gap: 8px; }
.fixture-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    align-items: center; gap: 14px;
    padding: 14px 18px; border-radius: 14px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    transition: all .2s;
}
.fixture-row:hover { border-color: rgba(0, 212, 255, .25); }
.fixture-row.is-played { opacity: .85; }
.fixture-row.is-played:hover { opacity: 1; }
.fixture-team {
    font-family: 'Outfit', sans-serif;
    font-size: 15px; font-weight: 600;
    color: var(--text-primary);
}
.fixture-team--right { text-align: right; }
.fixture-team.is-winner { color: var(--cyan); font-weight: 700; }
.fixture-team.is-loser  { color: var(--text-muted); }
.fixture-vs {
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 12px; letter-spacing: 2px;
    color: var(--text-muted); padding: 0 10px;
}
.fixture-score {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 10px;
    background: rgba(0, 212, 255, .08);
    border: 1px solid rgba(0, 212, 255, .3);
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px; font-weight: 700;
    color: var(--cyan); font-variant-numeric: tabular-nums;
}
.fixture-pending-badge {
    font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--text-muted); font-weight: 600;
    padding: 4px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--glass-border);
}
.fixture-action { padding: 8px 16px; font-size: 12px; }
.fixture-action-group { display: flex; gap: 6px; }

.fixture-live-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; font-size: 12px;
    background: rgba(251, 113, 133, .12);
    border-color: rgba(251, 113, 133, .4);
    color: #fb7185;
    text-decoration: none; font-weight: 700;
}
.fixture-live-btn:hover { background: rgba(251, 113, 133, .2); }
.live-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #fb7185;
    box-shadow: 0 0 0 0 rgba(251, 113, 133, .8);
    animation: livePulse 1.6s ease-out infinite;
}
@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(251, 113, 133, .8); }
    70%  { box-shadow: 0 0 0 8px rgba(251, 113, 133, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0); }
}

.fixture-row.has-live {
    border-color: rgba(251, 113, 133, .3);
    background: rgba(251, 113, 133, .03);
}
.fixture-empty {
    padding: 22px; text-align: center;
    color: var(--text-muted); font-size: 14px;
    background: rgba(255, 255, 255, .02);
    border: 1px dashed var(--glass-border);
    border-radius: 14px;
}

@media (max-width: 600px) {
    .fixture-row { grid-template-columns: 1fr auto 1fr; row-gap: 12px; }
    .fixture-row .fixture-action,
    .fixture-row .fixture-pending-badge { grid-column: 1 / -1; justify-self: center; }
}

/* Score entry modal */
.score-entry {
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: end; gap: 16px;
    padding: 20px 0;
}
.score-entry-team { text-align: center; }
.score-entry-name {
    font-family: 'Outfit', sans-serif;
    font-size: 14px; font-weight: 600;
    color: var(--text-primary); margin-bottom: 10px;
}
.score-entry-input {
    width: 100%; padding: 18px;
    background: rgba(0, 212, 255, .06);
    border: 1px solid rgba(0, 212, 255, .3);
    border-radius: 14px; color: var(--text-primary);
    font-family: 'Syne', sans-serif; font-weight: 800;
    font-size: clamp(36px, 8vw, 56px);
    text-align: center; outline: none;
    font-variant-numeric: tabular-nums;
}
.score-entry-input:focus { border-color: var(--cyan); background: rgba(0, 212, 255, .12); }
.score-entry-sep {
    font-family: 'Syne', sans-serif; font-weight: 800;
    font-size: 24px; color: var(--text-muted);
    padding-bottom: 22px;
}

/* Vóley set entry modal */
.voley-entry { padding: 8px 0 20px; }
.voley-entry-header {
    display: flex; justify-content: space-between; align-items: center;
    gap: 14px; margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}
.voley-team-name {
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 16px; color: var(--text-primary);
    flex: 1; text-align: center;
}
.voley-vs {
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 13px; letter-spacing: 2px;
    color: var(--text-muted);
}

.voley-sets-grid { display: flex; flex-direction: column; gap: 8px; }
.voley-set-row {
    display: grid;
    grid-template-columns: 64px 1fr auto 1fr 28px;
    align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 12px;
    background: rgba(255, 255, 255, .025);
    transition: background .2s;
}
.voley-set-row:focus-within { background: rgba(0, 212, 255, .05); }
.voley-set-label {
    font-size: 12px; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--text-muted);
    font-weight: 600;
}
.voley-set-row input {
    width: 100%; padding: 10px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--glass-border);
    border-radius: 10px; color: var(--text-primary);
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 22px; text-align: center; outline: none;
    font-variant-numeric: tabular-nums;
}
.voley-set-row input:focus {
    border-color: var(--cyan); background: rgba(0, 212, 255, .08);
}
.voley-set-sep { color: var(--text-muted); font-weight: 600; }
.voley-set-winner {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800; font-size: 18px;
    color: transparent; min-width: 24px; text-align: center;
}
.voley-set-winner.is-a { color: #10B981; }
.voley-set-winner.is-b { color: #3B82F6; }

.voley-summary {
    margin-top: 16px; padding: 14px 18px;
    border-radius: 14px;
    background: rgba(0, 212, 255, .06);
    border: 1px solid rgba(0, 212, 255, .3);
    display: flex; flex-direction: column; gap: 6px;
    font-size: 13px; color: var(--text-secondary);
}
.voley-summary strong {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px; color: var(--cyan); font-weight: 800;
}
.voley-summary-hint { font-size: 11px; color: var(--text-muted); }

/* Set detail in played fixture */
.fixture-row.has-sets { grid-template-rows: auto auto; }
.fixture-sets-detail {
    grid-column: 1 / -1;
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 8px 0 0;
    border-top: 1px solid rgba(255,255,255,.04);
    margin-top: 4px;
}
.set-mini {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 8px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px; color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.set-mini-label {
    font-size: 10px; color: var(--text-muted);
    padding: 1px 5px; border-radius: 4px;
    background: rgba(255, 255, 255, .04);
}
.set-mini-score { font-weight: 600; color: var(--text-secondary); }
.set-mini-score.win { color: var(--cyan); font-weight: 800; }
.set-mini-sep { opacity: .4; }

@media (max-width: 540px) {
    .voley-set-row { grid-template-columns: 50px 1fr auto 1fr 20px; gap: 6px; padding: 6px; }
    .voley-set-label { font-size: 10px; }
    .voley-set-row input { font-size: 18px; padding: 8px 4px; }
}

/* Form details (advanced toggle) */
.torneo-advanced {
    margin-top: 12px; padding: 14px; border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
}
.torneo-advanced summary {
    cursor: pointer; font-size: 13px;
    color: var(--text-secondary); font-weight: 600;
    letter-spacing: .5px;
}
.torneo-advanced summary:hover { color: var(--cyan); }
.torneo-advanced[open] summary { color: var(--cyan); margin-bottom: 6px; }

/* Branding footer */
.marcador-branding {
    max-width: 1100px; margin: 30px auto 0; padding: 14px 20px;
    display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
    border-top: 1px solid var(--glass-border);
    font-size: 12px; color: var(--text-muted); letter-spacing: .5px;
}
.marcador-branding .branding-text a {
    color: var(--cyan); font-weight: 700; text-decoration: none;
    letter-spacing: 1px; margin-left: 4px;
}
.marcador-branding .branding-text a:hover { text-decoration: underline; }
.marcador-branding .branding-code {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 2px;
}
.marcador-branding .branding-code strong { color: var(--cyan); font-weight: 800; letter-spacing: 3px; }

/* Big code in share modal */
.share-big-code {
    text-align: center; padding: 22px 16px; margin: 6px 0 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0, 212, 255, .08), rgba(167, 78, 250, .08));
    border: 1px solid rgba(0, 212, 255, .3);
}
.share-big-code-label {
    font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--text-muted); font-weight: 700; margin-bottom: 10px;
}
.share-big-code-value {
    font-family: 'Syne', sans-serif; font-weight: 800;
    font-size: clamp(48px, 11vw, 72px); line-height: 1;
    letter-spacing: clamp(6px, 2vw, 14px);
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    font-variant-numeric: tabular-nums; margin: 0 0 12px;
}
.share-big-code-hint {
    font-size: 12.5px; color: var(--text-secondary); line-height: 1.5;
}
.share-big-code-hint strong { color: var(--text-primary); font-weight: 600; }

/* Fullscreen mode: hide site chrome, focus on scoreboard */
body.is-fs-marcador .header,
body.is-fs-marcador .footer,
body.is-fs-marcador .whatsapp-float,
body.is-fs-marcador .ambient,
body.is-fs-marcador .noise-overlay { display: none !important; }
body.is-fs-marcador { background: var(--bg-1); }
body.is-fs-marcador .marcador-page {
    padding-top: 18px !important;
    padding-bottom: 0 !important;
    min-height: 100vh;
    display: flex; flex-direction: column;
}
body.is-fs-marcador .viewer-banner { display: none; }
body.is-fs-marcador .marcador-bar { padding: 0 18px; margin-bottom: 12px; }
body.is-fs-marcador .marcador-code { display: none; }
body.is-fs-marcador .marcador-bar .marcador-btn-label { display: none; }
body.is-fs-marcador .marcador-bar .marcador-btn { padding: 8px 12px; }
body.is-fs-marcador .marcador-bar { justify-content: flex-end; }
body.is-fs-marcador .scoreboard {
    flex: 1; align-items: stretch;
    padding: 0 18px;
}
body.is-fs-marcador .scoreboard-team { min-height: 0; }
body.is-fs-marcador .team-score { font-size: clamp(140px, 22vw, 280px); }
body.is-fs-marcador .marcador-branding {
    margin: 12px auto 0;
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 10px 18px;
    font-size: 11px;
}

@media (max-width: 720px) {
    .marcador-branding { font-size: 11px; padding: 12px 18px; flex-direction: column; gap: 6px; }
    .marcador-bar .marcador-btn-label { display: none; }
    .marcador-bar .marcador-btn { padding: 8px 12px; }
    .marcador-code { font-size: 13px; padding: 6px 12px; }
}

.share-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .7); z-index: 1000;
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.share-modal-backdrop.open { display: flex; }
.share-modal {
    background: var(--bg-2); border: 1px solid var(--glass-border);
    border-radius: 22px; padding: 32px; max-width: 480px; width: 100%;
}
.share-modal h3 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 22px; margin-bottom: 18px; }
.share-modal-row {
    display: flex; gap: 8px; margin: 14px 0;
}
.share-modal-row input {
    flex: 1; padding: 10px 14px; border-radius: 10px;
    background: rgba(255, 255, 255, .04); border: 1px solid var(--glass-border);
    color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-size: 13px;
}
.share-modal-label { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.share-modal-warn {
    font-size: 13px; color: var(--rose); margin-top: 14px; padding: 10px;
    background: rgba(251, 113, 133, .08); border-radius: 10px; border: 1px solid rgba(251, 113, 133, .2);
}

/* Calculadora IGV */
.igv-card {
    max-width: 560px; margin: 20px auto 0;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    border-radius: 22px; overflow: hidden;
}
.igv-tabs { display: flex; border-bottom: 1px solid var(--glass-border); }
.igv-tab {
    flex: 1; padding: 18px 16px; border: 0; background: transparent;
    color: var(--text-secondary); font-size: 14px; font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase; cursor: pointer;
    transition: all .25s; font-family: inherit;
    border-bottom: 2px solid transparent;
}
.igv-tab:hover { color: var(--text-primary); }
.igv-tab.is-active {
    color: var(--cyan); border-bottom-color: var(--cyan);
    background: rgba(0, 212, 255, .04);
}
.igv-body { padding: 28px 26px 26px; }
.igv-label {
    display: block; font-size: 12px; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--text-muted);
    font-weight: 600; margin-bottom: 10px;
}
.igv-input-wrap {
    position: relative; display: flex; align-items: center;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--glass-border);
    border-radius: 14px; padding: 0 18px;
    transition: all .25s;
}
.igv-input-wrap:focus-within {
    border-color: rgba(0, 212, 255, .5);
    background: rgba(0, 212, 255, .04);
}
.igv-currency {
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 24px; color: var(--text-muted); margin-right: 10px;
}
.igv-amount {
    flex: 1; border: 0; background: transparent;
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: clamp(28px, 5vw, 40px); color: var(--text-primary);
    padding: 18px 0; outline: none; font-variant-numeric: tabular-nums;
    width: 100%;
}
.igv-amount::placeholder { color: var(--text-muted); opacity: .4; }

.igv-rate-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; margin: 18px 0 4px;
    padding: 12px 16px; border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
}
.igv-rate-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.igv-rate-input { display: flex; align-items: center; gap: 6px; }
.igv-rate-input input {
    width: 70px; padding: 6px 10px; border-radius: 8px;
    background: rgba(255, 255, 255, .05); border: 1px solid var(--glass-border);
    color: var(--text-primary); font-family: 'JetBrains Mono', monospace;
    font-size: 14px; font-weight: 600; text-align: right; outline: none;
}
.igv-rate-input input:focus { border-color: rgba(0, 212, 255, .5); }
.igv-rate-input span { color: var(--text-muted); font-weight: 600; }

.igv-result {
    margin-top: 22px; padding: 20px 18px;
    border-radius: 14px;
    background: rgba(0, 212, 255, .04);
    border: 1px solid rgba(0, 212, 255, .2);
}
.igv-result-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; font-size: 15px; color: var(--text-secondary);
}
.igv-result-row strong {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary); font-size: 16px;
    font-variant-numeric: tabular-nums;
}
.igv-result-row--total {
    border-top: 1px solid rgba(0, 212, 255, .25);
    margin-top: 6px; padding-top: 14px;
    font-size: 17px; font-weight: 600;
}
.igv-result-row--total span { color: var(--text-primary); }
.igv-result-row--total strong {
    font-size: 22px; color: var(--cyan);
    background: linear-gradient(135deg, var(--cyan) 0%, var(--violet) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.igv-actions {
    display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap;
}
.igv-actions .marcador-btn { flex: 1; justify-content: center; padding: 12px 16px; }

.igv-tip {
    max-width: 560px; margin: 22px auto 0;
    padding: 16px 20px; border-radius: 14px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    font-size: 13.5px; color: var(--text-secondary); line-height: 1.6;
}
.igv-tip strong { color: var(--text-primary); }

.igv-cta-banner {
    max-width: 560px; margin: 22px auto 0;
    padding: 22px 24px; border-radius: 18px;
    background: linear-gradient(135deg, rgba(16, 185, 129, .08), rgba(0, 212, 255, .08));
    border: 1px solid rgba(16, 185, 129, .25);
    display: flex; align-items: center; gap: 18px;
    transition: all .3s;
}
.igv-cta-banner:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, .45);
    box-shadow: 0 14px 40px rgba(16, 185, 129, .14);
}
.igv-cta-icon {
    font-size: 38px; flex-shrink: 0;
}
.igv-cta-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.igv-cta-text strong { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 16px; color: var(--text-primary); }
.igv-cta-text span { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.igv-cta-arrow { font-size: 26px; color: #10B981; flex-shrink: 0; }

@media (max-width: 520px) {
    .igv-body { padding: 22px 18px; }
    .igv-cta-banner { padding: 18px; gap: 14px; }
    .igv-cta-icon { font-size: 30px; }
}

/* ============== QUIZ ENGINE — diagnósticos ============== */

.quiz-wrap {
    max-width: 720px; margin: 10px auto 0;
}

.quiz-progress {
    height: 4px; border-radius: 999px;
    background: rgba(255, 255, 255, .05);
    overflow: hidden; margin-bottom: 22px;
}
.quiz-progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--cyan), var(--violet));
    transition: width .4s cubic-bezier(.4, 0, .2, 1);
}
.quiz-step-counter {
    font-family: 'JetBrains Mono', monospace; font-size: 12px;
    letter-spacing: 2px; color: var(--text-muted);
    margin-bottom: 14px; text-transform: uppercase; font-weight: 600;
}

.quiz-card {
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    border-radius: 22px; padding: 36px 32px;
    animation: quizFadeIn .35s ease-out;
}
@keyframes quizFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.quiz-question {
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: clamp(22px, 3vw, 28px); color: var(--text-primary);
    line-height: 1.35; margin-bottom: 24px;
}

.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px; border-radius: 14px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    color: var(--text-primary); font-size: 15px; line-height: 1.4;
    cursor: pointer; transition: all .2s; text-align: left;
    font-family: inherit; width: 100%;
}
.quiz-option:hover {
    border-color: rgba(0, 212, 255, .4);
    background: rgba(0, 212, 255, .05);
    transform: translateX(2px);
}
.quiz-option.is-selected {
    border-color: var(--cyan);
    background: rgba(0, 212, 255, .1);
}
.quiz-option-bullet {
    width: 24px; height: 24px; border-radius: 50%;
    border: 2px solid var(--glass-border);
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--text-muted);
    transition: all .2s;
}
.quiz-option:hover .quiz-option-bullet { border-color: var(--cyan); color: var(--cyan); }
.quiz-option.is-selected .quiz-option-bullet {
    border-color: var(--cyan); background: var(--cyan); color: #0a0a14;
}
.quiz-option-icon { font-size: 24px; line-height: 1; flex-shrink: 0; }
.quiz-option-text { flex: 1; }
.quiz-option-text strong { display: block; font-weight: 600; }
.quiz-option-text span { display: block; font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

.quiz-nav {
    display: flex; justify-content: space-between; gap: 12px;
    margin-top: 26px; padding-top: 22px;
    border-top: 1px solid var(--glass-border);
}
.quiz-nav .marcador-btn { padding: 12px 24px; }
.quiz-nav .quiz-btn-spacer { flex: 1; }

/* Inputs for numeric quizzes (perdida-facturacion) */
.quiz-field { margin-bottom: 22px; }
.quiz-field-label {
    display: block; font-size: 14px; color: var(--text-secondary);
    margin-bottom: 8px; font-weight: 500;
}
.quiz-field-input {
    display: flex; align-items: center;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--glass-border);
    border-radius: 12px; padding: 0 16px;
    transition: all .25s;
}
.quiz-field-input:focus-within {
    border-color: rgba(0, 212, 255, .5);
    background: rgba(0, 212, 255, .04);
}
.quiz-field-input span {
    color: var(--text-muted); font-weight: 600;
    font-family: 'Syne', sans-serif; font-size: 18px;
}
.quiz-field-input input {
    flex: 1; border: 0; background: transparent;
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 22px; color: var(--text-primary);
    padding: 14px 0 14px 8px; outline: none;
    font-variant-numeric: tabular-nums; width: 100%;
}
.quiz-field-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* Slider */
.quiz-slider-row { display: flex; align-items: center; gap: 14px; }
.quiz-slider-row input[type="range"] {
    flex: 1; -webkit-appearance: none; appearance: none;
    height: 6px; border-radius: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--violet));
    outline: none;
}
.quiz-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 22px; height: 22px; border-radius: 50%;
    background: #fff; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 212, 255, .4);
}
.quiz-slider-value {
    min-width: 60px; text-align: right;
    font-family: 'JetBrains Mono', monospace; font-weight: 700;
    font-size: 18px; color: var(--cyan);
}

/* Result screen */
.quiz-result {
    background: linear-gradient(135deg, rgba(0, 212, 255, .06), rgba(167, 78, 250, .06));
    border: 1px solid rgba(0, 212, 255, .25);
    border-radius: 22px; padding: 36px 32px;
    text-align: center;
}
.quiz-result-icon {
    font-size: 64px; line-height: 1; margin-bottom: 14px;
}
.quiz-result-tier {
    font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
    color: var(--cyan); font-weight: 700; margin-bottom: 10px;
}
.quiz-result-title {
    font-family: 'Syne', sans-serif; font-weight: 800;
    font-size: clamp(28px, 4vw, 40px); color: var(--text-primary);
    line-height: 1.15; margin-bottom: 14px;
    background: linear-gradient(135deg, #fff 0%, var(--cyan) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.quiz-result-score {
    font-family: 'Syne', sans-serif; font-weight: 800;
    font-size: clamp(60px, 9vw, 96px); line-height: 1;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--violet) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    margin: 10px 0 20px; font-variant-numeric: tabular-nums;
}
.quiz-result-desc {
    color: var(--text-secondary); font-size: 16px; line-height: 1.7;
    max-width: 540px; margin: 0 auto 24px;
}

.quiz-checklist {
    text-align: left; max-width: 540px; margin: 22px auto 0;
    display: flex; flex-direction: column; gap: 8px;
}
.quiz-checklist-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 16px; border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    font-size: 14px; color: var(--text-secondary); line-height: 1.5;
}
.quiz-checklist-item-icon { font-size: 18px; line-height: 1.2; flex-shrink: 0; }
.quiz-checklist-item.is-ok { border-color: rgba(16, 185, 129, .3); background: rgba(16, 185, 129, .05); }
.quiz-checklist-item.is-pending { border-color: rgba(251, 191, 36, .25); background: rgba(251, 191, 36, .04); }

/* CTA card on result */
.quiz-cta-product {
    margin-top: 26px; padding: 26px 24px;
    border-radius: 18px; text-align: left;
    background: linear-gradient(135deg, rgba(16, 185, 129, .1), rgba(0, 212, 255, .1));
    border: 1px solid rgba(16, 185, 129, .3);
    display: flex; align-items: center; gap: 20px;
    transition: all .3s;
}
.quiz-cta-product:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, .5);
    box-shadow: 0 14px 40px rgba(16, 185, 129, .16);
}
.quiz-cta-product-icon {
    width: 64px; height: 64px; border-radius: 16px;
    background: rgba(255, 255, 255, .08);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 32px; flex-shrink: 0;
}
.quiz-cta-product-text { flex: 1; }
.quiz-cta-product-text .label {
    font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
    color: #10B981; font-weight: 700; margin-bottom: 4px;
}
.quiz-cta-product-text h4 {
    font-family: 'Syne', sans-serif; font-weight: 700; font-size: 20px;
    color: var(--text-primary); margin-bottom: 6px;
}
.quiz-cta-product-text p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.quiz-cta-product-arrow { font-size: 28px; color: #10B981; flex-shrink: 0; }

.quiz-result-actions {
    margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}

/* Big stat result (for perdida-facturacion) */
.quiz-stat-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    margin-top: 26px;
}
@media (max-width: 540px) { .quiz-stat-grid { grid-template-columns: 1fr; } }
.quiz-stat {
    padding: 22px 20px; border-radius: 16px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    text-align: left;
}
.quiz-stat-label { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.quiz-stat-value {
    font-family: 'Syne', sans-serif; font-weight: 800;
    font-size: clamp(26px, 4vw, 36px);
    background: linear-gradient(135deg, var(--cyan) 0%, var(--violet) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    font-variant-numeric: tabular-nums; line-height: 1.1;
}
.quiz-stat-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.quiz-stat--alert {
    background: rgba(251, 113, 133, .06);
    border-color: rgba(251, 113, 133, .25);
}
.quiz-stat--alert .quiz-stat-value {
    background: linear-gradient(135deg, var(--rose) 0%, #f97316 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

@media (max-width: 600px) {
    .quiz-card, .quiz-result { padding: 24px 20px; }
    .quiz-option { padding: 14px; gap: 10px; }
    .quiz-cta-product { flex-direction: column; text-align: center; }
    .quiz-cta-product-arrow { display: none; }
}

/* ============== TELEPROMPTER ============== */

/* --- Editor --- */
.tp-card {
    max-width: 680px; margin: 20px auto 0;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    border-radius: 22px; padding: 28px 26px;
}
.tp-script-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 10px;
}
.tp-script-head .igv-label { margin-bottom: 0; }
.tp-import-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 10px;
    background: rgba(0, 212, 255, .06);
    border: 1px solid rgba(0, 212, 255, .25);
    color: var(--cyan); font-size: 12.5px; font-weight: 600;
    cursor: pointer; transition: all .2s; font-family: inherit;
}
.tp-import-btn:hover { background: rgba(0, 212, 255, .14); border-color: rgba(0, 212, 255, .5); }
.tp-textarea {
    width: 100%; min-height: 200px; resize: vertical;
    padding: 16px 18px; border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif; font-size: 15px; line-height: 1.7;
    outline: none; transition: border-color .25s, background .25s;
}
.tp-textarea:focus { border-color: rgba(0, 212, 255, .5); background: rgba(0, 212, 255, .04); }
.tp-textarea::placeholder { color: var(--text-muted); }
.tp-textarea--err { border-color: var(--rose); animation: tpShake .4s; }
.tp-textarea--drag {
    border-color: var(--cyan); border-style: dashed;
    background: rgba(0, 212, 255, .08);
}
@keyframes tpShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}
.tp-textarea-meta {
    display: flex; justify-content: space-between; gap: 12px;
    margin-top: 8px; font-size: 12px; color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace; letter-spacing: .5px;
}

.tp-settings {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
    margin-top: 22px;
}
@media (max-width: 560px) { .tp-settings { grid-template-columns: 1fr; gap: 14px; } }
.tp-setting-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 8px; font-size: 13px; color: var(--text-secondary);
}
.tp-setting-head strong {
    font-family: 'JetBrains Mono', monospace; font-size: 14px;
    color: var(--cyan); font-weight: 700;
}
.tp-setting input[type="range"] {
    width: 100%; -webkit-appearance: none; appearance: none;
    height: 6px; border-radius: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--violet));
    outline: none;
}
.tp-setting input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px; border-radius: 50%;
    background: #fff; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 212, 255, .4);
}
.tp-setting input[type="range"]::-moz-range-thumb {
    width: 20px; height: 20px; border: 0; border-radius: 50%;
    background: #fff; cursor: pointer;
}

.tp-toggles {
    display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px;
}
.tp-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary); font-size: 14px;
    cursor: pointer; transition: all .2s; user-select: none;
}
.tp-toggle:hover { border-color: rgba(0, 212, 255, .35); color: var(--text-primary); }
.tp-toggle input { accent-color: var(--cyan); width: 16px; height: 16px; cursor: pointer; }
.tp-toggle-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 10px; line-height: 1.5; }

.tp-start-btn {
    width: 100%; margin-top: 24px; padding: 16px;
    font-size: 15px;
}

/* --- Stage (running teleprompter) --- */
body.is-tp-running { overflow: hidden; }
body.is-tp-running .header,
body.is-tp-running .footer,
body.is-tp-running .whatsapp-float,
body.is-tp-running .ambient,
body.is-tp-running .noise-overlay { display: none !important; }

.tp-stage {
    position: fixed; inset: 0; z-index: 4000;
    background: #000; display: none;
    overflow: hidden;
}
.tp-stage.is-open { display: block; }
.tp-stage.tp-cursor-hidden { cursor: none; }

.tp-scroll {
    position: absolute; inset: 0;
    overflow: hidden; cursor: pointer;
}
.tp-flip {
    width: 100%; height: 100%;
    transform-origin: center center;
}
.tp-content {
    margin: 0 auto;
    padding: 45vh 24px 90vh;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: 600; line-height: 1.45;
    text-align: center;
    will-change: transform;
}
.tp-line { display: block; }
.tp-line--gap { height: .85em; }

/* Active-line highlight */
.tp-content--highlight .tp-line {
    opacity: .3; transition: opacity .3s ease;
}
.tp-content--highlight .tp-line.is-active {
    opacity: 1;
}

/* Reading guide line */
.tp-readline {
    position: absolute; left: 0; right: 0; top: 45vh;
    height: 0; z-index: 3; pointer-events: none;
    border-top: 2px solid rgba(0, 212, 255, .55);
}
.tp-readline::before,
.tp-readline::after {
    content: ''; position: absolute; top: -9px;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
}
.tp-readline::before { left: 0; border-left: 14px solid rgba(0, 212, 255, .7); }
.tp-readline::after  { right: 0; border-right: 14px solid rgba(0, 212, 255, .7); }

/* top + bottom fade for legibility */
.tp-scroll::before,
.tp-scroll::after {
    content: ''; position: absolute; left: 0; right: 0;
    height: 22vh; z-index: 2; pointer-events: none;
}
.tp-scroll::before { top: 0; background: linear-gradient(180deg, #000, transparent); }
.tp-scroll::after  { bottom: 0; background: linear-gradient(0deg, #000, transparent); }

/* Countdown */
.tp-countdown {
    position: absolute; inset: 0; z-index: 10;
    display: none; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .7);
}
.tp-countdown.is-visible { display: flex; }
.tp-countdown span {
    font-family: 'Syne', sans-serif; font-weight: 800;
    font-size: clamp(120px, 30vw, 320px); line-height: 1;
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    animation: tpCount .8s ease-out;
}
@keyframes tpCount {
    0%   { opacity: 0; transform: scale(.4); }
    40%  { opacity: 1; transform: scale(1.1); }
    100% { opacity: .2; transform: scale(.9); }
}

/* Controls bar */
.tp-controls {
    position: absolute; left: 50%; bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    z-index: 12;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    justify-content: center;
    padding: 10px 14px; border-radius: 16px;
    background: rgba(16, 16, 26, .92);
    border: 1px solid var(--glass-border);
    box-shadow: 0 14px 44px rgba(0, 0, 0, .6);
    opacity: 0; pointer-events: none;
    transition: opacity .25s, transform .25s;
    max-width: calc(100vw - 32px);
}
.tp-controls.is-visible {
    opacity: 1; pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.tp-ctrl {
    min-width: 44px; height: 44px; padding: 0 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--glass-border);
    color: var(--text-primary); font-size: 18px; font-weight: 700;
    cursor: pointer; transition: all .2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-family: inherit;
}
.tp-ctrl:hover { background: rgba(0, 212, 255, .14); border-color: rgba(0, 212, 255, .4); }
.tp-ctrl.is-on {
    background: rgba(0, 212, 255, .2);
    border-color: var(--cyan); color: var(--cyan);
}
.tp-ctrl--sm { min-width: 38px; height: 38px; font-size: 14px; padding: 0 8px; }
.tp-ctrl--play {
    background: rgba(16, 185, 129, .16);
    border-color: rgba(16, 185, 129, .4); color: #10B981;
    font-size: 20px;
}
.tp-ctrl--play.is-paused {
    background: rgba(0, 212, 255, .16);
    border-color: rgba(0, 212, 255, .4); color: var(--cyan);
}
.tp-ctrl--exit {
    font-size: 13px; font-weight: 600; letter-spacing: .5px;
    background: rgba(251, 113, 133, .12);
    border-color: rgba(251, 113, 133, .35); color: #fb7185;
}
.tp-ctrl--exit:hover { background: rgba(251, 113, 133, .22); border-color: rgba(251, 113, 133, .5); }
.tp-ctrl-group {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 8px; border-radius: 11px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--glass-border);
}
.tp-ctrl-readout {
    font-family: 'JetBrains Mono', monospace; font-weight: 700;
    font-size: 14px; color: var(--cyan); min-width: 30px; text-align: center;
}

/* End-of-script card */
.tp-done {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%) scale(.9);
    z-index: 11; display: none;
    flex-direction: column; align-items: center; gap: 14px;
    padding: 36px 40px; border-radius: 22px;
    background: rgba(16, 16, 26, .96);
    border: 1px solid rgba(0, 212, 255, .3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
    text-align: center;
}
.tp-done.is-visible { display: flex; animation: tpDoneIn .35s ease-out forwards; }
@keyframes tpDoneIn {
    to { transform: translate(-50%, -50%) scale(1); }
}
.tp-done-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: rgba(16, 185, 129, .15);
    border: 2px solid rgba(16, 185, 129, .5);
    color: #10B981; font-size: 32px;
    display: flex; align-items: center; justify-content: center;
}
.tp-done p {
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 18px; color: var(--text-primary);
}
.tp-done-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* --- Light mode (read in bright environments) --- */
.tp-stage--light { background: #f3f3f6; }
.tp-stage--light .tp-content { color: #14151c; }
.tp-stage--light .tp-scroll::before { background: linear-gradient(180deg, #f3f3f6, transparent); }
.tp-stage--light .tp-scroll::after  { background: linear-gradient(0deg, #f3f3f6, transparent); }
.tp-stage--light .tp-readline { border-top-color: rgba(0, 150, 200, .8); }
.tp-stage--light .tp-readline::before { border-left-color: rgba(0, 150, 200, .9); }
.tp-stage--light .tp-readline::after  { border-right-color: rgba(0, 150, 200, .9); }
.tp-stage--light .tp-countdown { background: rgba(243, 243, 246, .85); }

@media (max-width: 560px) {
    .tp-card { padding: 22px 18px; }
    .tp-ctrl--exit span { display: none; }
    .tp-controls { gap: 6px; padding: 8px 10px; bottom: 14px; }
    .tp-script-head { flex-wrap: wrap; }
}
