/* ==========================================================================
   1. ALGEMENE STYLING (BASIS)
   ========================================================================== */
   * { 
    box-sizing: border-box; 
}

body { 
    margin: 0; 
    min-height: 100vh; 
    background: #f4f7fb; 
    font-family: Arial, sans-serif; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    flex-direction: column; 
    padding: 20px; 
}

/* ==========================================================================
   2. LEERKRACHTEN PANEL (INSTELLINGEN & DATABASE BEHEER)
   ========================================================================== */
.teacher-panel { 
    width: min(840px, 94vw); 
    background: #2c3e50; 
    color: white; 
    padding: 25px; 
    border-radius: 15px; 
    margin-bottom: 20px; 
    text-align: left; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.teacher-panel h3 { 
    margin: 0 0 15px 0; 
    font-size: 20px;
    color: #ecf0f1;
    border-bottom: 1px solid #34495e; 
    padding-bottom: 5px; 
}

.teacher-controls .control-row { 
    display: flex; 
    gap: 15px; 
    align-items: center; 
    flex-wrap: wrap; 
}

.teacher-panel label { 
    font-size: 15px; 
    font-weight: bold; 
}

.teacher-panel input[type="text"] { 
    padding: 8px 12px; 
    font-size: 16px; 
    border-radius: 6px; 
    border: none; 
    font-weight: bold;
    background: #ffffff;
    color: #333333;
}

/* Grote groene startknop */
.teacher-panel button.start-btn { 
    background: #27ae60; 
    color: white; 
    border: none; 
    padding: 10px 20px; 
    font-weight: bold; 
    border-radius: 6px; 
    cursor: pointer; 
    box-shadow: 0 3px 0 #1e7b43;
    transition: background 0.1s;
}

.teacher-panel button.start-btn:hover { 
    background: #2ecc71; 
}

#sound-toggle { 
    border: 0; 
    border-radius: 8px; 
    padding: 8px 14px; 
    font: bold 14px Arial; 
    background: #e8f1ff; 
    color: #173a63; 
    cursor: pointer; 
}

#sound-toggle.on { 
    background: #d7f5dc; 
    color: #1d6b2b; 
}

.volume-setting { 
    font-size: 15px; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.volume-setting input {
    cursor: pointer;
    width: 90px;
}

/* Database invoer sectie */
.database-manager { 
    background: #34495e; 
    padding: 15px; 
    border-radius: 10px; 
    margin-top: 15px; 
    border: 1px solid #475569; 
}

.database-manager h4 { 
    margin: 0 0 12px 0; 
    color: #ebdcf7; 
    font-size: 16px; 
}

.database-manager .control-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.database-manager input[type="text"] { 
    background: #ffffff !important; 
    color: #333333 !important; 
    text-align: left !important; 
    font-weight: normal !important;
}

/* Database actieknoppen */
.add-btn { 
    background: #9b59b6; 
    color: white; 
    border: none; 
    padding: 8px 14px; 
    font-weight: bold; 
    border-radius: 6px; 
    cursor: pointer; 
}

.add-btn:hover { 
    background: #8e44ad; 
}

.export-btn { 
    background: #e67e22; 
    color: white; 
    border: none; 
    padding: 8px 14px; 
    font-weight: bold; 
    border-radius: 6px; 
    cursor: pointer; 
}

.export-btn:hover { 
    background: #d35400; 
}

.import-label { 
    background: #3498db; 
    color: white; 
    padding: 8px 14px; 
    font-weight: bold; 
    border-radius: 6px; 
    cursor: pointer; 
    margin-left: 10px; 
    display: inline-block; 
}

.import-label:hover { 
    background: #2980b9; 
}

#db-counter {
    margin-left: 15px; 
    font-weight: bold; 
    color: #2ecc71;
}

/* ==========================================================================
   3. KLEUTER SCHERM (SPELOMGEVING)
   ========================================================================== */
.game { 
    width: min(760px, 94vw); 
    text-align: center; 
    background: white; 
    padding: 25px; 
    border-radius: 20px; 
    box-shadow: 0 8px 30px rgba(0,0,0,.12); 
    position: relative; 
    overflow: hidden; 
}

/* De onzichtbare knop rechtsboven */
.hidden-return-btn { 
    position: absolute; 
    top: 0; 
    right: 0; 
    width: 40px; 
    height: 40px; 
    background: transparent; 
    z-index: 100; 
    cursor: default;
}

.hidden-return-btn:hover {
    background: rgba(0, 0, 0, 0.02);
}

#fireworks-canvas { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    pointer-events: none; 
    z-index: 5; 
    display: none; 
}

.game h1 { 
    margin: 0; 
    font-size: 30px; 
    color: #222222;
}

.game p { 
    font-size: 18px; 
    margin: 5px 0 15px; 
    color: #555555; 
}

.score-display { 
    font-size: 22px; 
    font-weight: bold; 
    color: #f39c12; 
    background: #fef9e7; 
    padding: 6px 20px; 
    border-radius: 30px; 
    display: inline-block; 
    margin-bottom: 15px; 
    border: 2px dashed #f1c40f; 
}

/* Grote centrale plaatjesbox */
.image-container { 
    width: 100%; 
    max-height: 160px; 
    display: flex; 
    justify-content: center; 
    margin-bottom: 20px; 
}

.image-container img { 
    max-height: 160px; 
    width: auto; 
    object-fit: contain; 
    border-radius: 10px; 
}

/* Lege bouwhokjes (Slots) */
.slots-container { 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    margin-bottom: 25px; 
}

.slot { 
    width: 65px; 
    height: 65px; 
    border: 3px dashed #94a3b8; 
    border-radius: 12px; 
    background: #f8fafc; 
    font-size: 32px; 
    font-weight: bold; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #1e293b; 
}

/* Gevuld bouwhokje */
.slot.filled { 
    border-style: solid; 
    border-color: #334155; 
    background: #cbd5e1; 
}

/* Virtueel Toetsenbord onderaan */
.letters-keyboard { 
    display: flex; 
    justify-content: center; 
    gap: 10px; 
    flex-wrap: wrap; 
    max-width: 550px; 
    margin: 0 auto; 
}

.key-btn { 
    background: #3498db; 
    color: white; 
    border: none; 
    border-radius: 10px; 
    padding: 12px 20px; 
    font-size: 24px; 
    font-weight: bold; 
    cursor: pointer; 
    box-shadow: 0 3px 0 #2980b9; 
    transition: background .1s; 
}

.key-btn:hover { 
    filter: brightness(1.05); 
}

.key-btn:active { 
    transform: translateY(3px); 
    box-shadow: none; 
}

#message { 
    min-height: 38px; 
    font-size: 24px; 
    font-weight: bold; 
}

/* ==========================================================================
   4. BELONINGS OVERLAY (FINALE WIN-SCHERM)
   ========================================================================== */
.win-overlay { 
    display: none; 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(255, 255, 255, 0.85); 
    z-index: 10; 
    justify-content: center; 
    align-items: center; 
    flex-direction: column; 
}

.win-content { 
    font-size: 80px; 
    animation: bounce 0.6s infinite alternate; 
}

.win-text { 
    font-size: 36px; 
    font-weight: bold; 
    color: #1d6b2b; 
    margin-top: 15px; 
}

.restart-text { 
    font-size: 18px; 
    color: #555555; 
    margin-top: 10px; 
    font-style: italic; 
}

@keyframes bounce { 
    from { transform: translateY(0); } 
    to { transform: translateY(-15px); } 
}
