@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500&display=swap');

body {
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 5px;
    font-family: 'Orbitron', sans-serif;
    user-select: none;
    color: #fff;
    /* cursor: url('cursor-retro.png'), auto; */
    /* ← descomenta si tenés un cursor personalizado */
}

#header {
    width: max-content;
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    background: #000;
    padding: 20px 20px;
    align-items: center;
    gap: 30px;

}

#footer {
    width: max-content;
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    background: #000;
    padding: 20px;
    align-items: center;
    gap: 30px;
}

#minas,
#temporizador {
    font-family: 'Digital-7', monospace;
    font-weight: bold;
    font-size: 38px;
    width: 100px;
    height: 64px;
    color: #0ff;
    background: #000;
    border: 1px solid #0ff;
    text-align: center;
    line-height: 64px;
    border-radius: 6px;
    box-shadow: 0 0 8px #0ff;
    /* animation: glow 2s infinite; */
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px #0ff;
    }

    50% {
        box-shadow: 0 0 15px #0ff;
    }

    100% {
        box-shadow: 0 0 5px #0ff;
    }
}

#boton-reinicio {
    font-size: 38px;
    width: 70px;
    height: 70px;
    margin: 0 16px;
    background: #002;
    border: 1px solid #ff0;
    border-radius: 6px;
    cursor: pointer;
    line-height: 60px;
    transition: all 0.2s ease-in-out, transform 0.6s ease;
    color: #ff0;
    box-shadow: 0 0 10px #ff0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#boton-reinicio:hover {
    background: #333;
    box-shadow: 0 0 15px #ff0;
    transform: rotate(360deg);
}

#boton-reinicio:active {
    transform: scale(0.95);
    box-shadow: 0 0 5px #ff0 inset;
}


#tablero {
    border: 1px solid #3affff;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    box-shadow: 0 0 12px #00f0ff;
    animation: glow 2s infinite;
}

#tablero td {
    width: 40px;
    height: 40px;
    background: #000000;
    border: 1px solid #00f0ff;
    box-shadow: inset 0 0 4px #0ff4;
    cursor: pointer;
    text-align: center;
    vertical-align: middle;
    font-weight: bold;
    font-size: 27px;
    color: white;
    transition: all 0.2s ease;
    padding: 2px;
    font-family: 'Orbitron', sans-serif;
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

#tablero td:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px #ffffffff;
    border: 1px solid #ffffffff;
}

#tablero td.abierto {
    background: #1e1e1e;
    box-shadow: inset 0 0 8px #0ff2;
    color: #fff;
    cursor: default;
    animation: abrirCelda 0.2s ease;
}

@keyframes abrirCelda {
    from {
        transform: scale(0.8);
        opacity: 0.5;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

#tablero td.mina {
    background: #ff0044;
    color: #fff;
    box-shadow: 0 0 8px #ff0044;
}

#tablero td.marca {
    background: #1e1e1e;
    color: #00ffff;
    text-shadow: 0 0 4px #00ffff;
}

#tablero td.num1 {
    color: #00ff88;
    text-shadow: 0 0 4px #00ff88;
}

#tablero td.num2 {
    color: #ff0;
    text-shadow: 0 0 4px #ff0;
}

#tablero td.num3 {
    color: #ff44aa;
    text-shadow: 0 0 4px #ff44aa;
}

#tablero td.num4 {
    color: #ffaa00;
    text-shadow: 0 0 4px #ffaa00;
}

#tablero td.num5 {
    color: #ff0000;
    text-shadow: 0 0 4px #ff0000;
}

#tablero td.num6 {
    color: #00ffff;
    text-shadow: 0 0 4px #00ffff;
}

#tablero td.num7 {
    color: #fff;
    text-shadow: 0 0 4px #fff;
}

#tablero td.num8 {
    color: #aaa;
    text-shadow: 0 0 4px #aaa;
}

/* Animación al ganar o perder (activala con body.ganado o body.perdido) */
body.ganado {
    animation: victoria 0.6s ease forwards;
}

@keyframes victoria {
    0% {
        background: #000;
    }

    50% {
        background: #0f0;
    }

    100% {
        background: #000;
    }
}

body.perdido {
    animation: derrota 0.6s ease forwards;
}

@keyframes derrota {
    0% {
        background: #000;
    }

    50% {
        background: #f00;
    }

    100% {
        background: #000;
    }
}

/* Botón estilo neón */
.neon-button {
    background: transparent;
    border: 2px solid #0ff;
    color: #0ff;
    font-family: 'Rajdhani', sans-serif;
    padding: 10px 20px;
    font-size: 1.5rem;
    text-shadow: 0 0 5px #0ff;
    box-shadow: 0 0 8px #0ff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.neon-button:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 12px #0ff, 0 0 20px #0ff;
}

/* Modal general */
.modal {
    display: none;
    /* oculto por defecto */
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(3px);
    justify-content: center;
    align-items: center;
}

/* Contenido del modal */
.modal-content {
    background-color: #111;
    border: 2px solid #0ff;
    color: #0ff;
    padding: 20px 30px;
    max-width: 900px;
    width: 90%;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    box-shadow: 0 0 15px #0ff, 0 0 30px #00ffff66;
    border-radius: 16px;
    text-align: left;
    position: relative;
}

/* Botón de cierre */
.close-button {
    color: #0ff;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 4rem;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 0 0 5px #0ff;
}

.close-button:hover {
    color: #fff;
    text-shadow: 0 0 10px #fff;
}

.neon-link {
    color: #0ff;
    text-decoration: none;
    font-size: 2.3rem;
    padding: 2px 8px;
    background: transparent;
    border: 2px solid #0ff;
    text-shadow: 0 0 5px #0ff;
    box-shadow: 0 0 8px #0ff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.neon-link:hover {
    background-color: rgba(0, 255, 255, 0.1);
    color: #0ff;
    box-shadow: 0 0 10px #0ff, 0 0 20px #0ff;
    text-shadow: 0 0 10px #0ff;
}

.juego-final {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00ffff;
    text-align: end;
    margin-top: 20px;
    /*animation: glow 1.3s infinite alternate;*/
}

@keyframes glow {
    0% {
        text-shadow: 0 0 5px #00ffff, 0 0 10px #00ffff, 0 0 15px #ff00ff;
    }

    100% {
        text-shadow: 0 0 10px #00ffff, 0 0 20px #ff00ff, 0 0 30px #ffffff;
    }
}

/* CLASES RESPONSIVAS */

@media (max-width: 600px) {

    html,
    body {
        margin: 0;
        padding: 0;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background-color: #000;
        /* ajustá a tu fondo */
        box-sizing: border-box;
    }

    #header,
    #footer {
        width: 100%;
        display: flex;
        justify-content: space-around;
        align-items: center;
        flex-direction: row;
        gap: 10px;
        padding: 8px;
        box-sizing: border-box;
    }

    #tablero {
        border-collapse: collapse;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        table-layout: fixed;
    }

    #tablero td {
        width: 28px;
        height: 28px;
        font-size: 14px;
        text-align: center;
        vertical-align: middle;
        line-height: 28px;
        padding: 0;
        overflow: hidden;
        box-sizing: border-box;
    }

    #boton-reinicio {
        font-size: 20px;
        width: 40px;
        height: 40px;
    }

    .modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.8);
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
        box-sizing: border-box;
        overflow: hidden;
    }

    .modal-content {
        background: #111;
        color: #fff;
        width: 100%;
        max-height: 90%;
        overflow-y: auto;
        border-radius: 10px;
        padding: 16px;
        font-size: 14px;
        box-sizing: border-box;
    }

    .juego-final {
        text-align: center;
        font-size: 16px;
    }

    #openModal,
    .close-button {
        font-size: 16px;
    }
}