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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e);
    color: #00d4ff;
    min-height: 100vh;
    overflow-x: hidden;
    /* Added padding-top to prevent content from going under fixed nav */
    padding-top: 80px; /* Adjust this value if your nav bar height changes */
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Navigation */
.nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 1000;
    /* Added background to ensure it covers content when scrolling */
    background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e);
    padding: 10px 20px; /* Add some padding to the nav itself */
    border-radius: 30px; /* Optional: for a softer look */
}

.nav-btn {
    padding: 10px 20px;
    background: rgba(0, 212, 255, 0.1);
    border: 2px solid #00d4ff;
    border-radius: 25px;
    color: #00d4ff;
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.nav-btn:hover,
.nav-btn.active {
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
    transform: translateY(-2px);
}

/* Pages */
.page {
    display: none;
    width: 100%;
    text-align: center;
    /* Removed absolute positioning and top offset as body padding handles it */
    position: relative; /* Changed to relative */
    padding-bottom: 50px;
    min-height: calc(100vh - 80px); /* Still useful for page height */
    background: inherit;
    z-index: 1;
}

.page.active {
    display: block;
    z-index: 2;
}

/* Home Page */
.title {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 2rem;
    text-shadow:
        0 0 10px #00d4ff,
        0 0 20px #00d4ff,
        0 0 40px #00d4ff,
        0 0 80px #00d4ff;
    animation: pulse 2s infinite alternate;
}

@keyframes pulse {
    from {
        text-shadow: 0 0 10px #00d4ff, 0 0 20px #00d4ff, 0 0 40px #00d4ff;
    }
    to {
        text-shadow: 0 0 20px #00d4ff, 0 0 30px #00d4ff, 0 0 60px #00d4ff,
            0 0 100px #00d4ff;
    }
}

.welcome-text {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease-out;
}

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

.input-section {
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}

.name-input {
    padding: 15px 20px;
    font-size: 1.1rem;
    background: rgba(0, 212, 255, 0.1);
    border: 2px solid #00d4ff;
    border-radius: 25px;
    color: #00d4ff;
    font-family: 'Orbitron', monospace;
    width: 300px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    transition: all 0.3s ease;
}

.name-input:focus {
    outline: none;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

.name-input::placeholder {
    color: rgba(0, 212, 255, 0.5);
}

.option-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    background: rgba(0, 212, 255, 0.1);
    border: 2px solid #00d4ff;
    border-radius: 25px;
    color: #00d4ff;
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.btn:hover {
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
    transform: translateY(-2px);
}

.btn.selected {
    background: rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.8);
}

.symbol-selection {
    margin-bottom: 2rem;
}

.symbol-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.symbol-btn {
    width: 80px;
    height: 80px;
    font-size: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Center START GAME */
#startGameGroup {
    text-align: center;
}

/* Game Board */
.game-container {
    text-align: center;
}

.game-info {
    margin-bottom: 2rem;
}

.current-player {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 120px);
    grid-template-rows: repeat(3, 120px);
    gap: 5px;
    padding: 5px;
    background: #00d4f0; /* tighter dark base, blends with theme */
    border: 2px solid #00d4ff;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
    width: max-content;
    margin: 0 auto 2rem auto;
}


.cell {
    background: #1a1a2e;
    border: none;
    font-size: 3rem;
    font-weight: 900;
    color: #00d4ff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Orbitron', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.cell:hover {
    background: rgba(0, 212, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(0, 212, 255, 0.3);
}

.cell.x {
    color: #ff6b6b;
    text-shadow: 0 0 10px #ff6b6b;
}

.cell.o {
    color: #4ecdc4;
    text-shadow: 0 0 10px #4ecdc4;
}

.game-status {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    min-height: 2rem;
}

.winner {
    color: #4ecdc4;
    text-shadow: 0 0 20px #4ecdc4;
    animation: celebration 1s ease-in-out;
}

@keyframes celebration {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.reset-btn {
    margin-top: 1rem;
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(0, 212, 255, 0.1);
    border: 2px solid #00d4ff;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: #4ecdc4;
    text-shadow: 0 0 10px #4ecdc4;
}

.stat-label {
    font-size: 1rem;
    margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }

    .nav {
        flex-wrap: wrap;
    }

    .board {
        grid-template-columns: repeat(3, 100px);
        grid-template-rows: repeat(3, 100px);
    }

    .cell {
        font-size: 2.5rem;
    }

    .name-input {
        width: 250px;
    }

    .option-buttons {
        flex-direction: column;
        align-items: center;
    }
}
