@font-face {
    font-family: Banger;
    src: url(../fonts/Bangers-Regular.ttf);
}
/* --- RESET --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* --- BODY --- */
body {
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    color: #333;
}

h1 {
    margin-bottom: 30px;
    font-size: 2rem;
    text-align: center;
    color: #454545  ;
    text-shadow: 1px 1px 2px rgba(0,0,255,0.1);
    font-family: Banger;
}

/* --- MAIN CONTAINER --- */
.main-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* --- FILAS --- */
.row {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* --- CASILLAS --- */
.square {
    width: 60px;
    height: 60px;
    border: 2px solid #ccc;
    border-radius: 10px;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    outline: none;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.square:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 10px rgba(74,144,226,0.5);
}

/* --- ESTADOS --- */


.gold {
    background-color: #c9b458;
    color: #fff;
    border-color: #c9b458;
    animation: flip 0.6s ease forwards;
}
.green {
    background-color: #6aaa64;
    color: #fff;
    border-color: #6aaa64;
    animation: flip 0.6s ease forwards;
}
/* --- ANIMACIÓN DE ENTRADA --- */
@keyframes flip {
    0% { transform: rotateX(0deg); }
    50% { transform: rotateX(90deg); }
    100% { transform: rotateX(0deg); }
}

/* --- RESULTADOS --- */
.result {
    margin-top: 30px;
    text-align: center;
    font-size: 1.2rem;
    animation: fadeIn 0.8s ease forwards;
}

.result p {
    margin-bottom: 15px;
}

.button {
    padding: 10px 20px;
    background-color: #4a90e2;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button:hover {
    background-color: #357abd;
    transform: scale(1.05);
}

.timer {
    margin-top: 20px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #1a1a1a;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* --- Fondo oscuro de modal --- */
.result {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;
    visibility: hidden;

    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
    z-index: 999;
        margin: 0;
}

/* Cuando está activo */
.result.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}
/* --- Caja emergente --- */
.result .modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 30px 40px;
    max-width: 400px;
    text-align: center;
    animation: popIn 0.4s ease;
    box-shadow: 0px 8px 25px rgba(0,0,0,0.25);
}

/* Títulos */
.result .modal-content h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: bold;
}

/* Texto */
.result .modal-content p {
    font-size: 1rem;
    margin-bottom: 20px;
}

/* Botón */
.result .modal-content button {
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

/* Éxito */
.result.success .modal-content {
    border: 3px solid #2ecc71;
}
.result.success h2 {
    color: #2ecc71;
}
.result.success button {
    background: #2ecc71;
    color: white;
}
.result.success button:hover {
    background: #27ae60;
}

/* Derrota */
.result.failure .modal-content {
    border: 3px solid #e74c3c;
}
.result.failure h2 {
    color: #e74c3c;
}
.result.failure button {
    background: #e74c3c;
    color: white;
}
.result.failure button:hover {
    background: #c0392b;
}

/* Animación */
@keyframes popIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- ANIMACIÓN RESULTADOS --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
    .square {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }
}
