/* Player-facing flow. The editor keeps its denser, separate workspace styles. */
.tv-page .primary,.controller-page .primary{
 min-height:56px;padding:16px 24px;border:1px solid #ffd49a;border-radius:8px;
 background:#efb56f;color:#24190d;box-shadow:0 3px 0 #77502c;clip-path:none;
 font-size:16px;font-weight:700;letter-spacing:0;text-transform:none;line-height:1.3;
}
.tv-page .primary:hover,.controller-page .primary:hover{background:#ffd097}
.tv-page .secondary,.controller-page .secondary,.tv-page .quiet{
 min-height:48px;padding:12px 20px;border:1px solid #54727c;border-radius:8px;
 background:#0e252e;color:#e0ecee;font-size:14px;line-height:1.4;letter-spacing:0;
}
.tv-page .secondary:hover,.controller-page .secondary:hover,.tv-page .quiet:hover{background:#1b3640;border-color:#9cb2b7}
.tv-page .eyebrow,.controller-page .eyebrow{font-size:11px;letter-spacing:.14em}
.tv-page button:focus-visible,.controller-page button:focus-visible{outline:3px solid #fff1ce;outline-offset:4px}
.tv-page .world{filter:brightness(.7)}
.tv-page .topbar{height:80px;padding:16px 5vw}
.tv-page .fullscreen{background:#0a1a22a6}
.tv-lobby{
 width:min(1160px,90vw);height:calc(100dvh - 164px);min-height:490px;margin:auto;
 display:grid;grid-template-columns:minmax(0,1.25fr) minmax(340px,.9fr);gap:8%;align-items:center;
}
.welcome-copy{padding:16px 0}
.welcome-copy>.eyebrow{color:#b7c9ce;margin:0 0 20px}
.welcome-copy h1{margin:0 0 30px;line-height:0}
.welcome-copy h1 img{width:min(340px,90%);height:auto}
.welcome-copy h2{font-size:clamp(26px,2.7vw,38px);line-height:1.23;font-weight:500;letter-spacing:-.025em;margin:0 0 28px}
.join-steps{list-style:none;margin:0;padding:0;display:grid;gap:18px}
.join-steps li{display:flex;gap:16px;align-items:flex-start}
.join-steps li>span{border:1px solid #756047;border-radius:50%;color:#f0bc7c;width:32px;height:32px;display:grid;place-items:center;flex-shrink:0;font-size:13px}
.join-steps strong{font-size:17px;line-height:1.4;font-weight:500}
.join-steps p{font-size:14px;color:#a2bac1;line-height:1.5;margin:4px 0 0}
.pairing-card{padding:30px 24px;text-align:center;border:1px solid #3b5e67;border-radius:18px;background:#091b23d9;box-shadow:0 20px 60px #0003}
.pairing-card h2{font-size:23px;font-weight:500;margin:12px 0 20px;line-height:1.3}
.pairing-card .portal{width:272px;height:272px;margin:0 auto 20px}
.pairing-card .qr-frame{width:218px;height:218px;padding:12px}
.pairing-card .portal:before,.pairing-card .portal:after{display:none}
.pairing-card #connection-status{font-size:14px;color:#c4d8dc;line-height:1.5;margin:0 0 8px}
.pairing-card .micro{font-size:12px;margin:0 0 22px}
.pairing-card .controller-link{display:inline-flex;gap:18px;align-items:center;text-decoration:none;font-size:13px;min-height:44px}
.selected-track{min-width:0}
.selected-track h1{font:600 clamp(38px,5vw,68px)/1.08 Arial,Helvetica,sans-serif;letter-spacing:-.045em;margin:24px 0}
.selected-track>p{font-size:20px;color:#b4cbd0;line-height:1.6;margin:0 0 26px}
.selected-track-meta{display:flex;flex-wrap:wrap;gap:12px;align-items:center;color:#a7bfc6;font-size:15px;line-height:1.6}
.selected-track-meta #preview-genre{font-size:11px;letter-spacing:.1em;border:1px solid #5c675f;border-radius:5px;color:#ebbc7f;padding:7px 10px}
.selected-track .lane-marks{gap:28px;margin:48px 0 0}
.selected-track .gem{width:32px;height:32px}
.ready-card{text-align:center;padding:40px 28px;background:#0a2028d9;border:1px solid #375962;border-radius:18px}
.paired-symbol{width:80px;height:80px;margin:0 auto 30px;border:1px solid #7baa80;border-radius:50%;display:grid;place-items:center;font-size:32px;color:#c5e9bd;background:#73966616}
.ready-card>.eyebrow{color:#b3d3aa}.ready-card h2{font-size:30px;font-weight:500;margin:16px 0 22px}
.ready-card p{font-size:18px;color:#bed0d6;line-height:1.75;margin:0}.ready-card p strong{font-weight:600;color:#f3c590}
.ready-tip{font-size:13px;color:#99b5be;border-top:1px solid #345660;margin-top:32px;padding-top:24px;line-height:1.6}
.tv-page .bottom{height:84px;min-height:84px;margin:0 5vw;padding:16px 0;gap:24px;font-size:13px}
.tv-page .bottom .primary{min-height:48px;padding:12px 24px;font-size:14px}
.tv-page .bottom .audio-ready{background:#122b26;border-color:#74977a;color:#c6dec0;box-shadow:none}
.tv-page .diagnostics summary{min-height:44px;padding:12px 16px;border:1px solid #385760;border-radius:8px;font-size:13px}
.tv-page .diagnostic-body{bottom:64px}
/* Keep the song information above the highway instead of on top of its lanes. */
.tv-page .stage{height:calc(100dvh - 164px);min-height:430px;padding:0 5vw;display:flex;flex-direction:column}
.tv-page .stage-header{position:static;min-height:92px;align-items:center;flex-shrink:0;gap:32px;padding:8px 0 20px}
.tv-page .now-playing{width:auto;min-width:0;max-width:65%}
.tv-page .stage-header h2{font-size:26px;line-height:1.15;margin:0 0 6px;text-transform:none}
.tv-page .stage-header .eyebrow{font-size:10px;margin:0 0 8px}
.tv-page .stage-header p{font-size:13px;line-height:1.5;max-width:none}
.stage-track-details{display:flex;flex-wrap:wrap;align-items:center;gap:6px 20px}
.tv-page .stage-header .part-label{margin:0;color:#efbc7a;font-size:13px}.tv-page .stage-instruction{display:none}
.tv-page:not([data-phase="lobby"]):not([data-phase="error"]):not([data-phase="result"]) #audio-unlock{visibility:hidden;pointer-events:none}
.tv-page .scoreboard #score{font-size:42px;line-height:1.05}.tv-page .scoreboard small{font-size:13px;margin-top:4px;border:0;padding:0}
.tv-page .scoreboard>.eyebrow{margin-bottom:5px}
.tv-page .highway-wrap{height:auto;min-height:0;padding-top:0;flex:1}
.tv-page .track-progress{height:32px;flex-shrink:0;font-size:12px}
.tv-page .stage-overlay .primary{min-width:220px}
.tv-page .result .primary{min-width:280px}

/* Phone: library → round setup → controller. Settings is a separate screen. */
.controller-page:not(.play-mode) .world{opacity:.22}
.controller-page .phone-header{height:80px;margin:0 auto;width:min(920px,calc(100% - 40px));padding:16px 0;gap:16px}
.phone-brand{display:grid;gap:7px}.phone-header .connection-status{text-align:left;font-size:11px}
.phone-header .wordmark{font-size:18px}.phone-header .wordmark span{font-size:8px}
.phone-header .settings-button{font-size:13px;min-height:44px;padding:10px 16px;background:#0b2029}
.controller-page:not(.play-mode) main{max-width:800px;margin:auto;padding:30px 20px 36px}
.menu-flow{width:100%;min-width:0}
.menu-heading{margin:0 0 26px}.menu-heading .eyebrow{display:block;color:#c4a078;margin:0 0 12px}
.menu-heading h1{font-size:32px;font-weight:600;letter-spacing:-.035em;line-height:1.15;margin:0}
.menu-heading h1:focus{outline:none}.menu-heading p{font-size:15px;line-height:1.6;color:#aac0c7;margin:12px 0 0}
.song-list{display:grid;gap:10px}
.song-option{display:grid;grid-template-columns:48px minmax(0,1fr) 44px;gap:14px;align-items:center;text-align:left;width:100%;min-height:82px;padding:13px 14px;background:#10252e;border:1px solid #3a5661;border-radius:10px;color:#e7f1f1;transition:background .12s,border-color .12s}
.song-option:hover{background:#1b333c;border-color:#8ba6ad}.song-option:active{background:#253d43}
.song-option.is-selected{border-color:#c39963;background:#182c31}
.song-option-mark,.record-mark{display:grid;place-items:center;flex-shrink:0;color:var(--track-color);background:linear-gradient(140deg,#ffffff0c,transparent),#0a1921;border:1px solid #657c794d;border-radius:7px;font-family:Impact,'Arial Narrow',sans-serif;letter-spacing:.025em}
.song-option-mark{width:48px;height:48px;font-size:15px}
.song-option-copy{display:grid;gap:6px;min-width:0}
.song-option-copy strong{font-size:16px;font-weight:600;line-height:1.2;overflow-wrap:anywhere}
.song-option-copy>span{font-size:13px;color:#a8bfc7;line-height:1.3}
.song-option-end{display:flex;align-items:center;justify-content:space-between;gap:9px;color:#adc1c8;font-size:11px;font-variant-numeric:tabular-nums}
.song-option-end>span:last-child{font-size:26px;color:#d2bc98}
.catalog-caption{font-size:11px;line-height:1.65;color:#8da8b2;margin:22px 4px 0}
/* One recognizable back action across setup, settings, preparation and results. */
.controller-page .back-button{
 display:inline-flex;align-items:center;justify-content:center;gap:12px;
 min-height:52px;padding:9px 18px 9px 10px;margin:0;
 border:1px solid #78939c;border-radius:10px;background:#19343e;color:#f0f5f4;
 font:600 16px/1.3 Arial,Helvetica,sans-serif;letter-spacing:0;text-transform:none;
 box-shadow:0 2px 0 #020b10;touch-action:manipulation;
}
.controller-page .back-button::before{
 content:"";display:block;flex:0 0 30px;width:30px;height:30px;
 border:1px solid #627773;border-radius:7px;
 background:#0b2029 url('/assets/arrow-left.svg') center / 20px 20px no-repeat;
}
.controller-page .back-button:hover:not(:disabled){background:#254650;border-color:#bed0d2}
.controller-page .back-button:active:not(:disabled){transform:translateY(1px);box-shadow:0 1px 0 #020b10;background:#2d505a}
.menu-screen>.back-button{margin-bottom:24px}
.controller-actions .back-button{min-height:44px;padding:6px 12px 6px 8px;gap:8px;font-size:14px}
.controller-actions .back-button::before{width:28px;height:28px;flex-basis:28px}
.rotate-panel .back-button{width:100%}
.selected-song{display:flex;align-items:center;gap:20px;padding:24px;background:#10252ebf;border:1px solid #405963;border-radius:12px;margin:0 0 32px;min-width:0}
.record-mark{width:74px;height:90px;font-size:23px}.selected-song-copy{min-width:0}
.selected-song-copy .eyebrow{font-size:10px;color:#c3a27a}
.selected-song h2{font-size:24px;line-height:1.15;letter-spacing:-.025em;margin:10px 0;font-weight:600;overflow-wrap:anywhere}
.selected-song p{font-size:13px;color:#acc3c9;line-height:1.5;margin:0}.selected-song .track-part{font-size:12px;margin-top:8px;color:#d0b48f}
.duration-choice{padding:0;margin:0;border:0;min-width:0}.duration-choice legend{font-size:16px;font-weight:500;margin:0 0 16px;padding:0}
.duration-options{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.duration-option{position:relative;display:flex;gap:10px;align-items:flex-start;min-height:86px;padding:16px 12px;border:1px solid #45606b;border-radius:9px;background:#0b2029;cursor:pointer}
.duration-option:has(input:checked){border-color:#e5b273;background:#42332280;box-shadow:inset 0 0 0 1px #e5b273}
.duration-option:focus-within{outline:3px solid #fff1ce;outline-offset:3px}
.duration-option input{accent-color:#edb471;width:17px;height:17px;margin:1px 0 0;flex-shrink:0}
.duration-option strong{display:block;font-size:14px;line-height:1.35;font-weight:600}.duration-option small{display:block;font-size:12px;color:#aac0c7;line-height:1.5;margin-top:6px}
.play-tip{display:flex;align-items:flex-start;gap:12px;font-size:13px;color:#b2c8ce;line-height:1.65;margin:24px 0}
.play-tip>span:first-child{color:#eabd84;font-size:17px}
.start-actions .wide{margin:0}.start-actions>p{text-align:center;font-size:12px;line-height:1.5;color:#90adb7;margin:14px 0 0}
.menu-screen .wide{min-height:56px}
.timing-card{border:1px solid #45626c;border-radius:12px;padding:26px;background:#10262e;margin-bottom:24px}
.timing-card h2{font-size:21px;margin:0 0 12px;font-weight:500}.timing-card>p{font-size:15px;line-height:1.65;color:#b5cbd0;margin:0 0 24px}.timing-card>.micro{font-size:12px;margin:14px 0 0;text-align:center}
.manual-settings{border:1px solid #36555f;border-radius:10px;background:#091c24}.manual-settings summary{cursor:pointer;padding:20px;font-size:14px;min-height:60px;color:#c0d2d6}.manual-settings-body{padding:0 24px 24px}
.manual-settings .field{font-size:13px;letter-spacing:0;margin:20px 0 8px}.manual-settings .micro{font-size:12px;line-height:1.65}
.settings-saved{padding:16px;color:#c3e3b6;background:#1a342a;border:1px solid #668363;border-radius:8px;font-size:14px}
/* A single 44px control strip; all remaining safe screen area is playable.
   Keep this geometry during loading/countdown so prepared fingers never move. */
.controller-page.play-mode{height:100vh;height:100dvh;min-height:0;overflow:hidden;overscroll-behavior:none}
.controller-page.play-mode .phone-header{display:none}
.controller-page.play-mode main{
 width:100%;max-width:none;height:100%;margin:0;
 padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.controller-page.play-mode .controller{height:100%;min-height:0;display:grid;grid-template-rows:44px minmax(0,1fr)}
.controller-page.play-mode .controller-top{min-height:0;margin:0;padding:0 8px 0 12px;gap:12px;background:#06151d}
.controller-page.play-mode .controller-status{min-width:0;overflow:hidden}
.controller-page.play-mode .controller-top .eyebrow{display:none}
.controller-page.play-mode #controller-identity{max-width:100%;font-size:10px;line-height:1.2;margin-bottom:2px}
.controller-page.play-mode .controller-top strong{font-size:13px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.controller-actions{flex-shrink:0;display:flex;align-items:center;gap:8px}
.controller-actions .secondary{min-height:44px;padding:8px 14px;font-size:14px}
.controller-page.play-mode .controller-bottom{display:none}
.controller-page.play-mode .pads{height:100%;min-height:0;gap:0}
.controller-page.play-mode .pad{
 width:100%;height:100%;min-width:0;min-height:0;max-height:none;padding:0;
 border-radius:0;clip-path:none;border-width:1px 1px 4px;
 box-shadow:inset 0 0 0 5px #051119;
}
/* The whole rectangle is a target, including its border. Pressing never moves it. */
.controller-page.play-mode .pad.pressed{transform:none;box-shadow:inset 0 0 24px var(--lane)}
.controller-page.play-mode .pad-socket{width:clamp(64px,12vw,112px);height:clamp(64px,12vw,112px)}
.controller-page.play-mode .pad-caption{font-size:11px;letter-spacing:.09em;bottom:18px;color:#b2c5ca;writing-mode:horizontal-tb}
.controller-page.play-mode .pad .pad-number{font-size:12px;color:#9ab1ba}
.phone-overlay{border-radius:12px;padding:24px;background:#071a22fa}
.phone-overlay h2{font-size:28px;margin-bottom:12px}.phone-overlay p{margin:0 0 28px;line-height:1.65}
.pause-actions{display:flex;flex-wrap:wrap;gap:14px;justify-content:center}.pause-actions button{min-width:200px;min-height:52px}
.controller-page .phone-result{max-width:480px;margin:auto;padding:28px 0}.phone-result .wide{margin:8px 0;min-height:56px}
.rotate-panel .secondary{font-size:15px}.rotate-panel .eyebrow{font-size:11px}
@media(min-width:700px){
 .song-list{grid-template-columns:1fr 1fr;gap:14px}
 .setup-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:32px;align-items:start}
 .selected-song{flex-direction:column;align-items:flex-start;padding:28px;margin:0}
 .record-mark{width:100%;height:122px;font-size:40px}
 .selected-song h2{font-size:28px}
 .controller-page:not(.play-mode) main{max-width:920px;padding-top:32px}
 #menu-settings{max-width:600px;margin:auto}
}
@media(orientation:landscape) and (max-height:560px){
 .controller-page:not(.play-mode) .phone-header{height:54px;padding:8px 0}
 .phone-header .phone-brand{display:flex;align-items:center;gap:20px}
 .controller-page:not(.play-mode) main{max-width:960px;padding:14px 24px 24px}
 .menu-heading{margin-bottom:16px}.menu-heading h1{font-size:27px}.menu-heading .eyebrow{display:none}.menu-heading p{font-size:13px;margin-top:8px}
 .song-list{grid-template-columns:1fr 1fr;gap:8px 14px}.song-option{min-height:70px;padding:10px 12px}.song-option-mark{height:44px;width:44px}
 .menu-screen>.back-button{min-height:48px;margin-bottom:16px;padding-block:7px}
 .setup-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:28px}
 .selected-song{flex-direction:row;align-items:center;padding:20px;gap:16px;margin:0}.record-mark{width:66px;height:92px;font-size:21px}
 .selected-song h2{font-size:23px}.selected-song .eyebrow{font-size:9px}.selected-song p{font-size:12px}
 .duration-choice legend{font-size:14px;margin-bottom:10px}.duration-option{min-height:72px;padding:12px 10px}.duration-option small{font-size:11px;margin-top:4px}
 .play-tip{font-size:12px;margin:14px 0;line-height:1.5}.start-actions>p{display:none}.menu-screen .wide{min-height:48px;padding:12px 20px}
 .controller-page.play-mode .pad-caption{bottom:12px}
}
@media(max-width:370px){
 .controller-page:not(.play-mode) main{padding-inline:16px}.menu-heading h1{font-size:29px}
 .song-option{grid-template-columns:42px minmax(0,1fr) 38px;gap:10px;padding:12px}.song-option-mark{width:42px;height:46px;font-size:13px}.song-option-copy strong{font-size:14px}
 .selected-song{padding:18px;gap:14px}.record-mark{width:58px;height:78px;font-size:18px}.selected-song h2{font-size:22px}
 .duration-option{gap:7px;padding:14px 9px}.duration-option strong{font-size:13px}.duration-option small{font-size:11px}
}
@media(min-width:1500px) and (min-height:850px){
 .tv-lobby{width:min(1450px,86vw);gap:12%}.welcome-copy h1 img{width:440px}.welcome-copy h2{font-size:44px;margin-bottom:40px}
 .join-steps{gap:26px}.join-steps strong{font-size:21px}.join-steps p{font-size:17px}
 .pairing-card{padding:40px}.pairing-card h2{font-size:28px}.pairing-card .portal{width:340px;height:340px;margin:28px auto}.pairing-card .qr-frame{width:266px;height:266px}
 .pairing-card #connection-status{font-size:17px}.pairing-card .micro{font-size:14px}.ready-card{padding:60px 35px}.ready-card h2{font-size:38px}.ready-card p{font-size:21px}
}
@media(max-width:900px){
 .tv-lobby{gap:5%;grid-template-columns:minmax(0,1fr) minmax(300px,.9fr);width:90vw}
 .welcome-copy h2{font-size:26px}.join-steps strong{font-size:15px}.join-steps p{font-size:12px}.pairing-card{padding:24px 12px}.pairing-card h2{font-size:21px}
 .pairing-card .portal{width:248px;height:248px}.pairing-card .qr-frame{width:202px;height:202px}
 .tv-page .bottom{gap:14px;font-size:11px}.tv-page .bottom .primary{padding:12px 16px}.tv-page .world-label{display:none}
}
@media(max-width:650px){
 .tv-page .topbar{height:74px;padding:12px 20px}.tv-page .topbar .fullscreen{font-size:12px;padding:10px 12px}
 .tv-lobby{display:flex;flex-direction:column;height:auto;min-height:0;padding:24px 0 36px;gap:32px;align-items:stretch}
 .welcome-copy{padding:0}.welcome-copy h1{margin-bottom:22px}.welcome-copy h1 img{width:240px}.welcome-copy h2{font-size:27px;margin-bottom:0}.welcome-copy>.eyebrow,.join-steps{display:none}
 .pairing-card{padding:28px 20px}.pairing-card .portal{width:272px;height:272px}.pairing-card .qr-frame{width:218px;height:218px}
 .tv-page .bottom{height:auto;min-height:80px;flex-wrap:wrap;padding:20px 0;gap:16px}.tv-page .bottom .diagnostics{margin-left:0}
 .selected-track h1{font-size:42px}.selected-track>p{font-size:17px}.selected-track .lane-marks{margin-top:28px}
 .ready-card{padding:28px}.paired-symbol{width:60px;height:60px;margin-bottom:22px}
 .tv-page .stage{height:calc(100dvh - 190px)}.tv-page .stage-header h2{font-size:20px}.tv-page .stage-header p{font-size:11px}.tv-page .scoreboard #score{font-size:30px}
}

/* Partner marks sit with supporting information, outside the play controls. */
.partner-credit{display:flex;align-items:center;gap:16px;flex-shrink:0;line-height:1}
.partner-label{font-size:10px;color:#a4b7bd;white-space:nowrap}
.partner-stingray{display:flex;align-items:center;min-height:44px;border-radius:4px}
.partner-stingray img{display:block;width:132px;height:auto}
.partner-divider{width:1px;height:28px;background:#3a535c}
.partner-sam{display:block;width:63px;height:auto}
.tv-page .bottom{padding-block:10px}
.footer-tools{display:flex;flex-direction:column;align-items:flex-end;gap:5px}
.footer-tools #bottom-status{font-size:10px;line-height:1.4}
.tv-page .footer-tools .diagnostics summary{min-height:36px;padding:8px 12px}
.tv-page .footer-tools .diagnostic-body{bottom:46px}
.menu-partners{border-top:1px solid #29434c;margin-top:30px;padding-top:22px}
.menu-partners .partner-credit{justify-content:center;gap:14px}
.menu-partners .partner-stingray img{width:116px}
.menu-partners .partner-sam{width:57px}
@media(max-width:900px){
 .tv-page .partner-credit{gap:12px}.tv-page .partner-stingray img{width:110px}.tv-page .partner-sam{width:54px}
}
@media(max-width:650px){
 .tv-page .bottom>.partner-credit{width:100%;justify-content:center;padding-bottom:12px;margin-bottom:2px;border-bottom:1px solid #29434c}
 .tv-page .bottom{justify-content:space-between}.tv-page .bottom .diagnostics{margin:0}
 .tv-page .footer-tools{gap:7px}
}
@media(max-width:370px){
 .menu-partners .partner-credit{gap:10px}.menu-partners .partner-stingray img{width:108px}.menu-partners .partner-sam{width:52px}
}
