/* Chess Game - Premium Brown Theme */
:root {
    --chess-accent: #92400e;
    --chess-glow: rgba(146, 64, 14, 0.4);
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 25% 20%, rgba(146, 64, 14, 0.12), transparent 45%),
        radial-gradient(circle at 75% 80%, rgba(113, 63, 18, 0.1), transparent 45%),
        var(--bg-main);
    font-family: var(--font-main);
    color: var(--text-1);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

.header {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 24px 32px;
    background: var(--surface-1);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    box-sizing: border-box;
}

.header h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.home-btn {
    background: var(--surface-2);
    color: var(--text-0);
    border: 1px solid var(--border-1);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.home-btn:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-sm);
}

.level-badge {
    background: var(--surface-2);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-weight: 700;
    color: var(--accent-primary);
    border: 1px solid var(--border-highlight);
}

.game-container {
    display: flex;
    gap: 32px;
    max-width: 1200px;
    width: 95%;
    margin: 20px auto;
    align-items: flex-start;
}

.stats-panel {
    background: var(--surface-1);
    backdrop-filter: blur(var(--glass-blur));
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-1);
    width: 300px;
    flex-shrink: 0;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-2);
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-0);
}

/* Player Cards */
.player-card {
    background: var(--surface-2);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar {
    font-size: 1.5rem;
}

.player-name {
    font-weight: 600;
    color: var(--text-0);
}

.captured-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 30px;
}

.captured-piece {
    font-size: 1.2rem;
}

/* Board Area */
.board-main-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-height: 600px;
}

.chessboard-wrapper {
    background: var(--surface-1);
    padding: 24px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-1);
    box-shadow: var(--shadow-2xl);
}

.chessboard {
    display: grid;
    grid-template-columns: repeat(8, 60px);
    grid-template-rows: repeat(8, 60px);
    border: 8px solid var(--surface-3);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.chess-square {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    cursor: pointer;
    transition: var(--transition-base);
    position: relative;
}

.chess-square.white {
    background: #e2e8f0;
}

.chess-square.black {
    background: #475569;
}

.chess-square:hover {
    filter: brightness(1.1);
}

.chess-square.selected {
    background: rgba(234, 179, 8, 0.6) !important;
}

.chess-square.possible-move::after {
    content: '';
    width: 16px;
    height: 16px;
    background: rgba(34, 197, 94, 0.6);
    border-radius: 50%;
}

.chess-piece {
    z-index: 10;
    transition: var(--transition-base);
}

.chess-piece.white {
    color: #f8fafc;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.chess-piece.black {
    color: #0f172a;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.2);
}

/* Settings Overlay */
.game-settings-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 20, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border-radius: var(--radius-xl);
}

.settings-card {
    background: var(--surface-1);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-1);
    width: 100%;
    max-width: 450px;
}

.settings-title {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 24px;
    text-align: center;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-2);
}

.setting-options {
    display: flex;
    gap: 12px;
}

.setting-btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border-1);
    color: var(--text-1);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.setting-btn.active {
    background: var(--accent-primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-glow-sm);
}

/* Controls */
.controls {
    display: grid;
    gap: 12px;
    margin-top: auto;
}

.action-btn {
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-base);
    border: 1px solid var(--border-1);
}

.action-btn.primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
}

.action-btn.secondary {
    background: var(--surface-3);
    color: var(--text-1);
}

/* Rotation Prompt */
.rotate-prompt {
    position: fixed;
    inset: 0;
    background: var(--bg-main);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Mobile */
@media (max-width: 900px) {
    .game-container {
        flex-direction: column;
    }

    .stats-panel {
        width: auto;
        order: 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .board-main-area {
        width: 100%;
        order: 1;
    }

    .chessboard {
        grid-template-columns: repeat(8, 1fr);
        width: 90vw;
        height: 90vw;
    }

    .chess-square {
        width: auto;
        height: auto;
    }
}