/* Tic Tac Toe Styles - Orange/Yellow Theme */

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

:root {
    --primary-color: #F59E0B;
    --primary-dark: #D97706;
    --player-x: #3B82F6;
    --player-o: #EF4444;
    --background: #FFFBEB;
    --surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #FDE68A;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 500px;
    margin: 0 auto;
}

header {
    margin-bottom: 25px;
    text-align: center;
}

.back-btn {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
    display: inline-block;
    margin-bottom: 10px;
}

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

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.info-box {
    background: var(--surface);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
    border: 2px solid var(--border-color);
    text-align: center;
    flex: 1;
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: block;
}

.info-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.game-mode {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.mode-btn {
    padding: 10px 30px;
    border: 2px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

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

.mode-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.difficulty-btn {
    padding: 8px 20px;
    border: 2px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

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

.difficulty-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.current-player {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

#current-turn {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.cell {
    aspect-ratio: 1;
    background: var(--surface);
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.cell:hover:not(.taken) {
    background: #FEF3C7;
    transform: scale(1.05);
}

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

.cell.player-x {
    color: var(--player-x);
    animation: cellAppear 0.3s ease;
}

.cell.player-o {
    color: var(--player-o);
    animation: cellAppear 0.3s ease;
}

.cell.winning {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    animation: winning 0.5s ease infinite alternate;
}

@keyframes cellAppear {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes winning {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

.reset-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--primary-color) 0%, #FB923C 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.reset-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Win Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: var(--surface);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--primary-color);
    animation: slideUp 0.4s ease;
}

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

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--primary-dark);
}

.win-icon {
    font-size: 5rem;
    margin: 20px 0;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.overlay-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.overlay-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FB923C 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.overlay-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .game-board {
        gap: 8px;
    }
    
    .cell {
        font-size: 3rem;
    }
    
    .overlay-content {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .win-icon {
        font-size: 4rem;
    }
}
