/* --- ALAP BEÁLLÍTÁSOK --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #222;
    color: white;
    margin: 0;
    overflow: hidden; /* Gördítősávok elrejtése */
    user-select: none; /* Szövegkijelölés tiltása játék közben */
}

/* --- KEZDŐKÉPERNYŐ (Beállítások) --- */
#settings-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #333;
    z-index: 10;
    position: absolute;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto; /* Ha kicsi a képernyő, lehessen görgetni */
}

h1 {
    color: #4CAF50;
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Kétoszlopos elrendezés konténere */
.settings-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 900px;
}

/* Panelek (szürke dobozok) */
.panel {
    background: #444;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.left-panel {
    flex: 1;
    min-width: 300px;
}

.right-panel {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h3 {
    margin-top: 0;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    color: #ddd;
    width: 100%;
}

/* Vezérlő elemek (Inputok, Labelek) */
.control-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

label {
    font-weight: bold;
    color: #ccc;
    font-size: 0.9em;
}

select, input[type="number"] {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #666;
    background: #555;
    color: white;
    font-size: 14px;
}

/* Csúszkák (Range) */
input[type=range] {
    width: 100%;
    cursor: pointer;
}

.radio-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-group.vertical {
    flex-direction: column;
    gap: 8px;
}

/* --- BILLENTYŰZET --- */
.keyboard {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    margin-top: 10px;
}

.row {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.key {
    width: 36px;
    height: 36px;
    background: #555;
    border: 1px solid #666;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.1s ease;
}

.key:hover {
    background: #777;
    transform: translateY(-2px);
}

.key.selected {
    background: #4CAF50; /* Zöld */
    color: black;
    border-color: #45a049;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.key.shift-key {
    width: 80px;
    background: #884444; /* Pirosas */
}

.key.shift-key.active {
    background: #ff5555;
    box-shadow: 0 0 10px #ff5555;
}

.hint {
    font-size: 0.85em;
    color: #aaa;
    margin-top: 15px;
    text-align: center;
}

/* --- GOMBOK --- */
.big-btn {
    margin-top: 25px;
    padding: 15px 50px;
    font-size: 22px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.1s, background 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.big-btn:hover {
    background: #1976D2;
    transform: scale(1.05);
}

.small-btn {
    padding: 6px 12px;
    font-size: 13px;
    background: #607D8B;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.small-btn:hover {
    background: #78909C;
}

/* --- JÁTÉK KÉPERNYŐ --- */
#game-screen {
    display: none; /* Alapból rejtve */
    position: relative;
    width: 100%;
    height: 100vh;
    background: #1a1a1a;
}

/* Felső információs sáv */
#ui-bar {
    position: absolute;
    top: 0;
    width: 100%;
    height: 60px;
    padding: 0 20px;
    background: rgba(30, 30, 30, 0.95);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 22px;
    font-weight: bold;
    z-index: 20;
    border-bottom: 2px solid #444;
    box-sizing: border-box;
}

.stat-box {
    min-width: 140px;
    display: flex;
    gap: 10px;
}

#score { color: #4CAF50; }
#stat-value { font-weight: bold; }

/* Játék közbeni gombok (Pause, Stop) */
.game-controls {
    display: flex;
    gap: 15px;
}

.control-btn {
    padding: 8px 20px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    background: #757575;
    color: white;
    transition: background 0.2s;
}

.control-btn:hover { background: #9e9e9e; }
.control-btn.stop { background: #d32f2f; }
.control-btn.stop:hover { background: #f44336; }

/* Veszély vonal (alul) */
#danger-line {
    position: absolute;
    bottom: 60px;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, red, transparent);
    box-shadow: 0 0 20px red;
    z-index: 5;
}

/* --- HULLÓ SZAVAK --- */
.falling-word {
    position: absolute;
    color: #eee;
    font-size: 28px;
    font-weight: bold;
    font-family: 'Courier New', monospace; /* Monospace fontos a betűk szélessége miatt */
    white-space: pre;
    z-index: 10;
    text-shadow: 2px 2px 0px #000;
}

/* Ha eltaláltunk egy karaktert (PIROS) */
.hit {
    color: #ff3333;
    text-shadow: 0 0 10px #ff0000;
}

/* Ha a szót éppen írjuk (LOCKOLVA VAN) - Sárga keret */
.falling-word.locked {
    border: 2px dashed #FFC107;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 100; /* Kiemelkedik a többi közül */
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.3);
}

/* --- SZÜNET (Overlay) --- */
#pause-overlay {
    display: none;
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Sötét áttetsző háttér */
    z-index: 50; /* Legyen minden felett */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px); /* Homályosítás a háttéren */
}

#pause-overlay h2 {
    font-size: 50px;
    color: #FFC107;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 5px;
}