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

body {
    font-family: 'Quicksand', 'Comic Sans MS', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.5s;
}

body.christmas-mode {
    background: linear-gradient(135deg, #c41e3a 0%, #165b33 100%);
}

/* Hovedmeny */
.main-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 10px;
}

.main-menu-container {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* Mobiloptimalisering */
@media (max-width: 480px) {
    .main-menu-container {
        padding: 20px 15px;
        margin: 10px;
        border-radius: 15px;
    }
    
    .main-logo {
        max-width: 280px;
    }
    
    .main-subtitle {
        font-size: 1.2em;
        margin-bottom: 25px;
    }
}

.main-logo-container {
    margin-bottom: 25px;
}

.main-logo {
    width: 100%;
    max-width: 320px;
    height: auto;
}

.main-subtitle {
    font-size: 1.4em;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 30px;
    font-family: 'Fredoka', 'Quicksand', sans-serif;
}

.game-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.game-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    min-height: 70px;
}

.game-btn.flag-game {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.game-btn.flag-game:hover:not(:disabled) {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
}

/* Mobiloptimalisering for spillknapper */
@media (max-width: 480px) {
    .game-btn {
        padding: 15px 18px;
        gap: 12px;
        min-height: 65px;
    }
    
    .game-icon {
        font-size: 2.5em;
    }
    
    .game-title {
        font-size: 1.3em;
    }
    
    .game-desc {
        font-size: 0.9em;
    }
}

.game-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.game-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.game-btn.coming-soon {
    background: linear-gradient(135deg, #ccc 0%, #999 100%);
    cursor: not-allowed;
    opacity: 0.7;
}

.game-icon {
    font-size: 3em;
    flex-shrink: 0;
}

.game-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.game-title {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 3px;
    font-family: 'Fredoka', 'Quicksand', sans-serif;
}

.game-desc {
    font-size: 0.95em;
    opacity: 0.9;
}

/* Startmeny for bokstavspill */
.start-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 10px;
}

/* Mobiloptimalisering for bokstavspill-meny */
@media (max-width: 480px) {
    .menu-container {
        padding: 15px 20px 30px 20px;
        margin: 10px;
        border-radius: 15px;
    }
    
    .logo {
        max-width: 250px;
    }
    
    .subtitle {
        font-size: 1.1em;
        margin-bottom: 20px;
    }
    
    .difficulty-buttons {
        gap: 12px;
    }
    
    .difficulty-btn {
        padding: 15px 20px;
        gap: 15px;
    }
    
    .difficulty-btn .emoji {
        font-size: 2.5em;
    }
    
    .difficulty-btn .title {
        font-size: 1.3em;
    }
    
    .difficulty-btn .desc {
        font-size: 0.85em;
    }
}

.menu-container {
    background: white;
    border-radius: 20px;
    padding: 20px 30px 40px 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.header-with-back {
    position: relative;
    margin-bottom: 15px;
}

.header-with-back .back-btn {
    position: absolute;
    left: 0;
    top: 10px;
    padding: 8px 15px;
    font-size: 0.9em;
    background: #6c757d;
    z-index: 10;
}

.logo-container {
    margin-bottom: 20px;
}

.logo {
    width: 100%;
    max-width: 280px;
    height: auto;
}

.subtitle {
    font-size: 1.3em;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 25px;
    font-family: 'Fredoka', 'Quicksand', sans-serif;
}

.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    width: 100%;
}

.difficulty-btn {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 25px;
    border: none;
    border-radius: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
}

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

.difficulty-btn:active {
    transform: translateY(-1px);
}

.difficulty-btn.easy {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.difficulty-btn.easy:hover {
    background: linear-gradient(135deg, #c3e6cb 0%, #b1dfbb 100%);
}

.difficulty-btn.medium {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.difficulty-btn.medium:hover {
    background: linear-gradient(135deg, #ffeaa7 0%, #fddc8f 100%);
}

.difficulty-btn.hard {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.difficulty-btn.hard:hover {
    background: linear-gradient(135deg, #f5c6cb 0%, #f1b0b7 100%);
}

.difficulty-btn.europa {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.difficulty-btn.europa:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.difficulty-btn.asia {
    background: linear-gradient(135deg, #fd7e14 0%, #e55a00 100%);
}

.difficulty-btn.asia:hover {
    background: linear-gradient(135deg, #e55a00 0%, #cc4900 100%);
}

.difficulty-btn.amerika {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.difficulty-btn.amerika:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
}

.difficulty-btn.afrika {
    background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%);
}

.difficulty-btn.afrika:hover {
    background: linear-gradient(135deg, #5a2d91 0%, #4c1f78 100%);
}

.flag-logo {
    font-size: 2.2em;
    font-weight: 600;
    color: #667eea;
    font-family: 'Fredoka', 'Quicksand', sans-serif;
    margin: 20px 0;
}

.difficulty-btn .emoji {
    font-size: 3em;
    flex-shrink: 0;
}

.difficulty-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.difficulty-btn .title {
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
    font-family: 'Fredoka', 'Quicksand', sans-serif;
}

.difficulty-btn .desc {
    font-size: 0.95em;
    color: #666;
}

.christmas-toggle {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #eee;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    font-size: 1.2em;
    padding: 15px;
    border-radius: 10px;
    transition: background 0.3s;
}

.toggle-label:hover {
    background: #f8f9fa;
}

.toggle-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #c41e3a;
}

.toggle-text {
    font-weight: 600;
    color: #c41e3a;
    font-family: 'Fredoka', 'Quicksand', sans-serif;
}

/* Spillområde */
.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.header h1 {
    flex: 1;
    text-align: center;
    color: #667eea;
    font-size: 1.8em;
    margin: 0;
    font-family: 'Fredoka', 'Quicksand', sans-serif;
    font-weight: 600;
}

.back-btn {
    padding: 10px 20px;
    font-size: 1em;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.back-btn:hover {
    background: #5a6268;
}

.score {
    font-size: 1.3em;
    color: #333;
    white-space: nowrap;
}

.score strong {
    color: #667eea;
    font-size: 1.2em;
}

.game-area {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.image-container {
    display: flex;
    justify-content: center;
}

.image-box {
    width: 250px;
    height: 250px;
    background: #f0f0f0;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 4px solid #667eea;
}

#emoji {
    font-size: 150px;
}

#word-image {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
}

#flag-emoji {
    font-size: 180px;
}

/* Flervalgs-knapper for flaggspill */
.flag-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.choice-btn {
    padding: 15px 20px;
    font-size: 1.1em;
    font-weight: 600;
    background: white;
    color: #333;
    border: 3px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Quicksand', sans-serif;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.choice-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.choice-btn.correct {
    border-color: #28a745;
    background: #d4edda;
    color: #28a745;
}

.choice-btn.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
    color: #dc3545;
}

.choice-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.game-mode-toggle {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 10px;
    background: #f8f9fa;
}

.toggle-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.mode-btn {
    padding: 8px 16px;
    font-size: 0.9em;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
}

.mode-btn.active {
    background: #667eea;
    color: white;
}

.mode-btn:hover {
    background: #667eea;
    color: white;
}

/* Mobiloptimalisering for flaggspill */
@media (max-width: 480px) {
    #flag-emoji {
        font-size: 140px;
    }
    
    .flag-choices {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .choice-btn {
        padding: 12px 15px;
        font-size: 1em;
        min-height: 50px;
    }
    
    .toggle-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .mode-btn {
        padding: 10px 16px;
    }
}

.input-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

label {
    font-size: 1.3em;
    color: #333;
    text-align: center;
    font-weight: 600;
    font-family: 'Fredoka', 'Quicksand', sans-serif;
}

.letter-boxes {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.letter-box {
    width: 60px;
    height: 70px;
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    border: 3px solid #ddd;
    border-radius: 10px;
    background: white;
    transition: all 0.3s;
    text-transform: uppercase;
}

.letter-box:focus {
    outline: none;
    border-color: #667eea;
    background: #f8f9ff;
    transform: scale(1.05);
}

.letter-box.correct {
    border-color: #28a745;
    background: #d4edda;
    color: #28a745;
}

.letter-box.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
    color: #dc3545;
}

.letter-box.hint {
    border-color: #ffc107;
    background: #fff8e1;
    animation: hintPulse 0.5s ease;
}

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

button {
    padding: 15px 30px;
    font-size: 1.2em;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s, transform 0.1s;
}

button:hover {
    background: #5568d3;
}

button:active {
    transform: scale(0.98);
}

.hint-btn {
    padding: 12px 25px;
    font-size: 1.1em;
    background: #ffc107;
    color: #333;
    margin-top: 15px;
}

.hint-btn:hover {
    background: #ffb300;
}

.hint-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.feedback {
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    min-height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.feedback.correct {
    color: #28a745;
}

.feedback.incorrect {
    color: #dc3545;
}

.next-btn {
    background: #28a745;
}

.next-btn:hover {
    background: #218838;
}
