*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #2d2f55, #151628);
    color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.app {
    width: 100%;
    max-width: 800px;
    background: rgba(10, 10, 20, 0.9);
    border-radius: 18px;
    padding: 24px 24px 28px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
}

.app-header {
    margin-bottom: 20px;
}

.app-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.app-header p {
    font-size: 0.95rem;
    color: #b7bed8;
}

.status-bar {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(19, 22, 55, 0.9);
}

.status-item {
    font-size: 0.9rem;
    color: #d7def5;
}

.status-item span {
    font-weight: 600;
}

.forbidden-card {
    background: linear-gradient(135deg, #2b1c4a, #4b2272);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.forbidden-card h2 {
    font-size: 1rem;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #f6efff;
}

#forbiddenLetters {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #ffe483;
}

.input-area {
    margin-bottom: 16px;
}

.input-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #d4dcff;
}

.input-row {
    display: flex;
    gap: 10px;
}

#wordInput {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(105, 122, 200, 0.7);
    background: rgba(10, 10, 30, 0.95);
    color: #f5f5f5;
    font-size: 1rem;
    outline: none;
    transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#wordInput:focus {
    border-color: #8aa4ff;
    box-shadow: 0 0 0 1px rgba(138, 164, 255, 0.5);
    background: rgba(20, 20, 50, 1);
}

#wordInput:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn {
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
    white-space: nowrap;
}

.btn.primary {
    background: linear-gradient(135deg, #ff8a5c, #ff5d8f);
    color: #1b1025;
    box-shadow: 0 10px 22px rgba(255, 106, 140, 0.4);
}

.btn.secondary {
    background: transparent;
    color: #d5dbff;
    border: 1px solid rgba(148, 162, 255, 0.8);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.hidden {
    display: none;
}

.feedback {
    min-height: 18px;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #f3a7ff;
}

.feedback.error {
    color: #ff9da3;
}

.feedback.success {
    color: #adffb5;
}

.history {
    margin-top: 4px;
}

.history h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: #d8dfff;
}

.words-list {
    list-style: none;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

.words-list li {
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: rgba(24, 26, 60, 0.9);
}

/* Small screens */

@media (max-width: 600px) {
    .app {
        padding: 18px 16px 22px;
    }

    .status-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .controls {
        flex-direction: column;
    }
}

.language-select {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 0.9rem;
    color: #d7def5;
}

.language-select label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.language-select select {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(148, 162, 255, 0.8);
    background: rgba(10, 10, 30, 0.95);
    color: #f5f5f5;
    font-size: 0.85rem;
    outline: none;
}

.language-select select:focus {
    border-color: #8aa4ff;
    box-shadow: 0 0 0 1px rgba(138, 164, 255, 0.5);
}

.footer-note {
    margin-top: 14px;
    font-size: 0.75rem;
    color: #9198c7;
    text-align: right;
    opacity: 0.8;
}

.app-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.header-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.language-select,
.difficulty-select {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 0.9rem;
    color: #d7def5;
}

.language-select label,
.difficulty-select label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.language-select select,
.difficulty-select select {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(148, 162, 255, 0.8);
    background: rgba(10, 10, 30, 0.95);
    color: #f5f5f5;
    font-size: 0.85rem;
    outline: none;
}

.language-select select:focus,
.difficulty-select select:focus {
    border-color: #8aa4ff;
    box-shadow: 0 0 0 1px rgba(138, 164, 255, 0.5);
}

@media (max-width: 600px) {
    .app-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .header-controls {
        align-items: flex-start;
    }
}

/* Word preview for forbidden letters */

.word-preview {
    min-height: 18px;
    margin-top: 2px;
    font-size: 0.85rem;
    color: #d4dcff;
}

.word-preview span.forbidden {
    color: #ff9da3;
    font-weight: 700;
    text-decoration: underline;
}

/* Overlays: menu and end screen */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay-inner {
    background: rgba(10, 10, 20, 0.97);
    border-radius: 18px;
    padding: 24px 24px 20px;
    max-width: 420px;
    width: calc(100% - 48px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
    text-align: center;
}

.overlay-inner h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.overlay-inner p {
    font-size: 0.95rem;
    color: #c3c9ea;
    margin-bottom: 16px;
}

.overlay-buttons {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.end-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
    color: #e1e4ff;
    margin-top: 4px;
}

.end-stats span {
    font-weight: 600;
}

.overlay.hidden {
    display: none;
}

.current-config {
    font-size: 0.8rem;
    color: #d7def5;
    text-align: right;
}

/* Menu rows in de overlay */
.menu-row {
    width: 100%;
    margin-bottom: 10px;
}

/* Overlays: menu en end screen */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay-inner {
    background: rgba(10, 10, 20, 0.97);
    border-radius: 18px;
    padding: 24px 24px 20px;
    max-width: 420px;
    width: calc(100% - 48px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
    text-align: center;
}

.overlay-inner h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.overlay-inner p {
    font-size: 0.95rem;
    color: #c3c9ea;
    margin-bottom: 16px;
}

.overlay-buttons {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.end-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
    color: #e1e4ff;
    margin-top: 4px;
}

.end-stats span {
    font-weight: 600;
}

/* hidden override voor overlays */
.hidden {
    display: none;
}

.overlay.hidden {
    display: none;
}

/* woord preview */
.word-preview {
    min-height: 18px;
    margin-top: 2px;
    font-size: 0.85rem;
    color: #d4dcff;
}

.word-preview span.forbidden {
    color: #ff9da3;
    font-weight: 700;
    text-decoration: underline;
}

/* Groter menu scherm */
.overlay-inner {
    background: rgba(10, 10, 20, 0.97);
    border-radius: 18px;
    padding: 28px 28px 22px;
    max-width: 560px;          /* groter dan eerst */
    width: calc(100% - 48px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
    text-align: left;
}

.overlay-inner h2 {
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.overlay-inner p {
    font-size: 0.95rem;
    color: #c3c9ea;
    margin-bottom: 14px;
}

/* speciaal voor menu (optioneel, maar kan) */
.overlay-menu {
    max-width: 620px;
}

/* How-to blokje in menu */
.menu-howto {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(18, 20, 48, 0.9);
    border: 1px solid rgba(148, 162, 255, 0.5);
}

.menu-howto h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: #e3e6ff;
}

.menu-howto ol {
    margin-left: 18px;
    font-size: 0.88rem;
    color: #c9cffa;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-howto li strong {
    font-weight: 700;
}

.menu-highscore {
    font-size: 0.9rem;
    color: #e3e6ff;
    margin-top: 4px;
}

#muteClockBtn {
    margin-top: 8px;
}

.mute-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

