:root {
    /* Colors */
    --primary-bg: #0f172a;
    --secondary-bg: #1e293b;
    --accent-color: #3b82f6;
    --text-color: #f8fafc;
    --board-color: #334155;
    --line-color: #94a3b8;
    --tiger-color: #ef4444;
    --goat-color: #22c55e;
    
    /* 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;
    
    /* Layout */
    --container-max-width: 500px;
    
    /* Spacing */
    --gap-small: 0.5rem;
    --gap-medium: 1rem;
    --gap-large: 1.5rem;
    --padding-small: 0.5rem;
    --padding-medium: 1rem;
    --padding-large: 1.5rem;
    
    /* Font Sizes */
    --font-size-avatar: 2.5rem;
    --font-size-stat-icon: 2rem;
    --font-size-player-name: 1rem;
    --font-size-stat-label: 0.7rem;
    --font-size-stat-value: 1.1rem;
    
    /* Component Sizes */
    --player-card-height: 60px;
    --status-dot-size: 12px;
    --turn-badge-size: 36px;
}









/* ========= START SCREEN ========= */
.game-header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}
/* Logo circle and svg are in shared css */

.logo-piece {
    animation: piecePulse 2s ease-in-out infinite;
}

.piece-delay-1 { animation-delay: 0.2s; }
.piece-delay-2 { animation-delay: 0.4s; }
.piece-delay-3 { animation-delay: 0.6s; }
.piece-delay-4 { animation-delay: 0.8s; }

@keyframes piecePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

.connecting-line {
    animation: lineGlow 2s ease-in-out infinite;
}

@keyframes lineGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}







/* Game Mode Section */
.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(--accent-color);
    box-shadow: var(--shadow-glow);
}

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

.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 Update */
.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;
    justify-content: center;
    flex: 1;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(59, 130, 246, 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(--accent-color);
    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;
}


/* Font Awesome Icon Styling */




/* ========= LOBBY SCREEN ========= */


/* Legacy lobby styles (keeping for compatibility) */


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

/* Board Responsiveness */
#board {
    width: 100%;
    max-width: var(--container-max-width);
    aspect-ratio: 1 / 1;
    height: auto; /* Allow height to scale */
    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: 6%; /* Responsive padding */
}

#lines {
    position: absolute;
    top: 6%;
    left: 6%;
    right: 6%;
    bottom: 6%;
    background-image: url('board.svg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    z-index: 1;
}

#spots-container {
    position: absolute;
    top: 6%;
    left: 6%;
    right: 6%;
    bottom: 6%;
}

.spot {
    width: 10%; /* Increased from 8% for better visibility */
    height: 10%;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s;
}

.spot:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.valid-move::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background-color: rgba(34, 197, 94, 0.6);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Pieces */
.piece {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7vmin;
}

.goat {
    font-size: 5.5vmin;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.tiger {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.spot.selected {
    background-color: rgba(59, 130, 246, 0.3);
    box-shadow: inset 0 0 15px rgba(59, 130, 246, 0.4);
    border: 2px solid rgba(59, 130, 246, 0.5);
}

/* Last Move Highlighting */
.spot.last-move-from {
    background-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
    border: 2px solid rgba(251, 191, 36, 0.6);
}

.spot.last-move-to .piece {
    animation: swingDance 2s ease-in-out infinite;
}

@keyframes swingDance {
    0%, 80%, 100% { transform: rotate(0deg); }
    85% { transform: rotate(-15deg); }
    90% { transform: rotate(15deg); }
    95% { transform: rotate(-10deg); }
}

/* Trapped Tiger Highlighting */
.spot.trapped-tiger {
    background-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    border: 3px solid rgba(239, 68, 68, 0.7);
    animation: trappedPulse 2s ease-in-out infinite;
}

@keyframes trappedPulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    }
    50% { 
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.9);
    }
}

/* Stats */
.sidebar {
    width: 100%;
    max-width: var(--container-max-width);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#game-info {
    display: flex;
    gap: var(--gap-medium);
    margin-top: var(--gap-medium);
    flex-wrap: nowrap; /* Keep in same row */
    justify-content: center;
    width: 100%;
    max-width: var(--container-max-width);
}

.stat-icon {
    font-size: var(--font-size-stat-icon);
}

.stat-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.stat-label {
    font-size: var(--font-size-stat-label);
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.stat-value {
    font-size: var(--font-size-stat-value);
    font-weight: 700;
    white-space: nowrap; /* Keep numbers on one line */
}

/* Header Spacing */
/* Removed old turn-indicator styles */

/* ========= PREMIUM MODAL ========= */



/* Notifications */


/* Footer */
footer {
    margin-top: auto;
    padding: 2rem;
    color: #64748b;
    font-size: 0.9rem;
}

footer a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--accent-color);
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.3; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateX(100%); }
}

/* Helper */


/* Mobile Responsiveness */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    #game-screen {
        padding: 1rem;
    }

    .header {
        margin-bottom: 1.5rem;
    }

    #game-container {
        padding: 1rem;
    }

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

    #player-info {
        font-size: 1.2rem;
        padding: 0.75rem 1.5rem;
        margin-bottom: 1rem;
    }

    #game-info {
        gap: var(--gap-small);
        width: 100%;
        max-width: var(--container-max-width);
    }

    .stat-card {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        gap: 0.75rem;
        flex: 1;
    }

    .stat-icon {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    #goats-placed, #goats-captured {
        font-size: 1rem;
    }

    #board {
        max-width: var(--container-max-width);
    }
}

/* Lobby Mobile Responsiveness */
@media (max-width: 768px) {
    .lobby-content {
        padding: 1rem;
    }

    .lobby-title {
        font-size: 2rem;
    }

    .lobby-subtitle {
        font-size: 0.85rem;
    }

    .lobby-summary {
        flex-direction: column;
        gap: 1rem;
    }

    .lobby-stat-card {
        min-width: auto;
        width: 100%;
    }

    .room-list-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .btn-back {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}

/* VS Badge in Room Card */
.vs-badge {
    align-self: center;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 900;
    color: #fff;
    margin: -12px 0; /* Negative margin to overlap */
    z-index: 10;
    backdrop-filter: blur(4px);
    font-family: 'Orbitron', sans-serif;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    text-shadow: 0 0 5px rgba(59, 130, 246, 0.8);
}

.status-badge.offline {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: 6px;
    font-weight: normal;
}

/* ========= 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 - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .game-board {
        max-width: 90vmin;
        max-height: 90vmin;
    }
}

/* Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .game-board {
        max-width: 95vmin;
        max-height: 95vmin;
    }
    
    .game-notification {
        right: 10px;
        left: 10px;
        min-width: unset;
        max-width: unset;
        width: calc(100% - 20px);
    }
}

