/* Base Styles */
:root {
    --premium-red: #8B4513;      /* SaddleBrown */
    --premium-light: #F5DEB3;    /* Wheat */
    --premium-dark: #5D4037;     /* Brown */
    --premium-accent: #D2691E;   /* Chocolate */
    --premium-text: #FFF8E1;     /* Light text */
    --cell-hover: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #3E2723, #5D4037);
    color: var(--premium-text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Start Screen */
.start-screen {
    padding: 2rem;
    text-align: center;
}

.start-screen h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--premium-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.options {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.symbol-options {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.symbol-btn {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
    background: transparent;
    border: 2px solid var(--premium-accent);
    color: var(--premium-text);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.symbol-btn:hover, .symbol-btn.active {
    background: var(--premium-accent);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.difficulty-options {
    margin: 2rem 0;
}

select {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid var(--premium-accent);
    color: #ffffff;
    border-radius: 6px;
    margin-top: 0.5rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.5rem;
}

/* Style the dropdown options */
select option {
    background: #2a1f1a;
    color: #ffffff;
    padding: 0.5rem;
}

/* Focus state */
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(210, 105, 30, 0.4);
    border-color: var(--premium-accent);
}

/* Remove default arrow in IE10 and IE11 */
select::-ms-expand {
    display: none;
}

.start-btn, .restart-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    background: var(--premium-accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.start-btn:hover, .restart-btn:hover {
    background: #b35900;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Game Screen */
.game-screen {
    padding: 1.5rem;
}

.scoreboard {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--premium-light);
}

.status {
    text-align: center;
    margin: 1rem 0;
    font-size: 1.2rem;
    color: var(--premium-light);
    min-height: 2rem;
}

.board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 4px;
    margin: 2rem 0;
    aspect-ratio: 1/1;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.cell {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--premium-accent);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    aspect-ratio: 1/1;
    position: relative;
    overflow: hidden;
}

.cell::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0);
    transition: background 0.2s ease;
    pointer-events: none;
}

.cell:not(.x):not(.o):hover::after {
    background: rgba(255, 255, 255, 0.1);
}

.cell.x, .cell.o {
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.cell.x {
    color: #FF6B6B;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.cell.o {
    color: #4ECDC4;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

.cell.win {
    animation: pulse 1s infinite alternate;
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
    z-index: 2;
}

@keyframes pulse {
    from {
        transform: scale(0.95);
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    }
    to {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
    }
}

/* Disable hover effects when game is over */
.game-over .cell:not(.win) {
    cursor: not-allowed;
    opacity: 0.7;
}

.game-over .cell:not(.win):hover::after {
    background: transparent;
}

.restart-btn {
    display: block;
    margin: 2rem auto 0;
    max-width: 200px;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        margin: 10px;
    }
    
    .start-screen h1 {
        font-size: 2rem;
    }
    
    .symbol-btn {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .board {
        max-width: 100%;
    }
    
    .cell {
        font-size: 1.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Hidden class for toggling visibility */
.hidden {
    display: none !important;
}

