/* Basis instellingen */
body {
    background: #d1d8e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 10px;
}

#logo {
    width: 120px;
    mix-blend-mode: multiply;
}

h1 {
    margin: 5px 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

/* De container voor het spel */
#game-container {
    display: flex;
    flex-direction: column; /* Stapelt panel en grid op mobiel */
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 800px;
}

/* Het Raster (CRUCIAAL VOOR DE LETTERS) */
#grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr); /* DIT ZET ZE NAAST ELKAAR */
    gap: 2px;
    background: #2c3e50;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    width: 95vw;
    height: 95vw;
    max-width: 450px;
    max-height: 450px;
    touch-action: none; /* Voorkomt scrollen tijdens selecteren */
}

.cell {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    user-select: none;
    border-radius: 2px;
    aspect-ratio: 1;
}

/* Kleuren voor interactie */
.cell.selected {
    background-color: #3498db !important;
    color: white;
}

.cell.found {
    background-color: #2ecc71 !important;
    color: white;
}

/* Zijpaneel & Woordenlijst */
#side-panel {
    background: white;
    padding: 15px;
    border-radius: 10px;
    width: 95%;
    max-width: 450px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#woordenlijst ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

#woordenlijst li {
    padding: 5px 12px;
    background: #f1f2f6;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #7f8c8d;
}

#woordenlijst li.found-text {
    text-decoration: line-through;
    opacity: 0.5;
    background: #dcdde1;
}

/* Controls & Timer */
#controls-onder {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

#thema-select, #reset-btn {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    width: 100%;
    font-size: 1rem;
}

#reset-btn {
    background: #2c3e50;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

#timer {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: #e74c3c;
}

/* Win Overlay */
#win-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
}

/* Desktop layout aanpassing */
@media (min-width: 768px) {
    #game-container {
        flex-direction: row;
        align-items: flex-start;
    }
    #side-panel {
        width: 300px;
    }
}