:root {
    /* Chess Specific Colors */
    --board-light: #e2e8f0;
    --board-dark: #475569;
    --piece-white: #ffffff;
    --piece-black: #000000;
    --white-player-color: #f8fafc;
    --black-player-color: #94a3b8;
    
    /* Layout */
    --container-max-width: 500px;
    --captured-section-min-height: 400px;
    --captured-section-min-height-small: 300px;
    
    /* Glass Effect (From Sudoku) */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-blur: 20px;
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 25px rgba(0, 255, 255, 0.5);
    --radius-lg: 16px;
    --radius-md: 12px;
    --spacing-lg: 2rem;
    --spacing-md: 1.5rem;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}



/* Glassmorphism Utilities */


/* Lobby Screen */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.mode-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left var(--transition-slow);
}

.mode-card:hover::before {
    left: 100%;
}

.mode-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--color-accent-primary, #00ffff);
    box-shadow: var(--shadow-glow);
}

.mode-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-accent-primary, #00ffff);
}

.mode-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mode-desc {
    color: #e2e8f0;
    font-size: 0.9rem;
}

.mode-features {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: auto;
}

.feature-tag {
    font-size: 0.75rem;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: #94a3b8;
}

.mode-status {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    color: #94a3b8;
}

.mode-status.online {
    color: #4ade80;
}

/* Stat Card */
.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-accent-primary, #00ffff);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

/* Rule Card */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.rule-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.rule-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.3);
}

.rule-icon {
    font-size: 1.5rem;
    color: var(--color-accent-primary, #00ffff);
    margin-bottom: 0.75rem;
}

.rule-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}

.rule-text {
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.4;
}
#game-screen {
    width: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Game Container */
.game-container {
    width: 100%;
    max-width: var(--container-max-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Board with Sidebars Layout - Default (Large and Medium Screens) */
.board-with-sidebars {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
    justify-content: center;
}

.captured-sidebar {
    width: 100px;
    flex-shrink: 0;
}

/* Hide mobile "They Captured" on large screens */
#they-captured-mobile {
    display: none;
}

/* Small Screens - Switch to Horizontal Compact Layout */
@media (max-width: 768px) {
    .game-container {
        gap: 0.5rem;
    }
    
    .board-with-sidebars {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .captured-sidebar {
        width: 100%;
        max-width: var(--container-max-width);
        display: flex;
        gap: 0.5rem;
    }
    
    .captured-sidebar.left-sidebar {
        order: 2;
        flex-direction: row;
    }
    
    /* Hide right sidebar on small screens */
    .captured-sidebar.right-sidebar {
        display: none;
    }
    
    /* Show mobile "They Captured" */
    #they-captured-mobile {
        display: flex;
    }
    
    #board {
        order: 1;
    }
    
    .captured-section.vertical {
        flex-direction: column;
        min-height: var(--captured-section-min-height-small);
        padding: 0.35rem 0.5rem;
        width: 50%;
    }
    
    .captured-title {
        font-size: 0.6rem;
        margin-bottom: 0.4rem;
        text-align: center;
    }
    
    .captured-pieces-display {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important; /* 4 columns for small screens */
        gap: 0.25rem;
        justify-items: center;
        align-items: start;
    }
    
    .captured-piece {
        font-size: 1.2rem;
    }
    
    .no-captures {
        font-size: 0.65rem;
        margin-top: 0;
        width: 100%;
        grid-column: 1 / -1; /* Span all 4 columns */
    }
}

/* Extra Small Screens - Ultra Compact */
@media (max-width: 480px) {
    .game-container {
        gap: 0.25rem;
        max-width: 100%;
    }
    
    .board-with-sidebars {
        gap: 0.35rem;
    }
    
    .captured-section.vertical {
        padding: 0.25rem 0.4rem;
    }
    
    .captured-title {
        font-size: 0.55rem;
        min-width: 55px;
        margin-right: 0.4rem;
    }
    
    .captured-pieces-display {
        gap: 0.2rem;
    }
    
    .captured-piece {
        font-size: 1rem;
    }
    
    .no-captures {
        font-size: 0.6rem;
    }
}

/* Header, Player Cards, Status Dots, and Turn Display styles moved to game-ui.css */

/* Board Responsiveness */
#board {
    width: var(--container-max-width);
    height: var(--container-max-width);
    flex-shrink: 0;
    position: relative;
    background: var(--board-color);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 10px;
}

/* Responsive Board Sizing */
@media (max-width: 900px) {
    #board {
        width: min(550px, 85vw);
        height: min(550px, 85vw);
    }
}

@media (max-width: 768px) {
    #board {
        width: min(500px, 90vw);
        height: min(500px, 90vw);
    }
}

@media (max-width: 480px) {
    #board {
        width: min(400px, 92vw);
        height: min(400px, 92vw);
        padding: 6px;
    }
}

#spots-container {
    width: 100%;
    height: 100%;
    display: grid;
}

.spot {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.chess-square.light-square {
    background-color: var(--board-light);
}

.chess-square.dark-square {
    background-color: var(--board-dark);
}

.spot:hover {
    filter: brightness(0.9);
}

.spot.selected {
    background-color: rgba(255, 255, 0, 0.5) !important;
}

.spot.last-move {
    background-color: rgba(100, 255, 100, 0.4) !important;
}

.spot.valid-move::after {
    content: '';
    width: 20%;
    height: 20%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}

/* Pieces */
.piece {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7vmin; /* Responsive font size */
    user-select: none;
    cursor: grab;
    transition: transform 0.2s;
    line-height: 1;
}

.piece:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.piece.white {
    color: var(--piece-white);
    text-shadow: 0 0 2px black;
}

.piece.black {
    color: var(--piece-black);
    text-shadow: 0 0 2px white;
}

/* Captured Pieces Section */
.captured-section {
    background: var(--secondary-bg);
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    width: 100%;
}

.captured-section.vertical {
    display: flex;
    flex-direction: column;
    min-height: var(--captured-section-min-height);
}

.captured-title {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-align: center;
}

.captured-pieces-display {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns for vertical layout on large screens */
    gap: 0.5rem;
    align-items: start;
    justify-items: center;
}

.captured-piece {
    font-size: 1.8rem;
    line-height: 1;
    opacity: 0.9;
    transition: all 0.2s;
}

.captured-piece:hover {
    opacity: 1;
    transform: scale(1.15);
}

.no-captures {
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
    text-align: center;
    margin-top: 1rem;
    grid-column: 1 / -1; /* Span both columns */
}

/* Responsive Overrides for Captured Sections - Must come after base styles */
@media (max-width: 768px) {
    .captured-section.vertical {
        min-height: var(--captured-section-min-height-small);
    }
}

/* Modal */


/* Notifications */


/* Footer */




/* Mobile Responsiveness */
@media (max-width: 600px) {


    #game-screen {
        padding: 1rem;
    }

    .header {
        margin-bottom: 1.5rem;
    }

    .game-container {
        padding: 0;
        gap: 1.5rem;
    }

    .player-card {
        padding: 0.5rem;
    }
}



/* ========= GRACE PERIOD NOTIFICATION ========= */
.game-notification {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    top: auto !important;
    left: auto !important;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.game-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.game-notification:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.grace-period-notification {
    position: relative;
}

.notification-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.notification-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.notification-message {
    font-size: 0.8rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.notification-timer {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fbbf24;
    margin-left: auto;
    flex-shrink: 0;
}

.notification-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), #22c55e);
    width: 100%;
    transition: width 1s linear;
    box-shadow: 0 0 10px var(--accent-color);
    border-radius: 0 0 12px 12px;
}



/* ========= COMPREHENSIVE RESPONSIVE DESIGN ========= */

/* Tablet (481px - 900px) */
@media (min-width: 481px) and (max-width: 900px) {
    .chess-square {
        font-size: 2rem;
    }
}

/* Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .chess-square {
        font-size: 1.5rem;
    }
    
    .game-notification {
        right: 10px;
        left: 10px;
        min-width: unset;
        max-width: unset;
        width: calc(100% - 20px);
    }
}

