* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    min-height: 100vh;
    color: #fff;
}

.screen { display: none; }
.screen.active { display: block; }

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

/* --- Menu --- */
.title {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    background: linear-gradient(90deg, #f7971e, #ffd200);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: rgba(255,255,255,0.65);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.settings-group { margin-bottom: 1.8rem; }

.group-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 0.7rem;
}

.cat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.cat-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.cat-btn:hover { background: rgba(255,255,255,0.18); }

.cat-btn.active {
    background: #f7971e;
    border-color: #f7971e;
    color: #000;
    font-weight: 700;
}

.speed-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.speed-btn {
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.18);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.4;
    min-width: 80px;
    transition: all 0.2s;
}

.speed-btn:hover { background: rgba(255,255,255,0.18); }

.speed-btn.active {
    background: rgba(247,151,30,0.25);
    border-color: #f7971e;
    font-weight: 700;
}

.speed-btn small { color: rgba(255,255,255,0.55); font-size: 0.72rem; }

/* Toggle */
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 1rem;
    color: rgba(255,255,255,0.85);
}

.toggle-label input { display: none; }

.toggle-track {
    width: 46px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    position: relative;
    transition: background 0.3s;
    flex-shrink: 0;
}

.toggle-track::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: left 0.3s;
}

.toggle-label input:checked + .toggle-track { background: #f7971e; }
.toggle-label input:checked + .toggle-track::after { left: 25px; }

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #f7971e, #ffd200);
    color: #1a1a1a;
    border: none;
    padding: 14px 44px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(247,151,30,0.5);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.25);
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover { background: rgba(255,255,255,0.2); }

.btn-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.copyright {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
}

/* --- Game Header --- */
.game-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 14px 20px;
    background: rgba(0,0,0,0.35);
    flex-wrap: wrap;
}

.hstat { font-size: 0.95rem; font-weight: 600; color: rgba(255,255,255,0.85); }

.btn-small {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-small:hover { background: rgba(255,255,255,0.22); }

/* --- Progress bar (question progress) --- */
.progress-bar-wrap {
    height: 5px;
    background: rgba(255,255,255,0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f7971e, #ffd200);
    transition: width 0.4s ease;
    width: 0%;
}

/* --- Word Area --- */
.word-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    padding: 2rem;
}

.word-display {
    font-family: 'Arial Unicode MS', 'Noto Sans Hebrew', Arial, sans-serif;
    font-size: 5rem;
    font-weight: 800;
    direction: rtl;
    color: #ffd200;
    text-shadow: 0 0 30px rgba(255,210,0,0.4);
    margin-bottom: 2rem;
    line-height: 1.2;
}

.countdown-wrap {
    width: 260px;
    height: 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    overflow: hidden;
}

.countdown-bar {
    height: 100%;
    background: linear-gradient(90deg, #f7971e, #ffd200);
    border-radius: 4px;
    width: 100%;
}

/* --- Choices Area --- */
.choices-area {
    padding: 1.5rem 1rem 2rem;
}

.choices-area.hidden { display: none; }
.word-area.hidden { display: none; }

.choices-prompt {
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    letter-spacing: 0.5px;
}

.choices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
}

.choice-btn {
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.18);
    color: #fff;
    padding: 18px 12px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 60px;
}

.choice-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-2px);
}

.choice-btn.correct {
    background: rgba(56,239,125,0.25);
    border-color: #38ef7d;
    color: #38ef7d;
}

.choice-btn.incorrect {
    background: rgba(255,82,82,0.25);
    border-color: #ff5252;
    color: #ff5252;
}

.choice-btn:disabled { cursor: not-allowed; }

/* --- Feedback --- */
.feedback {
    text-align: center;
    padding: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    min-height: 40px;
}

.feedback.hidden { visibility: hidden; }
.feedback.correct-fb { color: #38ef7d; }
.feedback.incorrect-fb { color: #ff5252; }

/* --- Results --- */
.score-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 4px solid #f7971e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 2rem auto;
    box-shadow: 0 0 30px rgba(247,151,30,0.3);
}

.score-big {
    font-size: 3.5rem;
    font-weight: 900;
    color: #ffd200;
}

.score-out {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

.perf-msg {
    font-size: 1.3rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    margin-bottom: 0.5rem;
}

/* --- Responsive --- */
@media (max-width: 560px) {
    .title { font-size: 1.8rem; }
    .word-display { font-size: 3.5rem; }
    .choices-grid { grid-template-columns: 1fr; }
    .speed-row { gap: 6px; }
    .speed-btn { min-width: 70px; padding: 8px 12px; }
}
