/* Two-hand rhythm (/learn/ritm). Builds on proto.css + home.css. Theme-aware: left hand = --lh, right hand = --rh. */
.ritm-body { --lh: #2f6f73; --rh: var(--accent); --lh-text: #fff; --rh-text: #fff; }
.dark .ritm-body { --lh: #3a9ea3; }
[data-theme="konsert"] .ritm-body { --lh: #6f8fae; --rh-text: #14110b; }
[data-theme="defter"] .ritm-body { --lh: #27486a; }
[data-theme="neon"] .ritm-body { --lh: #1497b3; --rh: #d6389a; }
[data-theme="klaviatura"] .ritm-body { --lh: #000; --rh: #e10600; }
[data-theme="oyun"] .ritm-body { --lh: #7c4dff; }
[data-theme="cyan"] .ritm-body, [data-theme="green"] .ritm-body { --rh-text: #06121a; }
/* while practising: no site header or bottom bar, the pads own the bottom of the screen */
html.ritm-focus .site-header, html.ritm-focus .site-tabbar, html.ritm-focus .tabbar { display: none !important; }
html.ritm-focus body { padding-bottom: 0 !important; }

.ritm { max-width: 680px; 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; }
.ritm h1 { font-size: 1.7rem; margin-top: 4px; }
.ritm .lead { margin-top: 6px; color: var(--ink-2); }
.device-note { margin-top: 14px; font-size: 0.8rem; color: var(--muted); }

/* stages */
.stages { list-style: none; margin: 16px 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); }
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(--rh); color: var(--rh-text); box-shadow: 0 0 0 5px var(--accent-soft); }
.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 { color: var(--gold); 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; }

/* practice */
#play-view { padding-bottom: 250px; }
.play-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); }
.play-name { flex: 1; min-width: 0; display: grid; }
.play-name b { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-name span { font-size: 0.8rem; color: var(--muted); }
.tempo { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.tempo button { width: 36px; height: 36px; border: 0; background: none; font-size: 1.2rem; font-weight: 800; color: var(--ink); border-radius: 999px; }
.tempo button:disabled { opacity: 0.35; }
.tempo span { font-size: 0.82rem; font-weight: 800; white-space: nowrap; }
.beats { display: flex; justify-content: center; gap: 10px; margin: 14px 0 12px; }
.beats span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-weight: 900; transition: transform 0.08s; }
.beats span.past { background: var(--ink-bg); border-color: var(--ink-bg); color: #fff; }
.beats span.on { background: var(--rh); border-color: var(--rh); color: var(--rh-text); transform: scale(1.15); }
.line { padding: 10px 12px 2px; margin-top: 10px; color: var(--ink); box-shadow: none; }
.line.hand-R { border-left: 5px solid var(--rh); }
.line.hand-L { border-left: 5px solid var(--lh); }
.line-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.line-head b { font-weight: 900; }
.hand-R .line-head b, .res-hand.hand-R .rh-name { color: var(--rh); }
.hand-L .line-head b, .res-hand.hand-L .rh-name { color: var(--lh); }
.line-head span { text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--muted); }
.line svg { display: block; fill: currentColor; stroke: currentColor; overflow: visible; }
.line .st { stroke: var(--line); stroke-width: 1.4; }
.line .bl { stroke: var(--muted); stroke-width: 1.2; }
.line .bl.end { stroke-width: 2.6; }
.line .ts { stroke: none; font-size: 13px; font-weight: 900; font-family: Georgia, serif; }
.line .stem { stroke-width: 1.6; }
.line .flag { fill: none; stroke-width: 1.8; }
.line .hollow { fill: none; stroke-width: 1.9; }
.line .n, .line .beam, .line .rest { color: var(--ink); }
.line .rest { fill: currentColor; stroke: currentColor; stroke-width: 0.6; }
.line .m-ok, .line .beam.m-ok { color: var(--ok); }
.line .m-late, .line .m-early, .line .beam.m-late, .line .beam.m-early { color: #d49a00; }
.line .m-miss, .line .beam.m-miss { color: var(--bad); }
.line .mt { stroke: none; font-size: 10px; font-weight: 800; }
.line .dot { stroke: none; }
.line .head { fill: var(--accent); stroke: none; }
.hint { margin-top: 12px; text-align: center; font-size: 0.88rem; color: var(--ink-2); }
.play-actions { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.play-actions .btn { min-width: 130px; }
.pads { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; gap: 10px; padding: 0 12px calc(14px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }
.pad { position: relative; flex: 1; height: 220px; border: 0; border-radius: 24px; display: grid; place-items: center; align-content: center; gap: 4px; font-size: 1.5rem; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform 0.06s, box-shadow 0.06s, filter 0.06s; }
.pad small { font-size: 0.78rem; font-weight: 700; opacity: 0.85; }
.pad b { font-weight: 900; letter-spacing: 0.02em; }
.pad-L { background: var(--lh); color: var(--lh-text); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28); }
.pad-R { background: var(--rh); color: var(--rh-text); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22); }
.pad.hit { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); filter: brightness(1.12); }
.pad .key { position: absolute; top: 10px; right: 12px; padding: 1px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.25); font-size: 0.72rem; font-weight: 800; }
@media (max-height: 700px) { .pad { height: 170px; } #play-view { padding-bottom: 200px; } }
@media (hover: hover) and (pointer: fine) { .pad { height: 150px; } #play-view { padding-bottom: 180px; } }

/* result */
#result-view { text-align: center; padding-top: 10px; }
.stars { font-size: 2rem; letter-spacing: 4px; color: var(--gold); }
#result-view h1 { outline: none; }
.res-both { margin-top: 4px; color: var(--ink-2); }
.res-hands { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; text-align: left; }
.res-hand { display: grid; gap: 2px; padding: 12px 14px; box-shadow: none; }
.res-hand.hand-L { border-top: 5px solid var(--lh); }
.res-hand.hand-R { border-top: 5px solid var(--rh); }
.rh-name { font-size: 0.75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.res-hand b { font-size: 1.9rem; font-weight: 900; line-height: 1.1; }
.res-hand span:last-child { font-size: 0.78rem; color: var(--muted); }
.timing { margin-top: 10px; padding: 12px 14px; text-align: left; box-shadow: none; }
.timing svg { display: block; margin-top: 6px; }
.timing .mid { stroke: var(--line); stroke-dasharray: 4 4; }
.timing .p-L { fill: var(--lh); }
.timing .p-R { fill: var(--rh); }
.timing .pm { font-size: 11px; font-weight: 900; }
.tip { margin-top: 8px; font-size: 0.9rem; color: var(--ink-2); }
.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%; }
