/* Spot the Method — recognition / interleave trainer (IMPROVING_MATH.md §3d).
   Layered on top of math-rounds.css + number_bonds.css (mode badge, band,
   lesson carousel, HUD reused). This file adds the big problem face, the four
   method-choice buttons, the per-round soft timer bar (test mode), the speed
   ghost line and the session progress bar. Consumes the same emerald
   design-system tokens as the other math screens (dark-palette fallbacks). */

/* ── The problem, shown big ── */
.stm-problem {
    font-family: var(--mono, 'JetBrains Mono', ui-monospace, monospace);
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--text, #eef2ff);
    text-align: center;
    margin: 10px auto 6px;
    letter-spacing: 0.02em;
}

.stm-prompt-line {
    text-align: center;
    font-size: 0.86rem;
    color: var(--dim, #9aa6c4);
    margin: 4px auto 12px;
}

/* ── Per-round soft timer (test mode only) ── */
.stm-round-timer {
    width: 100%;
    max-width: 360px;
    height: 6px;
    margin: 4px auto 2px;
    border-radius: 6px;
    background: var(--surface2, #15291f);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
    overflow: hidden;
}
.stm-round-timer-bar {
    height: 100%;
    width: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg,
        var(--teal, #2dd4bf),
        color-mix(in srgb, var(--accent, #10b981) 80%, transparent));
}

/* ── The four method-choice buttons ── */
.stm-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    margin: 6px auto 4px;
}
.stm-option {
    display: block;
    width: 100%;
    padding: 14px 14px;
    border-radius: 12px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    background: var(--surface2, #15291f);
    color: var(--text, #eef2ff);
    font-family: var(--sans, 'Space Grotesk', system-ui, sans-serif);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.14s ease, background 0.14s ease, transform 0.08s ease;
}
.stm-option:hover:not(:disabled) {
    border-color: var(--teal, #2dd4bf);
    background: color-mix(in srgb, var(--teal, #2dd4bf) 10%, var(--surface2, #15291f));
}
.stm-option:active:not(:disabled) { transform: translateY(1px); }
.stm-option:disabled { cursor: default; }

.stm-option.correct {
    border-color: color-mix(in srgb, var(--accent, #10b981) 70%, transparent);
    background: color-mix(in srgb, var(--accent, #10b981) 18%, var(--surface2, #15291f));
    color: var(--accent-bright, #34d399);
}
.stm-option.wrong {
    border-color: #f87171;
    background: color-mix(in srgb, #f87171 16%, var(--surface2, #15291f));
    color: #fca5a5;
}

/* ── The one-line "why" (train only) ── */
.stm-why {
    min-height: 1.1em;
    max-width: 360px;
    margin: 10px auto 2px;
    text-align: center;
    font-size: 0.84rem;
    color: var(--dim, #9aa6c4);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.stm-why.show { opacity: 1; }

/* ── Speed ghost + progress bar ── */
.stm-meta {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 10px auto 2px;
    font-size: 0.78rem;
    color: var(--faint, #6b7799);
}
.stm-ghost.beat { color: var(--accent-bright, #34d399); }

.stm-progress {
    width: 100%;
    max-width: 280px;
    height: 8px;
    margin: 6px auto 2px;
    border-radius: 6px;
    background: var(--surface2, #15291f);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
    overflow: hidden;
}
.stm-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--accent, #10b981) 70%, transparent),
        var(--teal, #2dd4bf));
    transition: width 0.3s ease;
}

@media (max-width: 420px) {
    .stm-problem { font-size: 2.1rem; }
    .stm-option { padding: 12px 10px; font-size: 0.94rem; }
    .stm-options { max-width: 100%; }
}
