/* Christmas Theme Colors */
:root {
    --primary: #DC143C; /* Crimson Red */
    --primary-light: #FF1744;
    --secondary: #228B22; /* Forest Green */
    --secondary-light: #32CD32;
    --background-dark: #0D1B0D; /* Dark Green */
    --background-medium: #1B3B1B; /* Medium Green */
    --text-primary: #FFF8DC; /* Beige */
    --text-secondary: #FFD700; /* Gold */
    --text-white: #FFFFFF;
    --success: #228B22; /* Green for wins */
    --warning: #FFD700; /* Gold */
    --border-red: rgba(220, 20, 60, 0.3);
    --border-green: rgba(34, 139, 34, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #0D1B0D 0%, #1B3B1B 50%, #0D1B0D 100%);
    min-height: 100vh;
    height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--text-white);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    flex-shrink: 0;
}

.sound-toggle {
    margin-left: 16px;
}

.title-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.icon-button {
    padding: 8px;
    background: rgba(220, 20, 60, 0.15);
    border: 1.5px solid rgba(220, 20, 60, 0.5);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(220, 20, 60, 0.3);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.icon-button:hover {
    background: rgba(220, 20, 60, 0.25);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.4);
}

.title {
    font-size: clamp(18px, 4vw, 24px);
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 2px;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.87),
        0 0 8px var(--primary);
    margin: 0;
}

.language-selector {
    margin-right: 16px;
}

.lang-dropdown {
    position: absolute;
    top: 70px;
    right: 20px;
    background: var(--background-medium);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 5px 20px rgba(220, 20, 60, 0.5);
    z-index: 100;
}

.lang-dropdown.hidden {
    display: none;
}

.lang-option {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-white);
    cursor: pointer;
    text-align: left;
    border-radius: 8px;
    font-size: 14px;
    transition: background 0.2s;
}

.lang-option:hover {
    background: rgba(220, 20, 60, 0.2);
}

/* Game Options */
.game-options {
    margin: 0 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, var(--background-medium), var(--background-dark));
    border: 1px solid var(--border-green);
    border-radius: 15px;
    box-shadow: 
        0 5px 20px rgba(34, 139, 34, 0.2),
        0 3px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: flex-end;
    flex-shrink: 0;
}

.options-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: flex-end;
    width: 100%;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    flex: 1;
}

.option-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* Dropdown Styles */
.dropdown-container {
    position: relative;
}

.dropdown-button {
    width: 100%;
    padding: 8px 12px;
    background: rgba(220, 20, 60, 0.15);
    border: 1.5px solid rgba(220, 20, 60, 0.5);
    border-radius: 10px;
    color: var(--text-white);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(220, 20, 60, 0.2);
}

.dropdown-button:hover {
    background: rgba(220, 20, 60, 0.25);
    border-color: rgba(220, 20, 60, 0.7);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
}

.dropdown-button:active,
.dropdown-button.active {
    background: rgba(220, 20, 60, 0.3);
    border-color: var(--primary);
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s;
    opacity: 0.8;
}

.dropdown-button.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--background-medium);
    border: 1.5px solid var(--primary);
    border-radius: 10px;
    box-shadow: 
        0 5px 20px rgba(220, 20, 60, 0.4),
        0 3px 10px rgba(0, 0, 0, 0.5);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
}

.dropdown-menu.hidden {
    display: none;
}

/* Scrollbar styling for dropdown */
.dropdown-menu::-webkit-scrollbar {
    width: 8px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: var(--background-dark);
    border-radius: 10px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(220, 20, 60, 0.5);
    border-radius: 10px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(220, 20, 60, 0.7);
}

.dropdown-item {
    padding: 10px 12px;
    color: var(--text-white);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 107, 0, 0.1);
    font-family: 'Courier New', monospace;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(220, 20, 60, 0.2);
    color: var(--primary);
}

.dropdown-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--text-white);
    font-weight: 700;
}

/* AI Thinking Indicator */
.ai-thinking {
    margin: 0 8px;
    padding: 8px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    border-radius: 15px;
    text-align: center;
    font-size: 12px;
    color: var(--text-white);
    box-shadow: 0 3px 10px rgba(34, 139, 34, 0.3);
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.ai-thinking.hidden {
    display: none;
}

/* Score Board */
.score-board {
    margin: 0 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, var(--background-medium), var(--background-dark));
    border: 1px solid var(--border-green);
    border-radius: 15px;
    box-shadow: 
        0 5px 20px rgba(34, 139, 34, 0.2),
        0 3px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    flex-shrink: 0;
}

.score-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.score-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.score-value {
    padding: 4px 10px 5px;
    background: rgba(220, 20, 60, 0.1);
    border: 1px solid rgba(220, 20, 60, 0.3);
    border-radius: 12px;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
}

/* Player Indicator */
.player-indicator {
    margin: 0 8px;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(220, 20, 60, 0.2);
    flex-shrink: 0;
}

.player-indicator.draw {
    background: linear-gradient(135deg, var(--warning), var(--warning));
}

.player-indicator.reindeer {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
}

#currentPlayerText {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-white);
    letter-spacing: 1px;
}

/* Game Board */
.game-board {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    padding: 8px;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.board-row {
    display: flex;
    gap: 4px;
    width: 100%;
    justify-content: center;
}

.cell {
    aspect-ratio: 1;
    margin: 2px;
    background: linear-gradient(135deg, var(--background-medium), var(--background-dark));
    border: 2px solid var(--border-green);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.cell:hover:not(.occupied):not(.game-over) {
    background: linear-gradient(135deg, var(--background-dark), var(--background-medium));
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
    transform: scale(1.05);
}

.cell.santa {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
}

.cell.reindeer {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    border-color: var(--secondary);
    box-shadow: 0 4px 12px rgba(34, 139, 34, 0.3);
}

.cell.winning {
    border-width: 3px;
    border-color: var(--warning);
    animation: pulse 1.5s ease-in-out infinite;
}

.cell.occupied {
    cursor: default;
}

.cell.game-over {
    cursor: default;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Action Buttons */
.action-buttons {
    margin: 0 8px;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.game-button {
    flex: 1;
    height: 45px;
    border-radius: 22px;
    border: 2px solid;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
}

.game-button.primary {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.15), rgba(220, 20, 60, 0.08));
    border-color: rgba(220, 20, 60, 0.5);
    color: var(--primary);
    box-shadow: 0 2px 6px rgba(220, 20, 60, 0.2);
}

.game-button.primary:hover {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.25), rgba(220, 20, 60, 0.15));
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.4);
    transform: translateY(-2px);
}

.game-button.secondary {
    background: linear-gradient(135deg, rgba(34, 139, 34, 0.15), rgba(34, 139, 34, 0.08));
    border-color: rgba(34, 139, 34, 0.5);
    color: var(--secondary);
    box-shadow: 0 2px 6px rgba(34, 139, 34, 0.2);
}

.game-button.secondary:hover {
    background: linear-gradient(135deg, rgba(34, 139, 34, 0.25), rgba(34, 139, 34, 0.15));
    box-shadow: 0 4px 12px rgba(34, 139, 34, 0.4);
    transform: translateY(-2px);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(220, 20, 60, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay.draw {
    background: rgba(255, 215, 0, 0.9);
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    padding: 32px;
    background: linear-gradient(135deg, var(--background-medium), var(--background-dark));
    border: 2px solid rgba(220, 20, 60, 0.5);
    border-radius: 20px;
    text-align: center;
    box-shadow: 
        0 5px 20px rgba(220, 20, 60, 0.5),
        0 3px 10px rgba(0, 0, 0, 0.7);
}

.overlay-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.overlay-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--success);
    letter-spacing: 3px;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 8px var(--success);
    margin-bottom: 15px;
}

.overlay-message {
    font-size: 18px;
    color: var(--text-white);
    margin-bottom: 30px;
}

.overlay-button {
    background: var(--primary);
    color: var(--text-white);
    border: 2px solid rgba(220, 20, 60, 0.8);
    border-radius: 15px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.5);
    font-family: 'Courier New', monospace;
}

.overlay-button:hover {
    background: var(--primary-light);
    box-shadow: 0 0 30px rgba(220, 20, 60, 0.7);
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 480px) {
    .game-options {
        padding: 10px;
    }
    
    .options-row {
        gap: 8px;
    }
    
    .option-group {
        flex: 1;
        min-width: 0;
    }
    
    .option-label {
        font-size: 11px;
    }
    
    .dropdown-button {
        font-size: 11px;
        padding: 8px 10px;
    }
    
    .action-buttons {
        margin: 0 8px;
        gap: 8px;
    }
    
    .game-button {
        height: 40px;
        font-size: 12px;
    }
    
    .cell {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }
    
    .title {
        font-size: 20px;
    }
    
    .overlay-content {
        padding: 24px;
        margin: 20px;
    }
    
    .overlay-icon {
        font-size: 60px;
    }
    
    .overlay-title {
        font-size: 24px;
    }
}

/* Portrait orientation */
@media (orientation: portrait) and (max-width: 768px) {
    .game-options {
        padding: 10px;
    }
    
    .options-row {
        gap: 8px;
    }
    
    .option-group {
        flex: 1;
        min-width: 0;
    }
    
    .option-label {
        font-size: 11px;
    }
    
    .dropdown-button {
        font-size: 11px;
        padding: 8px 10px;
    }
    
    .action-buttons {
        margin: 0 8px;
        gap: 8px;
    }
    
    .game-button {
        height: 40px;
        font-size: 12px;
    }
}

