/* Grandmaster WebChess - Modern Luxury Chess Interface */
:root {
    --bg-dark: #0f141c;
    --bg-card: rgba(22, 30, 44, 0.85);
    --border-color: rgba(212, 175, 55, 0.25);
    --board-light: #ebecd0;
    --board-dark: #739552;
    --board-border: #2c3e50;
    --gold: #d4af37;
    --gold-bright: #ffd700;
    --accent: #3b82f6;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(30, 58, 138, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    color: #f1f5f9;
    font-family: var(--font-sans);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.brand-title {
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #ffd700 0%, #d4af37 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Chessboard Layout */
.board-wrapper {
    position: relative;
    width: 100%;
    max-width: 540px;
    aspect-ratio: 1 / 1;
    border: 6px solid #1a222d;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    overflow: hidden;
}

.square {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.square.light {
    background-color: var(--board-light);
}

.square.dark {
    background-color: var(--board-dark);
}

/* Square Highlight States */
.square.selected {
    background-color: rgba(255, 215, 0, 0.65) !important;
}

.square.last-move {
    background-color: rgba(245, 158, 11, 0.45) !important;
}

.square.check {
    background-color: rgba(239, 68, 68, 0.75) !important;
    animation: pulseCheck 1s infinite alternate;
}

@keyframes pulseCheck {
    from { box-shadow: inset 0 0 10px rgba(255,0,0,0.8); }
    to { box-shadow: inset 0 0 25px rgba(255,0,0,1); }
}

/* Legal Move Hints */
.legal-dot {
    width: 28%;
    height: 28%;
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 50%;
    pointer-events: none;
}

.legal-capture-ring {
    position: absolute;
    inset: 4px;
    border: 4px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    pointer-events: none;
}

/* Piece Images */
.piece-img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
    transition: transform 0.1s ease;
    pointer-events: none;
}

.square:hover .piece-img {
    transform: scale(1.06);
}

/* Notation Text inside board border */
.coord-file, .coord-rank {
    position: absolute;
    font-size: 0.65rem;
    font-weight: 700;
    opacity: 0.8;
    pointer-events: none;
    font-family: var(--font-mono);
}

.coord-file {
    bottom: 2px;
    right: 4px;
}

.coord-rank {
    top: 2px;
    left: 4px;
}

.square.light .coord-file, .square.light .coord-rank {
    color: var(--board-dark);
}

.square.dark .coord-file, .square.dark .coord-rank {
    color: var(--board-light);
}

/* Player Info Bar */
.player-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.8rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.player-timer {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    background: #000;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.player-timer.active {
    border-color: var(--gold-bright);
    color: var(--gold-bright);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* Captured Pieces Tray */
.captured-tray {
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: 24px;
}

.captured-tray img {
    width: 20px;
    height: 20px;
}

.material-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
}

/* Notation History Box */
.history-box {
    height: 240px;
    overflow-y: auto;
    background: rgba(3, 7, 18, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.history-row {
    display: flex;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.history-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.history-num {
    width: 35px;
    color: #64748b;
}

.history-move {
    flex: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 3px;
}

.history-move:hover {
    color: var(--gold-bright);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 100%);
    color: #000;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.btn-gold:hover {
    transform: translateY(-2px);
    color: #000;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}
