/* ===== CHESS BOARD STYLES ===== */

/* Game Header */
.game-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    z-index: 10; flex-shrink: 0;
}
.game-title { font-size: 18px; font-weight: 800; letter-spacing: 2px; color: var(--accent); }
.header-actions { display: flex; gap: 8px; }

/* Game Layout */
.game-layout {
    display: flex; flex: 1; overflow: hidden; gap: 0;
}

/* Board Area */
.board-area {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 12px; gap: 8px; overflow: hidden;
}

/* Player Info */
.player-info {
    display: flex; align-items: center; gap: 12px;
    width: 100%; max-width: 480px;
    padding: 8px 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    position: relative;
}
.player-info.active-player {
    border-color: var(--accent);
    background: rgba(201,168,76,0.08);
}
.player-avatar {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; border-radius: 50%;
    background: rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.white-avatar { color: #f0f0f0; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.black-avatar { color: #1a1a1a; text-shadow: 0 1px 3px rgba(255,255,255,0.2); background: rgba(255,255,255,0.15); }
.player-details { flex: 1; }
.player-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.player-captured { font-size: 12px; color: var(--text-muted); margin-top: 2px; min-height: 16px; }
.player-timer {
    font-size: 18px; font-weight: 800; font-family: monospace;
    color: var(--accent); min-width: 60px; text-align: right;
}
.player-timer.low-time { color: var(--danger); animation: timerPulse 1s ease infinite; }
.turn-indicator {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); opacity: 0;
}
.active-player .turn-indicator { opacity: 1; }

/* Board Container */
.board-container {
    position: relative;
    display: flex; align-items: center; justify-content: center;
}

/* Chess Board */
.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: clamp(280px, min(55vw, 55vh), 520px);
    height: clamp(280px, min(55vw, 55vh), 520px);
    aspect-ratio: 1;
    border: 3px solid rgba(0,0,0,0.5);
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 20px 60px rgba(0,0,0,0.6);
    overflow: hidden;
    position: relative;
}

/* Chess Square */
.sq {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease;
    overflow: hidden;
}
.sq.light { background-color: var(--light-sq); }
.sq.dark { background-color: var(--dark-sq); }
.sq.selected { background-color: var(--selected-sq) !important; }
.sq.last-move { background-color: var(--last-move) !important; }
.sq.in-check { background-color: var(--check-sq) !important; }
.sq.legal-move::after {
    content: '';
    position: absolute;
    width: 30%; height: 30%;
    background: rgba(0,0,0,0.25);
    border-radius: 50%;
    pointer-events: none;
}
.sq.legal-capture::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 4px solid rgba(0,0,0,0.3);
    border-radius: 50%;
    pointer-events: none;
}
.sq:hover:not(.selected) { filter: brightness(1.1); }

/* Coordinate labels */
.sq .coord-rank {
    position: absolute; bottom: 2px; left: 3px;
    font-size: 10px; font-weight: 700; opacity: 0.7;
    pointer-events: none; line-height: 1;
}
.sq .coord-file {
    position: absolute; top: 2px; right: 3px;
    font-size: 10px; font-weight: 700; opacity: 0.7;
    pointer-events: none; line-height: 1;
}
.sq.light .coord-rank, .sq.light .coord-file { color: var(--dark-sq); }
.sq.dark .coord-rank, .sq.dark .coord-file { color: var(--light-sq); }

/* Chess Piece */
.piece {
    font-size: clamp(22px, 4.5vmin, 44px);
    line-height: 1;
    cursor: pointer;
    transition: transform 0.1s ease;
    pointer-events: none;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
    z-index: 1;
}
.piece.white-piece { color: #f8f8f8; text-shadow: 0 1px 2px rgba(0,0,0,0.6), 0 0 8px rgba(255,255,255,0.3); }
.piece.black-piece { color: #1a1a1a; text-shadow: 0 1px 2px rgba(255,255,255,0.2), 0 0 8px rgba(0,0,0,0.5); }

/* Piece move animation */
@keyframes pieceMove {
    0% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.piece-moved { animation: pieceMove 0.2s ease; }

/* Capture animation */
@keyframes capturePop {
    0% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
}

/* Check pulse */
@keyframes checkPulse {
    0%, 100% { background-color: rgba(255,0,0,0.4); }
    50% { background-color: rgba(255,0,0,0.7); }
}
.sq.in-check { animation: checkPulse 0.8s ease infinite; }

/* Timer pulse */
@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Promotion choices */
.promotion-choices {
    display: flex; gap: 12px; justify-content: center; margin-top: 16px;
}
.promo-piece {
    width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px; cursor: pointer;
    background: var(--card-bg); border: 2px solid var(--card-border);
    border-radius: var(--radius-sm); transition: all 0.2s ease;
}
.promo-piece:hover { background: rgba(201,168,76,0.2); border-color: var(--accent); transform: scale(1.1); }