/* Arena Chess 3D Stylesheet */
:root {
    --gold: #d4af37;
    --gold-glow: rgba(212, 175, 55, 0.4);
    --gold-dark: #8a6d1e;
    --hud-bg: rgba(26, 26, 46, 0.85);
    --hud-border: rgba(212, 175, 55, 0.65);
    --white-piece-color: #d4af37;
    --black-piece-color: #9e9e9e;
}

#chess-canvas-container {
    width: 100%;
    max-width: 800px;
    height: min(60vh, 500px);
    background: radial-gradient(circle at center, #1b1e2e 0%, #0c0d17 100%);
    border: 3px solid var(--gold);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.2);
    overflow: hidden;
    position: relative;
    margin: 15px auto 10px;
    touch-action: none;
}

.chess-bar-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    height: 90px;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(16, 16, 32, 0.95));
    border: 2px solid var(--hud-border);
    border-radius: 18px;
    padding: 10px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(0,0,0,0.8);
    box-sizing: border-box;
    margin: 0 auto 15px;
    z-index: 10;
}

.chess-bar-player {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 260px;
    height: 100%;
    padding: 5px 10px;
    border-radius: 12px;
    border: 1.5px solid transparent;
    transition: all 0.4s ease;
}

.player-white {
    background: linear-gradient(to right, rgba(212, 175, 55, 0.05), transparent);
    justify-content: flex-start;
}

.player-black {
    background: linear-gradient(to left, rgba(255, 255, 255, 0.03), transparent);
    justify-content: flex-end;
}

/* Active Turn Indicators */
.chess-bar-player.active {
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--gold-glow);
    background: rgba(212, 175, 55, 0.08);
}

.chess-bar-player.active .chess-player-indicator {
    color: var(--gold);
    animation: pulseGlow 1.5s infinite alternate;
}

.chess-player-indicator {
    color: rgba(255, 255, 255, 0.25);
    font-size: 14px;
    transition: all 0.4s;
}

@keyframes pulseGlow {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px var(--gold));
    }
    100% {
        transform: scale(1.25);
        filter: drop-shadow(0 0 8px var(--gold));
    }
}

.player-name-text {
    font-size: 15px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.player-white .player-name-text {
    color: var(--gold);
    font-style: italic;
}

.player-black .player-name-text {
    color: #e5e9f0;
}

/* Captured Pieces Display */
.captured-box {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    overflow: hidden;
    height: 25px;
    max-width: 130px;
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.05);
}

.captured-piece {
    font-size: 12px;
    font-weight: bold;
}

.player-white .captured-piece {
    color: var(--black-piece-color);
}

.player-black .captured-piece {
    color: var(--white-piece-color);
}

/* Center HUD Controls */
.chess-bar-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    gap: 6px;
    padding: 0 10px;
}

.chess-message-text {
    font-size: 13px;
    font-weight: 600;
    color: #e5e9f0;
    letter-spacing: 0.5px;
    height: 18px;
    line-height: 18px;
    text-transform: uppercase;
}

.chess-action-buttons {
    display: flex;
    gap: 10px;
}

.hud-btn {
    background: linear-gradient(to bottom, rgba(26,26,46,0.9), rgba(16,16,32,0.9));
    border: 1.5px solid var(--hud-border);
    border-radius: 8px;
    color: white;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.hud-btn:hover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.15);
    transform: translateY(-1px);
}

.resign-btn {
    background: linear-gradient(to bottom, #7a0000, #3a0000);
    border-color: rgba(255, 0, 0, 0.4);
}

.resign-btn:hover {
    background: linear-gradient(to bottom, #aa0000, #5a0000);
    border-color: #ff3333;
}

/* Mobile HUD adjustments */
@media (max-width: 768px) {
    #chess-canvas-container {
        height: 380px !important;
        margin: 10px !important;
    }

    .chess-bar-wrapper {
        flex-direction: column !important;
        height: auto !important;
        padding: 15px !important;
        gap: 15px !important;
        margin: 10px !important;
        width: calc(100% - 20px) !important;
    }

    .chess-bar-player {
        width: 100% !important;
        justify-content: center !important;
    }

    .player-white {
        order: 2;
    }

    .player-black {
        order: 3;
    }

    .chess-bar-center {
        order: 1;
        width: 100% !important;
        margin-bottom: 5px;
    }
}
