/* Estilos para el layout 70/30 */
body {
    margin: 0;
    padding: 0;
    height: 100vh; /* Ocupa toda la altura de la pantalla */
    overflow: hidden; /* Evita scrolls innecesarios */
    position: relative; /* Para posicionar el botón de fullscreen */
    background-color: black; /* Mantener fondo negro del scoreboard */
    color: white;
    font-family: sans-serif, Arial;
    -webkit-text-size-adjust: 100%;
}

.container {
    display: flex; /* División flexible */
    height: 100%; /* Llena la pantalla */
}

.scoreboard-section {
    flex: 7; /* 70% del ancho */
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-section {
    flex: 3; /* 30% del ancho */
    height: 100%;
    background-color: back; /* Fondo oscuro para los videos, coherente con el tema */
    display: flex;
    align-items: center; /* Centra verticalmente el video */
    justify-content: center; /* Centra horizontalmente */
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100%; /* Asegura que no exceda el 30% */
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Mantiene el aspect ratio sin distorsión */
    aspect-ratio: 9 / 16; /* Fuerza 9:16 (portrait, como reels de TikTok) */
}

#fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    z-index: 1000; /* Asegura que el botón esté encima */
}

#fullscreen-btn:hover {
    background-color: #0056b3;
}

/* Estilos del scoreboard (de tu style.css original, con ajustes) */
.scoreboard {
    width: 100%;
    height: 80%; /* Actualizado de 90% a 80% */
    display: center;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 0px solid white; /* Actualizado de 2px a 8px */
    border-radius: 20px; /* Actualizado de 10px a 20px */
    padding: 0.0%; /* Actualizado de 0.5% a 0.0% */
    box-sizing: border-box;
    overflow-y: hidden;
    margin-left: 10px; /* Añadido para reforzar centrado */
    margin-right: 10px; /* Añadido para reforzar centrado */
    background-color: black; /* Mantener fondo negro */
}

.team-names {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 0.5%;
}

.team-names input {
    background: transparent;
    border: none;
    color: white;
    font-size: clamp(1.5rem, 5vw, 3rem);
    text-align: center;
    width: 45%;
    -webkit-user-modify: read-write-plaintext-only;
}

.points {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 0.5%;
}

.controls {
    display: flex;
    flex-direction: column;
}

.controls button {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    width: clamp(3rem, 8vw, 5rem);
    height: clamp(3rem, 8vw, 5rem);
    margin: 0.2%;
    border-radius: 5px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.controls button:first-child {
    background-color: green;
    color: white;
    border: 0px solid red;
}

.controls button:last-child {
    background-color: red;
    color: white;
    border: 0px solid red;
}

.display {
    display: flex;
    justify-content: space-around;
    flex: 1;
    width: 100%;
}

.display span {
    font-size: clamp(4rem, 15vw, 8rem);
    border: 6px solid red;
    border-radius: 10px;
    padding: 1% 2%;
    background-color: black;
    margin: 0 0.5%;
}

.serve-indicator {
    display: flex;
    align-items: center;
    font-size: clamp(1.2rem, 4vw, 2rem);
    margin-bottom: 0.1%; /* Reducido aún más */
    width: 100%;
    justify-content: center;
}

.arrow {
    color: yellow;
    font-size: clamp(2rem, 6vw, 3rem);
    visibility: hidden;
}

.arrow.active {
    visibility: visible;
}

.games-sets {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: clamp(1.5rem, 4.5vw, 2.5rem);
    margin-bottom: 0.2%; /* Reducido */
}

.games-sets .left, .games-sets .right {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.games-sets span {
    margin-right: 0.5%;
}

.games-sets span span {
    border: 2px solid red;
    border-radius: 5px;
    padding: 0.5% 1%;
    background-color: black;
    font-size: clamp(1.5rem, 4.5vw, 2.5rem);
}

.tiebreak {
    font-size: clamp(3rem, 8vw, 5rem);
    color: red;
    display: none;
    margin-bottom: 0.1%; /* Reducido aún más */
    text-align: center;
    width: 100%;
}

.blinking {
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.controls-bottom {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
    margin-top: -2%; /* Aumentado para subir más */
}



.mode-btn:hover {
    background: #0056b3;
}

.buttons-row {
    display: flex;
    justify-content: center;
    gap: 0.9%;
    width: 100%;
    flex-wrap: wrap;
}

.reset-score, .reset-match {
    font-size: 16px;
    width: clamp(3rem, 8vw, 5rem);
    height: clamp(3rem, 8vw, 5rem);
    margin: 0.2%;
    border-radius: 10px;
    cursor: pointer;
   border: 2px solid white;
    min-width: 5vw;
}

.reset-score {
    background: red;
    color: white;
}

.reset-match {
    background: red;
    color: white;
}

/* Responsive Adjustments */
@media (min-width: 1920px) { /* Large TVs 1920x1080+ */
    .scoreboard { padding: 0.3%; }
    .team-names { font-size: 2.5vw; }
    .display span { font-size: 10vw; }
    .controls button { font-size: 3vw; width: 6vw; height: 6vw; }
    .serve-indicator { font-size: 2vw; }
    .arrow { font-size: 3vw; }
    .games-sets { font-size: 2.5vw; }
    .games-sets span span { font-size: 2.5vw; }
    .tiebreak { font-size: 4vw; }
    .timer { font-size: 2vw; }
    .timer button { font-size: 1.2vw; }
    .mode-btn { font-size: 1.5vw; min-width: 5vw; }
    .buttons-row button { font-size: 1.5vw; min-width: 5vw; }
}

@media (min-width: 1280px) and (max-width: 1919px) { /* Tablets and smaller laptops */
    .scoreboard { padding: 0.3%; }
    .team-names { font-size: 3vw; }
    .display span { font-size: 12vw; }
    .controls button { font-size: 3.5vw; width: 7vw; height: 7vw; }
    .serve-indicator { font-size: 2.5vw; }
    .arrow { font-size: 3.5vw; }
    .games-sets {
        flex-direction: row;
        justify-content: space-between;
    }
    .games-sets { font-size: 3vw; }
    .games-sets span span { font-size: 3vw; }
    .games-sets .left {
        align-items: flex-start;
        margin-right: auto;
    }
    .games-sets .right {
        align-items: flex-end;
        margin-left: auto;
    }
    .tiebreak { font-size: 5vw; }
    .timer { font-size: 1.5vw; } /* Reducido para timer más pequeño */
    .timer button { font-size: 1.2vw; } /* Reducido */
    .mode-btn { font-size: 1.2vw; min-width: 4vw; } /* Botones pequeños */
    .controls-bottom { margin-top: -2.5%; } /* Aumentado para subir más */
    .buttons-row {
        gap: 0.2%;
        flex-wrap: wrap;
    }
    .buttons-row button {
        font-size: 1.6vw;
        min-width: 4vw;
        padding: 0.2% 0.4%;
    }
}

@media (max-width: 767px) { /* Phones */
    .container {
        flex-direction: column; /* Stack vertical en móviles para mejor visibilidad */
    }
    .scoreboard-section, .video-section {
        flex: 1;
        height: 50%; /* Divide la pantalla verticalmente */
    }
    .scoreboard { 
        padding: 1%; 
        height: 100%; 
        overflow-y: hidden; 
    }
    .team-names { 
        font-size: 5vw; 
        flex-direction: column; 
        align-items: center; 
        width: 100%; 
    }
    .team-names input { 
        width: 80%; 
        margin-bottom: 0.5%; 
    }
    .points { 
        flex-direction: column; 
        align-items: center; 
        width: 100%; 
    }
    .controls { 
        flex-direction: row; 
        margin: 0.5% 0; 
    }
    .display { 
        width: 100%; 
        justify-content: center; 
        gap: 2%; 
    }
    .serve-indicator { 
        font-size: 4vw; 
    }
    .arrow { 
        font-size: 5vw; 
    }
    .games-sets {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    .games-sets { 
        font-size: 3.5vw; 
    }
    .games-sets span span { 
        font-size: 3.5vw; 
    }
    .games-sets .left {
        align-items: flex-start;
        margin-right: auto;
    }
    .games-sets .right {
        align-items: flex-end;
        margin-left: auto;
    }
    .tiebreak { 
        font-size: 6vw; 
    }
    .timer { 
        font-size: 2.5vw; 
    }
    .timer button { 
        font-size: 2vw; 
    }
    .mode-btn { font-size: 3vw; min-width: auto; } /* Botones pequeños en móviles */
    .buttons-row { 
        flex-direction: column; 
        gap: 0.3%; 
        width: 100%; 
    }
    .buttons-row button { 
        font-size: 4vw; 
        min-width: auto; 
        padding: 1% 2%; 
    }
}