/* Only the requested play area and original vector control icons. */
.control-icon{display:block;width:32px;height:32px;flex:none;pointer-events:none;filter:drop-shadow(0 1px 0 #220d18)}
.direction-pad button>.control-icon{width:32px;height:32px}
.action-pad button>.control-icon{width:24px;height:24px}
.action-pad .rotate small{transform:none}
@media(orientation:portrait),(max-width:649px){
 header{height:27px;padding-bottom:3px}
 .screen{padding:5px 6px 0}
 .hud{height:28px;gap:7px;padding:0 2px 4px}.hud b{font-size:14px}.hud small{font-size:7px}.hud progress{height:5px;margin-top:3px}.energy-box span{font-size:8px}
 .songline{height:28px;padding:3px 0;gap:5px}.songline .album{width:21px;height:21px}.song-select{min-height:24px;padding:3px 6px}.songline b{font-size:10px}.songline div>span{font-size:7px}
 .board-layout{padding-top:4px;gap:6px}.beat-meter{height:20px;padding:3px 0;gap:6px}.beat-meter>span{font-size:8px}
 .controls{height:198px;padding-top:0;padding-bottom:5px}.console-mark{height:14px;padding-top:3px;align-items:center;font-size:6px}.control-deck{height:166px;padding:3px 2px 7px}.controls footer{padding-top:2px;font-size:7px;line-height:1.3}.control-charm{top:0;height:22px}
 .direction-pad{height:130px}.action-pad{height:166px;gap:12px}.action-pad .drop,.action-pad .rotate{height:77px}.action-pad button small{font-size:18px}
}
/* Performance feedback and board-first layout. */
.cabinet>.stage{height:82px;margin-top:4px;flex-shrink:0}
.cabinet>.stage .stage-label{position:absolute;inset:2px 4px auto;z-index:3;pointer-events:none;font-size:6px;padding:0}
.cabinet>.stage .idols{height:calc(100% - 4px)}
.stage .sparkles{display:block;opacity:0;z-index:3;pointer-events:none;transition:opacity .2s}
.stage .stage-lights{filter:none;opacity:.12;background:conic-gradient(from 155deg at 15% 0,transparent,#ff315a99 18deg,transparent 40deg),conic-gradient(from 170deg at 85% 0,transparent,#ffe4b699 22deg,transparent 45deg)}
body[data-tier="1"] .stage-lights{opacity:.85;animation:stage-sweep 2s ease-in-out infinite alternate}
body[data-tier="1"] .stage .sparkles{opacity:.75}
body[data-tier="2"] .stage-lights{opacity:1;animation:stage-sweep .8s ease-in-out infinite alternate}
body[data-tier="2"] .stage .sparkles{opacity:1;animation:stage-twinkle .7s ease-in-out infinite alternate}
body[data-tier="2"] .stage{background-color:#551b33;box-shadow:inset 0 0 24px #f3397170,0 0 12px #f3476670}
.celebrate .stage{animation:stage-clear .65s ease-out}
.celebrate #clear-flash{animation:clear-bloom .22s ease-out;pointer-events:none}
@keyframes stage-sweep{to{transform:translateX(12%) scaleX(1.3)}}
@keyframes stage-twinkle{to{filter:drop-shadow(0 0 5px #ffd1dd);transform:translateY(-5px)}}
@keyframes stage-clear{30%{box-shadow:inset 0 0 40px #ff517ba0,0 0 18px #ed6982}}
@keyframes clear-bloom{0%{box-shadow:inset 0 0 24px #fff0d8;background:#ffe6ea18}100%{box-shadow:inset 0 0 0 transparent;background:transparent}}
@media(orientation:portrait),(max-width:649px){
 .cabinet>.stage{height:72px;margin-top:3px}
 .controls{height:199px;margin-top:3px;padding-left:6px;padding-right:6px}
 .console-mark{height:9px;padding-top:0}.control-deck{height:177px;padding-top:0;padding-bottom:0}
 .action-pad{height:176px;gap:22px}.action-pad .drop,.action-pad .rotate{height:77px}
 .controls footer{padding-top:0;line-height:1}
 .board-layout{gap:4px;padding-top:2px;position:relative}
 .live-card,.next-card{width:32px;padding-top:3px}.live-card .micro{display:none}.live-card>span{font-size:6px}.fan-chip{padding:3px 1px}.fan-chip small{font-size:6px}.next-card #next{width:30px;height:30px}.next-card>span{font-size:6px}
 .board-wrap{flex:1;max-width:none;height:100%;aspect-ratio:auto}
 .beat-meter{height:17px;padding:2px 0}.songline{height:25px}.songline .album{display:none}
}
@media(prefers-reduced-motion:reduce){.stage-lights,.stage .sparkles,.celebrate .stage,.celebrate #clear-flash{animation:none!important}}
@media(orientation:portrait),(max-width:649px){
 .songline>div:not(.album){display:flex;flex-direction:column;justify-content:center;gap:1px;min-width:0;height:23px}
 .songline b{line-height:11px;margin:0;white-space:nowrap}
 .songline div>span{display:block;line-height:8px;margin:0;white-space:nowrap}
}
/* Small live-house stage: curtains, truss, footlights and audience. */
.cabinet>.stage{margin-top:3px;margin-bottom:1px;background:radial-gradient(ellipse at 50% 120%,#a6305360,transparent 70%),linear-gradient(90deg,#430f22 0 9%,#180f19 14% 86%,#430f22 91%);border:1px solid #6e3b4b;border-bottom:4px solid #201018;box-shadow:inset 0 -9px #3c1d2c,inset 0 2px #a7746b55;isolation:isolate}
.cabinet>.stage::before{left:0;top:9px;bottom:7px;width:16px;border:0;background:repeating-linear-gradient(90deg,#681c35 0 3px,#290d1b 4px 7px);clip-path:polygon(0 0,100% 0,80% 70%,100% 100%,0 100%);z-index:1}
.cabinet>.stage::after{right:0;top:9px;bottom:7px;width:16px;border:0;background:repeating-linear-gradient(90deg,#290d1b 0 3px,#681c35 4px 7px);clip-path:polygon(0 0,100% 0,100% 100%,0 100%,20% 70%);z-index:1}
.cabinet>.stage .stage-lights{border-top:4px solid #4b3c49;background:radial-gradient(circle at 18% 0,#ffe5bf 0 2px,transparent 3px),radial-gradient(circle at 50% 0,#ff8aa4 0 2px,transparent 3px),radial-gradient(circle at 82% 0,#ffe5bf 0 2px,transparent 3px),conic-gradient(from 158deg at 20% 0,transparent,#d9326655 18deg,transparent 36deg),conic-gradient(from 170deg at 80% 0,transparent,#d8b9a855 25deg,transparent 45deg);opacity:.55}
.cabinet>.stage .crowd{display:block;position:absolute;bottom:0;left:0;right:0;height:10px;line-height:10px;background:radial-gradient(ellipse at 8px 12px,#0c090e 0 8px,transparent 9px) 0 0/25px 15px;color:#da6d94;font-size:9px;z-index:4;border:0;opacity:.65}
.cabinet>.stage .idols{bottom:4px;height:calc(100% - 8px)}
body[data-event="formal"] .stage{border-color:#bf8c77;box-shadow:inset 0 -9px #502739,inset 0 2px #dbaf82aa}
body[data-event="formal"] .stage .crowd{letter-spacing:1px;color:#ffe1a5;opacity:1}
body[data-event="formal"] .stage .stage-lights{opacity:.9}
.track-card.locked{opacity:.62}.unlock-note{color:#e1acbb!important;font-size:10px!important;margin:7px 0!important}
.completion{color:#f1c5a9}.overlay .hint{white-space:pre-line}
/* Two venue scenes, selected by performance phase. */
body[data-event="opening"] .cabinet>.stage{background:#21121d url('stage-livehouse-industrial.svg') center/cover no-repeat;border-color:#6e3b4b;box-shadow:none}
body[data-event="formal"] .cabinet>.stage{background:#aa9172 url('stage-school.svg') center/cover no-repeat;border-color:#ba9676;box-shadow:none}
.cabinet>.stage::before,.cabinet>.stage::after{display:none}
body[data-event="formal"] .stage .stage-label{color:#463032;text-shadow:0 1px #f6e5c0}
body[data-event="formal"] .stage .stage-label span:last-child{color:#463032}
body[data-event="formal"] .stage .stage-lights{border:0;background:conic-gradient(from 158deg at 20% 0,transparent,#fff4c860 18deg,transparent 36deg),conic-gradient(from 170deg at 80% 0,transparent,#ffe4af60 25deg,transparent 45deg)}
body[data-event="formal"] .stage .crowd{background:none;color:#f7df91}
body[data-tier="2"] .cabinet>.stage{box-shadow:inset 0 0 24px #f3397170,0 0 12px #f3476670}
.celebrate .cabinet>.stage{animation:stage-clear .65s ease-out}
/* Debug toolbar sits outside the cabinet and appears only on localhost. */
#local-debug{position:fixed;right:12px;bottom:12px;z-index:100;display:flex;align-items:center;gap:8px;padding:9px 11px;border:1px dashed #af7b88;border-radius:8px;background:#211b24f5;color:#d8bac5;font:11px sans-serif;box-shadow:0 3px 12px #0006}
#local-debug button{min-height:36px;padding:6px 11px;border:1px solid #b27787;border-radius:6px;background:#663044;color:#ffe5ec;font:12px sans-serif;cursor:pointer}
@media(max-width:700px){body:has(#local-debug:not([hidden])) .cabinet{height:calc(100dvh - 55px)}#local-debug{bottom:4px;left:6px;right:6px;justify-content:space-between;padding:5px 9px}}
/* Timing targets and landing feedback use the existing palette. */
.beat-track{background:linear-gradient(90deg,#eac39488 0 10%,#33233b 19% 81%,#eac39488 90% 100%)}
.grounded .board-wrap{box-shadow:0 0 0 1px #efb2c9,inset 0 -6px 15px #d653772a}
.tap-hit[data-judgement="perfect"] #judge{color:#ffe3ac;text-shadow:0 0 9px #f7b97188,1px 1px #24111f}
.tap-hit[data-judgement="good"] #judge{color:#e2bfd9}
.tap-hit[data-judgement="error"] #judge{color:#ed8598}
.tap-hit .beat-track{box-shadow:0 0 7px #f0b9c3aa}
/* Compact band formation; preserve stage and game layout dimensions. */
.cabinet>.stage .idols{left:50%;right:auto;transform:translateX(-50%);width:min(74%,230px);justify-content:center;gap:0}
.cabinet>.stage .idol{flex:0 0 33.333%;width:33.333%;height:100%}
.cabinet>.stage .idol .sprite{background-image:url('idols-stage-band.png')}
.cabinet>.stage .idol>span{font-size:9px;line-height:12px;padding:0 3px}
.stage-notes{position:absolute;inset:8px 5px 10px;z-index:3;pointer-events:none;overflow:hidden;opacity:0;transition:opacity .15s}
.floating-note{position:absolute;bottom:0;width:11px;height:16px;color:#f1b8ce;filter:drop-shadow(0 0 3px #d7648b66);opacity:0;animation:band-note-rise var(--note-duration,2.6s) linear infinite;animation-delay:var(--note-delay);animation-play-state:paused}
.floating-note:nth-child(2n){color:#f3d398;width:13px;height:18px}
.performing .stage-notes{opacity:1}.performing .floating-note{animation-play-state:running}
body[data-tier="2"] .floating-note{filter:drop-shadow(0 0 4px #ffd0d9)}
@keyframes band-note-rise{0%{transform:translate(0,5px) rotate(-12deg);opacity:0}15%{opacity:.85}75%{opacity:.65}100%{transform:translate(var(--note-drift),-48px) rotate(15deg);opacity:0}}
@media(prefers-reduced-motion:reduce){.performing .floating-note{animation:none;opacity:.5;bottom:18px}}
/* A full ending comic, read by scrolling rather than dialogue pagination. */
.after-story.ending-comic{display:block;overflow:auto;overscroll-behavior:contain;padding:16px 12px 22px;background:#1b1816;text-align:left}
.ending-comic .ending-header{height:auto;display:block;text-align:center;margin:0 auto 14px;max-width:620px;padding:0;color:#d9c2a2}
.ending-header>span{font:10px monospace;letter-spacing:1px}.ending-header h2{font:23px var(--story-font,serif);margin:9px 0}.ending-header p{font-size:11px;color:#b79c87;margin:0}
#ending-pages{max-width:620px;margin:0 auto;width:100%}.ending-full-page{display:block;width:100%;height:auto;border:1px solid #8a7359}
.ending-actions{display:flex;gap:12px;justify-content:center;max-width:620px;margin:20px auto 0}.ending-actions button{min-height:44px;flex:1;max-width:220px}.ending-actions button:last-child{background:#743044}
.ending-mini-panel{position:relative;min-height:160px;border:2px solid #8c7760;overflow:hidden;margin:0 0 13px;background:linear-gradient(#19121ec9,#281824b8),url('stage-livehouse.svg') center/cover;display:flex;align-items:center;padding:12px;gap:8px}
.ending-mini-panel:nth-child(2n){margin-left:15px;transform:rotate(.6deg)}.ending-mini-portrait{flex:0 0 95px;height:95px;background:url('idols-stage-dolls.png') 0 center/300% 100%;image-rendering:pixelated}
.ending-mini-bubble{background:#f1e5cf;color:#38262b;border-radius:50%;padding:16px 18px;flex:1;text-align:center;min-width:0;border:1px solid #4a3530}.ending-mini-bubble b{font-size:10px;color:#785449}.ending-mini-bubble p{font-size:13px;line-height:1.7;margin:5px 0}
.panel-tone-0{filter:saturate(.5)}.panel-tone-0 .ending-mini-portrait{opacity:.7}.ending-milestone{padding:14px;border:1px solid #8a7359;color:#e0c5a7;font-size:13px;line-height:1.8}
@media(max-width:380px){.ending-mini-panel{padding:8px;gap:2px}.ending-mini-portrait{flex-basis:70px;height:85px}.ending-mini-bubble{padding:14px 12px}.ending-mini-bubble p{font-size:12px}}
@media(prefers-reduced-motion:reduce){.ending-mini-panel:nth-child(2n){transform:none}}
