/* Vollbild-Overlay für Kiosk/Toucheinsatz */

.wtg-container {
    position: fixed;
    inset: 0;
    background: #111;
    color: #ffffff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    box-sizing: border-box;
    overflow: hidden;
    touch-action: manipulation;
    z-index: 9999;
}

/* Obere Steuerung: Zeit, Start/Neustart, Spieler */
.wtg-top-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}

/* Zeitanzeige */
.wtg-timer {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-align: center;
}

/* Start / Neustart */
.wtg-main-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.wtg-btn {
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.6rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.2s ease, background-color 0.15s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    white-space: nowrap;
}

/* START = rot, NEUSTART = grün */
.wtg-btn-start {
    background: #ff1744;
    color: #fff;
}
.wtg-btn-start[disabled] {
    opacity: 0.4;
    cursor: default;
    box-shadow: none;
}

.wtg-btn-restart {
    background: #00c853;
    color: #fff;
}

.wtg-btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.wtg-btn-back {
    background: #444;
    color: #fff;
    padding-inline: 1.2rem;
}

/* Spieler-Buttons */
.wtg-player-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    align-items: center;
}

.wtg-player-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    justify-content: center;
}

.wtg-btn-player {
    background: #1976d2;
    color: #fff;
    min-width: 100px;
    font-size: 0.95rem;
    padding-inline: 1rem;
}

.wtg-btn-player-active {
    background: #ff1744;
}

/* Spielfeld */
.wtg-game-wrapper {
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    justify-content: center;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    min-height: 0;
}

.wtg-game-field {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    border: 2px solid rgba(255,255,255,0.12);
    background: radial-gradient(circle at top, #1e1e1e 0, #050505 65%);
    padding: 0.75rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Obere Wort-Reihe – 10% kleiner (von 3rem auf 2.7rem) */
.wtg-top-word-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 3.5rem;
    margin-bottom: 0.35rem;
    flex: 0 0 auto;
}

.wtg-current-word-top {
    flex: 1 1 auto;
    font-size: 2.7rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Bereich für die herunterfallenden Buchstaben */
.wtg-letter-rain-area {
    position: relative;
    flex: 1 1 auto;
    overflow: hidden;
    border-radius: 12px;
    min-height: 0;
}

/* Untere Wort-Reihe – ebenfalls 2.7rem */
.wtg-bottom-word-row {
    min-height: 3.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
}

.wtg-current-word-bottom {
    font-size: 2.7rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-align: center;
    max-width: 80%;
    margin: 0 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Wort-Auswahl */
.wtg-bottom-word-select {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.3rem;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.wtg-bottom-word-select .wtg-label {
    font-size: 1rem;
    opacity: 0.9;
}

.wtg-word-select {
    min-width: 220px;
    padding: 0.5rem 0.7rem;
    border-radius: 999px;
    border: none;
    font-size: 1rem;
}

/* Konfiguration */
.wtg-config-panel {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
    font-size: 1rem;
    flex: 0 0 auto;
}

.wtg-config-item select {
    margin-left: 0.25rem;
    border-radius: 999px;
    border: none;
    padding: 0.3rem 0.8rem;
    font-size: 1rem;
}

/* Herabfallende Buchstaben */
.wtg-letter {
    position: absolute;
    top: -40px;
    left: 0;
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: rgba(33, 150, 243, 0.28);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    text-shadow: 0 0 6px rgba(0,0,0,0.9);
}

/* Gewinner-Overlay */
.wtg-winner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.wtg-winner-box {
    position: relative;
    background: #d50000;
    border-radius: 20px;
    padding:   4.8rem 4rem;
    text-align: center;
    box-shadow: 0 10px 35px rgba(0,0,0,0.7);
}

.wtg-winner-line1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.wtg-winner-line2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.wtg-winner-close {
    position: absolute;
    top: 0.4rem;
    right: 0.6rem;
    border: none;
    background: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Konfetti */
.wtg-confetti-layer {
    pointer-events: none;
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 60;
}

.wtg-confetti {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 18px;
    background: #ffeb3b;
    border-radius: 2px;
    opacity: 0.9;
    animation-name: wtg-confetti-fall;
    animation-timing-function: linear;
    animation-iteration-count: 1;
}

.wtg-confetti:nth-child(3n) {
    background: #ff5252;
}
.wtg-confetti:nth-child(3n+1) {
    background: #4caf50;
}
.wtg-confetti:nth-child(3n+2) {
    background: #29b6f6;
}

@keyframes wtg-confetti-fall {
    0% {
        transform: translate3d(0, -10px, 0) rotateZ(0deg);
        opacity: 1;
    }
    100% {
        transform: translate3d(0, 110vh, 0) rotateZ(360deg);
        opacity: 0;
    }
}

/* Kleinere Screens (Laptop-Test etc.) */
@media (max-width: 600px) {
    .wtg-container {
        padding: 0.6rem;
    }

    .wtg-timer {
        font-size: 2rem;
    }

    .wtg-current-word-top,
    .wtg-current-word-bottom {
        font-size: 2.1rem;
        letter-spacing: 0.16em;
    }

    .wtg-btn {
        padding: 0.45rem 1rem;
        font-size: 0.95rem;
    }

    .wtg-btn-player {
        min-width: 80px;
    }

    .wtg-winner-box {
        padding:   4.8rem 4rem;
    }

    .wtg-winner-line1 {
        font-size: 1.8rem;
    }

    .wtg-winner-line2 {
        font-size: 1.3rem;
    }
}
