:root{
    --cell-size: 150px;
    --cell-gap: 10px;
    --board-padding: 10px;

    /* Dark blue theme */
    --bg-1: #081529; /* darkest */
    --bg-2: #0f2a59; /* deep game background */
    --board-bg: rgba(10,36,75,0.6);
    --cell-bg: rgba(255,255,255,0.06);
    --cell-bg-hover: rgba(255,255,255,0.10);
    --text-on-dark: #e6f0ff;
    --accent: #4ea1ff;
    --win-light: #86c5ff; /* lighter blue on win */
    --x-neon: #39ff14; /* neon green for X */
    --o-neon: #ff3b3b; /* neon red for O */
}

body {
    font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
    color: var(--text-on-dark);
}

/* Neon colors for players */
.cell.player-x {
    color: var(--x-neon);
    text-shadow: 0 0 8px rgba(57,255,20,0.25), 0 0 18px rgba(57,255,20,0.12);
}

.cell.player-o {
    color: var(--o-neon);
    text-shadow: 0 0 8px rgba(255,59,59,0.25), 0 0 18px rgba(255,59,59,0.12);
}

/* Strong neon glow for placed cells */
.cell.player-x {
    background: linear-gradient(180deg, rgba(57,255,20,0.06), rgba(57,255,20,0.03));
    box-shadow: 0 6px 20px rgba(2,8,0,0.6), 0 0 24px rgba(57,255,20,0.18), inset 0 -6px 12px rgba(0,0,0,0.45);
    border-color: rgba(57,255,20,0.18);
}

.cell.player-o {
    background: linear-gradient(180deg, rgba(255,59,59,0.06), rgba(255,59,59,0.03));
    box-shadow: 0 6px 20px rgba(30,0,0,0.6), 0 0 24px rgba(255,59,59,0.18), inset 0 -6px 12px rgba(0,0,0,0.45);
    border-color: rgba(255,59,59,0.18);
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

h1 {
    color: #ffffff;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-size: 2.5em;
}

.game-container {
    text-align: center;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, var(--cell-size));
    grid-template-rows: repeat(3, var(--cell-size));
    gap: var(--cell-gap);
    margin: 28px auto;
    background-color: var(--board-bg);
    padding: var(--board-padding);
    border-radius: 14px;
    width: fit-content;
    box-shadow: 0 8px 32px rgba(2, 10, 30, 0.6);
}

.cell {
    background-color: var(--cell-bg);
    border: 1px solid rgba(255,255,255,0.04);
    font-size: 3.5rem;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
    color: var(--text-on-dark);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 -6px 12px rgba(0,0,0,0.25);
    position: relative;
    z-index: 0;
}

.cell:hover:not(:disabled) {
    background-color: var(--cell-bg-hover);
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(0, 20, 60, 0.6);
}

.cell:disabled {
    cursor: not-allowed;
}

.status {
    font-size: 1.6rem;
    margin: 20px 0;
    color: var(--text-on-dark);
    min-height: 40px;
}

.reset-btn {
    padding: 10px 30px;
    font-size: 1rem;
    background-color: transparent;
    color: var(--text-on-dark);
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.18s;
    font-weight: 700;
}

.reset-btn:hover {
    background-color: rgba(78,161,255,0.08);
    transform: scale(1.03);
    border-color: rgba(78,161,255,0.18);
}

.winner {
    color: #ffeb3b;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.scoreboard {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}

.score {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 30px;
    background-color: rgba(255,255,255,0.03);
    border-radius: 8px;
    min-width: 120px;
    box-shadow: 0 4px 18px rgba(2,6,30,0.5);
    border: 1px solid rgba(255,255,255,0.03);
}

.player-label {
    font-size: 1em;
    color: var(--text-on-dark);
    margin-bottom: 5px;
}

.score-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
}

@keyframes glow-blue {
    0% { box-shadow: 0 0 6px rgba(134,197,255,0.25); transform: scale(1); }
    50% { box-shadow: 0 0 18px rgba(134,197,255,0.5); transform: scale(1.02); }
    100% { box-shadow: 0 0 6px rgba(134,197,255,0.25); transform: scale(1); }
}

.winning-cell {
    background: linear-gradient(180deg, rgba(134,197,255,0.18), rgba(78,161,255,0.12));
    color: var(--bg-1) !important;
    animation: glow-blue 1.2s ease-in-out infinite;
    transform-origin: center;
}

@keyframes glow-x {
    0% { box-shadow: 0 0 6px rgba(57,255,20,0.18); }
    50% { box-shadow: 0 0 18px rgba(57,255,20,0.35); }
    100% { box-shadow: 0 0 6px rgba(57,255,20,0.18); }
}

@keyframes glow-o {
    0% { box-shadow: 0 0 6px rgba(255,59,59,0.18); }
    50% { box-shadow: 0 0 18px rgba(255,59,59,0.35); }
    100% { box-shadow: 0 0 6px rgba(255,59,59,0.18); }
}

.winning-cell.winning-x {
    background: linear-gradient(180deg, rgba(57,255,20,0.12), rgba(57,255,20,0.06));
    color: #00110a !important;
    animation: glow-x 0.9s ease-in-out infinite;
    box-shadow: 0 8px 36px rgba(57,255,20,0.35), 0 0 48px rgba(57,255,20,0.22), 0 0 120px rgba(57,255,20,0.18) !important;
    outline: 2px solid rgba(57,255,20,0.22);
    transform: scale(1.04);
    z-index: 5;
}

.winning-cell.winning-o {
    background: linear-gradient(180deg, rgba(255,59,59,0.12), rgba(255,59,59,0.06));
    color: #2b0000 !important;
    animation: glow-o 0.9s ease-in-out infinite;
    box-shadow: 0 8px 36px rgba(255,59,59,0.35), 0 0 48px rgba(255,59,59,0.22), 0 0 120px rgba(255,59,59,0.18) !important;
    outline: 2px solid rgba(255,59,59,0.22);
    transform: scale(1.04);
    z-index: 5;
}

/* Audio control - top-right minimal buttons */
#audio-control {
    position: fixed;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(0,0,0,0.25);
    padding: 6px 8px;
    border-radius: 999px;
    z-index: 1000;
}

.audio-btn {
    background: rgba(255,255,255,0.08);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
}

.audio-btn:hover { background: rgba(255,255,255,0.14); }

#audio-control audio { display: none; }
