* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background: linear-gradient(135deg, #111, #1b1b1b);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.contenedor {
    background: #1f1f1f;
    width: 700px;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    text-align: center;
    border: 1px solid #333;
}

h1 {
    margin-bottom: 25px;
    color: #00c896;
    font-size: 32px;
}

.volver {
    display: inline-block;
    margin-bottom: 20px;
    color: #00c896;
    text-decoration: none;
    font-weight: 600;
}

.volver:hover {
    text-decoration: underline;
}

.panel {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.jugador {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.jugador label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #ddd;
}

.jugador input {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #2a2a2a;
    color: #fff;
    font-size: 16px;
}

.jugador input:focus {
    box-shadow: 0 0 0 3px rgba(0, 200, 150, 0.2);
    border-color: #00c896;
    outline: none;
}

.botones {
    margin: 20px 0;
}

button {
    padding: 12px 22px;
    margin: 5px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: 0.3s;
    color: white;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(1px);
}

#btnIniciar {
    background: linear-gradient(45deg, #00c896, #00e0a8, #00c896);
    background-size: 200%;
}

#btnIniciar:hover {
    background-position: right;
    box-shadow: 0 0 12px rgba(0, 200, 150, 0.4);
}

#btnReiniciar {
    background: linear-gradient(45deg, #3d6bff, #4d7bff, #3d6bff);
    background-size: 200%;
}

#btnReiniciar:hover {
    background-position: right;
    box-shadow: 0 0 12px rgba(61, 107, 255, 0.4);
}

#btnNueva {
    background: linear-gradient(45deg, #ff4757, #ff5767, #ff4757);
    background-size: 200%;
}

#btnNueva:hover {
    background-position: right;
    box-shadow: 0 0 12px rgba(255, 71, 87, 0.4);
}

#turno {
    margin: 20px 0;
    color: #ddd;
    font-size: 18px;
    font-weight: 600;
}

#tablero {
    display: grid;
    grid-template-columns: repeat(3, 120px);
    grid-template-rows: repeat(3, 120px);
    gap: 12px;
    justify-content: center;
    margin: 25px auto;
    padding: 10px;
    background: #1f1f1f;
    border-radius: 24px;
    border: 2px solid #00c896;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

.celda {
    background: #252525;
    border: 3px solid #00c896;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 60px;
    font-weight: bold;
    transition: 0.3s;
    user-select: none;
    border-radius: 12px;
}

.celda:hover {
    background: #2a2a2a;
    box-shadow: 0 0 12px rgba(0, 200, 150, 0.3);
}

/* X */
.celda.x {
    color: #00c896;
}

/* O */
.celda.o {
    color: #ff4757;
}

/* Casillas ganadoras */
.celda.ganadora {
    box-shadow: inset 0 0 0 4px rgba(0, 200, 150, 0.6);
    animation: parpadeo 1s infinite alternate;
}

@keyframes parpadeo {
    from {
        box-shadow: inset 0 0 0 4px rgba(0, 200, 150, 0.4);
    }
    to {
        box-shadow: inset 0 0 0 4px rgba(0, 200, 150, 0.8);
    }
}

.marcador {
    margin-top: 20px;
    padding: 20px;
    background: #252525;
    border-radius: 18px;
    border-left: 4px solid #00c896;
    box-shadow: 0 6px 15px rgba(0, 200, 150, 0.1);
}

.marcador h2 {
    margin-bottom: 15px;
    color: #00c896;
}

.marcador p {
    margin: 6px 0;
    font-size: 16px;
    color: #aaa;
}

#mensaje {
    margin-top: 15px;
    font-size: 18px;
    color: #00c896;
    font-weight: 600;
    min-height: 24px;
}

@media (max-width: 700px) {
    .contenedor {
        width: 100%;
    }

    .panel {
        flex-direction: column;
    }

    #tablero {
        grid-template-columns: repeat(3, 90px);
        grid-template-rows: repeat(3, 90px);
    }

    .celda {
        font-size: 45px;
    }
}