:root {
    --primary-color: #348cb2;
    --secondary-color: #25617d;
    --background-color: rgba(0, 0, 0, 0.8);
    --text-color: #ffffff;
    --cell-size: 110px;
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--background-color);
    font-family: 'Source Sans Pro', sans-serif;
    color: var(--text-color);
}

.game-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    text-align: center;
}

h1 {
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.mode-selector, .difficulty-selector {
    margin-bottom: 1rem;
}

button {
    background: var(--secondary-color);
    color: var(--text-color);
    border: none;
    padding: 0.8rem 1.5rem;
    margin: 0 0.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

button:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

button.active {
    background: var(--primary-color);
    box-shadow: 0 0 15px rgba(52, 140, 178, 0.5);
}

.status {
    margin: 1rem 0;
    font-size: 1.2rem;
}

.board {
    max-width: 650px;
    margin: 10px auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px 10px; /* First value (3px) is for row gap, second value (10px) is for column gap */
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 4rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cell:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cell.x {
    color: #ff4757;
}

.cell.o {
    color: #2ed573;
}

.restart {
    margin-top: 1rem;
    background: #ff4757;
}

.restart:hover {
    background: #ff6b81;
}

.back-btn {
    display: inline-block;
    margin-top: 1rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.back-btn:hover {
    color: var(--primary-color);
}

@media screen and (max-width: 480px) {
    :root {
        --cell-size: 80px;
    }
    
    .game-container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    button {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}


/* Theme selector styles */
.theme-selector {
    margin-bottom: 20px;
    text-align: center;
}

.theme-selector select {
    padding: 8px 16px;
    font-size: 16px;
    border: 2px solid #333;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    min-width: 200px;
}

.theme-selector select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

.theme-selector button {
    padding: 8px 16px;
    border: 2px solid #333;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-selector button.active {
    background: #333;
    color: #fff;
}

/* Classic theme (default) */
.theme-classic .cell {
    background: #fff;
    border: 2px solid #333;
}

/* Neon theme */
.theme-neon {
    background: #111;
}

.theme-neon .cell {
    background: #000;
    border: 2px solid #0ff;
    box-shadow: 0 0 10px #0ff;
    color: #0ff;
}

.theme-neon .status {
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
}

/* Pixel theme */
.theme-pixel .cell {
    background: #98c1d9;
    border: 4px solid #293241;
    image-rendering: pixelated;
    font-family: 'Courier New', monospace;
}

.theme-pixel .status {
    font-family: 'Courier New', monospace;
    color: #293241;
}


/* Add these new theme styles */

/* Retro theme */
.theme-retro {
    background: #f4d03f;
}

.theme-retro .cell {
    background: #f5b041;
    border: 4px solid #784212;
    border-radius: 0;
    font-family: 'Courier New', monospace;
    color: #784212;
}

.theme-retro .status {
    color: #784212;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.theme-retro button {
    background: #f5b041;
    border: 2px solid #784212;
    color: #784212;
}

/* Space theme */
.theme-space {
    background: #1a1a2e;
}

.theme-space .cell {
    background: #16213e;
    border: 2px solid #0f3460;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.3);
    color: #e94560;
}

.theme-space .status {
    color: #e94560;
    text-shadow: 0 0 8px rgba(233, 69, 96, 0.5);
}

.theme-space button {
    background: #16213e;
    border: 2px solid #e94560;
    color: #e94560;
}

/* Halloween theme */
.theme-halloween {
    background: #2c3e50;
}

.theme-halloween .cell {
    background: #1a1a1a;
    border: 3px solid #ff6b6b;
    color: #4cd137;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

.theme-halloween .status {
    color: #ff6b6b;
    text-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
}

.theme-halloween button {
    background: #1a1a1a;
    border: 2px solid #ff6b6b;
    color: #ff6b6b;
}

/* Minecraft theme */
.theme-minecraft {
    background: #8b8b8b url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAYdEVYdFRpdGxlAE1pbmVjcmFmdCBkaXJ0IGJsb2Nr1m5cQQAAABh0RVh0QXV0aG9yAFJvYmVydCBIdXR0aW5nZXL8JJJoAAAAF3RFWHRUaXRsZQBNaW5lY3JhZnQgZGlydCBibG9ja+2czEIAAAAXdEVYdEF1dGhvcgBSb2JlcnQgSHV0dGluZ2Vy/CSScAAAABd0RVh0VGl0bGUATWluZWNyYWZ0IGRpcnQgYmxvY2vtpMxCAAAAF3RFWHRBdXRob3IAUm9iZXJ0IEh1dHRpbmdlcvwkkmgAAAAXdEVYdFRpdGxlAE1pbmVjcmFmdCBkaXJ0IGJsb2Nr7aTMQgAAABd0RVh0QXV0aG9yAFJvYmVydCBIdXR0aW5nZXL8JJJoAAAAF3RFWHRUaXRsZQBNaW5lY3JhZnQgZGlydCBibG9ja+2kzEIAAAAXdEVYdEF1dGhvcgBSb2JlcnQgSHV0dGluZ2Vy/CSScAAAABd0RVh0VGl0bGUATWluZWNyYWZ0IGRpcnQgYmxvY2vtpMxCAAAAF3RFWHRBdXRob3IAUm9iZXJ0IEh1dHRpbmdlcvwkkmg=');
}

.theme-minecraft .cell {
    background: #735434;
    border: 4px solid #4a3523;
    font-family: 'Minecraft', monospace;
    color: #fff;
    image-rendering: pixelated;
}

.theme-minecraft .status {
    color: #fff;
    font-family: 'Minecraft', monospace;
    text-shadow: 2px 2px #000;
}

/* Candy theme */
.theme-candy {
    background: #ffcce6;
}

.theme-candy .cell {
    background: #fff;
    border: 4px solid #ff66b3;
    border-radius: 15px;
    box-shadow: 0 0 10px rgba(255, 102, 179, 0.3);
    color: #ff1a75;
}

.theme-candy .status {
    color: #ff1a75;
    font-family: 'Comic Sans MS', cursive;
}

/* Ocean theme */
.theme-ocean {
    background: #e3f2fd;
}

.theme-ocean .cell {
    background: #bbdefb;
    border: 3px solid #1976d2;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(25, 118, 210, 0.2);
    color: #0d47a1;
}

.theme-ocean .status {
    color: #1976d2;
    text-shadow: 1px 1px 2px rgba(25, 118, 210, 0.2);
}

/* Forest theme */
.theme-forest {
    background: #dcedc8;
}

.theme-forest .cell {
    background: #c5e1a5;
    border: 3px solid #558b2f;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(85, 139, 47, 0.2);
    color: #33691e;
}

.theme-forest .status {
    color: #558b2f;
    font-family: 'Georgia', serif;
}

.theme-selector label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 16px;
}

.score-box {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.score-item span:first-child {
    font-size: 0.9rem;
    margin-bottom: 5px;
    opacity: 0.8;
}

.score-item span:last-child {
    font-size: 1.5rem;
    font-weight: bold;
}

.turn-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
}

.turn-selector button {
    background: var(--secondary-color);
    color: var(--text-color);
    border: none;
    padding: 0.8rem 1.5rem;
    margin: 0 0.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.turn-selector button:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.turn-selector button.active {
    background: var(--primary-color);
    box-shadow: 0 0 15px rgba(52, 140, 178, 0.5);
}

[class*="theme-"] .turn-selector button {
    background-color: var(--button-bg);
    color: var(--button-text);
}

[class*="theme-"] .turn-selector button:hover {
    background-color: var(--button-hover);
}

[class*="theme-"] .turn-selector button.active {
    background-color: var(--button-active);
}

.turn-selector button.active {
    background: #4CAF50;
    color: white;
    border-color: #45a049;
}
