/* style.css */

:root { 
    --bg: #020617; 
    --card: #1e293b; 
    --accent: #0ea5e9; 
    --text: #f8fafc; 
    --x-color: #f43f5e;
    --o-color: #0ea5e9;
    
    /* Difficulty Colors */
    --easy: #22c55e;
    --normal: #eab308;
    --difficult: #f97316;
    --impossible: #ef4444;
}

body { 
    font-family: 'Segoe UI', Roboto, sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    margin: 0; 
    overflow-x: hidden;
}

/* NAVIGATION */
nav { 
    background: rgba(0, 0, 0, 0.8); 
    padding: 1rem; 
    display: flex; 
    justify-content: center; 
    gap: 20px; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    border-bottom: 2px solid var(--accent);
    backdrop-filter: blur(10px);
}
nav a { color: white; text-decoration: none; font-weight: bold; font-size: 0.9rem; cursor: pointer; transition: 0.3s; }
nav a:hover { color: var(--accent); text-shadow: 0 0 8px var(--accent); }

.container { max-width: 900px; margin: auto; padding: 20px; }

/* GAME AREA & ANIMATIONS */
.game-area { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    background: var(--card); 
    padding: 40px 20px; 
    border-radius: 24px; 
    margin: 20px 0; 
    border: 1px solid #334155;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* LEVEL SELECTION DROPDOWN */
.level-picker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    width: 100%;
}

.custom-select {
    background: #0f172a;
    color: var(--text);
    border: 2px solid var(--accent);
    padding: 12px 20px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    outline: none;
    width: 80%;
    max-width: 300px;
    text-align: center;
    appearance: none; 
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.2);
    transition: 0.3s;
}
.custom-select:hover { border-color: #38bdf8; box-shadow: 0 0 20px rgba(14, 165, 233, 0.4); }
.custom-select optgroup { background: var(--card); color: var(--accent); font-style: normal; font-weight: bold; }
.custom-select option { background: #0f172a; color: white; font-weight: normal; }

/* DIFFICULTY BADGE */
.difficulty-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    box-shadow: 0 0 10px currentColor;
    transition: all 0.3s ease;
}

/* STATUS MESSAGE */
#status { font-size: 1.2rem; min-height: 1.5em; margin-bottom: 20px; font-weight: bold; text-align: center; }

/* THE BOARD */
.board { 
    display: grid; 
    grid-template-columns: repeat(3, 100px); 
    gap: 15px; 
    background: #0f172a;
    padding: 15px;
    border-radius: 15px;
    border: 1px solid var(--accent);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.1);
}

.cell { 
    width: 100px; 
    height: 100px; 
    background: #1e293b; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 3rem; 
    cursor: pointer; 
    border: 1px solid #334155; 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.cell:hover { background: #334155; border-color: var(--accent); transform: scale(1.02); }

.cell.x { color: var(--x-color); text-shadow: 0 0 15px var(--x-color); animation: pop 0.3s ease-out; }
.cell.o { color: var(--o-color); text-shadow: 0 0 15px var(--o-color); animation: pop 0.3s ease-out; }

@keyframes pop {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* CONTENT SECTIONS */
.page { display: none; padding: 30px; background: var(--card); border-radius: 15px; margin-top: 20px; line-height: 1.8; }
.active { display: block; animation: fadeIn 0.5s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

footer { text-align: center; padding: 40px; color: #64748b; font-size: 0.8rem; border-top: 1px solid #334155; margin-top: 50px; }
h2 { color: var(--accent); }

button.reset { 
    margin-top: 30px; 
    background: transparent; 
    border: 2px solid var(--accent); 
    color: var(--accent); 
    padding: 10px 25px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: bold;
    transition: 0.3s;
}
button.reset:hover { background: var(--accent); color: white; }

@media (max-width: 400px) {
    .board { grid-template-columns: repeat(3, 80px); gap: 10px; }
    .cell { width: 80px; height: 80px; font-size: 2.5rem; }
}