/* Tone Ladder. Brass rungs on slate. Scoped to .tl- classes. */
.tl-wrap{--tl-brass:#d49a35;--tl-hi:#f0c36a;--tl-ink:#e8f1f2;--tl-mute:#9db3b8;--tl-slate:#10242a;--tl-line:#2b4a52;color:var(--tl-ink);padding-bottom:max(.5rem,env(safe-area-inset-bottom))}
.tl-wrap h1{font-size:1.3rem;letter-spacing:.02em;margin:.1rem 0 .35rem;color:var(--tl-hi)}
.tl-hud{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin-bottom:.5rem}
.tl-stat{display:flex;flex-direction:column;min-width:64px;line-height:1.15}
.tl-stat small{font-size:.68rem;color:var(--tl-mute);text-transform:uppercase;letter-spacing:.08em}
.tl-stat b{font-size:1.15rem;font-variant-numeric:tabular-nums}
.tl-lives{display:flex;gap:6px;align-items:center;margin-right:auto}
.tl-life{width:14px;height:14px;background:#2b4a52;transform:rotate(45deg);border-radius:2px;transition:background .2s,transform .2s}
.tl-life.on{background:var(--tl-brass)}
.tl-btn{min-height:44px;min-width:44px;padding:.5rem .9rem;border-radius:10px;border:2px solid var(--tl-line);background:var(--tl-slate);color:var(--tl-ink);font:inherit;font-weight:700;cursor:pointer;touch-action:manipulation}
.tl-btn:disabled{opacity:.4;cursor:default}
.tl-btn:focus-visible,.tl-chip:focus-visible{outline:3px solid var(--tl-hi);outline-offset:2px}
.tl-btn.go{background:var(--tl-brass);border-color:var(--tl-hi);color:#241705}
.tl-status{min-height:2.4em;margin:.4rem 0;color:var(--tl-mute);font-size:.95rem}
.tl-stage{position:relative;border-radius:14px;overflow:hidden;border:2px solid var(--tl-line);background:#0a1519}
#tl-canvas{display:block;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.tl-over{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;gap:.6rem;padding:1rem;background:rgba(8,18,21,.93);overflow:auto}
.tl-over[hidden]{display:none}
.tl-over h2{font-size:1.35rem;color:var(--tl-hi)}
.tl-over p{color:var(--tl-ink);font-size:.95rem;line-height:1.4}
.tl-chips{display:grid;grid-template-columns:1fr 1fr;gap:.4rem}
.tl-chip{min-height:48px;text-align:left;padding:.4rem .6rem;border-radius:10px;border:2px solid var(--tl-line);background:#0f2026;color:var(--tl-ink);font:inherit;cursor:pointer;display:flex;flex-direction:column;touch-action:manipulation}
.tl-chip b{font-size:.88rem}.tl-chip i{font-style:normal;font-size:.72rem;color:var(--tl-mute)}
.tl-chip.sel{border-color:var(--tl-hi);background:#1d3a42}
.tl-chip.lock{opacity:.5}
.tl-row{display:flex;gap:.5rem;flex-wrap:wrap}
.tl-row .tl-btn{flex:1}
.tl-small{font-size:.8rem;color:var(--tl-mute)}
@media (prefers-reduced-motion:reduce){.tl-life{transition:none}}

.tl-stage{min-height:360px}
.tl-pips{display:flex;flex-wrap:wrap;gap:4px;min-height:14px;margin:0 0 .4rem}
.tl-pip{width:10px;height:10px;border-radius:50%;background:#2b4a52;transition:background .15s,transform .15s}
.tl-pip.done{background:var(--tl-brass)}
.tl-pip.next{background:var(--tl-hi);transform:scale(1.35)}
.tl-phase{font-weight:800;letter-spacing:.04em;text-transform:uppercase;font-size:.8rem;color:var(--tl-hi)}
.tl-phase.listen{color:#7fd0e0}
.tl-over .tl-btn{min-height:48px}
.tl-over{padding:.8rem}
.tl-over h2{margin:0}
@media (prefers-reduced-motion:reduce){.tl-pip{transition:none}}

/* Full screen (native and immersive): the ladder fills the stage under the dock. */
html.pip-immersive .tl-wrap,html.pip-native .tl-wrap,.tl-wrap:fullscreen{display:flex;flex-direction:column;overflow:hidden!important;max-width:none;background:#0a1519}
html.pip-immersive .tl-wrap>h1,html.pip-native .tl-wrap>h1,.tl-wrap:fullscreen>h1,
html.pip-immersive .tl-status,html.pip-native .tl-status,.tl-wrap:fullscreen .tl-status,
html.pip-immersive #tl-mode,html.pip-native #tl-mode,
html.pip-immersive .tl-intro,html.pip-native .tl-intro,.tl-wrap:fullscreen .tl-intro,
html.pip-immersive #tl-daily-info,html.pip-native #tl-daily-info{display:none}
html.pip-immersive .tl-hud,html.pip-native .tl-hud,.tl-wrap:fullscreen .tl-hud{margin-bottom:.3rem;flex:none}
html.pip-immersive .tl-pips,html.pip-native .tl-pips,.tl-wrap:fullscreen .tl-pips{flex:none;margin-bottom:.3rem}
html.pip-immersive .tl-stage,html.pip-native .tl-stage,.tl-wrap:fullscreen .tl-stage{flex:1 1 0;min-height:0;position:relative}
html.pip-immersive #tl-canvas,html.pip-native #tl-canvas,.tl-wrap:fullscreen #tl-canvas{position:absolute;left:0;top:0}
html.pip-immersive .tl-wrap,html.pip-native .tl-wrap{padding-bottom:max(.5rem,env(safe-area-inset-bottom))}
@media (orientation:landscape) and (max-height:520px){
  html.pip-immersive .tl-chips,html.pip-native .tl-chips{grid-template-columns:repeat(4,1fr)}
  html.pip-immersive .tl-over,html.pip-native .tl-over{gap:.35rem;padding:.5rem}
  html.pip-immersive .tl-over h2,html.pip-native .tl-over h2{font-size:1.1rem}
}
