/* Estilos base para el body y header */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    font-family: "Press Start 2P", system-ui;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
}

header {
    font-size: 18px;
    margin-top: 5px;
    margin-bottom: 10px;
    color: #00d4ff;
    text-align: center;
    text-shadow: 0 0 10px #00d4ff, 0 0 20px #00d4ff;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 10px #00d4ff, 0 0 20px #00d4ff; }
    to { text-shadow: 0 0 15px #00d4ff, 0 0 25px #00d4ff, 0 0 35px #00d4ff; }
}

/* Estilos para el contenedor principal */
.main-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    max-width: 1000px;
    padding: 10px;
    box-sizing: border-box;
    margin-bottom: 20px;
}

aside.rules, aside.record {
    color: #e8e8e8;
    width: 18%;
    max-width: 200px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(5px);
}

.rules h2, .record h2 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #00d4ff;
    text-shadow: 0 0 5px #00d4ff;
}

.rules ul, .record ol {
    padding-left: 15px;
}

.rules li, .record li {
    font-size: 10px;
    margin-bottom: 6px;
    line-height: 1.3;
    color: #b8b8b8;
}

/* Estilos para el contenedor central del juego */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    margin: 0 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(5px);
}

/* Estilos para la sección de puntuación */
.puntuacion {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.puntuacion p {
    color: #e8e8e8;
    margin: 3px 0;
    font-size: 12px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

#resultado {
    margin-top: 5px;
    color: #00ff88;
    font-size: 12px;
    min-height: 15px;
    text-shadow: 0 0 5px #00ff88;
    font-weight: bold;
}

#reiniciar, #acabar {
    background: linear-gradient(145deg, #00d4ff, #0099cc);
    color: white;
    font-size: 12px;
    padding: 8px 15px;
    margin: 5px;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 212, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

#reiniciar:hover, #acabar:hover {
    background: linear-gradient(145deg, #00ff88, #00cc6a);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 255, 136, 0.4);
}

#reiniciar:active, #acabar:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 212, 255, 0.3);
}

#victorias {
    color: #00ff88;
    text-shadow: 0 0 5px #00ff88;
    font-weight: bold;
}

#derrotas {
    color: #ff6b6b;
    text-shadow: 0 0 5px #ff6b6b;
    font-weight: bold;
}

/* Estilos para el contenedor de botones */
.button-container {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    gap: 8px;
    width: 100%;
    margin-top: 5px;
    margin-bottom: 10px;
    justify-content: center;
}

.button-container input[type="button"] {
    height: 100px;
    width: 100px;
    font-size: 50px;
    cursor: pointer;
    background: linear-gradient(145deg, #2a2a3e, #1a1a2e);
    border: 2px solid #00d4ff;
    border-radius: 12px;
    color: #00d4ff;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-shadow: 0 0 10px #00d4ff;
}

.button-container input[type="button"]:hover {
    background: linear-gradient(145deg, #00d4ff, #0099cc);
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 212, 255, 0.4);
    text-shadow: none;
}

.button-container input[type="button"]:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 8px rgba(0, 212, 255, 0.3);
}

/* Efecto especial para botones con X y O */
.button-container input[type="button"][value="X"] {
    color: #ff6b6b;
    text-shadow: 0 0 10px #ff6b6b;
    border-color: #ff6b6b;
}

.button-container input[type="button"][value="O"] {
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88;
    border-color: #00ff88;
}

/* Responsive para tablets */
@media (max-width: 768px) {
    body {
        padding: 8px;
        justify-content: flex-start;
    }

    header {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .main-layout {
        flex-direction: column;
        align-items: center;
        padding: 8px;
        gap: 10px;
        margin-bottom: 15px;
    }

    aside.rules, aside.record {
        width: 100%;
        max-width: 400px;
        margin: 0;
        padding: 8px;
    }

    .rules h2, .record h2 {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .rules li, .record li {
        font-size: 9px;
        margin-bottom: 4px;
    }

    .container {
        margin: 0;
        padding: 12px;
        width: 100%;
        max-width: 400px;
    }

    .puntuacion {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px;
        margin-bottom: 8px;
    }

    .puntuacion p {
        font-size: 10px;
        margin: 0 5px;
    }

    #resultado {
        font-size: 11px;
        margin: 5px 0;
    }

    #reiniciar, #acabar {
        font-size: 10px;
        padding: 6px 10px;
        margin: 0 3px;
    }

    .button-container {
        grid-template-columns: repeat(3, 90px);
        gap: 6px;
        margin: 8px 0;
    }

    .button-container input[type="button"] {
        height: 90px;
        width: 90px;
        font-size: 45px;
    }
}

/* Responsive para móviles */
@media (max-width: 480px) {
    body {
        padding: 5px;
        justify-content: flex-start;
        overflow-y: auto;
    }

    header {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .main-layout {
        padding: 5px;
        gap: 8px;
        margin-bottom: 10px;
    }

    aside.rules, aside.record {
        padding: 6px;
        border-radius: 6px;
    }

    .rules h2, .record h2 {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .rules li, .record li {
        font-size: 8px;
        margin-bottom: 3px;
        line-height: 1.2;
    }

    .container {
        padding: 8px;
        border-radius: 8px;
    }

    .puntuacion {
        flex-direction: column;
        padding: 6px;
        margin-bottom: 6px;
        gap: 3px;
    }

    .puntuacion p {
        font-size: 9px;
    }

    #resultado {
        font-size: 10px;
        margin: 3px 0;
    }

    #reiniciar, #acabar {
        font-size: 9px;
        padding: 5px 8px;
        margin: 2px;
    }

    .button-container {
        grid-template-columns: repeat(3, 75px);
        gap: 5px;
        margin: 6px 0;
    }

    .button-container input[type="button"] {
        height: 75px;
        width: 75px;
        font-size: 35px;
        border-radius: 8px;
    }
}

/* Responsive para móviles muy pequeños */
@media (max-width: 360px) {
    .button-container {
        grid-template-columns: repeat(3, 65px);
        gap: 4px;
    }

    .button-container input[type="button"] {
        height: 65px;
        width: 65px;
        font-size: 30px;
    }

    .puntuacion {
        padding: 4px;
    }

    .puntuacion p {
        font-size: 8px;
    }

    #reiniciar, #acabar {
        font-size: 8px;
        padding: 4px 6px;
    }
}






