/* Ear training (/learn/qulaq). Builds on proto.css + home.css; theme-aware through the theme colours. */
html.qulaq-focus .site-header, html.qulaq-focus .site-tabbar, html.qulaq-focus .tabbar { display: none !important; }
html.qulaq-focus body { padding-bottom: 0 !important; }
.qulaq { max-width: 560px; padding-top: 12px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.crumb { display: block; width: fit-content; margin-bottom: 10px; font-size: 0.85rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.qulaq .eyebrow { color: var(--teal); }
.qulaq h1 { font-size: 1.7rem; margin-top: 4px; }
.qulaq .lead { margin-top: 6px; color: var(--ink-2); }
.sound-off { margin-top: 12px; padding: 10px 12px; font-size: 0.88rem; border: 1px solid var(--accent); box-shadow: none; }
.sound-off a { font-weight: 800; color: var(--accent-ink); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 16px; padding: 4px; border-radius: 14px; background: var(--paper-2); }
.seg button { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; font-size: 0.95rem; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }

/* stages (same look as /learn/ritm) */
.stages { list-style: none; margin: 8px 0 0; padding: 0; }
.stages li + li .stage { border-top: 1px solid var(--line); }
.stage { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 2px; border: 0; background: none; text-align: left; color: var(--ink); font: inherit; }
button.stage { cursor: pointer; }
button.stage:hover .st-text b { color: var(--accent-ink); }
.st-num { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--paper-2); color: var(--muted); font-weight: 900; }
.stage.done .st-num { background: var(--ok); color: #fff; }
.stage.now .st-num { background: var(--accent); color: #fff; box-shadow: 0 0 0 5px var(--accent-soft); }
[data-theme="cyan"] .stage.now .st-num, [data-theme="green"] .stage.now .st-num, [data-theme="konsert"] .stage.now .st-num { color: #14110b; }
.st-text { flex: 1; min-width: 0; display: grid; }
.st-text b { font-size: 1rem; }
.st-text span { font-size: 0.82rem; color: var(--muted); }
.stage.locked .st-text b { color: var(--muted); }
.st-stars, .stars { color: var(--gold); }
.st-stars { letter-spacing: 1px; font-size: 0.95rem; }
.st-stars .off, .stars .off { color: var(--line); }
.st-go { font-size: 0.78rem; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-ink); }
.lock { color: var(--line); flex: none; }
.day-strip { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--paper-2); font-size: 0.86rem; font-weight: 800; color: var(--accent-ink); }
.device-note { margin-top: 10px; font-size: 0.8rem; color: var(--muted); }

/* question */
.q-top { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); cursor: pointer; }
.q-name { flex: 1; min-width: 0; display: grid; }
.q-name b { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-name span { font-size: 0.8rem; color: var(--muted); }
.q-right { font-weight: 900; color: var(--ok); white-space: nowrap; }
.q-prog { height: 8px; margin-top: 12px; border-radius: 9px; background: var(--paper-2); overflow: hidden; }
.q-prog i { display: block; height: 100%; width: 0; border-radius: 9px; background: var(--accent); transition: width 0.25s; }
.listen { display: grid; place-items: center; width: 124px; height: 124px; margin: 28px auto 8px; border: 0; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 0 0 12px var(--accent-soft); cursor: pointer; }
[data-theme="cyan"] .listen, [data-theme="green"] .listen, [data-theme="konsert"] .listen { color: #14110b; }
.listen:active { transform: scale(0.96); }
.l-cap { text-align: center; font-size: 0.86rem; font-weight: 800; color: var(--ink-2); }
.l-cap .link-btn { font-weight: 800; color: var(--accent-ink); }
.chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chips span { padding: 4px 10px; border-radius: 99px; background: var(--paper-2); font-size: 0.8rem; font-weight: 800; color: var(--ink-2); }
.qulaq .ask { margin: 20px 0 14px; text-align: center; font-size: 1.25rem; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opts.odd .opt:last-child { grid-column: 1 / -1; }
.opt { position: relative; display: grid; place-items: center; align-content: center; gap: 2px; min-height: 58px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); font: inherit; text-align: center; cursor: pointer; }
.opt b { font-size: 0.98rem; font-weight: 800; }
.opt small { font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.opt .o-key { position: absolute; top: 5px; left: 8px; font-size: 0.66rem; font-weight: 800; color: var(--muted); opacity: 0.7; }
@media (hover: none) { .opt .o-key { display: none; } }
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt:disabled { cursor: default; }
.opt.good { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--card)); }
.opt.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, var(--card)); }
.opt.good b::before { content: '✓ '; color: var(--ok); }
.opt.bad b::before { content: '✗ '; color: var(--bad); }
.opt.dim { opacity: 0.45; }
.opts.big .opt { min-height: 150px; border-radius: 22px; }
.opts.big .opt b { font-size: 1.15rem; }
.o-ic { width: 52px; height: 52px; background: center / contain no-repeat; }
.o-maj { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4.5' fill='%23f2a516'/%3E%3Cg stroke='%23f2a516' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 2.5v2.5M12 19v2.5M2.5 12H5M19 12h2.5M5.3 5.3l1.8 1.8M16.9 16.9l1.8 1.8M5.3 18.7l1.8-1.8M16.9 7.1l1.8-1.8'/%3E%3C/g%3E%3C/svg%3E"); }
.o-min { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 17h10a4 4 0 0 0 .5-8 5.5 5.5 0 0 0-10.6 1.5A3.3 3.3 0 0 0 7 17z' fill='%238a93a8'/%3E%3Cg stroke='%235b7bb0' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M9 19.5l-.8 2M13 19.5l-.8 2M17 19.5l-.8 2'/%3E%3C/g%3E%3C/svg%3E"); }
.q-ok { margin-top: 14px; text-align: center; font-size: 1.1rem; font-weight: 900; color: var(--ok); }
.cmp { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); box-shadow: none; }
.cmp h2 { margin: 0 0 6px; font-size: 1rem; }
.cl { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.cl + .cl { border-top: 1px solid var(--line); }
.cl > div { flex: 1; min-width: 0; display: grid; }
.cl b { font-size: 0.95rem; }
.cl span { font-size: 0.78rem; color: var(--muted); }
.pl { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; color: #fff; cursor: pointer; }
.pl-bad { background: var(--bad); }
.pl-good { background: var(--ok); }
.keys { margin-top: 8px; }
.keys svg { display: block; height: 74px; }
.keys .kw { fill: #fff; stroke: #c9c2b5; }
.keys .kb { fill: #1f2440; }
.keys .kw.k-good { fill: #bfe8cf; } .keys .kw.k-bad { fill: #f8cbc5; } .keys .kw.k-both { fill: #fde3c8; }
.keys .kb.k-good { fill: #1f9d55; } .keys .kb.k-bad { fill: #d33c2c; } .keys .kb.k-both { fill: #e2763a; }
.keys text { font-size: 9px; font-weight: 800; text-anchor: middle; fill: #1f2440; }
.q-next { margin-top: 16px; }
.keys-hint { margin-top: 14px; text-align: center; font-size: 0.78rem; color: var(--muted); }
@media (hover: none) { .keys-hint { display: none; } }

/* result */
#res-view { text-align: center; padding-top: 16px; }
.stars { font-size: 2.2rem; letter-spacing: 4px; }
#res-view h1 { outline: none; }
.res-score { margin-top: 4px; font-size: 1.1rem; font-weight: 800; color: var(--ink-2); }
.res-line { margin-top: 8px; color: var(--ink-2); font-size: 0.92rem; }
.unlocked { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); font-weight: 800; }
.res-actions { display: grid; gap: 10px; margin-top: 18px; }
.res-actions .btn { width: 100%; }
.res-actions [hidden] { display: none; }
.l-cap .link-btn { display: inline; width: auto; min-height: 0; margin: 0; padding: 4px 2px; }
