/* Reset & base */
* { margin: 0; padding: 0; box-sizi.brand-logo{ 
    height: 90px; 
    width: auto; 
    max-width: 100%;
    object-fit: contain;
    transition: transform .2s ease, filter .2s ease;
}
.brand-logo:hover{ transform: scale(1.02); }

/* Invertir logo en modo oscuro con máxima especificidad */
body.dark .brand-mark img.brand-logo {
    filter: invert(1);
    /* Aislar el filtro para que no afecte otros elementos */
    isolation: isolate;
}
:root{
    /* Paleta libreta escolar */
    --paper: #fbfbf7;
    --paper-dots: #e7e7df;
    --ink: #252525;
    --ink-2: #484848;
    --accent-blue: #2b6cb0;
    --accent-red: #d64545;
    --accent-green: #2e7d32;
    --accent-yellow: #f59e0b;
    --shadow: rgba(0,0,0,0.06);
}

/* Dark theme tokens */
body.dark{
    --paper: #121212;
    --paper-dots: #1f1f1f;
    --ink: #f3f3f3;
    --ink-2: #cfcfcf;
    --accent-blue: #7aa7ff;
    --accent-red: #ff7a7a;
    --accent-green: #7ae389;
    --accent-yellow: #facc15;
    --shadow: rgba(0,0,0,0.5);
}

html, body { height: 100%; overflow-x: hidden; }
body {
    font-family: 'Patrick Hand', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--ink);
    background: var(--paper);
    background-image:
        radial-gradient(var(--paper-dots) 1px, transparent 1px),
        linear-gradient(transparent 39px, rgba(0,0,0,.05) 40px),
        linear-gradient(to right, rgba(0,0,0,.05) 1px, transparent 1px);
    background-size: 28px 28px, 40px 40px, 40px 40px;
    background-position: 0 0, 0 0, 0 0;
    overflow-x: hidden;
    font-size: 18px; /* slightly larger base */
}

.bg.fx-grain{ display:none; }

/* Fondo de muñecos haciendo mímica (capa sutil) */
/* container ya sobre papel cuadriculado, sin capa extra */

.container { max-width: 1100px; margin: 0 auto; padding: 20px; max-height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

.glass{ background: rgba(255,255,255,.8); border: 2px dashed rgba(0,0,0,.08); box-shadow: 0 4px 0 var(--shadow); border-radius: 18px; }
body.dark .glass{ background: rgba(32,32,32,.8); border-color: rgba(255,255,255,.08); }

.brand-mark{ display:flex; align-items:center; gap:10px; }
.brand-icon{ font-size: 26px; }
.brand-logo{ 
    height: 25vh; 
    max-height: 280px;
    width: auto; 
    max-width: 100%;
    object-fit: contain;
    transition: transform .2s ease, filter .2s ease;
}
/* Header */
.header { text-align: center; margin-bottom: 12px; }
.header .brand-mark{ justify-content: center; }
.header .subtitle{ color: var(--ink-2); margin-top: 4px; }

.game-header { display:flex; justify-content: space-between; align-items:center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.game-header .brand-logo {
    height: 50px;
}
.actions{ display:flex; gap:10px; align-items:center; flex-wrap: wrap; }
.lang-select{ position: fixed; top: 16px; right: 68px; z-index: 1001; padding:6px 10px; border-radius:10px; border:2px solid rgba(0,0,0,.12); background:#fff; color: var(--ink); box-shadow: 0 3px 0 var(--shadow); }
body.dark .lang-select{ background:#1d1d1d; border-color: rgba(255,255,255,.12); }

/* Main content */
.main-content { flex-grow:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap: 12px; min-height: 0; }

/* Welcome card */
.welcome-card{ padding: 20px; text-align:center; max-width: 560px; border-radius: 18px; transform: rotate(-.3deg); }
.welcome-card .hero{ font-family:'Caveat', cursive; font-size: 56px; margin-bottom: 2px; letter-spacing: .3px; }
.welcome-card p{ color: var(--ink-2); margin: 4px 0 12px; }

/* Scoreboard */
.scoreboard { display:flex; justify-content:center; align-items:center; flex-wrap: wrap; gap:18px; margin-bottom: 14px; padding: 12px 14px; }

.team{ text-align:center; padding:14px 16px; border-radius:14px; min-width:130px; transition: transform .2s ease; border: 2px solid rgba(0,0,0,.1); background: white; box-shadow: 0 3px 0 var(--shadow); cursor: pointer; }
.team:hover{ transform: translateY(-2px); filter: brightness(0.98); }
body.dark .team{ background: #1d1d1d; border-color: rgba(255,255,255,.08); }
.team.active{ 
    background: rgba(0,0,0,.06); 
    border-color: var(--accent-blue); 
}
body.dark .team.active{ background: rgba(255,255,255,.08); }
.team h3{ font-size: 20px; color: var(--ink-2); margin-bottom: 2px; }
.score{ font-family:'Caveat', cursive; font-size: 56px; color: var(--ink); letter-spacing:.5px; line-height: 1; }
.team.active{ outline: 3px dashed var(--accent-blue); transform: translateY(-2px); }
.team.active .score{ color: var(--accent-blue); }
.vs{ font-weight:700; color: var(--ink-2); opacity:.8; }

/* Current turn */
.current-turn{ text-align:center; margin-bottom: 18px; color: var(--ink-2); font-weight:600; }

/* Movie card */
.movie-card{ padding: 22px 20px; text-align:center; margin: 0 auto 18px; max-width: 680px; width:100%; border-radius: 18px; }
.movie-title-wrap{ margin-bottom: 8px; }
.reveal-btn{ margin-bottom: 10px; }
.movie-card #toggleRevealBtn, .movie-card #skipBtn{ margin-bottom: 12px; }
.movie-card #skipBtn{ margin-left: 8px; }
.movie-secret{ position: relative; }
/* Ocultación limpia: ocultar contenido y mostrar sólo el overlay */
.movie-secret > *{ transition: opacity .2s ease, filter .2s ease; }
.movie-secret.blurred{ pointer-events: none; user-select: none; }
.movie-secret.blurred > :not(.conceal-overlay){ opacity: 0; filter: blur(6px); }
/* Overlay centrado con texto */
.conceal-overlay{ position:absolute; inset:0; display:grid; place-items:center; pointer-events:none; }
.movie-secret:not(.blurred) .conceal-overlay{ display:none; }
.co-wrap{ padding:10px 14px; border-radius: 12px; background: rgba(255,255,255,.9); border: 2px dashed rgba(0,0,0,.12); color: var(--ink); box-shadow: 0 3px 0 var(--shadow); display:flex; gap:8px; align-items:center; }
body.dark .co-wrap{ background: rgba(0,0,0,.7); border-color: rgba(255,255,255,.14); }
.co-icon{ display:inline-flex; align-items:center; justify-content:center; }
.co-icon svg{ stroke: currentColor; stroke-width: 1.8; fill: none; }
.co-icon svg circle{ fill: currentColor; stroke: none; }
.movie-card h2{ font-family:'Caveat', cursive; font-size: 64px; letter-spacing:.3px; line-height:1.05; }
.movie-year{ font-size: 20px; color: var(--ink-2); margin-top: 6px; }
.movie-regional{ margin-top: 8px; }
.movie-title-es, .movie-title-latam{ font-size: 18px; color: var(--ink-2); line-height: 1.4; display:flex; gap:8px; align-items:center; justify-content:center; }
.movie-title-es[hidden], .movie-title-latam[hidden]{ display:none !important; }
.movie-title-es .geo-label{ color: var(--ink); font-weight: 600; }
.movie-title-latam .geo-label{ color: var(--ink); font-weight: 600; }
.geo-icon{ display:inline-flex; align-items:center; justify-content:center; color: var(--accent-blue); }
.geo-latam{ color: var(--accent-green); }

/* Timer section */
.timer-section{ text-align:center; margin-bottom: 20px; }
.timer-display{ margin-bottom: 8px; }

/* Ocultar el reloj por defecto */
.timer-display {
    display: none;
}

/* Solo mostrar el reloj cuando el timer está corriendo */
body.timer-running .timer-display {
    display: block;
}

.hourglass{ position: relative; width: 280px; height: 362px; margin: 0 auto; }
.hg-svg .hg-outline{ stroke: rgba(0,0,0,.28); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 0 rgba(0,0,0,.08)); }
body.dark .hg-svg .hg-outline{ stroke: rgba(255,255,255,.92); filter: drop-shadow(0 1px 0 rgba(255,255,255,.12)); }
.hourglass .hg-svg{ width: 100%; height: 100%; }
.hg-sand{ 
    transition: fill .2s ease; 
    /* Color inicial verde, será sobrescrito por JavaScript */
    fill: var(--accent-green);
}

/* Aislar completamente el SVG del reloj de cualquier filtro */
.hourglass, .hg-svg {
    isolation: isolate;
    filter: none;
}
.hg-stream{ stroke: var(--accent-yellow); stroke-width: 4; stroke-linecap: round; opacity: .95; stroke-dasharray: 2 6; filter: drop-shadow(0 0 0.5px rgba(0,0,0,.25)); animation: streamFlow 0.6s linear infinite, streamPulse 1.2s ease-in-out infinite; }
.hg-grain circle{ fill: currentColor; animation: grainFall 0.8s linear infinite; }
.hg-center{ display:none; }
.hg-time{ text-align:center; margin-top: 2px; font-family:'Patrick Hand', cursive; font-size: 64px; line-height: 1; }

.timer-controls{ display:flex; justify-content:center; align-items:center; gap:12px; flex-wrap:wrap; }
.timer-select{ padding: 10px 14px; border-radius: 10px; border: 2px solid rgba(0,0,0,.15); background: #fff; color: var(--ink); cursor: pointer; font-family:'Patrick Hand', sans-serif; font-size: 1.05rem; }
body.dark .timer-select{ background: #1d1d1d; border-color: rgba(255,255,255,.12); }

/* Voting section */
.voting-section{ position: fixed; inset: 0; display:none; align-items:center; justify-content:center; padding: 16px; z-index: 1200; background: rgba(0,0,0,.35); }
.voting-section[style*="display: block"]{ display:flex !important; }
.voting-modal{ width: 100%; max-width: 560px; padding: 26px 24px; border-radius: 18px; text-align:center; background: rgba(255,255,255,.95); border: 2px dashed rgba(0,0,0,.08); box-shadow: 0 16px 36px rgba(0,0,0,.25); }
body.dark .voting-modal{ background: rgba(24,24,24,.95); border-color: rgba(255,255,255,.12); }
.voting-section h3{ margin-bottom: 14px; font-size: 1.3rem; }
.voting-buttons{ display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin-top: 8px; }

/* Team History Modal */
.team-history-section{ position: fixed; inset: 0; display:none; align-items:center; justify-content:center; padding: 16px; z-index: 1200; background: rgba(0,0,0,.35); }
.team-history-section[style*="display: block"]{ display:flex !important; }
.team-history-modal{ 
    width: 100%; 
    max-width: 600px; 
    max-height: 90vh; 
    overflow-y: auto; 
    padding: 24px; 
    border-radius: 18px; 
    background: rgba(255,255,255,.95); 
    border: 2px dashed rgba(0,0,0,.08); 
    box-shadow: 0 16px 36px rgba(0,0,0,.25); 
}
body.dark .team-history-modal{ background: rgba(24,24,24,.95); border-color: rgba(255,255,255,.12); }

.team-history-header{ 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
    padding-bottom: 15px; 
    border-bottom: 2px dashed rgba(0,0,0,.1); 
}
body.dark .team-history-header{ border-bottom-color: rgba(255,255,255,.15); }

.team-history-header h3{ margin: 0; font-size: 1.4rem; }
.btn-close{ 
    background: none; 
    border: none; 
    font-size: 24px; 
    cursor: pointer; 
    color: var(--ink-2); 
    padding: 5px; 
    border-radius: 50%; 
    width: 35px; 
    height: 35px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.btn-close:hover{ background: rgba(0,0,0,.1); }
body.dark .btn-close:hover{ background: rgba(255,255,255,.1); }

.team-edit-section{ margin-bottom: 25px; }
.team-name-edit{ 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 15px; 
    flex-wrap: wrap; 
}
.team-name-edit label{ font-weight: 600; min-width: 130px; }
.team-name-input{ 
    flex: 1; 
    min-width: 150px; 
    padding: 8px 12px; 
    border: 2px solid rgba(0,0,0,.15); 
    border-radius: 8px; 
    font-family: inherit; 
    font-size: 1rem; 
    background: #fff; 
}
body.dark .team-name-input{ background: #1d1d1d; border-color: rgba(255,255,255,.2); color: var(--ink); }

.team-score-edit{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.team-score-edit label{ font-weight: 600; min-width: 130px; }
.score-controls{ display: flex; align-items: center; gap: 15px; }
.current-score{ 
    font-size: 1.5rem; 
    font-weight: bold; 
    color: var(--accent-blue); 
    min-width: 40px; 
    text-align: center; 
}

.history-stats{ 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); 
    gap: 15px; 
    margin-bottom: 25px; 
    padding: 15px; 
    background: rgba(0,0,0,.03); 
    border-radius: 12px; 
}
body.dark .history-stats{ background: rgba(255,255,255,.05); }

.stat-item{ text-align: center; }
.stat-label{ display: block; font-size: 0.9rem; color: var(--ink-2); margin-bottom: 5px; }
.stat-value{ 
    display: block; 
    font-size: 1.8rem; 
    font-weight: bold; 
}
.stat-value.correct{ color: var(--accent-green); }
.stat-value.incorrect{ color: var(--accent-red); }
.stat-value.skipped{ color: var(--accent-yellow); }

.history-list h4{ margin-bottom: 15px; color: var(--ink); }
.movie-history-list{ max-height: 300px; overflow-y: auto; }
.history-item{ 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 10px 15px; 
    margin-bottom: 8px; 
    border-radius: 8px; 
    background: rgba(0,0,0,.08); 
    border: 1px solid rgba(0,0,0,.06);
}
body.dark .history-item{ background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.08); }

.movie-info{ flex: 1; }
.movie-title{ font-weight: 700; color: var(--ink); font-size: 1rem; }
.movie-year{ font-size: 0.9rem; color: var(--ink-2); font-weight: 500; }
.result-badge{ 
    padding: 6px 12px; 
    border-radius: 14px; 
    font-size: 0.85rem; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 0.025em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.result-badge.correct{ background: #16a34a; color: white; font-weight: 700; }
.result-badge.incorrect{ background: #dc2626; color: white; font-weight: 700; }
.result-badge.skipped{ background: #ea580c; color: white; font-weight: 700; }

/* Mejorar contraste en modo oscuro */
body.dark .result-badge.correct{ background: #4ade80; color: black; }
body.dark .result-badge.incorrect{ background: #f87171; color: black; }
body.dark .result-badge.skipped{ background: #fbbf24; color: black; }

/* Buttons */
.btn{ padding: 12px 18px; border: 2px solid rgba(0,0,0,.15); border-radius: 14px; font-weight: 600; cursor:pointer; transition: transform .1s ease, filter .2s; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:10px; color: var(--ink); background: #fff; box-shadow: 0 3px 0 var(--shadow); font-size: 1.1rem; }
.btn:hover{ transform: translateY(-1px); filter: brightness(0.98); }
.btn:disabled{ opacity:.6; cursor:not-allowed; }
.btn .btn-icon{ font-weight:700; }
.btn-primary{ background: #fffbeb; border-color: #f59e0b; }
.btn-secondary{ background: #eff6ff; border-color: #2b6cb0; }
.btn-success{ background: #ecfdf5; border-color: #2e7d32; }
.btn-danger{ background: #fef2f2; border-color: #d64545; }
.btn-link{ background: #eef2ff; border-color: #4f46e5; }
.glow{ box-shadow: none; animation: none; }
body.dark .btn{ background:#1d1d1d; border-color: rgba(255,255,255,.12); color: var(--ink); }
body.dark .btn-primary{ background:#1f1a0a; border-color:#d97706; }
body.dark .btn-secondary{ background:#0b1a2e; border-color:#7aa7ff; }
body.dark .btn-success{ background:#0a1f16; border-color:#7ae389; }
body.dark .btn-danger{ background:#2a0c0c; border-color:#ff7a7a; }
body.dark .btn-link{ background:#0b0f2e; border-color:#7aa7ff; }

/* Focused timer mode (mobile-friendly) */
body.timer-focus{ overflow: hidden; }
body.timer-focus .game-header,
body.timer-focus .scoreboard,
body.timer-focus .current-turn,
body.timer-focus .movie-card,
body.timer-focus .voting-section{ display: none !important; }
body.timer-focus .timer-section{
        position: fixed; inset: 0; z-index: 1000; margin: 0;
        display: grid; place-items: center; background: var(--paper);
        padding: 0; /* no padding to truly fill viewport */
}
/* Fit hourglass to viewport while preserving 3:4 aspect ratio */
body.timer-focus .hourglass{
    width: min(100vw, calc(100vh / 1.333333));
    height: min(100vh, calc(100vw * 1.333333));
}
body.timer-focus .hg-time{ font-size: 96px; }
body.timer-focus .timer-controls{ margin-top: 16px; }
body.timer-focus #startBtn,
/* Ocultar botón stop por defecto - solo visible en modo foco */
#stopBtn { display: none !important; }

body.timer-focus #skipBtn,
body.timer-focus #timerDuration{ display: none !important; }
body.timer-focus #stopBtn{ display: inline-flex !important; padding: 14px 22px; font-size: 1.25rem; }
/* Floating prominent Stop button in focus mode */
body.timer-focus #stopBtn{
    position: fixed;
    left: 50%;
    bottom: clamp(16px, 4vh, 32px);
    transform: translateX(-50%);
    z-index: 1100;
    min-width: 160px;
    padding: 16px 26px;
    font-size: 1.35rem;
    border-width: 3px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

@media (max-width: 480px){
    /* Keep viewport fit on small screens as well */
    body.timer-focus .hourglass{ width: min(100vw, calc(100vh / 1.333333)); height: min(100vh, calc(100vw * 1.333333)); }
    body.timer-focus .hg-time{ font-size: 88px; }
}

@keyframes streamPulse{
    0%,100%{ opacity: .7 }
    50%{ opacity: 1 }
}

@keyframes streamFlow{
    from { stroke-dashoffset: 0 }
    to   { stroke-dashoffset: 8 }
}

/* Pause animations when the timer is not running */
body:not(.timer-running) .hg-stream,
body:not(.timer-running) .hg-grain circle{
    animation-play-state: paused;
}

@keyframes grainFall{
    0%{ transform: translateY(0) translateX(0); opacity: 0 }
    10%{ opacity: 1 }
    70%{ transform: translateY(16px) translateX(0.4px); }
    100%{ transform: translateY(22px) translateX(0); opacity: 0 }
}

/* Instructions */
.instructions{ padding: 15px; max-width: 620px; margin: 0 auto; }
.instructions h3{ color: var(--ink); margin-bottom: 8px; font-size: 22px; }
.instructions ul{ list-style:none; }
.instructions li{ position: relative; padding: 6px 0 6px 28px; color: var(--ink-2); }
.instructions li::before{ content:"✦"; position:absolute; left:0; top:2px; font-size: 18px; color: var(--accent-yellow); transform: rotate(-10deg); }

/* Footer */
.footer{ text-align:center; padding-top: 8px; color: var(--ink-2); }
.heart{ color:#e25555; }

/* Notifications */
.notification{ position: fixed; top: 20px; right: 20px; background: #ecfdf5; color:#065f46; padding: 10px 14px; border-radius: 12px; box-shadow: 0 3px 0 var(--shadow); transform: translateX(400px) rotate(-.5deg); transition: transform .3s ease; z-index: 1000; border:2px solid rgba(0,0,0,.1); }
body.dark .notification{ background:#0a1f16; color:#7ae389; border-color: rgba(255,255,255,.12);} 
.notification.show{ transform: translateX(0); }

/* Theme toggle button */
.theme-toggle{
    position: fixed; top: 16px; right: 16px; z-index: 1001;
    background: #fff; color: var(--ink); border: 2px solid rgba(0,0,0,.12);
    border-radius: 50%; width: 48px; height: 48px; display:grid; place-items:center;
    box-shadow: 0 3px 0 var(--shadow); cursor:pointer; transform: rotate(-.4deg);
}
body.dark .theme-toggle{ background:#1d1d1d; border-color: rgba(255,255,255,.12);} 

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .brand-logo { height: 22vh; max-height: 200px; }
    
    .movie-card h2 { font-size: 52px; }
    .movie-title-es, .movie-title-latam{ font-size: 16px; }
    
    /* Botones de header en línea para móvil */
    .game-header { 
        flex-direction: column; 
        text-align: center; 
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .actions { 
        display: flex; 
        justify-content: center; 
        gap: 8px; 
        flex-wrap: wrap;
        width: 100%;
    }
    
    .actions .btn {
        flex: 1;
        min-width: 100px;
        max-width: 120px;
        font-size: 0.9rem;
        padding: 10px 8px;
    }
    
    /* Scoreboard: equipos lado a lado */
    .scoreboard {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
        padding: 15px;
        margin-bottom: 16px;
    }
    
    .team { 
        flex: 1;
        padding: 12px; 
        min-width: auto;
        max-width: none;
    }
    
    .vs {
        font-size: 20px;
        flex-shrink: 0;
    }
    
    .score { font-size: 48px; }
    
    /* Timer section reorganized */
    .timer-section {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    /* Controles de timer ARRIBA del reloj */
    .timer-controls {
        order: -1; /* Mover arriba */
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }
    
    .timer-controls .btn, 
    .timer-select { 
        flex: 0 0 auto;
        font-size: 0.95rem;
    }
    
    /* Reloj de arena centrado */
    .timer-display {
        order: 0;
    }
    
    .timer-ring{ width: 130px; height: 130px; }
    .ring-center span{ font-size: 40px; }
    
    .voting-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn { padding: 14px 18px; font-size: 1.1rem; }
    
    .welcome-card,
    .movie-card,
    .voting-section,
    .instructions {
        padding: 20px;
    }
    
    /* Reducir rotaciones para legibilidad */
    .welcome-card, .movie-card, .scoreboard, .btn, .instructions { 
        transform: none; 
    }
    .brand-logo, .current-turn { transform: none; }
    .theme-toggle { 
        top: max(12px, env(safe-area-inset-top)); 
        right: max(12px, env(safe-area-inset-right)); 
    }
    
    /* Responsivo para modal de historial */
    .team-history-modal {
        max-width: 95%;
        max-height: 95vh;
        padding: 20px;
    }
    
    .team-name-edit,
    .team-score-edit {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .team-name-edit label,
    .team-score-edit label {
        min-width: auto;
        font-size: 0.9rem;
    }
    
    .team-name-input {
        width: 100%;
        min-width: auto;
    }
    
    .history-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 12px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }
    
    .result-badge {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    /* Mantener equipos lado a lado también en móviles pequeños */
    .scoreboard {
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
    }
    
    .vs {
        display: block;
        font-size: 16px;
    }
    
    .brand-logo { height: 18vh; max-height: 150px; }
    .movie-card h2 { font-size: 36px; }
    .movie-title-es, .movie-title-latam{ font-size: 15px; }
    
    .team{ 
        flex: 1;
        min-width: auto; 
        padding: 12px; 
    }
    
    .score{ font-size: 36px; }
    
    .actions .btn {
        font-size: 0.85rem;
        padding: 8px 6px;
        min-width: 90px;
        max-width: 110px;
    }
    
    .timer-controls .btn,
    .timer-select {
        font-size: 0.9rem;
        padding: 10px 12px;
    }
    
    .btn{ padding: 12px 16px; font-size: 1.05rem; }
    .container { padding-top: calc(12px + env(safe-area-inset-top)); }
    .theme-toggle{ width: 44px; height: 44px; }
    .hg-time{ font-size: 72px; margin-top: 0; }
}

/* Animaciones adicionales */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.movie-card,
.voting-section,
.welcome-card {
    animation: fadeIn 0.5s ease;
}
}