/* ── Reset ─────────────────────────────────────────────────── */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ── Fondo principal ────────────────────────────────────────── */
.background {
    background-image: url('Fondo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

/* ── Título ─────────────────────────────────────────────────── */
.title-text {
    color: #FFD700;
    font-size: 55px;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.9);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   PANTALLA DE SELECCIÓN DE MODO
═══════════════════════════════════════════════════════════════ */
#modeScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: fadeIn 0.4s ease;
}

.mode-subtitle {
    color: #f0f0f0;
    font-size: 20px;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
}

.mode-buttons {
    display: flex;
    gap: 24px;
    margin-top: 10px;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 145px;
    padding: 24px 16px;
    border-radius: 16px;
    border: 2px solid rgba(255, 215, 0, 0.4);
    background: rgba(0, 0, 0, 0.65);
    color: white;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
    backdrop-filter: blur(6px);
}

.mode-btn:hover {
    background: rgba(255, 215, 0, 0.18);
    border-color: #FFD700;
    transform: translateY(-4px);
}

.mode-icon {
    font-size: 42px;
    line-height: 1;
}

.mode-label {
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
}

.mode-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

/* ═══════════════════════════════════════════════════════════════
   PANTALLA DE JUEGO
═══════════════════════════════════════════════════════════════ */
#gameScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    animation: fadeIn 0.4s ease;
}

/* ── Marcador (intentos) ────────────────────────────────────── */
.score-board {
    display: flex;
    align-items: center;
    gap: 30px;
    background: rgba(0,0,0,0.70);
    padding: 14px 32px;
    border-radius: 50px;
    border: 1px solid rgba(255,215,0,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    margin-bottom: 14px;
}

.score-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.score-name {
    color: white;
    font-size: 15px;
    font-weight: bold;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score-label {
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-val {
    font-size: 26px;
    font-weight: bold;
}

.score-divider {
    color: rgba(255,215,0,0.6);
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

#attX, .playerX { color: #09C372; }
#attO, .playerO { color: #498AF8; }

/* ── Indicador de turno ─────────────────────────────────────── */
.display {
    color: #f0f0f0;
    font-size: 20px;
    margin-bottom: 18px;
    background: rgba(0,0,0,0.5);
    padding: 5px 15px;
    border-radius: 10px;
}

.display-player {
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

/* ── Tablero ────────────────────────────────────────────────── */
.container {
    display: grid;
    grid-template-columns: repeat(3, 95px);
    grid-template-rows: repeat(3, 95px);
    gap: 12px;
    background: rgba(0,0,0,0.4);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,215,0,0.2);
}

.tile {
    border: 2px solid #FFD700;
    width: 95px;
    height: 95px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 48px;
    cursor: pointer;
    background-color: rgba(255,255,255,0.05);
    color: white;
    transition: background 0.2s, transform 0.15s;
    user-select: none;
}

.tile:hover {
    background-color: rgba(255,215,0,0.15);
    transform: scale(1.03);
}

/* ── Anunciador ─────────────────────────────────────────────── */
.announcer {
    color: #FFD700;
    font-size: 28px;
    margin-top: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,1);
    text-align: center;
}

/* ── Botón reset ────────────────────────────────────────────── */
#reset {
    background: linear-gradient(135deg, #FF3860 0%, #b01e3a 100%);
    color: white;
    padding: 12px 30px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 22px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s, filter 0.2s;
}

#reset:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

#reset:active {
    transform: translateY(1px);
}

/* ── Utilitario ─────────────────────────────────────────────── */
.hide { display: none !important; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
