:root {
    /* Paleta Premium - Light Mode */
    --bg-color: #f4f7f6;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.08);
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    
    /* Colores Colombia */
    --col-yellow: #fcd116;
    --col-blue: #003893;
    --col-red: #ce1126;
    
    /* Colores Portugal */
    --por-red: #da291c;
    --por-green: #046a38;

    /* Acentos */
    --accent: #003893; 
    --accent-glow: rgba(0, 56, 147, 0.3);
    
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Background Blobs Animados (Banderas) */
#background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.6;
    animation: float 12s infinite alternate ease-in-out;
}

/* Colombia Colors */
.blob-1 { width: 350px; height: 350px; background: var(--col-yellow); top: -50px; left: -100px; }
.blob-2 { width: 250px; height: 250px; background: var(--col-blue); top: 20%; left: 10%; animation-delay: -2s; }
.blob-3 { width: 200px; height: 200px; background: var(--col-red); top: 40%; left: -50px; animation-delay: -4s; }

/* Portugal Colors */
.blob-4 { width: 400px; height: 400px; background: var(--por-red); bottom: -100px; right: -50px; animation-delay: -1s; }
.blob-5 { width: 300px; height: 300px; background: var(--por-green); bottom: 20%; right: 10%; animation-delay: -3s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, -40px) scale(1.1); }
}

/* Cursor Ball */
#cursor-ball {
    position: fixed;
    top: 0;
    left: 0;
    font-size: 2rem;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.05s linear;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

/* Globos Decorativos */
.balloon {
    position: absolute;
    width: 40px;
    height: 50px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    pointer-events: none;
    opacity: 0.85;
    animation: floatUp 15s infinite linear;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.2));
}
.balloon::after {
    content: "";
    position: absolute;
    width: 2px;
    height: 60px;
    background: rgba(255,255,255,0.5);
    top: 50px;
    left: 19px;
}

/* Colores de Banderas */
.balloon-col-1 { background: #FCD116; left: 5%; bottom: -20vh; animation-duration: 18s; animation-delay: 2s; }
.balloon-por-1 { background: #FF0000; right: 15%; bottom: -20vh; animation-duration: 22s; animation-delay: 0s; }
.balloon-col-2 { background: #003893; left: 25%; bottom: -20vh; animation-duration: 20s; animation-delay: 7s; }
.balloon-por-2 { background: #006600; right: 35%; bottom: -20vh; animation-duration: 16s; animation-delay: 5s; }

@keyframes floatUp {
    0% { transform: translateY(120vh) rotate(-10deg); opacity: 0; }
    10% { opacity: 0.85; }
    50% { transform: translateY(30vh) rotate(10deg); }
    90% { opacity: 0.85; }
    100% { transform: translateY(-30vh) rotate(-10deg); opacity: 0; }
}

/* Panel Principal (Glassmorphism Light) */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    width: 90%;
    max-width: 450px;
    min-height: 80vh;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

/* Vistas */
.view { display: none; animation: fadeIn 0.4s ease forwards; }
.view.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* Tipografía */
h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -1px; text-align: center; color: #111; }
h1 span { color: var(--por-red); }
h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 1rem; color: #222; }
.header-logo p { text-align: center; color: var(--text-secondary); margin-bottom: 2rem; font-size: 1.1rem; font-weight: 600; }
.subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.95rem; }

/* Formularios */
.input-group { margin-bottom: 1.5rem; }
.input-group label { display: block; margin-bottom: 0.5rem; font-size: 0.95rem; font-weight: 600; color: var(--text-secondary); }
input[type="text"], input[type="number"] {
    width: 100%;
    padding: 1rem;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
input[type="text"]:focus, input[type="number"]:focus {
    border-color: var(--col-blue);
    box-shadow: 0 0 0 3px rgba(0, 56, 147, 0.1);
}

/* Botones */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--col-blue) 0%, var(--por-red) 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(218, 41, 28, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(218, 41, 28, 0.4);
}
.btn-secondary {
    background: #fff;
    border: 2px solid #e2e8f0;
    color: var(--text-primary);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}
.btn-secondary:hover { background: #f8fafc; border-color: var(--col-blue); }
.btn-back {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: 0.3s;
}
.btn-back:hover { color: var(--text-primary); }

/* Carrusel Skins */
.skins-selector { margin-bottom: 2rem; }
.skins-selector label { font-size: 0.95rem; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 0.8rem;}
.skins-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 15px;
    scrollbar-width: thin;
}
.skin-option {
    min-width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: 0.3s;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.skin-option img { width: 100%; height: 100%; object-fit: cover; }
.skin-option.selected {
    border-color: var(--col-blue);
    box-shadow: 0 0 0 4px rgba(0, 56, 147, 0.2);
    transform: scale(1.1);
}

/* Dashboard Topbar */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.user-info { display: flex; align-items: center; gap: 1rem; }
.user-info img { width: 50px; height: 50px; border-radius: 50%; border: 3px solid var(--col-yellow); box-shadow: 0 2px 5px rgba(0,0,0,0.1);}
.user-alias { display: block; font-weight: 700; font-size: 1.1rem; color: #111; }
.user-points {
    font-size: 0.9rem;
    color: var(--col-yellow);
    font-weight: 600;
}

.btn-logout {
    background: rgba(206, 17, 38, 0.1);
    color: var(--col-red);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--col-red);
    color: white;
}

/* Dashboard Cards */
.match-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border: 1px solid #e2e8f0;
    margin-bottom: 2.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}
.match-card .team { text-align: center; }
.match-card .flag { width: 65px; height: auto; border-radius: 8px; margin-bottom: 0.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.match-card h2 { font-size: 1.2rem; margin: 0; font-weight: 800;}
.match-card .vs { font-size: 1.5rem; font-weight: 800; color: #cbd5e1; font-style: italic;}
.countdown {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: #fff;
    padding: 0.3rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Menu Grid */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.menu-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 1.5rem 1rem;
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.menu-btn i { font-size: 2rem; color: var(--col-blue); transition: 0.3s; }
.menu-btn:nth-child(2) i { color: var(--por-red); }
.menu-btn:nth-child(3) i { color: var(--col-yellow); }
.menu-btn:nth-child(4) i { color: var(--por-green); }
.menu-btn:hover { background: #f8fafc; transform: translateY(-5px); border-color: var(--col-blue); box-shadow: 0 10px 15px rgba(0,0,0,0.05); }

/* Polla Score Input */
.polla-board { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: #fff; padding: 1.5rem; border-radius: 16px; border: 1px solid #e2e8f0;}
.score-input { display: flex; flex-direction: column; align-items: center; gap: 1rem; flex: 1; }
.score-input img { width: 80px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.score-input input { font-size: 2.5rem; text-align: center; font-weight: 800; padding: 0.5rem; width: 100px; height: 100px; background: #f8fafc; color: var(--text-primary); }
.vs-text { font-size: 2rem; font-weight: 800; color: #cbd5e1; }
.success-msg { background: #dcfce7; color: #166534; padding: 1rem; border-radius: 8px; text-align: center; margin-top: 1rem; border: 1px solid #bbf7d0; font-weight: 600; }

/* Teams Tab */
.teams-tabs { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.tab-btn { flex: 1; padding: 0.8rem; background: #e2e8f0; border: none; color: var(--text-secondary); border-radius: 8px; cursor: pointer; transition: 0.3s; font-weight: 700; }
.tab-btn.active { background: var(--col-blue); color: #fff; }
.tab-btn:nth-child(2).active { background: var(--por-red); }
.players-grid { display: grid; gap: 1rem; overflow-y: auto; max-height: 500px; padding-right: 5px; }
.player-card { display: flex; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,0.03); min-height: 100px; }
.player-img { width: 100px; height: 100px; object-fit: cover; background: #f1f5f9; flex-shrink: 0; }
.player-info { padding: 1rem; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.player-info h4 { margin-bottom: 0.2rem; font-size: 1.1rem; color: #111;}
.player-info p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.player-stat { display: inline-block; background: #f1f5f9; padding: 0.3rem 0.6rem; border-radius: 6px; font-size: 0.8rem; font-weight: 600; color: var(--col-blue); }
.player-stat.coach { background: #fee2e2; color: #991b1b; }

/* Leaderboard */
.leaderboard-list { display: flex; flex-direction: column; gap: 0.8rem; overflow-y: auto; max-height: 500px; }
.lb-item { display: flex; align-items: center; justify-content: space-between; background: #fff; padding: 1rem; border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: 0 2px 6px rgba(0,0,0,0.02);}
.lb-rank { font-size: 1.3rem; font-weight: 800; color: #94a3b8; width: 35px; }
.lb-user { display: flex; align-items: center; gap: 1rem; flex: 1; }
.lb-user img { width: 45px; height: 45px; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.lb-user span { font-weight: 600; font-size: 1.05rem; }
.lb-points { font-size: 1.2rem; font-weight: 800; color: var(--por-green); }
.lb-item:nth-child(1) .lb-rank { color: #d4af37; }
.lb-item:nth-child(2) .lb-rank { color: #a0aec0; }
.lb-item:nth-child(3) .lb-rank { color: #cd7f32; }

/* Trivia */
.trivia-container { text-align: center; }
.trivia-container p { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.95rem; }
.options-grid { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.option-btn { background: #fff; border: 2px solid #e2e8f0; color: var(--text-primary); padding: 1.2rem; border-radius: 12px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: 0.3s; text-align: left; }
.option-btn:hover { background: #f8fafc; border-color: var(--col-blue); }
.option-btn.correct { background: #dcfce7; border-color: #4ade80; color: #166534; }
.option-btn.wrong { background: #fee2e2; border-color: #f87171; color: #991b1b; }
#trivia-q { font-size: 1.3rem; font-weight: 700; line-height: 1.4; color: #111; }

/* Efecto Pulsing para Marcador en Vivo */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.05); opacity: 0.8; box-shadow: 0 0 10px rgba(255,0,0,0.5); }
}
.pulsing {
    animation: pulse 0.8s infinite alternate;
}
