/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Neon Cyberpunk Theme (Default) */
    --bg-primary: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    --bg-secondary: #1e1e2f;
    --bg-card: rgba(255, 255, 255, 0.05);
    --border-primary: rgba(255, 255, 255, 0.1);
    --accent-x: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    --accent-o: linear-gradient(45deg, #4ecdc4, #44a08d);
    --accent-glow: rgba(255, 255, 255, 0.3);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    --glass: rgba(255, 255, 255, 0.1);
    --x-color: #ff6b6b;
    --o-color: #4ecdc4;
}

[data-theme="glass"] {
    --bg-primary: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 50%, #80cbc4 100%);
    --bg-secondary: rgba(255, 255, 255, 0.8);
    --bg-card: rgba(255, 255, 255, 0.4);
    --border-primary: rgba(0, 150, 136, 0.2);
    --text-primary: #004d40;
    --text-secondary: rgba(0, 77, 64, 0.7);
    --x-color: #e91e63;
    --o-color: #00897b;
}

[data-theme="retro"] {
    --bg-primary: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    --bg-secondary: #1a1a1a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-primary: #00ff00;
    --text-primary: #00ff00;
    --text-secondary: rgba(0, 255, 0, 0.7);
    --x-color: #ff00ff;
    --o-color: #00ffff;
}

[data-theme="minimal"] {
    --bg-primary: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    --bg-secondary: #ffffff;
    --bg-card: rgba(0, 0, 0, 0.02);
    --border-primary: rgba(0, 0, 0, 0.1);
    --text-primary: #000000;
    --text-secondary: rgba(0, 0, 0, 0.6);
    --x-color: #ff6b6b;
    --o-color: #4ecdc4;
}

[data-theme="forest"] {
    --bg-primary: linear-gradient(135deg, #0a3d2c 0%, #1a5c42 50%, #2d7a5e 100%);
    --bg-secondary: #0a3d2c;
    --bg-card: rgba(255, 255, 255, 0.05);
    --border-primary: rgba(255, 215, 0, 0.2);
    --text-primary: #ffd700;
    --text-secondary: rgba(255, 215, 0, 0.7);
    --x-color: #ffab00;
    --o-color: #76ff03;
}

[data-theme="sunset"] {
    --bg-primary: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 30%, #c44569 60%, #6c5ce7 100%);
    --bg-secondary: rgba(0, 0, 0, 0.2);
    --bg-card: rgba(255, 255, 255, 0.1);
    --border-primary: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --x-color: #ffd93d;
    --o-color: #ff6bcb;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease;
}

/* === CONTAINER LAYOUT === */
.container {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    width: 280px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-primary);
    padding: 1.5rem;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--x-color), var(--o-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: var(--glass);
    transform: scale(1.05);
}

.sidebar-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* === MODE BUTTONS === */
.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.mode-btn:hover {
    background: var(--glass);
    border-color: var(--accent-glow);
    transform: translateX(4px);
}

.mode-btn.active {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(78, 205, 196, 0.2));
    border-color: var(--o-color);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.mode-icon {
    font-size: 1.25rem;
}

.mode-label {
    flex: 1;
}

/* === DIFFICULTY BUTTONS === */
.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.difficulty-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn:hover {
    background: var(--glass);
    transform: translateX(4px);
}

.difficulty-btn.active {
    border-color: var(--o-color);
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.3);
}

.difficulty-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.difficulty-dot.beginner {
    background: #4caf50;
    box-shadow: 0 0 10px #4caf50;
}

.difficulty-dot.intermediate {
    background: #ffeb3b;
    box-shadow: 0 0 10px #ffeb3b;
}

.difficulty-dot.advanced {
    background: #ff9800;
    box-shadow: 0 0 10px #ff9800;
}

.difficulty-dot.master {
    background: #f44336;
    box-shadow: 0 0 10px #f44336;
}

.bot-options {
    margin-top: 0.75rem;
}

/* === STATS PANEL === */
.stats-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* === LEADERBOARD === */
.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: var(--glass);
    transform: translateX(4px);
}

.rank {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.player-name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
}

.win-rate {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--o-color);
}

/* === THEME BUTTONS === */
.theme-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.theme-btn {
    padding: 0.625rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background: var(--glass);
    transform: scale(1.05);
}

.theme-btn.active {
    border-color: var(--o-color);
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.3);
}

/* === SETTINGS === */
.settings-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.slider-label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.slider-label input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-card);
    outline: none;
    cursor: pointer;
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    overflow-y: auto;
}

/* === GAME HEADER === */
.game-header {
    width: 100%;
    max-width: 700px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    border: 2px solid var(--border-primary);
    transition: all 0.3s ease;
}

.player-info:nth-child(1) .player-avatar {
    background: var(--accent-x);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

.player-info:nth-child(3) .player-avatar {
    background: var(--accent-o);
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
}

.player-avatar.active {
    transform: scale(1.1);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1.15);
    }
}

.player-symbol {
    color: white;
}

.player-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.player-name {
    font-size: 1rem;
    font-weight: 600;
}

.player-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--o-color);
}

.game-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.turn-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
}

.turn-symbol {
    font-size: 1.25rem;
    font-weight: 700;
}

.game-timer {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

.game-timer.warning {
    color: #ff9800;
    animation: timerBlink 0.5s ease-in-out infinite;
}

.game-timer.critical {
    color: #f44336;
    animation: timerBlink 0.3s ease-in-out infinite;
}

@keyframes timerBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* === GAME BOARD === */
.board-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
}

.board {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.cell {
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.cell::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--accent-glow), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cell:hover:not(.x):not(.o) {
    border-color: var(--accent-glow);
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--accent-glow);
}

.cell:hover:not(.x):not(.o)::before {
    opacity: 0.3;
}

.cell.x {
    color: var(--x-color);
    animation: cellAppear 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cell.o {
    color: var(--o-color);
    animation: cellAppear 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes cellAppear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.cell.winning {
    animation: winning 0.6s ease-in-out;
}

@keyframes winning {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 40px var(--o-color);
    }
}

/* === WINNING LINE === */
.winning-line {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.winning-line.show {
    opacity: 1;
}

.winning-line line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 0.8s ease-out forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* === CONTROL PANEL === */
.control-panel {
    width: 100%;
    max-width: 700px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    box-shadow: var(--shadow);
    gap: 1rem;
}

.controls-left,
.controls-right {
    display: flex;
    gap: 0.75rem;
}

.controls-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: var(--glass);
    border-color: var(--accent-glow);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.move-counter {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* === MOVE HISTORY === */
.move-history {
    width: 100%;
    max-width: 700px;
    padding: 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: none;
}

.move-history.show {
    display: block;
}

.move-history h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    font-size: 0.875rem;
}

.history-item.current {
    border-color: var(--o-color);
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
}

.replay-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.replay-controls button {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.replay-controls button:hover {
    background: var(--glass);
}

.replay-controls input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-card);
    outline: none;
    cursor: pointer;
}

/* === MODALS === */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--glass);
    transform: rotate(90deg);
}

/* === VICTORY MODAL === */
.victory-content {
    text-align: center;
}

.victory-header {
    margin-bottom: 2rem;
}

.victory-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, var(--x-color), var(--o-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.victory-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.victory-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.victory-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
}

.stat-icon {
    font-size: 2rem;
}

.stat-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.victory-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.victory-btn {
    padding: 0.875rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.victory-btn:hover {
    background: var(--glass);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.victory-btn.primary {
    background: linear-gradient(135deg, var(--x-color), var(--o-color));
    border-color: transparent;
    color: white;
}

/* === TOURNAMENT MODAL === */
.tournament-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.tournament-bracket {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tournament-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* === BOT THINKING === */
.bot-thinking {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: none;
    align-items: center;
    gap: 1rem;
    z-index: 500;
}

.bot-thinking.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.thinking-dots {
    display: flex;
    gap: 0.5rem;
}

.thinking-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--o-color);
    animation: dotBounce 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.thinking-text {
    font-size: 1rem;
    font-weight: 500;
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-color: #4caf50;
}

.toast.error {
    border-color: #f44336;
}

.toast.info {
    border-color: var(--o-color);
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-message {
    font-size: 0.875rem;
    font-weight: 500;
}

/* === ACHIEVEMENTS === */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.achievement-item {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.achievement-item.unlocked {
    border-color: var(--o-color);
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.3);
}

.achievement-item:hover {
    transform: translateY(-4px);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    filter: grayscale(100%);
    opacity: 0.5;
}

.achievement-item.unlocked .achievement-icon {
    filter: none;
    opacity: 1;
}

.achievement-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.achievement-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
    }

    .main-content {
        padding: 1.5rem;
    }

    .board-container {
        max-width: 400px;
    }

    .cell {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: var(--shadow);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 999;
    }

    .main-content {
        padding: 1rem;
        padding-top: 4rem;
    }

    .game-header {
        flex-direction: column;
        gap: 1rem;
    }

    .player-info {
        width: 100%;
        justify-content: center;
    }

    .board-container {
        max-width: 350px;
    }

    .cell {
        font-size: 2.5rem;
    }

    .control-panel {
        flex-direction: column;
        gap: 1rem;
    }

    .controls-left,
    .controls-right {
        width: 100%;
        justify-content: center;
    }

    .victory-stats {
        grid-template-columns: 1fr;
    }

    .victory-actions {
        flex-direction: column;
    }

    .toast-container {
        right: 1rem;
        left: 1rem;
    }
}

@media (max-width: 480px) {
    .board-container {
        max-width: 300px;
    }

    .cell {
        font-size: 2rem;
    }

    .player-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .control-btn {
        padding: 0.625rem 1rem;
        font-size: 0.75rem;
    }

    .control-btn span:last-child {
        display: none;
    }

    .theme-buttons {
        grid-template-columns: 1fr;
    }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-card);
}

::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-glow);
}