@charset "UTF-8";

/* ==========================================================================
   1. ALGEMENE STYLING & RESET
   ========================================================================== */
* { 
    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. SPELCONTAINER & HOOFDSCHIERMEN
   ========================================================================== */
.game {
    width: min(800px, 96vw); 
    text-align: center; 
    background: white;
    padding: 28px; 
    border-radius: 20px; 
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
    position: relative; 
    overflow: hidden;
}

/* ⚙️ INTERACTIEVE TERUGKNOP NAAR LERAAR MENU */
.hidden-return-btn {
    position: absolute; 
    top: 15px; 
    right: 15px; 
    width: 44px; 
    height: 44px; 
    background-color: #f1f5f9; 
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    cursor: pointer; 
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.12s, border-color 0.2s;
}

/* Effect wanneer je met de muis over het tandwiel beweegt */
.hidden-return-btn:hover { 
    background-color: #cbd5e1; 
    border-color: #94a3b8;
    transform: scale(1.05); 
}

.hidden-return-btn:hover svg {
    stroke: #1e293b; /* Maakt het tandwiel iets donkerder bij een hover */
}

#fireworks-canvas { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    pointer-events: none; 
    z-index: 5; 
    display: none; 
}

h1 { 
    margin: 0 0 8px; 
    font-size: 32px; 
    color: #222; 
}

p { 
    font-size: 20px; 
    margin: 0 0 15px; 
    color: #555; 
}

/* ==========================================================================
   3. SCOREBOARDEN & STATISTIEKEN
   ========================================================================== */
.stats-counter-container { 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    margin-bottom: 25px; 
}

.score-display { 
    font-size: 24px; 
    font-weight: bold; 
    color: #f39c12; 
    background: #fef9e7; 
    padding: 8px 20px; 
    border-radius: 30px; 
    border: 2px dashed #f1c40f; 
}

.clicks-display { 
    font-size: 24px; 
    font-weight: bold; 
    color: #475569; 
    background: #f1f5f9; 
    padding: 8px 20px; 
    border-radius: 30px; 
    border: 2px dashed #cbd5e1; 
}

/* ==========================================================================
   4. SPELBORD GRID & TEGELS (.WEBP AFBEELDINGEN)
   ========================================================================== */
.grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 15px; 
    max-width: 700px; 
    margin: 0 auto 22px; 
}

.tile {
    aspect-ratio: 1 / 1; 
    border: 3px solid #cbd5e1; 
    border-radius: 16px; 
    background: #fff; 
    cursor: pointer; 
    padding: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: transform .12s, border-color .2s; 
    z-index: 2; 
    position: relative;
    overflow: hidden;
}

.tile:hover { 
    transform: scale(1.03); 
    border-color: #94a3b8; 
}

.tile img {
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
    border-radius: 8px;
}

/* Correcte en foute visuele feedback */
.tile.correct { 
    background: #e8f8f5; 
    border-color: #2cc7c9; 
}

.tile.wrong { 
    background: #fef9f9; 
    border-color: #f1a9a9; 
    opacity: 0.6; 
}

/* 🌟 POP-UP STER ANIMATIE BIJ CORREKTE KLIK */
.pop-star { 
    position: absolute; 
    font-size: 50px; 
    z-index: 10; 
    pointer-events: none; 
    animation: flyUp 1.2s ease-out forwards; 
}

@keyframes flyUp {
    0% { transform: translate(-50%, -50%) scale(0.5); top: 50%; left: 50%; opacity: 1; }
    100% { transform: translate(-50%, -200%) scale(1.2); top: 0%; opacity: 0; }
}

/* ==========================================================================
   5. LEERKRRACHTEN MENU (TEACHER PANEL)
   ========================================================================== */
.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; 
}

.control-row { 
    display: flex; 
    gap: 15px; 
    align-items: center; 
    flex-wrap: wrap; 
    margin-bottom: 20px; 
}

.control-row label { 
    font-size: 15px; 
    font-weight: bold; 
}

.teacher-panel input[type="text"] { 
    padding: 8px; 
    font-size: 16px; 
    border-radius: 6px; 
    border: none; 
    width: 65px; 
    text-align: center; 
    font-weight: bold; 
}

.teacher-panel button.start-btn { 
    background: #27ae60; 
    color: white; 
    border: none; 
    padding: 10px 20px; 
    font-size: 16px; 
    font-weight: bold; 
    border-radius: 6px; 
    cursor: pointer; 
    box-shadow: 0 3px 0 #1e7b43; 
}

.teacher-panel button.start-btn:hover { 
    background: #2ecc71; 
}

#sound-toggle { 
    border: 0; 
    border-radius: 8px; 
    padding: 8px 14px; 
    font: bold 14px Arial, sans-serif; 
    background: #e8f1ff; 
    color: #173a63; 
    cursor: pointer; 
}

#sound-toggle.on { 
    background: #d7f5dc; 
    color: #1d6b2b; 
}

.volume-setting { 
    font-size: 15px; 
    color: #ecf0f1; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.volume-setting input { 
    cursor: pointer; 
    width: 120px; 
}

/* ==========================================================================
   6. RESULTATEN LOGBOEK
   ========================================================================== */
.logbook-section { 
    background: #34495e; 
    padding: 15px; 
    border-radius: 10px; 
    margin-top: 15px; 
}

#log-table { 
    width: 100%; 
    border-collapse: collapse; 
    background: #ffffff; 
    color: #333; 
    border-radius: 6px; 
    overflow: hidden; 
    font-size: 14px; 
}

#log-table th, #log-table td { 
    padding: 10px 12px; 
    text-align: left; 
    border-bottom: 1px solid #e2e8f0; 
}

#log-table th { 
    background: #cbd5e1; 
    font-weight: bold; 
    color: #1e293b; 
}

.clear-log-btn { 
    background: #e74c3c; 
    color: white; 
    border: none; 
    padding: 6px 12px; 
    font-size: 13px; 
    border-radius: 4px; 
    margin-top: 10px; 
    cursor: pointer; 
}

/* ==========================================================================
   7. INTERACTIEVE FEEDBACK & OVERWINNINGSOVERLAY
   ========================================================================== */
#message { 
    min-height: 38px; 
    font-size: 24px; 
    font-weight: bold; 
    margin-bottom: 15px; 
}

#reset { 
    border: 0; 
    border-radius: 10px; 
    padding: 12px 24px; 
    font: bold 20px Arial, sans-serif; 
    background: #333; 
    color: white; 
    cursor: pointer; 
}

.win-overlay { 
    display: none; 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(255, 255, 255, 0.9); 
    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: #555; 
    margin-top: 10px; 
    font-style: italic; 
}

@keyframes bounce { 
    from { transform: translateY(0); } 
    to { transform: translateY(-15px); } 
}

/* ==========================================================================
   8. RESPONSIVE DESIGN (MOBIELE APPARATEN)
   ========================================================================== */
@media (max-width: 600px) {
    .grid { 
        grid-template-columns: repeat(3, 1fr); 
        gap: 10px; 
    }
    h1 { 
        font-size: 24px; 
    }
    .score-display, .clicks-display { 
        font-size: 18px; 
        padding: 6px 14px; 
    }
}
