/* Theme Variables - Dark Mode as Default */
:root {
    --bg-app: #121s12;         /* Deep dark background */
    --bg-card: #1e1e1e;        /* Slightly lighter card background */
    --bg-container: #252525;   /* Container/Board background */
    --text-primary: #e0e0e0;   /* Light text for high contrast */
    --text-secondary: #a0a0a0; /* Dimmed text for labels */
    --text-vs: #444444;        /* Subtle color for 'VS' */
    --accent-x: #3498db;       /* Blue for X */
    --accent-o: #e74c3c;       /* Red for O */
    --border-color: #333333;   /* Grid line color */
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    --button-bg: #ffffff;      /* Button text/elements */
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-app);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Main Container */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

/* Scoreboard Styling */
.scoreboard {
    display: flex;
    justify    content: space-between;
    align-items: center;
    width: 100%;
    background: var(--bg-card);
    padding: 1rem 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.player-score {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.score {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.vs {
    font-weight: 900;
    color: var(--text-vs);
    font-style: italic;
}

/* Game Board Container */
#game-board-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--bg-container);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

#game-board {
    width: 100%;
    height: 100%;
    display: block;
}

/* SVG Element Styling */
line {
    stroke: var(--border-color);
    stroke-width: 2;
}

#marks circle {
    fill: none;
    stroke: var(--accent-o);
    stroke-width: 12;
    stroke-linecap: round;
}

#marks path {
    fill: none;
    stroke: var(--accent-x);
    stroke-width: 12;
    stroke-linecap: round;
}

/* Controls */
.controls {
    width: 100%;
}

button {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    background-color: var(--text-primary);
    color: var(--bg-app);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.2s ease;
}

button:hover {
    opacity: 0.9;
}

button:active {
    transform: scale(0.98);
}

/* Theme Toggle Button Positioning */
.theme-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 10; /* Ensure it stays above the board */
    transition: transform 0.2s ease, background-cor 0.3s ease;
}

.theme-btn:hover {
    transform: scale(1.1);
}

/* Light Mode Overrides */
body.light-mode {
    --bg-app: #ffffff;          /* Pure white background */
    --bg-card: #f8f9fa;         /* Light grey card */
    --bg-container: #ffffff;    /* White board */
    --text-primary: #212529;    /* Dark text */
    --text-secondary: #6c757d;  /* Grey labels */
    --text-vs: #dee2e6;         /* Very light grey VS */
    --border-color: #dee2e6;    /* Light grid lines */
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1); /* Shallower shadow for light mode */
}
