@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

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

body {
    background: #1a1a2e;
    font-family: 'Inter', sans-serif;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- screens --- */
.screen {
    display: none;
    width: 100%;
}

.screen.active {
    display: flex;
    justify-content: center;
}

.container {
    max-width: 640px;
    width: 100%;
    padding: 32px 20px;
    text-align: center;
}

/* --- typography --- */
.title {
    font-size: 2rem;
    color: #00ff88;
    text-shadow: none;
    margin-bottom: 12px;
}

.title.small {
    font-size: 1.4rem;
}

.accent {
    color: #ff4444;
}

.subtitle {
    font-size: 1rem;
    color: #88ccff;
    margin-bottom: 28px;
}

/* --- menu --- */
.menu-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.menu-btn {
    display: block;
    width: 100%;
    padding: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: #cc3300;
    border: 3px solid #ffcc00;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    text-shadow: none;
    box-shadow: 0 4px 0 #882200, 0 6px 12px rgba(0, 0, 0, 0.3);
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.menu-btn:hover {
    background: #ff4400;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #882200, 0 8px 16px rgba(0, 0, 0, 0.3);
}

.menu-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #882200;
}

.menu-btn.secondary {
    background: #2040b0;
    box-shadow: 0 4px 0 #102060, 0 6px 12px rgba(0, 0, 0, 0.3);
}

.menu-btn.secondary:hover {
    background: #3060d0;
    box-shadow: 0 6px 0 #102060, 0 8px 16px rgba(0, 0, 0, 0.3);
}

.back-link {
    text-align: center;
}

/* --- category picker --- */
.category-select h2 {
    font-size: 1.1rem;
    color: #ffcc00;
    margin-bottom: 12px;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 16px;
}

.cat-btn {
    padding: 10px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    background: #16213e;
    border: 2px solid #00ff88;
    border-radius: 6px;
    color: #00ff88;
    cursor: pointer;
    transition: background 0.15s;
}

.cat-btn:hover,
.cat-btn.selected {
    background: #00ff88;
    color: #1a1a2e;
}

/* --- stats --- */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 32px;
    font-size: 0.85rem;
    color: #888;
    margin-top: 16px;
}

/* --- how to play --- */
.how-list {
    text-align: left;
    list-style: none;
    margin: 20px auto;
    max-width: 480px;
    font-size: 0.95rem;
    line-height: 2;
}

.how-list li::before {
    content: '▸ ';
    color: #00ff88;
}

/* --- game HUD --- */
.game-hud {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.timer {
    color: #ffcc00;
}

/* --- question card --- */
.question-card {
    background: #16213e;
    border: 3px solid #ffcc00;
    border-radius: 12px;
    padding: 24px 16px;
    margin-bottom: 16px;
}

.question-text {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
    color: #fff;
}

/* --- answers --- */
.answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-btn {
    width: 100%;
    padding: 14px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    text-align: left;
    background: #0f3460;
    border: 2px solid #3282b8;
    border-radius: 8px;
    color: #e0e0e0;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    line-height: 1.6;
}

.answer-btn:hover:not(.locked) {
    background: #3282b8;
    border-color: #fff;
}

.answer-btn.correct {
    background: #007744;
    border-color: #00ff88;
    color: #fff;
}

.answer-btn.wrong {
    background: #772200;
    border-color: #ff4444;
    color: #fff;
}

.answer-btn.locked {
    cursor: default;
}

/* --- details --- */
.details-wrap {
    margin-top: 12px;
    text-align: left;
}

.details-btn {
    width: 100%;
    padding: 10px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #cfe6ff;
    background: #102540;
    border: 2px solid #2f5f8f;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.details-btn:hover:not(:disabled) {
    background: #1a3a63;
    border-color: #88ccff;
}

.details-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.details-text {
    display: none;
    margin-top: 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #b9ddff;
    background: rgba(10, 30, 50, 0.65);
    border: 1px solid #2f5f8f;
    border-radius: 8px;
}

.details-wrap.open .details-text {
    display: block;
}

.details-link {
    display: none;
    margin-top: 8px;
    font-size: 0.82rem;
    color: #88ccff;
    text-decoration: underline;
}

.details-wrap.open .details-link {
    display: inline-block;
}

.details-page {
    text-align: left;
}

.details-long {
    margin: 10px 0 16px;
    line-height: 1.7;
    color: #dcefff;
}

.details-heading {
    font-size: 0.95rem;
    color: #ffcc00;
    margin-bottom: 8px;
}

.details-examples {
    margin-left: 18px;
    line-height: 1.8;
}

.details-actions {
    margin-top: 16px;
}

/* --- question nav --- */
.question-nav {
    display: none;
    margin-top: 12px;
    gap: 10px;
}

.nav-btn {
    flex: 1;
    padding: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    background: #cc3300;
    border: 2px solid #ffcc00;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.nav-btn:hover:not(:disabled) {
    background: #ff4400;
}

.nav-btn.secondary {
    background: #2040b0;
    border-color: #88ccff;
}

.nav-btn.secondary:hover:not(:disabled) {
    background: #3060d0;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- feedback --- */
.feedback {
    font-size: 1rem;
    font-weight: 700;
    min-height: 24px;
    margin-top: 8px;
}

.feedback.correct-fb {
    color: #00ff88;
}

.feedback.wrong-fb {
    color: #ff4444;
}

/* --- explanation (strong/weak) --- */
.explanation {
    font-size: 0.85rem;
    font-weight: 400;
    color: #88ccff;
    margin-top: 8px;
    line-height: 1.6;
}

/* --- results --- */
.results-body {
    font-size: 1rem;
    line-height: 2.4;
    margin: 24px 0;
}

.results-body strong {
    color: #ffcc00;
}

/* --- responsive --- */
@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }

    .game-hud {
        font-size: 0.8rem;
    }

    .question-text {
        font-size: 0.95rem;
    }

    .answer-btn {
        font-size: 0.85rem;
    }
}