:root {
    --gold: #ffd700;
    --glass: rgba(0, 0, 0, 0.85);
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    background-color: #000;
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url("https://lh3.googleusercontent.com/pw/AP1GczOhhNqug4XiTmNq34mtL-SvCD-42ss_GxttFN9hLGmSWV1UxxZ5OYKLRnNnQmEnX_kKO42RYFnvrcng3sCFJXTwTOTnEnzyn27_fWwEkFPwjFtVMuCh0Qiu-62ApF8_PINh6P6J5xBgowDpx_V-8I7e=w869-h869-s-no-gm?authuser=0");
    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    background-attachment: fixed;
}

.container {
    background: transparent;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 20px;
    width: 95%;
    max-width: 400px;
    border: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.nav-menu {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.nav-item { cursor: pointer; font-size: 1.2rem; transition: color 0.3s; }
.nav-item:hover { color: var(--gold); }

.bonus-badge { 
    background: rgba(255, 215, 0, 0.1); 
    border: 1px solid var(--gold); 
    color: var(--gold); 
    padding: 10px; 
    border-radius: 12px; 
    margin-bottom: 15px; 
    font-weight: bold; 
    font-size: 0.9rem; 
}

.scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.team-box { background: rgba(255,255,255,0.05); padding: 15px; border-radius: 15px; }
.score { font-size: 3rem; font-weight: 900; color: var(--gold); margin: 5px 0; }

input { 
    width: 100%; 
    padding: 15px; 
    border-radius: 12px; 
    border: none; 
    font-size: 1.5rem; 
    text-align: center; 
    margin-bottom: 15px; 
    background: white; 
    color: black; 
}

.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
button { padding: 15px; border-radius: 12px; border: none; font-weight: bold; font-size: 1rem; cursor: pointer; }
.btn-e1 { background: #27ae60; color: white; }
.btn-e2 { background: #2980b9; color: white; }
.btn-reset-manual { background: #c0392b; color: white; width: 100%; margin-top: 15px; text-transform: uppercase; font-size: 0.8rem; }

.history { 
    margin-top: 15px; 
    height: 100px; 
    overflow-y: auto; 
    font-size: 0.8rem; 
    border-top: 1px solid rgba(255,255,255,0.1); 
    padding-top: 10px; 
    text-align: left; 
    color: #ddd; 
}

.seccion-publicidad {
    width: 100%;
    max-width: 500px; /* Ajusta al ancho de tu app */
    margin: 0 auto;
    overflow: hidden;
}

#contenido-anuncio {
    transition: opacity 0.5s ease-in-out; /* Hace que el cambio de texto sea suave */
}

#winner-screen { 
    display: none; 
    position: fixed; 
    top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.9); 
    z-index: 10000; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
}

.winner-card { background: var(--gold); color: black; padding: 30px; border-radius: 20px; text-align: center; }

/* ConfiguraciÃ³n de rejilla dinÃ¡mica para los marcadores */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; }

/* Ajuste para que los nombres en el marcador no se corten */
.team-box small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Clase mejorada para 3 jugadores */
.grid-3-ajustado {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Mantenemos 2 columnas principales */
    gap: 10px;
}

/* El truco: El tercer elemento (¨ªndice 3) ocupar¨¢ las 2 columnas si es el ¨²ltimo */
.grid-3-ajustado > div:nth-child(3):last-child {
    grid-column: span 2;
    margin: 0 auto;
    width: 100%; /* Ocupa todo el ancho inferior */
}
/* Contenedor de Anuncios Visuales */
.media-publi {
    width: 100%;
    height: 220px; /* Altura fija para mantener orden */
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.media-content {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Esto hace que la imagen/video llene el espacio sin estirarse */
    display: block;
}

/* Efecto suave para el cambio de anuncio */
.media-publi img, .media-publi video {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.media-publi a {
    cursor: pointer;
    text-decoration: none;
}

.media-publi:hover {
    filter: brightness(1.1); /* Brilla un poquito al tocarlo o pasar el mouse */
    transition: 0.3s;
}