/* Letterland Styles */

.letterland-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    font-family: 'Fredoka', sans-serif;
    overflow-x: hidden;
}

/* Voorkom body scroll op mobiel en tablet tijdens games */
@media (max-width: 1024px) {
    .letterland-body.game-active {
        overflow: hidden;
        height: 100vh;
        height: 100dvh;
        position: fixed;
        width: 100%;
    }
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    padding: 1rem;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .screen {
        padding: 0;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .screen.active {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        width: 100%;
        box-sizing: border-box;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    /* Intro screen op mobiel - scrollbaar */
    #intro-screen.active {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem;
    }
    
    /* Game screens - GEEN scroll, alles past op scherm */
    #game-screen-choose.active,
    #game-screen-listen.active,
    #game-screen-build.active {
        overflow: hidden;
        padding: 0;
    }
    
    .game-content {
        flex: 1;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
        padding: 0.5rem;
        padding-top: 3.5rem; /* Ruimte voor fixed header */
    }
    
    /* Alle game content - GEEN scroll, alles moet passen */
    #game-screen-choose.active .game-content,
    #game-screen-listen.active .game-content,
    #game-screen-build.active .game-content {
        overflow: hidden;
        padding: 0.5rem;
        padding-top: 3.5rem; /* Ruimte voor fixed header */
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 0.4rem;
    }
}

.screen.active {
    display: block;
}

@media (max-width: 768px) {
    .screen.active {
        display: flex;
    }
}

/* Intro Screen */
.intro-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
}

.intro-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: white;
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.intro-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.intro-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.dashboard-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 0.75rem 1.5rem;
    color: white;
    text-decoration: none;
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-btn:hover,
.dashboard-btn:active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.dashboard-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.game-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.mode-btn {
    background: white;
    border: none;
    border-radius: 25px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.mode-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 107, 157, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s;
}

.mode-btn:active::before {
    opacity: 1;
}

.mode-btn:hover,
.mode-btn:active {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.mode-icon {
    font-size: 4rem;
    line-height: 1;
    animation: wiggle 2s ease-in-out infinite;
}

.mode-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #FF6B9D;
    margin-top: 0.5rem;
}

.mode-description {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: #7F8C8D;
    line-height: 1.5;
}

.mode-age {
    font-size: 0.85rem;
    color: #4ECDC4;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Game Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    flex-wrap: nowrap;
    gap: 0.5rem;
}

.back-btn {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    flex-shrink: 0;
}

.back-btn:hover,
.back-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    color: #000000 !important;
    background: #ffffff !important;
}

.game-title {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: #2C3E50;
    margin: 0;
    font-weight: 700;
    flex: 1;
    text-align: center;
    padding: 0 0.5rem;
}

.score-display {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    font-weight: 600;
    color: #FF6B9D;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Game Content */
.game-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Tablet styling - tussen mobiel en desktop */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Fixed header voor alle game screens op tablet */
    #game-screen-choose.active .game-header,
    #game-screen-listen.active .game-header,
    #game-screen-build.active .game-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 200;
        padding: 0.5rem 0.75rem;
        margin: 0;
        border-radius: 0 0 15px 15px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0.5rem;
        flex-shrink: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .game-header {
        padding: 0.5rem 0.75rem;
        margin: 0;
        border-radius: 0 0 15px 15px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 200;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0.5rem;
        flex-shrink: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .back-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
        border-radius: 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .game-title {
        font-size: clamp(0.9rem, 2vw, 1.2rem);
        flex: 1;
        text-align: center;
        padding: 0 0.5rem;
        margin: 0;
        font-weight: 700;
    }
    
    .score-display {
        font-size: clamp(0.85rem, 2vw, 1.1rem);
        white-space: nowrap;
        flex-shrink: 0;
        font-weight: 600;
    }
    
    /* Game screens op tablet - geen scroll */
    .screen.active {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        width: 100%;
        box-sizing: border-box;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        overflow: hidden;
        padding: 0;
    }
    
    #game-screen-choose.active,
    #game-screen-listen.active,
    #game-screen-build.active {
        overflow: hidden;
    }
    
    .game-content {
        flex: 1;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
        padding: 1rem;
        padding-top: 4rem;
        gap: 1rem;
    }
    
    /* School board op tablet */
    .school-board {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 25px;
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .board-center {
        padding: 1rem;
        flex: 1;
        min-height: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .word-svg {
        width: 100%;
        height: 100%;
        max-height: 100%;
        object-fit: contain;
    }
    
    /* Kies het woord op tablet */
    #game-screen-choose .school-board {
        max-width: 650px;
    }
    
    /* Luister en tik op tablet */
    #game-screen-listen .school-board {
        max-width: 650px;
    }
    
    .listen-btn {
        padding: 0.7rem 1.2rem;
        font-size: clamp(0.95rem, 2vw, 1.2rem);
        min-height: 50px;
        margin-bottom: 0.75rem;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .listen-icon {
        font-size: 1.8rem;
    }
    
    /* Word buttons op tablet */
    .word-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        max-width: 650px;
        margin: 0.5rem auto 0 auto;
        padding: 0 0.5rem;
    }
    
    .word-btn {
        padding: 0.9rem 0.5rem;
        min-height: 65px;
        font-size: clamp(1rem, 2vw, 1.4rem);
        border-radius: 15px;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        line-height: 1.3 !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Image options op tablet */
    .image-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        max-width: 650px;
        margin: 0.5rem auto 0 auto;
        padding: 0 0.5rem;
    }
    
    .image-option {
        padding: 0.9rem 0.5rem;
        min-height: 100px;
        border-radius: 18px;
    }
    
    .option-word {
        font-size: clamp(1rem, 2vw, 1.3rem);
    }
    
    /* Bouw het woord op tablet */
    .build-content .school-board {
        max-width: 650px;
        margin: 0 auto 0.75rem auto;
        padding: 0.75rem;
    }
    
    .build-content .board-center {
        padding: 0.75rem;
        min-height: 280px;
        max-height: 50vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .build-content .word-svg {
        max-height: 50vh;
        min-height: 250px;
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    
    /* Letter slots en tiles op tablet */
    .build-content .word-slots {
        margin: 0.5rem auto;
        padding: 0.6rem;
        gap: 0.5rem;
        max-width: 650px;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    
    /* Bij 7+ letters op tablet: kleiner maken */
    .build-content.long-word .word-slots {
        gap: 0.4rem;
        padding: 0.5rem;
    }
    
    .build-content .letter-slot {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
        border-radius: 12px;
        border-width: 3px;
    }
    
    /* Bij 7+ letters op tablet: kleiner maken */
    .build-content.long-word .letter-slot {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }
    
    .build-content .letter-tiles {
        margin: 0.5rem auto;
        padding: 0.75rem;
        gap: 0.6rem;
        max-width: 650px;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    
    /* Bij 7+ letters op tablet: kleiner maken */
    .build-content.long-word .letter-tiles {
        gap: 0.5rem;
        padding: 0.65rem;
    }
    
    .build-content .letter-tile {
        width: 60px;
        height: 60px;
        font-size: 1.9rem;
        border-radius: 15px;
    }
    
    /* Bij 7+ letters op tablet: kleiner maken */
    .build-content.long-word .letter-tile {
        width: 52px;
        height: 52px;
        font-size: 1.6rem;
        border-radius: 12px;
    }
    
    /* Bottom bar op tablet – meescrollen, niet vast */
    .build-content .difficulty-selector {
        position: relative;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        padding: 0.7rem 1rem;
        margin: 0;
        margin-top: auto;
        border-top: 2px solid rgba(102, 126, 234, 0.25);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.75rem;
        overflow: hidden;
        box-sizing: border-box;
        max-width: 650px;
        margin-left: auto;
        margin-right: auto;
        border-radius: 15px 15px 0 0;
    }
    
    .build-content .diff-btn {
        flex: 1;
        padding: 0.65rem 0.5rem;
        font-size: clamp(0.85rem, 1.8vw, 1rem);
        font-weight: 700;
        border-width: 2px;
        border-radius: 12px;
        min-height: 48px;
        max-width: 180px;
    }
    
    /* Geen extra padding meer – bottom bar scrollt mee */
    #game-screen-build.active .game-content {
        padding-bottom: 0.5rem;
    }
}

/* Fixed topbar voor mobiel - consistent voor alle spellen */
@media (max-width: 768px) {
    /* Fixed header voor alle game screens - altijd zichtbaar bovenaan */
    #game-screen-choose.active .game-header,
    #game-screen-listen.active .game-header,
    #game-screen-build.active .game-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 200;
        padding: 0.4rem 0.5rem;
        margin: 0;
        border-radius: 0 0 12px 12px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0.4rem;
        flex-shrink: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Fallback voor game-header zonder active class */
    .game-header {
        padding: 0.4rem 0.5rem;
        margin: 0;
        border-radius: 0 0 12px 12px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 200;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0.4rem;
        flex-shrink: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Ruimte voor fixed header in game-content */
    #game-screen-choose.active .game-content,
    #game-screen-listen.active .game-content,
    #game-screen-build.active .game-content {
        padding-top: 3.5rem;
    }
    
    .back-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
        border-radius: 8px;
        white-space: nowrap;
        flex-shrink: 0;
        box-shadow: 0 2px 6px rgba(255, 107, 157, 0.25);
    }
    
    .game-title {
        font-size: clamp(0.75rem, 3vw, 0.95rem);
        flex: 1;
        text-align: center;
        padding: 0 0.3rem;
        margin: 0;
        font-weight: 700;
    }
    
    .score-display {
        font-size: clamp(0.7rem, 2.8vw, 0.85rem);
        white-space: nowrap;
        flex-shrink: 0;
        font-weight: 600;
    }
}

/* School Board */
.school-board {
    position: relative;
    background: white;
    border-radius: 30px;
    padding: 2rem;
    margin: 0 auto 2rem;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

@media (max-width: 768px) {
    .school-board {
        border-radius: 20px;
        margin-bottom: 1rem;
    }
}

.board-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at top left, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at top right, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
        radial-gradient(circle at bottom left, rgba(255, 107, 157, 0.15) 0%, transparent 50%),
        radial-gradient(circle at bottom right, rgba(78, 205, 196, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.board-center {
    position: relative;
    z-index: 1;
    background: white;
    border-radius: 20px;
    padding: 2rem;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-svg {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Hide images until they have a src */
.word-svg:not([src]),
.word-svg[src=""],
.word-svg[src="undefined"] {
    display: none;
}

/* Larger SVG for "Kies het woord" - desktop default */
#game-screen-choose .word-svg {
    max-height: 500px;
    min-height: 300px;
}

/* Desktop styling - overschrijft tablet styling */
@media (min-width: 1025px) {
    #game-screen-choose .school-board {
        max-width: 800px;
        padding: 3rem;
    }
    
    #game-screen-choose .board-center {
        min-height: 500px;
        padding: 3rem;
    }
    
    #game-screen-choose .word-svg {
        max-height: 600px;
        min-height: 400px;
    }
}

@media (min-width: 1200px) {
    #game-screen-choose .school-board {
        max-width: 900px;
        padding: 4rem;
    }
    
    #game-screen-choose .board-center {
        min-height: 600px;
        padding: 4rem;
    }
    
    #game-screen-choose .word-svg {
        max-height: 700px;
        min-height: 500px;
    }
}

/* Larger SVG on desktop for "Bouw het woord" - basis desktop styling */
@media (min-width: 1025px) {
    .build-content .school-board {
        max-width: 800px;
        padding: 2rem;
    }
    
    .build-content .board-center {
        min-height: 500px;
        padding: 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .build-content .word-svg {
        max-height: 600px;
        min-height: 400px;
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    
    /* Ruimte tussen letter tiles en difficulty selector */
    .build-content .difficulty-selector {
        margin-top: 2rem;
        margin-bottom: 1rem;
    }
    
    /* Letter tiles spacing voor desktop */
    .build-content .letter-tiles {
        margin-bottom: 1rem;
    }
}

/* Very small desktop - extra grote SVG */
@media (min-width: 1025px) and (max-width: 1099px) {
    .build-content .school-board {
        max-width: 600px;
        padding: 1.5rem;
    }
    
    .build-content .board-center {
        min-height: 450px;
        padding: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .build-content .word-svg {
        max-height: 550px;
        min-height: 400px;
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    
    /* Meer ruimte tussen letter tiles en difficulty buttons */
    .build-content .difficulty-selector {
        margin-top: 2.5rem;
        margin-bottom: 1.5rem;
    }
    
    /* Letter tiles spacing */
    .build-content .letter-tiles {
        margin-bottom: 1rem;
    }
}

/* Small desktop - compact maar SVG blijft groot */
@media (min-width: 1100px) and (max-width: 1199px) {
    .build-content .school-board {
        max-width: 650px;
        padding: 1.75rem;
    }
    
    .build-content .board-center {
        min-height: 480px;
        padding: 1.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .build-content .word-svg {
        max-height: 550px;
        min-height: 400px;
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    
    /* Meer ruimte tussen letter tiles en difficulty buttons */
    .build-content .difficulty-selector {
        margin-top: 2.5rem;
        margin-bottom: 1.5rem;
    }
    
    /* Letter tiles spacing */
    .build-content .letter-tiles {
        margin-bottom: 1rem;
    }
}

/* Medium desktop - iets meer ruimte */
@media (min-width: 1200px) and (max-width: 1399px) {
    .build-content .school-board {
        max-width: 750px;
        padding: 2rem;
    }
    
    .build-content .board-center {
        min-height: 500px;
        padding: 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .build-content .word-svg {
        max-height: 600px;
        min-height: 400px;
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    
    /* Meer ruimte tussen letter tiles en difficulty buttons */
    .build-content .difficulty-selector {
        margin-top: 2.5rem;
        margin-bottom: 1.5rem;
    }
    
    /* Letter tiles spacing */
    .build-content .letter-tiles {
        margin-bottom: 1rem;
    }
}

/* Large desktop - meer ruimte */
@media (min-width: 1400px) {
    .build-content .school-board {
        max-width: 900px;
        padding: 3rem;
    }
    
    .build-content .board-center {
        min-height: 500px;
        padding: 3rem;
    }
    
    .build-content .word-svg {
        max-height: 600px;
        min-height: 400px;
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    
    /* Ruimte tussen letter tiles en difficulty selector */
    .build-content .difficulty-selector {
        margin-top: 2rem;
        margin-bottom: 1rem;
    }
    
    /* Letter tiles spacing */
    .build-content .letter-tiles {
        margin-bottom: 1rem;
    }
}

/* Extra large desktop */
@media (min-width: 1400px) {
    .build-content .school-board {
        max-width: 1000px;
        padding: 4rem;
    }
    
    .build-content .board-center {
        min-height: 600px;
        padding: 4rem;
    }
    
    .build-content .word-svg {
        max-height: 700px;
        min-height: 500px;
    }
}

/* Word Buttons */
.word-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.word-btn {
    border: none;
    border-radius: 20px;
    padding: 1.5rem 1rem;
    color: white;
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    white-space: normal;
    word-wrap: break-word;
    hyphens: auto;
    line-height: 1.3;
    text-align: center;
}

/* Different colors for each button */
.word-btn:nth-child(1) {
    background: linear-gradient(135deg, #FF6B9D 0%, #C44569 100%);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.word-btn:nth-child(2) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.word-btn:nth-child(3) {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.word-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.word-btn:hover::before {
    left: 100%;
}

.word-btn:hover,
.word-btn:active {
    transform: translateY(-4px) scale(1.05);
}

.word-btn:nth-child(1):hover,
.word-btn:nth-child(1):active {
    box-shadow: 0 8px 28px rgba(255, 107, 157, 0.5);
}

.word-btn:nth-child(2):hover,
.word-btn:nth-child(2):active {
    box-shadow: 0 8px 28px rgba(102, 126, 234, 0.5);
}

.word-btn:nth-child(3):hover,
.word-btn:nth-child(3):active {
    box-shadow: 0 8px 28px rgba(78, 205, 196, 0.5);
}

.word-btn.correct {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    animation: correctPulse 0.6s ease-out;
}

.word-btn.wrong {
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
    animation: wrongShake 0.5s ease-out;
}

/* Correct Word Display – leuk bordje (desktop + mobiel) */
.correct-word-display {
    text-align: center;
    margin: 1.5rem auto 0;
    padding: 0.75rem;
    max-width: min(90vw, 520px);
    opacity: 0;
    transform: scale(0.6) translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.correct-word-display.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Bordje: afgerond bord met schaduw en rand */
.correct-word-display .word-bordje {
    display: inline-block;
    background: linear-gradient(165deg, #FFF9E6 0%, #FFEBB3 35%, #FFE082 100%);
    border-radius: 20px;
    padding: 1.75rem 2rem 1.5rem;
    box-shadow:
        0 8px 0 0 #D4A84B,
        0 10px 25px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    border: 4px solid #C99A2E;
    position: relative;
    animation: wordBordjePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Kleine “Goed zo!”-strip bovenop het bordje */
.correct-word-display .word-bordje::before {
    content: '★ Goed zo! ★';
    position: absolute;
    top: -0.5em;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(0.75rem, 3vw, 1rem);
    font-weight: 700;
    color: #5D4037;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.25em 0.6em;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.correct-word-display .word-bordje-text {
    font-family: 'Luckiest Guy', cursive;
    font-size: clamp(2rem, 9vw, 4rem);
    font-weight: 400;
    color: #2C1810;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.1;
    display: block;
    text-shadow:
        2px 2px 0 rgba(255, 255, 255, 0.8),
        3px 3px 0 rgba(0, 0, 0, 0.08);
    position: relative;
    margin-top: 0.35em;
}

@keyframes wordBordjePop {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }
    60% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .correct-word-display {
        margin: 1rem auto 0;
        padding: 0.5rem;
        max-width: 92vw;
    }
    
    .correct-word-display .word-bordje {
        padding: 1.4rem 1.5rem 1.25rem;
        border-radius: 18px;
        border-width: 3px;
    }
    
    .correct-word-display .word-bordje-text {
        font-size: clamp(1.75rem, 11vw, 3.25rem);
        letter-spacing: 0.04em;
        margin-top: 0.3em;
    }
}

@media (max-width: 480px) {
    .correct-word-display {
        margin: 0.75rem auto 0;
        padding: 0.4rem;
    }
    
    .correct-word-display .word-bordje {
        padding: 1.2rem 1.25rem 1rem;
        border-radius: 16px;
    }
    
    .correct-word-display .word-bordje-text {
        font-size: clamp(1.5rem, 12vw, 2.75rem);
        margin-top: 0.25em;
    }
}

/* Listen and Tap */
#game-screen-listen .school-board {
    margin-bottom: 2rem;
}

/* Larger SVG for "Luister en tik" - desktop default */
#game-screen-listen .word-svg {
    max-height: 500px;
    min-height: 300px;
}

/* Desktop styling voor "Luister en tik" - overschrijft tablet styling */
@media (min-width: 1025px) {
    #game-screen-listen .school-board {
        max-width: 800px;
        padding: 3rem;
    }
    
    #game-screen-listen .board-center {
        min-height: 500px;
        padding: 3rem;
    }
    
    #game-screen-listen .word-svg {
        max-height: 600px;
        min-height: 400px;
    }
}

@media (min-width: 1200px) {
    #game-screen-listen .school-board {
        max-width: 900px;
        padding: 4rem;
    }
    
    #game-screen-listen .board-center {
        min-height: 600px;
        padding: 4rem;
    }
    
    #game-screen-listen .word-svg {
        max-height: 700px;
        min-height: 500px;
    }
}

.listen-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    padding: 2rem 3rem;
    color: white;
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 auto 2rem;
    min-height: 80px;
}

.listen-btn:hover,
.listen-btn:active {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}

.listen-icon {
    font-size: 2.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.image-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.image-option {
    border: none;
    border-radius: 20px;
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 80px;
}

/* Vrolijke kleuren voor elke button - net zoals bij "Kies het woord" */
.image-option:nth-child(1) {
    background: linear-gradient(135deg, #FF6B9D 0%, #C44569 100%);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.image-option:nth-child(2) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.image-option:nth-child(3) {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.image-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.image-option:hover::before,
.image-option:active::before {
    left: 100%;
}

.image-option:hover,
.image-option:active {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}


.option-svg {
    max-width: 100%;
    max-height: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.option-word {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: white;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Correct/wrong states overschrijven de normale kleuren */
.image-option.correct {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%) !important;
    animation: correctPulse 0.6s ease-out;
}

.image-option.wrong {
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%) !important;
    animation: wrongShake 0.5s ease-out;
}

.image-option.correct .option-word,
.image-option.wrong .option-word {
    color: white;
}

/* Build Word */
.build-content {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.word-slots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem auto;
    padding: 0.75rem;
    background: transparent;
    border-radius: 20px;
    box-shadow: none;
    min-height: 80px;
}

.letter-slot {
    width: 60px;
    height: 60px;
    border: 3px dashed #ddd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    transition: all 0.3s;
    font-size: 2rem;
    font-weight: 700;
    color: #2C3E50;
}

.letter-slot.filled {
    border-color: #4ECDC4;
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    color: white;
    border-style: solid;
    transform: scale(1.1);
}

.letter-tiles {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    min-height: 100px;
}

.letter-tile {
    width: 70px;
    height: 70px;
    border: none;
    border-radius: 15px;
    color: white;
    font-family: 'Fredoka', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    cursor: grab;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: none;
}

.letter-tile:active {
    cursor: grabbing;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 18px rgba(255, 107, 157, 0.6);
}

.letter-tile.placed {
    opacity: 0.5;
    cursor: default;
    transform: scale(0.9);
}

.letter-tile.wrong {
    animation: wrongBounce 0.6s ease-out;
}

.letter-tile.wrong-tile {
    animation: wrongBounce 0.8s ease-out;
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%) !important;
}

.letter-slot.wrong-slot {
    border-color: #E53935 !important;
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.2), rgba(198, 40, 40, 0.2)) !important;
    animation: slotShake 0.6s ease-out;
}

.letter-slot.correct-slot {
    border-color: #4ECDC4 !important;
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.3), rgba(68, 160, 141, 0.3)) !important;
    animation: correctFlash 0.5s ease-out;
}

@keyframes slotShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes correctFlash {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 rgba(78, 205, 196, 0);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(78, 205, 196, 0.6);
    }
}

.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 1rem;
}

.diff-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    color: #2C3E50;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.diff-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    transition: background 0.2s ease;
}

.diff-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: none;
}

.diff-btn.active::before {
    background: rgba(255, 255, 255, 0.1);
}

.diff-btn:hover,
.diff-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Animations */
@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

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

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes wrongBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--confetti-color);
    border-radius: 50%;
    animation: confettiFall linear;
}

.confetti-explosion {
    /* Special styling for explosion confetti */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .game-modes {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .mode-btn {
        padding: 1.5rem 1rem;
        min-height: 180px;
    }
    
    /* Compacte layout voor alles in 1 scherm - GEEN scroll */
    .game-content {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        flex: 1;
        overflow: hidden;
        width: 100%;
        box-sizing: border-box;
        min-height: 0;
        -webkit-overflow-scrolling: auto;
    }
    
    /* Specifiek voor "Kies het woord": kleinere gap voor beter ruimtegebruik, behoud padding-top */
    #game-screen-choose.active .game-content {
        gap: 0.25rem;
        padding-top: 3.5rem !important; /* Zorg dat padding-top behouden blijft */
    }
    
    /* Specifiek voor "Luister en tik": behoud padding-top */
    #game-screen-listen.active .game-content {
        padding-top: 3.5rem !important; /* Zorg dat padding-top behouden blijft */
    }
    
    /* Voorkom touch scroll op game screens */
    #game-screen-choose.active,
    #game-screen-listen.active,
    #game-screen-build.active {
        touch-action: none;
        -ms-touch-action: none;
    }
}

/* Tablet: voorkom touch scroll op game screens */
@media (min-width: 769px) and (max-width: 1024px) {
    #game-screen-choose.active,
    #game-screen-listen.active,
    #game-screen-build.active {
        touch-action: none;
        -ms-touch-action: none;
    }
    
    /* Bouw het woord: bottom bar scrollt mee */
    #game-screen-build.active .game-content {
        padding-bottom: 0.5rem;
        overflow: hidden;
    }
    
    /* Kies het woord en luister en tik: correcte padding voor fixed header */
    #game-screen-choose.active .game-content,
    #game-screen-listen.active .game-content {
        padding: 0.5rem;
        padding-top: 3.5rem; /* Ruimte voor fixed header */
        padding-bottom: 0.5rem;
        overflow: hidden;
        gap: 0.25rem;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    
    /* Build content specifiek - zorg dat alles zichtbaar is */
    .build-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    /* Veel grotere SVG's op mobiel - vul het scherm */
    .school-board {
        padding: 0.5rem;
        margin: 0 0 0.5rem 0;
        flex-shrink: 0;
        max-width: 100%;
        width: 100%;
        border-radius: 15px;
    }
    
    .board-center {
        min-height: auto;
        padding: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* SVG's vullen de breedte van het scherm - maar niet voor choose/listen games */
    .word-svg {
        width: 100%;
        height: auto;
        max-height: none;
        min-height: auto;
        object-fit: contain;
    }
    
    /* Override voor choose/listen games - SVG moet groot en zichtbaar zijn in vierkant bord */
    #game-screen-choose .word-svg,
    #game-screen-listen .word-svg {
        width: 95% !important;
        height: 95% !important;
        max-width: 95% !important;
        max-height: 95% !important;
        min-width: 85% !important;
        min-height: 85% !important;
        object-fit: contain !important;
        display: block !important;
        margin: auto !important;
    }
    
    /* Kies het woord - Vierkant schoolbord met grote SVG */
    #game-screen-choose .school-board {
        padding: 0.4rem;
        margin: 0 auto 0.5rem auto;
        flex-shrink: 1;
        flex-grow: 0;
        width: 100%;
        max-width: 100%;
        aspect-ratio: 1;
        height: auto;
        min-height: 200px;
        max-height: calc(100vh - 11rem);
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        position: relative;
        border-radius: 20px;
    }
    
    #game-screen-choose .board-center {
        padding: 0.25rem;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        position: relative;
    }
    
    #game-screen-choose .word-svg {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        min-width: 95% !important;
        min-height: 95% !important;
        object-fit: contain !important;
        display: block !important;
        margin: auto !important;
    }
    
    /* Luister en tik - Vierkant schoolbord met grote SVG */
    #game-screen-listen .school-board {
        padding: 0.4rem;
        margin: 0 auto 0.5rem auto;
        flex-shrink: 1;
        flex-grow: 0;
        width: 100%;
        max-width: 100%;
        aspect-ratio: 1;
        height: auto;
        min-height: 200px;
        max-height: calc(100vh - 13rem);
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        position: relative;
        border-radius: 20px;
    }
    
    #game-screen-listen .board-center {
        padding: 0.25rem;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        position: relative;
    }
    
    #game-screen-listen .word-svg {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        min-width: 95% !important;
        min-height: 95% !important;
        object-fit: contain !important;
        display: block !important;
        margin: auto !important;
    }
    
    /* Bouw het woord - Compacte layout */
    .build-content .school-board {
        padding: 0.25rem;
        margin: 0 0 0.3rem 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        flex-shrink: 0;
    }
    
    .build-content .board-center {
        padding: 0.25rem;
        min-height: 0;
        max-height: 35vh;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .build-content .word-svg {
        width: 100%;
        max-height: 35vh;
        height: auto;
        object-fit: contain;
    }
    
    /* Compacter listen button */
    .listen-btn {
        padding: 0.4rem 0.6rem;
        font-size: clamp(0.7rem, 2.5vw, 0.85rem);
        min-height: 36px;
        margin-bottom: 0.25rem;
        border-radius: 12px;
        flex-shrink: 0;
    }
    
    .listen-icon {
        font-size: 1.3rem;
    }
    
    /* Word buttons naast elkaar op mobiel (3 kolommen) - goed passend */
    .word-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
        max-width: 100%;
        margin: 0.2rem 0 0 0;
        flex-shrink: 0;
        padding: 0 0.2rem;
    }
    
    /* Goed passende word buttons op mobiel - lange woorden op meerdere regels */
    .word-btn {
        padding: 0.6rem 0.3rem;
        min-height: 50px;
        font-size: clamp(0.85rem, 3.2vw, 1.1rem);
        border-radius: 12px;
        font-weight: 700;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        line-height: 1.3 !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Image options naast elkaar op mobiel (3 kolommen) - vrolijke buttons zoals bij "Kies het woord" */
    .image-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
        margin: 0.2rem 0 0 0;
        flex-shrink: 0;
        padding: 0 0.2rem;
        max-width: 100%;
    }
    
    .image-option {
        padding: 0.6rem 0.3rem;
        min-height: 50px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        position: relative;
        overflow: hidden;
        transition: all 0.3s;
    }
    
    /* Vrolijke kleuren voor elke button - net zoals bij "Kies het woord" */
    .image-option:nth-child(1) {
        background: linear-gradient(135deg, #FF6B9D 0%, #C44569 100%);
        box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
    }
    
    .image-option:nth-child(2) {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }
    
    .image-option:nth-child(3) {
        background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
        box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
    }
    
    .image-option::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.5s;
    }
    
    .image-option:hover::before,
    .image-option:active::before {
        left: 100%;
    }
    
    .option-word {
        font-size: clamp(0.85rem, 3.2vw, 1.1rem);
        font-weight: 700;
        color: white;
        text-align: center;
        position: relative;
        z-index: 1;
    }
    
    
    /* Veel compacter letter slots en tiles op mobiel */
    .build-content .word-slots {
        margin: 0.25rem auto;
        padding: 0.3rem;
        gap: 0.3rem;
        flex-shrink: 0;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
    }
    
    /* Bij 7+ letters: kleiner maken voor betere pasvorm */
    .build-content.long-word .word-slots {
        gap: 0.25rem;
        padding: 0.25rem;
    }
    
    .build-content .letter-slot {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
        border-radius: 8px;
        border-width: 2px;
    }
    
    /* Bij 7+ letters: kleiner maken */
    .build-content.long-word .letter-slot {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        border-width: 2px;
    }
    
    .build-content .letter-tiles {
        margin: 0.25rem auto;
        padding: 0.4rem;
        gap: 0.35rem;
        flex-shrink: 0;
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        min-height: auto;
    }
    
    /* Bij 7+ letters: kleiner maken voor betere pasvorm */
    .build-content.long-word .letter-tiles {
        gap: 0.3rem;
        padding: 0.3rem;
    }
    
    .build-content .letter-tile {
        width: 46px;
        height: 46px;
        font-size: 1.5rem;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    /* Bij 7+ letters: kleiner maken */
    .build-content.long-word .letter-tile {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
        border-radius: 8px;
    }
    
    /* Bottom bar op mobiel – meescrollen, niet vast */
    .build-content .difficulty-selector {
        position: relative;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        padding: 0.5rem;
        margin: 0;
        margin-top: auto;
        border-top: 2px solid rgba(102, 126, 234, 0.25);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
        display: flex;
        justify-content: space-evenly;
        align-items: center;
        gap: 0.35rem;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .build-content .diff-btn {
        flex: 1;
        padding: 0.5rem 0.3rem;
        font-size: clamp(0.75rem, 2.8vw, 0.9rem);
        font-weight: 700;
        border-width: 2px;
        border-radius: 10px;
        min-height: 40px;
        max-width: none;
        transition: all 0.2s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        margin: 0;
        position: relative;
        box-sizing: border-box;
    }
    
    .build-content .diff-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 12px;
        background: transparent;
        transition: background 0.2s ease;
    }
    
    .build-content .diff-btn.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-color: #667eea;
        color: white;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
        transform: none;
    }
    
    .build-content .diff-btn.active::before {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .build-content .diff-btn:active {
        transform: scale(0.98);
    }
    
    /* Geen extra padding – bottom bar scrollt mee */
    #game-screen-build.active .game-content {
        padding-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .intro-content {
        padding: 1rem 0.5rem;
    }
    
    .mode-btn {
        padding: 1.25rem 0.75rem;
        min-height: 160px;
    }
    
    /* Fixed topbar op kleine schermen - consistent voor alle spellen */
    .game-header {
        padding: 0.3rem 0.4rem;
        margin: 0;
        border-radius: 0 0 10px 10px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 200;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0.35rem;
        flex-shrink: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Fixed header voor alle game screens op kleine schermen */
    #game-screen-choose .game-header,
    #game-screen-listen .game-header,
    #game-screen-build .game-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 200;
    }
    
    .back-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
        border-radius: 8px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .game-title {
        font-size: clamp(0.7rem, 3.5vw, 0.9rem);
        padding: 0 0.3rem;
        margin: 0;
        font-weight: 700;
        flex: 1;
        text-align: center;
    }
    
    .score-display {
        font-size: clamp(0.65rem, 3vw, 0.8rem);
        white-space: nowrap;
        flex-shrink: 0;
        font-weight: 600;
    }
    
    /* Game content optimalisatie voor kleine schermen */
    .game-content {
        gap: 0.35rem;
        padding-top: 3rem;
    }
    
    /* Compacte SVG containers op kleine schermen */
    .school-board {
        padding: 0.2rem;
        margin-bottom: 0.3rem;
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    
    .board-center {
        padding: 0.2rem;
        flex: 1;
        min-height: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .word-svg {
        width: 100%;
        height: 100%;
        max-height: 100%;
        object-fit: contain;
    }
    
    /* Kies het woord op kleine schermen - Vierkant schoolbord met grote SVG */
    #game-screen-choose .school-board {
        padding: 0.4rem;
        margin: 0 auto 0.5rem auto;
        flex-shrink: 1;
        flex-grow: 0;
        width: 100%;
        max-width: 100%;
        aspect-ratio: 1;
        height: auto;
        min-height: 200px;
        max-height: calc(100vh - 11rem);
        box-sizing: border-box;
        position: relative;
        display: flex;
        flex-direction: column;
        border-radius: 20px;
    }
    
    #game-screen-choose .board-center {
        padding: 0.25rem;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        position: relative;
    }
    
    #game-screen-choose .word-svg {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        min-width: 95% !important;
        min-height: 95% !important;
        object-fit: contain !important;
        display: block !important;
        margin: auto !important;
    }
    
    /* Luister en tik op kleine schermen - Vierkant schoolbord met grote SVG */
    #game-screen-listen .school-board {
        padding: 0.4rem;
        margin: 0 auto 0.5rem auto;
        flex-shrink: 1;
        flex-grow: 0;
        width: 100%;
        max-width: 100%;
        aspect-ratio: 1;
        height: auto;
        min-height: 200px;
        max-height: calc(100vh - 13rem);
        box-sizing: border-box;
        position: relative;
        display: flex;
        flex-direction: column;
        border-radius: 20px;
    }
    
    #game-screen-listen .board-center {
        padding: 0.25rem;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        position: relative;
    }
    
    #game-screen-listen .word-svg {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        min-width: 95% !important;
        min-height: 95% !important;
        object-fit: contain !important;
        display: block !important;
        margin: auto !important;
    }
    
    .build-content .school-board {
        padding: 0.2rem;
        margin: 0 0 0.25rem 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        flex-shrink: 0;
    }
    
    .build-content .board-center {
        padding: 0.2rem;
        min-height: 0;
        max-height: 35vh;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* SVG blijft even groot bij alle woordlengtes */
    .build-content .word-svg {
        width: 100%;
        max-height: 35vh;
        min-height: 30vh;
        height: auto;
        object-fit: contain;
        box-sizing: border-box;
    }
    
    /* Bij 7+ letters: SVG blijft even groot */
    .build-content.long-word .word-svg {
        max-height: 35vh;
        min-height: 30vh;
    }
    
    /* Grotere en duidelijkere buttons op kleine schermen */
    .word-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        padding: 0 0.25rem;
    }
    
    .word-btn {
        padding: 0.8rem 0.4rem;
        min-height: 60px;
        font-size: clamp(0.95rem, 4vw, 1.25rem);
        font-weight: 700;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        line-height: 1.3 !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .image-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
        padding: 0 0.2rem;
        margin: 0.2rem 0 0 0;
    }
    
    .image-option {
        padding: 0.7rem 0.4rem;
        min-height: 50px;
        border-radius: 12px;
    }
    
    .image-option:nth-child(1) {
        box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
    }
    
    .image-option:nth-child(2) {
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }
    
    .image-option:nth-child(3) {
        box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
    }
    
    .option-word {
        font-size: clamp(0.85rem, 3.2vw, 1.1rem);
        font-weight: 700;
        color: white;
    }
    
    .listen-btn {
        padding: 0.5rem 0.8rem;
        font-size: clamp(0.8rem, 3vw, 0.95rem);
        min-height: 40px;
    }
    
    .listen-icon {
        font-size: 1.3rem;
    }
    
    /* Extra compacte letter slots en tiles op kleine schermen */
    .build-content .letter-slot {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
        border-width: 2px;
        border-radius: 8px;
    }
    
    /* Bij 7+ letters: kleiner maken */
    .build-content.long-word .letter-slot {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .build-content .letter-tile {
        width: 42px;
        height: 42px;
        font-size: 1.4rem;
        border-radius: 10px;
    }
    
    /* Bij 7+ letters: kleiner maken */
    .build-content.long-word .letter-tile {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
        border-radius: 8px;
    }
    
    .build-content .word-slots {
        padding: 0.25rem;
        gap: 0.25rem;
        margin: 0.2rem auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
    }
    
    /* Bij 7+ letters: nog compacter */
    .build-content.long-word .word-slots {
        gap: 0.2rem;
        padding: 0.2rem;
    }
    
    .build-content .letter-tiles {
        padding: 0.35rem;
        gap: 0.3rem;
        margin: 0.2rem auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        min-height: auto;
    }
    
    /* Bij 7+ letters: nog compacter */
    .build-content.long-word .letter-tiles {
        gap: 0.25rem;
        padding: 0.25rem;
    }
    
    /* Compacte bottom bar voor kleine schermen – meescrollen */
    .build-content .difficulty-selector {
        padding: 0.45rem 0.35rem;
        gap: 0.25rem;
        border-top-width: 2px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .build-content .diff-btn {
        padding: 0.45rem 0.25rem;
        font-size: clamp(0.7rem, 2.8vw, 0.85rem);
        font-weight: 700;
        min-height: 38px;
        max-width: none;
        border-radius: 8px;
        box-sizing: border-box;
    }
    
    /* Geen extra padding – bottom bar scrollt mee */
    #game-screen-build.active .game-content {
        padding-bottom: 0.5rem;
    }
}

