/* CSS Variables for Theme - Dark Mode Default */
:root {
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --text-color: #e0e0e0;
    --text-secondary: #b0b0b0;
    --card-bg: rgba(0, 0, 0, 0.3);
    --card-border: rgba(255, 255, 255, 0.15);
    --button-bg: #4CAF50;
    --button-hover: #45a049;
    --secondary-button-bg: #1565C0;
    --secondary-button-hover: #0D47A1;
    --danger-button-bg: #f44336;
    --danger-button-hover: #d32f2f;
    --input-bg: rgba(255, 255, 255, 0.1);
    --input-border: rgba(255, 255, 255, 0.2);
    --letter-btn-bg: rgba(255, 255, 255, 0.1);
    --letter-btn-text: #e0e0e0;
    --letter-btn-hover: rgba(255, 255, 255, 0.2);
    --letter-btn-selected: #4CAF50;
    --possible-words-bg: rgba(33, 150, 243, 0.2);
    --possible-words-border: rgba(33, 150, 243, 0.4);
    --possible-words-text: #64B5F6;
    --disabled-button-bg: linear-gradient(135deg, #424242, #616161);
    --disabled-button-text: #9e9e9e;
}

/* Light Theme */
[data-theme="light"] {
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --text-color: #333;
    --text-secondary: #666;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(255, 255, 255, 0.3);
    --button-bg: #4CAF50;
    --button-hover: #45a049;
    --secondary-button-bg: #2196F3;
    --secondary-button-hover: #1976D2;
    --danger-button-bg: #f44336;
    --danger-button-hover: #d32f2f;
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(0, 0, 0, 0.1);
    --letter-btn-bg: #fff;
    --letter-btn-text: #333;
    --letter-btn-hover: #f0f0f0;
    --letter-btn-selected: #4CAF50;
    --possible-words-bg: rgba(33, 150, 243, 0.1);
    --possible-words-border: rgba(33, 150, 243, 0.3);
    --possible-words-text: #2196F3;
    --disabled-button-bg: linear-gradient(135deg, #e0e0e0, #bdbdbd);
    --disabled-button-text: #757575;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
}

header h1 {
    color: var(--text-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    background: linear-gradient(135deg, #4CAF50, #2196F3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-display {
    display: flex;
    justify-content: space-between;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Screen Management */
.screen {
    display: none;
    flex: 1;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.screen.active {
    display: block;
}

/* Buttons */
.primary-btn, .secondary-btn, .difficulty-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.primary-btn {
    background: var(--button-bg);
    color: white;
}

.primary-btn:hover:not(:disabled) {
    background: var(--button-hover);
    transform: translateY(-2px);
}

.primary-btn:disabled {
    background: var(--disabled-button-bg);
    color: var(--disabled-button-text);
    cursor: not-allowed;
    transform: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.secondary-btn {
    background: var(--danger-button-bg);
    color: white;
}

.secondary-btn:hover {
    background: var(--danger-button-hover);
    transform: translateY(-2px);
}

.leaderboard-btn {
    background: var(--secondary-button-bg);
    color: white;
}

.leaderboard-btn:hover {
    background: var(--secondary-button-hover);
    transform: translateY(-2px);
}

/* Language Selection */
#language-screen {
    text-align: center;
}

#language-screen h2 {
    margin-bottom: 30px;
    color: var(--text-color);
    font-size: 2rem;
}

.language-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.language-btn {
    background: linear-gradient(135deg, var(--secondary-button-bg) 0%, var(--secondary-button-hover) 100%);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 12px;
    min-height: 80px;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
    font-size: 1rem;
    font-weight: 600;
}

.language-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.language-label {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.language-desc {
    font-size: 1rem;
    opacity: 0.9;
}

/* Difficulty Selection */
#difficulty-screen {
    text-align: center;
}

#difficulty-screen h2 {
    margin-bottom: 30px;
    color: var(--text-color);
    font-size: 2rem;
}

.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.difficulty-btn {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 12px;
    min-height: 80px;
    justify-content: center;
    border: 2px solid var(--card-border);
    backdrop-filter: blur(10px);
}

.difficulty-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.difficulty-label {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.difficulty-desc {
    font-size: 1rem;
    opacity: 0.9;
}

/* Game Screen */
.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-secondary);
}

.current-word-display {
    text-align: center;
    margin-bottom: 30px;
}

.current-word-display h3 {
    color: var(--text-color);
    font-size: 1.5rem;
}

#word-display {
    color: #4CAF50;
    font-family: monospace;
    font-size: 1.8rem;
    letter-spacing: 2px;
}

.possible-words {
    margin-top: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--possible-words-text);
    text-align: center;
    background: var(--possible-words-bg);
    border: 2px solid var(--possible-words-border);
    border-radius: 8px;
    padding: 10px;
}

.word-suggestion {
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #FF9800;
    text-align: center;
    background: rgba(255, 152, 0, 0.1);
    border: 2px solid rgba(255, 152, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    line-height: 1.4;
}

/* Letter Rows */
#letter-rows {
    margin-bottom: 30px;
}

.letter-row-container {
    margin-bottom: 15px;
}

.letter-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.mobile-letter-row {
    flex-wrap: nowrap;
    margin-bottom: 8px;
}

.letter-btn {
    width: 50px;
    height: 50px;
    border: 2px solid var(--input-border);
    background: var(--letter-btn-bg);
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--letter-btn-text);
}

.letter-btn:hover:not(:disabled) {
    border-color: var(--button-bg);
    background: var(--letter-btn-hover);
    transform: scale(1.1);
}

.letter-btn:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.letter-btn.selected {
    background: var(--letter-btn-selected);
    color: white;
    border-color: var(--letter-btn-selected);
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Game Stats */
.game-stats {
    display: flex;
    justify-content: space-around;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 15px;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

/* Loading Screen */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    margin: 30px 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.loading-content {
    text-align: center;
    color: var(--text-color);
}

.loading-content h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: var(--text-color);
}

.loading-bar {
    width: 200px;
    height: 8px;
    background: var(--input-border);
    border-radius: 4px;
    overflow: hidden;
    margin: 15px auto;
}

.loading-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #2196F3);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

#loading-percentage {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 10px;
}

.loading-container.hidden {
    display: none;
}

/* Game Settings */
.game-settings {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 10px;
    border-radius: 6px;
    gap: 20px;
    flex-wrap: wrap;
    backdrop-filter: blur(10px);
    font-size: 0.85rem;
    margin-top: 10px;
}

.setting {
    display: flex;
    align-items: center;
    gap: 5px;
}

.setting label {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.setting-select {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--input-border);
    min-width: 100px;
    color-scheme: dark;
}

.setting-select:focus {
    outline: none;
    border-color: #4CAF50;
}

.setting-select option {
    background: #1a1a1a;
    color: var(--text-color);
    border: none;
    padding: 4px 8px;
}

/* Try to style the dropdown container for browsers that support it */
.setting-select::-webkit-dropdown-button {
    background: var(--input-bg);
}

.setting-btn {
    padding: 4px 12px;
    background: var(--secondary-button-bg);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.setting-btn:hover {
    background: var(--secondary-button-hover);
}

/* Game Over Screen */
.final-stats {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 5px 0;
    border-bottom: 1px solid var(--card-border);
}

.stat-row:last-child {
    border-bottom: none;
}

.label {
    font-weight: 600;
    color: var(--text-secondary);
}

.value {
    font-weight: bold;
    color: var(--text-color);
}

.name-input-section {
    text-align: center;
    margin-bottom: 30px;
}

.name-input-section h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

#player-name {
    padding: 12px;
    border: 2px solid var(--input-border);
    border-radius: 8px;
    font-size: 1rem;
    margin-right: 10px;
    width: 200px;
    max-width: 100%;
    background: var(--input-bg);
    color: var(--text-color);
}

.game-over-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Leaderboard */
.leaderboard-type-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn, .type-tab-btn {
    padding: 10px 20px;
    border: 2px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active, .type-tab-btn.active {
    background: var(--button-bg);
    color: white;
    border-color: var(--button-bg);
}

.tab-btn:hover:not(.active), .type-tab-btn:hover:not(.active) {
    border-color: var(--button-bg);
    background: var(--letter-btn-hover);
}

.type-tab-btn {
    font-weight: 600;
    min-width: 80px;
}

#leaderboard-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 300px;
    backdrop-filter: blur(10px);
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 40px 1fr 120px 80px;
    gap: 10px;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    color: var(--text-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.leaderboard-entry:last-child {
    margin-bottom: 0;
}

.player-rank {
    font-weight: bold;
    color: var(--text-secondary);
    text-align: center;
}

.player-name {
    font-weight: 600;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-word {
    font-style: italic;
    color: #2196F3;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-score {
    font-weight: bold;
    color: #4CAF50;
    text-align: right;
}

.no-scores {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 50px 0;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    color: white;
}

.cookie-header h3 {
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    color: #FFD700;
}

.cookie-text {
    margin-bottom: 20px;
}

.cookie-text p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

.cookie-types {
    margin: 20px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.cookie-type {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-type-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    position: relative;
}

.cookie-type-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.cookie-type-header input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.cookie-type-header label {
    flex: 1;
    cursor: pointer;
    font-size: 1rem;
}

.required-badge {
    background: #FF6B6B;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.cookie-type-desc {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px 0;
}

.cookie-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.cookie-btn.reject {
    background: #FF6B6B;
    color: white;
}

.cookie-btn.reject:hover {
    background: #FF5252;
    transform: translateY(-2px);
}

.cookie-btn.necessary {
    background: #FFA726;
    color: white;
}

.cookie-btn.necessary:hover {
    background: #FF9800;
    transform: translateY(-2px);
}

.cookie-btn.accept {
    background: #4CAF50;
    color: white;
}

.cookie-btn.accept:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.cookie-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.cookie-link {
    background: none;
    border: none;
    color: #81C784;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

.cookie-link:hover {
    color: #A5D6A7;
}

/* Cookie Settings Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-modal.show {
    display: flex;
}

.cookie-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.cookie-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close-btn:hover {
    background: #f0f0f0;
}

.cookie-modal-body {
    padding: 20px;
}

.cookie-modal-body .cookie-type {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

.cookie-modal-body .cookie-type-desc {
    color: #666;
}

.cookie-modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

/* Mobile Responsiveness for Cookie Banner */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 15px;
    }
    
    .cookie-types {
        grid-template-columns: 1fr;
    }
    
    .cookie-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cookie-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .cookie-footer {
        flex-direction: column;
        gap: 5px;
    }
    
    .cookie-modal-content {
        margin: 10px;
        max-height: 90vh;
    }
    
    .cookie-modal-header {
        padding: 15px;
    }
    
    .cookie-modal-body {
        padding: 15px;
    }
    
    .cookie-modal-footer {
        padding: 15px;
    }
}



/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .score-display {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .screen {
        padding: 20px;
    }
    
    .difficulty-buttons {
        gap: 15px;
    }
    
    .difficulty-btn {
        padding: 15px;
        min-height: 70px;
    }
    
    .difficulty-label {
        font-size: 1.3rem;
    }
    
    .letter-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .letter-row-container {
        margin-bottom: 10px;
    }
    
    .letter-row {
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .mobile-letter-row {
        gap: 6px;
        margin-bottom: 6px;
        justify-content: center;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .game-controls button {
        width: 100%;
        max-width: 250px;
    }
    
    .game-stats {
        flex-direction: column;
        text-align: center;
    }
    
    .game-settings {
        flex-direction: column;
        gap: 10px;
        padding: 8px;
    }
    
    .setting {
        justify-content: space-between;
        width: 100%;
    }
    
    .setting-select {
        min-width: 120px;
    }
    
    .stat-row {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .name-input-section {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    #player-name {
        margin-right: 0;
        margin-bottom: 10px;
        width: 100%;
        max-width: 250px;
    }
    
    .leaderboard-type-tabs, .leaderboard-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .tab-btn, .type-tab-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .leaderboard-entry {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .player-name {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .letter-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .letter-row {
        gap: 6px;
    }
    
    #word-display {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    .current-word-display h3 {
        font-size: 1.3rem;
    }
    
    .possible-words {
        font-size: 1rem;
        padding: 6px;
    }
    
    .dictionary-banner {
        padding: 8px 15px;
        gap: 10px;
    }
    
    .banner-label {
        font-size: 0.9rem;
    }
    
    .dict-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-width: 70px;
    }
}

/* Additional animations */
.letter-btn.selected {
    animation: letterSelect 0.3s ease;
}

@keyframes letterSelect {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.screen {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Share Results Button */
.share-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 20px;
    margin: 10px 5px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
    display: none; /* Hidden by default */
}

/* Share Section Styling */
.share-section {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(76, 175, 80, 0.3);
}

.share-section .share-btn {
    font-size: 18px;
    padding: 15px 30px;
    margin: 0;
}

/* Show share button only on game over screen */
#game-over-screen.active .share-btn {
    display: inline-block;
}

.share-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.4);
}

.share-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.theme-switch-input {
    display: none;
}

.theme-switch-label {
    display: block;
    width: 60px;
    height: 34px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 34px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-switch-button {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.theme-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    transition: opacity 0.3s ease;
}

.theme-icon.sun {
    left: 8px;
    opacity: 0;
}

.theme-icon.moon {
    right: 8px;
    opacity: 1;
}

.theme-switch-input:checked + .theme-switch-label {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.theme-switch-input:checked + .theme-switch-label .theme-switch-button {
    left: 30px;
    background: white;
}

.theme-switch-input:checked + .theme-switch-label .theme-icon.sun {
    opacity: 1;
}

.theme-switch-input:checked + .theme-switch-label .theme-icon.moon {
    opacity: 0;
}

/* Mobile adjustments for theme toggle */
@media (max-width: 768px) {
    .theme-toggle {
        bottom: 15px;
        left: 15px;
    }
    
    .theme-switch-label {
        width: 50px;
        height: 28px;
    }
    
    .theme-switch-button {
        width: 22px;
        height: 22px;
        top: 1px;
        left: 1px;
    }
    
    .theme-switch-input:checked + .theme-switch-label .theme-switch-button {
        left: 25px;
    }
    
    .theme-icon {
        font-size: 12px;
    }
    
    .theme-icon.sun {
        left: 6px;
    }
    
    .theme-icon.moon {
        right: 6px;
    }
}


/* Tutorial Modal */
.tutorial-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.tutorial-modal.show {
    display: flex;
}

.tutorial-modal-content {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: tutorialSlideIn 0.4s ease-out;
}

@keyframes tutorialSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tutorial-modal-header {
    padding: 25px 30px 15px;
    border-bottom: 2px solid var(--card-border);
    text-align: center;
}

.tutorial-modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4CAF50, #2196F3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tutorial-modal-body {
    padding: 25px 30px;
    color: var(--text-color);
    line-height: 1.6;
}

.tutorial-section {
    margin-bottom: 25px;
}

.tutorial-section:last-child {
    margin-bottom: 0;
}

.tutorial-section h3 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tutorial-section p {
    margin: 0 0 10px 0;
    color: var(--text-secondary);
    font-size: 1rem;
}

.tutorial-section ol,
.tutorial-section ul {
    margin: 0;
    padding-left: 25px;
    color: var(--text-secondary);
}

.tutorial-section li {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.tutorial-section strong {
    color: var(--text-color);
    font-weight: 600;
}

.tutorial-modal-footer {
    padding: 20px 30px 25px;
    border-top: 2px solid var(--card-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.tutorial-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    min-width: 200px;
}

.tutorial-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.tutorial-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.tutorial-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.tutorial-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.tutorial-checkbox span {
    cursor: pointer;
}

/* Mobile adjustments for tutorial modal */
@media (max-width: 768px) {
    .tutorial-modal {
        padding: 15px;
    }
    
    .tutorial-modal-content {
        max-height: 85vh;
    }
    
    .tutorial-modal-header {
        padding: 20px 20px 10px;
    }
    
    .tutorial-modal-header h2 {
        font-size: 1.6rem;
    }
    
    .tutorial-modal-body {
        padding: 20px;
    }
    
    .tutorial-section h3 {
        font-size: 1.2rem;
    }
    
    .tutorial-modal-footer {
        padding: 15px 20px 20px;
    }
    
    .tutorial-btn {
        padding: 12px 25px;
        font-size: 1rem;
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .tutorial-modal-header h2 {
        font-size: 1.4rem;
    }
    
    .tutorial-section h3 {
        font-size: 1.1rem;
    }
    
    .tutorial-section p,
    .tutorial-section li {
        font-size: 0.9rem;
    }
    
    .tutorial-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
        min-width: 160px;
    }
}

/* Footer */
.game-footer {
    margin-top: 30px;
    padding: 20px;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.game-footer p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.support-link {
    margin-top: 15px;
}

.coffee-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #FF813F, #FF6B35);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 129, 63, 0.3);
    border: 2px solid transparent;
}

.coffee-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 129, 63, 0.4);
    background: linear-gradient(135deg, #FF6B35, #FF5722);
    border-color: rgba(255, 255, 255, 0.2);
}

.coffee-link:active {
    transform: translateY(0);
}

/* Game Description */
.game-description {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--card-border);
    text-align: center;
}

.game-description p {
    margin: 0 0 10px 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    font-style: italic;
}

.creator-links {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.creator-links strong {
    color: var(--text-color);
}

.creator-links a {
    color: #4CAF50;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.creator-links a:hover {
    background: rgba(76, 175, 80, 0.1);
    color: #45a049;
    text-decoration: underline;
}

/* Mobile adjustments for footer */
@media (max-width: 768px) {
    .game-footer {
        margin-top: 20px;
        padding: 15px;
    }
    
    .game-footer p {
        font-size: 0.8rem;
    }
    
    .support-link {
        margin-top: 12px;
    }
    
    .coffee-link {
        padding: 8px 16px;
        font-size: 0.85rem;
        gap: 6px;
    }
    
    .game-description p {
        font-size: 0.75rem;
    }
    
    .creator-links {
        font-size: 0.7rem;
    }
    
    .creator-links a {
        padding: 2px 4px;
    }
}

@media (max-width: 480px) {
    .game-footer {
        margin-top: 15px;
        padding: 12px;
    }
    
    .game-footer p {
        font-size: 0.75rem;
    }
    
    .support-link {
        margin-top: 10px;
    }
    
    .coffee-link {
        padding: 7px 14px;
        font-size: 0.8rem;
        gap: 5px;
    }
    
    .game-description p {
        font-size: 0.7rem;
    }
    
    .creator-links {
        font-size: 0.65rem;
    }
    
    .creator-links a {
        padding: 2px 4px;
    }
}

