/* V2.3 uses the existing controls, floor and responsive layout. */
.training-setup{max-width:720px;margin:0 auto 12px;padding:12px;border:1px solid #514561;border-radius:12px;display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;width:100%;box-sizing:border-box}
#training-settings{grid-column:1/-1;display:grid;grid-template-columns:1.3fr 1fr;gap:10px}
#salsa-settings{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#training-settings label{display:block;font-size:14px;min-width:0}
.training-setup select{display:block;width:100%;min-width:0;min-height:44px;font-size:14px;background:#191522;color:#f4f0e7;border:1px solid #67536e;border-radius:8px;padding:8px}
#training-help{grid-column:1/-1;margin:0;font-size:14px;color:var(--lime)}
.training-setup .setting-title,.training-setup #bpm,.training-setup .range-labels{grid-column:1/-1;margin:0}
#training-status{text-align:center;font-size:14px;margin:8px auto;max-width:95%;overflow-wrap:anywhere}
.ninja-note{display:none;text-align:center;font-size:14px;padding:8px}
body[data-training="ninja"] .ninja-note{display:block}
body[data-game-state="playing"] .training-setup,body[data-game-state="paused"] .training-setup,body[data-game-state="finished"] .training-setup,body[data-game-state="loading"] .training-setup{display:none}
body[data-training="ninja"] #notes,body[data-training="ninja"] .wave-panel,body[data-training="ninja"] .sequence,body[data-training="ninja"] .finger-guide,body[data-training="ninja"] #cycle,body[data-training="ninja"] #progress,body[data-training="ninja"] .play-hint{display:none!important}
body[data-training="ninja"] [data-foot]{animation:none!important}
.break-step{outline:2px solid var(--lime);outline-offset:-2px}
.result-config{font-size:14px;line-height:1.5;margin:4px 0 10px;overflow-wrap:anywhere}
[hidden]{display:none!important}
@media(max-width:420px){#training-settings{grid-template-columns:1fr}.training-setup{padding:9px;gap:6px}#training-help{font-size:13px}}
/* Added setup rows must not consume the original floor's fractional grid row. */
.compact-game > main{display:flex;flex-direction:column;overflow-y:auto}
.compact-game .intro,.compact-game .quick-controls,.training-setup,#training-status,.ninja-note,.compact-game .sequence{flex-shrink:0}
.compact-game .workspace{flex:1;min-height:360px}
.compact-game[data-game-state="idle"] .workspace,.compact-game[data-game-state="challenge"] .workspace{min-height:430px}
.compact-game[data-training="ninja"] .game-card{grid-template-rows:46px minmax(0,1fr) 96px 44px 3px}
.compact-game[data-training="ninja"] .stats>div:last-child{display:none}
.compact-game .ninja-note{margin:0;padding:0}
@media(max-width:620px){.compact-game[data-training="ninja"] .game-card{grid-template-rows:42px minmax(0,1fr) 88px 42px 3px}}
@media(max-height:480px){.compact-game .workspace{min-height:260px}.compact-game[data-training="ninja"] .game-card{grid-template-rows:30px minmax(0,1fr) 60px 36px 3px}}
.training-setup #training-settings{grid-row:1;grid-column:1/-1}
.training-setup .setting-title{grid-row:2;grid-column:1/-1}
.training-setup #bpm{grid-row:3;grid-column:1/-1}
.training-setup .range-labels{display:flex;grid-row:4;grid-column:1/-1}
.training-setup .difficulty-label{display:block;grid-row:5;grid-column:1/-1;margin:0;font-size:14px}
.training-setup #difficulty{grid-row:6;grid-column:1/-1}
.compact-game[data-game-state="challenge"] .training-setup{display:none}

/* Two role illustrations share the existing input-driven dancer rig. */
.follower-art{display:none}
body[data-dance-role="follower"] .follower-art{display:block}
body[data-dance-role="follower"] .leader-art{display:none}
#dancer #torso{fill:url(#shirt-shade);stroke:#83d6d0}
body[data-dance-role="follower"] #dancer #torso{fill:url(#dress-shade);stroke:#f4a6c0}
#dancer #body .head{fill:#e8bb91}
#dancer #leg-l,#dancer #leg-r{stroke-width:10}
#dancer{filter:drop-shadow(0 4px 5px #0005)}
#salsa-settings:has(#timing-setting[hidden]){grid-template-columns:1fr}

/* The floor stays on screen; all configuration lives in the settings dialog. */
.compact-game > main{overflow:hidden}
.compact-game .workspace,.compact-game[data-game-state="idle"] .workspace,.compact-game[data-game-state="challenge"] .workspace{min-height:0}
.compact-game .quick-controls{justify-content:flex-end}
.compact-game #training-status{margin:0 auto;font-size:13px;line-height:1.3}
.compact-game #game-settings .training-setup{display:grid;margin:0 0 14px}
#game-settings .training-setup .styles{grid-column:1/-1;grid-row:1;display:flex;margin:0;gap:8px}
#game-settings .training-setup .styles button{flex:1;min-height:44px}
#game-settings .training-setup #training-settings{grid-row:2}
#game-settings .training-setup .setting-title{grid-row:3}
#game-settings .training-setup #bpm{grid-row:4}
#game-settings .training-setup .range-labels{grid-row:5}
#game-settings .training-setup .difficulty-label{grid-row:6}
#game-settings .training-setup #difficulty{grid-row:7}
@media(max-height:700px){.compact-game .intro p,.compact-game .play-hint{display:none}.compact-game > main{gap:6px}}
@media(max-height:480px){.compact-game .quick-controls{position:absolute;right:12px;top:48px;z-index:2}.compact-game #training-status{padding-right:130px;min-height:36px;display:flex;align-items:center;margin:0;font-size:12px}.compact-game .ninja-note{display:none}.compact-game .workspace{min-height:0}}

/* Pause is an opaque, readable state above the frozen playfield. */
.compact-game[data-game-state="paused"] #overlay{background:#12121c;inset:0;z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px;gap:10px;text-align:center}
.compact-game[data-game-state="paused"] #overlay-title{font-size:clamp(28px,7vw,46px);margin:0;line-height:1.1}
.compact-game[data-game-state="paused"] #overlay-text{font-size:14px;line-height:1.45;color:#f4d68c;margin:0;max-width:30ch}
.compact-game[data-game-state="paused"] #overlay .mini,.compact-game[data-game-state="paused"] #overlay-caption,.compact-game[data-game-state="paused"] #feedback,.compact-game[data-game-state="paused"] .dance-stage{display:none!important}
.compact-game[data-game-state="paused"] #start{min-height:44px;margin:0}
.compact-game[data-game-state="paused"] #game-settings .paused-note{display:block;background:#292217;border:1px solid #a4813c;border-left:4px solid #e5b74e;border-radius:8px;color:#ffe6ad;padding:14px;font-size:15px;line-height:1.5;margin:0 0 16px}
.compact-game[data-game-state="paused"] #settings-title{font-size:32px;color:#f1cf75}
@media(max-height:480px){.compact-game[data-game-state="paused"] #overlay{gap:5px;padding:6px}.compact-game[data-game-state="paused"] #overlay-title{font-size:24px}.compact-game[data-game-state="paused"] #overlay-text{font-size:12px}}

.guate-badge{display:inline-flex;align-items:center;gap:6px;color:#c8c3d5;font-size:12px;line-height:1.2;margin-right:auto}
.guate-badge>span{font-size:20px}
#game-settings .training-setup #difficulty-explanation{grid-column:1/-1;grid-row:8;margin:4px 0 0;font-size:14px;line-height:1.5;color:#e7e1ef}
#game-settings .training-setup #tolerance{grid-column:1/-1;grid-row:9;margin:0;border-left:3px solid #e5b74e;padding:8px 10px;background:#292217;color:#ffe6ad;font-size:14px;line-height:1.5}
@media(max-height:480px){.guate-badge{display:none}}

#game-settings #timing-window-help{grid-column:1/-1;grid-row:10;margin:0;font-size:13px;line-height:1.5;color:#c8c3d5}

/* Rhythm choices remain on the floor; secondary settings stay in the dialog. */
.compact-game .rhythm-shortcuts{display:flex;flex-shrink:0;gap:6px;margin:0;width:100%}
.compact-game .rhythm-shortcuts button{flex:1;min-height:40px;font-size:13px;padding:6px;border:1px solid #514561;border-radius:8px;background:#191522;color:#eee}
.compact-game .rhythm-shortcuts button.selected{background:#24423f;border-color:#68f5db;color:#d8fff7}
.break-step{outline-color:#68f5db}
.compact-game .dance-stage #step-label{display:none}
.compact-game .dance-stage p{display:none}
.compact-game #step-label.floor-step-label{position:static;display:block;flex-shrink:0;min-height:16px;line-height:16px;margin:0;text-align:center;font-size:12px;color:#c8c3d5}
@media(max-height:650px){.compact-game .rhythm-shortcuts button{min-height:34px}.compact-game #step-label.floor-step-label{display:none}}
@media(max-height:480px){.compact-game .rhythm-shortcuts{max-width:60%;position:absolute;top:48px;left:12px;z-index:2}.compact-game #training-status{padding-top:40px}}
.compact-game button:focus-visible,.compact-game a:focus-visible,.compact-game select:focus-visible,.compact-game input:focus-visible,.compact-game .arena:focus-visible{outline-color:#68f5db}

/* A brief landing-pad glow marks the current foot, with no marks on falling tiles. */
body[data-training="visual"][data-game-state="playing"] .arena:has(.note.aligned:not(.r):not([hidden])) .impact>span:first-child,
body[data-training="visual"][data-game-state="playing"] .arena:has(.note.aligned.r:not([hidden])) .impact>span:last-child{background:#19483f;border-color:#9dffe9;color:#fff;box-shadow:0 0 0 3px #68f5db55,0 0 22px #68f5dbbb;transform:translateX(-50%) scale(1.06)}
@media(prefers-reduced-motion:reduce){.compact-game .impact>span{transform:translateX(-50%)!important}}
.note.break-step{outline:none}

/* A projected floor reacts to the player's own input, never to upcoming beats. */
#dance-mat polygon{fill:#171c2b;stroke:#7b87aa;stroke-width:1.2;stroke-linejoin:round}
#dance-mat polygon.stepped{fill:var(--cell-color);stroke:#fff;filter:drop-shadow(0 0 5px var(--cell-color))}
.compact-game[data-game-state="playing"] .dance-stage{top:15%;bottom:4%;width:62%;max-width:360px}
.compact-game .dance-stage #dancer{height:100%;max-height:none}
.compact-game #feedback{top:2%;z-index:4;font-size:24px}
.compact-game #step-label.floor-step-label{font-size:12px;line-height:16px;min-height:16px}
@media(max-width:600px){.compact-game[data-game-state="playing"] .dance-stage{width:68%;top:17%;bottom:3%}.compact-game #feedback{font-size:20px}}
.compact-game[data-game-state="playing"] .dance-stage{top:0;bottom:0;width:72%;max-width:390px}
.compact-game[data-game-state="playing"] #feedback{top:0;transform:translateY(-12%)}

#dance-mat .mat-number{display:block;fill:#e8e5f4;font-size:10px;font-weight:700;paint-order:stroke;stroke:#12121c;stroke-width:2px}
#dance-mat polygon{fill:color-mix(in srgb,var(--cell-color) 14%,#171c2b);stroke:color-mix(in srgb,var(--cell-color) 70%,#fff)}
.compact-game[data-game-state="playing"] #feedback{transform:translate(-50%,-12%)}

.guate-badge small{display:block;font-size:10px;line-height:1.4;color:#a8a3b6}
.guate-badge>span:last-child{font-size:12px}
.note.break-step{outline:2px solid #68f5db;outline-offset:2px;box-shadow:0 0 9px #68f5db44}
.note.break-step b{color:#baffee;font-weight:900}
.note.tap small{background:#171725;border:1px solid #bbb4d3;border-radius:4px;padding:1px 4px;color:#fff}
.clap-arms{display:none}
#dancer.clapping .clap-arms{display:block}
#dancer.clapping .dancer-arms,#dancer.clapping .shirt-sleeves{visibility:hidden}
.compact-game[data-game-state="playing"] #feedback{top:3%;left:50%;transform:translateX(-50%);font-size:16px;line-height:1.2;padding:3px 9px;border-radius:12px;background:#11111dcc;max-width:120px;white-space:nowrap;pointer-events:none}
.compact-game #feedback:empty{display:none}
.compact-game[data-game-state="playing"] .dance-stage{top:12%;bottom:0}
#feedback-detail{min-height:15px;text-align:center;font-size:12px;line-height:15px;color:#bfb9ce;flex-shrink:0}
#feedback-detail:empty{min-height:0}
body[data-game-state="paused"] #feedback-detail{visibility:hidden}
#feedback-detail:empty{min-height:15px}

/* Results own the card; inactive gameplay rows must not consume its height. */
.compact-game[data-game-state="finished"] .game-card{grid-template-rows:minmax(0,1fr) 44px 3px;overflow:hidden}
.compact-game[data-game-state="finished"] .stats,
.compact-game[data-game-state="finished"] .wave-panel,
.compact-game[data-game-state="finished"] .touch-controls,
.compact-game[data-game-state="finished"] .sequence,
.compact-game[data-game-state="finished"] #step-label.floor-step-label,
.compact-game[data-game-state="finished"] #feedback-detail{display:none}
.compact-game[data-game-state="finished"] .arena{min-height:0;overflow-y:auto;touch-action:pan-y;overscroll-behavior:contain}
.compact-game[data-game-state="finished"] .start-overlay{position:relative;inset:auto;min-height:100%;height:auto;max-height:none;overflow:visible;padding:16px 12px 24px;gap:10px;touch-action:pan-y}
.compact-game .demo-button{width:min(100%,260px);border-color:#79bfff;color:#79bfff;background:#79bfff12}
.compact-game .demo-button:hover,.compact-game .demo-button:focus-visible{background:#79bfff28}
.compact-game[data-game-state="finished"] .start-overlay h2{margin:0;line-height:1.15}
.compact-game[data-game-state="finished"] .result-config{margin:0 0 8px;line-height:1.4}
.compact-game[data-game-state="finished"] #start{min-height:44px;width:min(100%,260px);min-width:0}
.compact-game[data-game-state="finished"] #overlay-caption{margin:0}
.compact-game[data-game-state="finished"] #pause{display:none}

/* A small inward arm gesture keeps the rear-view shirt and shoulders intact. */
#dancer.clapping .clap-arms{transform-origin:130px 84px;animation:arm-pulse 220ms ease-in-out}
@keyframes arm-pulse{0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}
@media(prefers-reduced-motion:reduce){#dancer.clapping .clap-arms{animation:none}}

#dancer.clapping .side-arm{transform:rotate(-14deg);transform-origin:124px 84px}
body[data-dance-role="follower"] #profile-body>path:first-child,body[data-dance-role="follower"] #overhead-body>ellipse:first-child{fill:#c14e80;stroke:#f4a6c0}

/* Smoothly transfer the torso and connected hips onto the supporting foot. */
#dancer #body,#profile-body,#overhead-body{transition:transform 180ms ease-in-out}
#dancer #leg-l,#dancer #leg-r{transition:d 180ms ease-in-out}
@media(prefers-reduced-motion:reduce){#dancer #body,#profile-body,#overhead-body,#dancer #leg-l,#dancer #leg-r{transition:none}}

/* Final compact layout: reserve the screen for the dance floor. */
.compact-game > main{gap:6px;padding-top:8px;max-width:1400px}
.compact-game .intro{margin:0;min-height:0}
.compact-game .intro h1{font-size:32px;margin:0}
.compact-game .intro p,.compact-game .play-hint{display:none}
.compact-game .quick-controls{position:static;display:flex;gap:8px;min-height:40px}
.compact-game #rhythm-select{width:145px;min-height:40px;padding:7px 10px;margin:0;background:#203631;border:1px solid #68d8c0;border-radius:9px;font-size:14px;color:#f4f0e7}
.compact-game #open-settings{min-height:40px;padding:7px 12px;font-size:13px}
.compact-game #training-status{padding:0;margin:0;min-height:0;font-size:11px}
.compact-game .game-card{grid-template-rows:38px 44px minmax(0,1fr) 68px 38px 3px}
.compact-game[data-training="ninja"] .game-card{grid-template-rows:38px minmax(0,1fr) 68px 38px 3px}
.compact-game #waveform{height:28px}
.compact-game .wave-panel{padding:2px 10px 0}
.compact-game .touch-controls{padding:5px 10px}
.compact-game .touch-controls button{min-height:54px}
.compact-game .sequence{margin:0;padding:0;min-height:30px}
.compact-game .sequence>div:first-child{display:none}
.compact-game .beat{padding:2px 0}
.compact-game .beat b{font-size:16px}
.compact-game .beat small{font-size:9px}
.compact-game[data-game-state="playing"] .dance-stage{top:3%;bottom:0;width:82%;max-width:520px}
.compact-game .feedback-strip{display:flex;justify-content:center;align-items:center;gap:10px;min-height:24px;flex-shrink:0;overflow:hidden}
.compact-game .feedback-strip #feedback{position:static;transform:none;animation:none;max-height:none;max-width:none;width:auto;margin:0;padding:0;background:none;white-space:nowrap;font-size:15px;line-height:22px;contain:none}
.compact-game .feedback-strip #feedback-detail{min-height:0;line-height:22px;font-size:12px}
.compact-game[data-game-state="finished"] .feedback-strip{display:none}
.compact-game #step-label.floor-step-label{font-size:11px;line-height:14px;min-height:14px}
#dancer #foot-l,#dancer #foot-r{transition:cx 180ms ease-in-out,cy 180ms ease-in-out}
@media(prefers-reduced-motion:reduce){#dancer #foot-l,#dancer #foot-r{transition:none}}
@media(max-width:600px){
 .compact-game > main{padding:6px 8px;gap:4px}
 .compact-game .intro h1{font-size:25px}
 .compact-game .guate-badge{position:absolute;right:10px;top:59px;font-size:9px}
 .compact-game .guate-badge>span:last-child{font-size:9px}
 .compact-game .guate-badge small{font-size:8px}
 .compact-game .quick-controls{justify-content:space-between}
 .compact-game #rhythm-select{flex:1;width:auto}
 .compact-game .game-card{grid-template-rows:34px 36px minmax(0,1fr) 60px 36px 3px}
 .compact-game[data-training="ninja"] .game-card{grid-template-rows:34px minmax(0,1fr) 60px 36px 3px}
 .compact-game #waveform{height:22px}
 .compact-game .touch-controls button{min-height:48px}
}
.compact-game[data-game-state="finished"] .game-card{grid-template-rows:minmax(0,1fr) 38px 3px}
.compact-game .feedback-strip{width:100%;align-self:stretch}
.compact-game .quick-controls #open-settings{margin-left:0}

/* Optional next steps belong after results and inside help, never over the game. */
#overlay .studio-invitation{display:none}
.compact-game[data-game-state="finished"] #overlay .studio-invitation{display:block;flex-shrink:0}
.studio-invitation{width:min(100%,470px);margin:12px auto 0;padding:14px 8px 0;border-top:1px solid #ffffff20;text-align:center}
.studio-invitation strong{font-size:15px;color:#eee9f3}
.compact-game .studio-invitation p{font-size:13px;line-height:1.5;color:#bfb9ca;margin:6px 0}
.studio-invitation a{display:block;padding:10px 4px;font-size:13px;line-height:1.4;color:#8de7d4;text-underline-offset:3px;border-radius:5px}
.studio-invitation a:hover{color:white;background:#ffffff08}
.studio-invitation a.project-support{font-size:12px;color:#bfb9ca}
#game-settings .studio-invitation{margin-top:20px}

/* Keep TAP beside the tile, away from its count and footprint. */
.compact-game .note.tap small{top:50%;left:auto;right:calc(100% + 5px);bottom:auto;transform:translateY(-50%);white-space:nowrap;font-size:9px;line-height:14px;letter-spacing:0;padding:1px 3px;pointer-events:none}
.compact-game .note.tap.r small{right:auto;left:calc(100% + 5px)}

/* A clear verdict badge occupies its own row, never the dance floor. */
.compact-game .feedback-strip{min-height:36px;gap:12px}
.compact-game .feedback-strip #feedback:not(:empty){display:block;min-width:108px;text-align:center;font-size:20px;font-weight:900;letter-spacing:.035em;line-height:28px;padding:2px 10px;border:1px solid currentColor;border-radius:8px;background:#24212e}
.compact-game .feedback-strip #feedback[data-verdict="perfect"]{color:#8dffe0!important;background:#123e34;border-color:#67e3bb}
.compact-game .feedback-strip #feedback[data-verdict="good"]{color:#b9dcff!important;background:#193149;border-color:#79bfff}
.compact-game .feedback-strip #feedback[data-verdict="miss"]{color:#ffd0c8!important;background:#482329;border-color:#ff938d}
.compact-game .feedback-strip #feedback-detail{font-size:12px;line-height:16px;max-width:24ch}
@media(max-width:400px){.compact-game .feedback-strip #feedback:not(:empty){font-size:18px;min-width:100px}.compact-game .feedback-strip{gap:8px}}

/* Verdicts stay below the hit line and flash only the relevant input pad. */
#edge-feedback{position:absolute;bottom:5px;left:8px;z-index:5;pointer-events:none;font-size:11px;font-weight:900;line-height:20px;padding:2px 6px;border-radius:6px;max-width:23%;white-space:nowrap;color:#fff;background:#174334;border:1px solid #80efc9}
#edge-feedback[data-side="right"]{left:auto;right:8px}
#edge-feedback[data-verdict="good"]{background:#1d3852;border-color:#94cfff}
#edge-feedback[data-verdict="miss"]{background:#5b2029;border-color:#ff9a9a}
#edge-feedback:empty,body:not([data-game-state="playing"]) #edge-feedback{display:none}
.compact-game .touch-controls button.result-miss{background:#7c2633!important;border-color:#ffacac!important;color:#fff!important;box-shadow:inset 0 0 0 2px #ff8080,0 0 14px #ff5d5d66!important}
.compact-game .touch-controls button.result-perfect{background:#16513f!important;border-color:#8bffd4!important;color:#fff!important;box-shadow:inset 0 0 0 2px #5ddbb0!important}
.compact-game .touch-controls button.result-good{background:#21486a!important;border-color:#b2deff!important;color:#fff!important;box-shadow:inset 0 0 0 2px #78b8ee!important}

.haptic-setting{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:14px 0;font-size:14px}.haptic-setting input{width:20px;height:20px;accent-color:#68dfca}.haptic-setting small{width:100%;color:#bfb9ca;font-size:12px}

/* Expose the existing role control without duplicating its state or handlers. */
.compact-game .quick-role{display:block;margin:0;font-size:0;flex:0 1 150px;min-width:0}
.compact-game .quick-role #role{width:100%;min-height:40px;margin:0;padding:7px 8px;font-size:14px;background:#282237;border:1px solid #a48ac7;border-radius:9px;color:#f4f0e7}
#salsa-settings{grid-template-columns:1fr}
@media(max-width:600px){
 .compact-game .quick-controls{gap:5px}
 .compact-game #rhythm-select{flex:1 1 100px;min-width:0;font-size:12px;padding:7px 5px}
 .compact-game .quick-role{flex:1 1 105px}
 .compact-game .quick-role #role{font-size:12px;padding:7px 4px}
 .compact-game #open-settings{flex:0 1 112px;padding:7px 5px;font-size:11px}
}
/* Larger mobile touch targets and clearer left/right labels. */
@media(max-width:600px){
 .compact-game .game-card{grid-template-rows:34px 36px minmax(0,1fr) 78px 36px 3px}
 .compact-game[data-training="ninja"] .game-card{grid-template-rows:34px minmax(0,1fr) 78px 36px 3px}
 .compact-game .touch-controls{padding:6px 8px;gap:10px}
 .compact-game .touch-controls button{min-height:64px;font-size:16px;font-weight:800;border-radius:12px}
 .compact-game .touch-controls button small{font-size:11px}
 .compact-game[data-game-state="finished"] .game-card{grid-template-rows:minmax(0,1fr) 38px 3px}
}
/* Final alignment pass: matching controls and compact small-screen start panel. */
.compact-game .quick-controls{display:grid;grid-template-columns:minmax(0,1fr) repeat(3,150px);align-items:center;gap:8px}
.compact-game .quick-controls #rhythm-select,.compact-game .quick-role,.compact-game .quick-controls #open-settings{width:100%;min-width:0;margin:0}
.compact-game .quick-controls #rhythm-select,.compact-game .quick-role #role,.compact-game .quick-controls #open-settings{height:40px;border-radius:9px;font-size:13px}
.compact-game .touch-controls button{flex:1 1 0;min-width:0}
.compact-game .result-grid>span{display:flex;flex-direction:column;justify-content:center;min-height:58px;border-radius:8px}
@media(max-width:600px){
 .compact-game .quick-controls{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
 .compact-game .quick-controls #rhythm-select,.compact-game .quick-role #role,.compact-game .quick-controls #open-settings{font-size:11px;padding:6px 4px}
}
@media(max-width:600px) and (max-height:620px){
 .compact-game[data-game-state="idle"] .start-overlay{gap:5px;padding:6px;justify-content:center}
 .compact-game[data-game-state="idle"] #overlay-title{font-size:22px;line-height:1.1;margin:0}
 .compact-game[data-game-state="idle"] #overlay-text{font-size:11px;line-height:1.3}
 .compact-game[data-game-state="idle"] #start{min-width:0;width:100%;min-height:40px;font-size:12px;padding:8px 5px}
 .compact-game[data-game-state="idle"] #start span{margin-left:5px}
}
/* Readable, equally sized transport actions on desktop and phones. */
.compact-game .transport{display:flex;align-items:center;gap:6px;padding:3px 8px;flex-wrap:nowrap}
.compact-game .transport>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.compact-game .transport button{flex:0 0 106px;min-height:30px;padding:5px 8px;border-radius:7px;font-size:12px;font-weight:700;line-height:18px;border:1px solid transparent}
.compact-game .transport #pause{background:#245448;color:#dffff2;border-color:#70d7b7}
.compact-game .transport #restart{background:#54401c;color:#fff0c4;border-color:#e5bb62}
.compact-game .transport #home{background:#39305b;color:#f0e9ff;border-color:#bba2ef}
.compact-game .transport button:hover:not(:disabled){filter:brightness(1.2)}
.compact-game .transport button:disabled{opacity:.4}
@media(max-width:600px){
 .compact-game .transport{gap:6px;padding:3px 8px}
 .compact-game .transport>span{display:none}
 .compact-game .transport button{flex:1 1 0;min-width:0;font-size:12px;padding:4px 3px;min-height:30px}
}

.compact-game .intro h1 .game-version{display:inline-block;vertical-align:middle;margin-left:8px;padding:3px 5px;border:1px solid #53615f;border-radius:5px;font:600 10px/1.2 system-ui,sans-serif;letter-spacing:0;color:#a5dfd2}
@media(max-width:360px){.compact-game .intro h1{font-size:21px}.compact-game .intro h1 .game-version{font-size:8px;margin-left:4px;padding:2px 3px}.compact-game .guate-badge>span:first-child{display:none}.compact-game .guate-badge>span:last-child{font-size:8px}.compact-game .guate-badge small{font-size:7px}}

.compact-game .result-receipt{font-size:11px;line-height:1.5;color:#bfb9ca;overflow-wrap:anywhere;margin:10px 0 0;font-variant-numeric:tabular-nums}

.desktop-shortcuts{display:none}@media(min-width:801px) and (min-height:650px){.desktop-shortcuts{display:block;flex-shrink:0;text-align:center;color:#bfb9ca;font-size:11px;line-height:16px;margin:0}}

/* Keep the complete dance diagram between independent falling-note lanes. */
.compact-game .arena{--lane-left:15%;--lane-right:85%}
.compact-game .lane-labels>span,.compact-game .impact>span{position:absolute;left:var(--lane-left);transform:translateX(-50%)}
.compact-game .lane-labels>span:last-child,.compact-game .impact>span:last-child{left:var(--lane-right)}
.compact-game[data-game-state="playing"] .dance-stage{left:50%;width:calc(70% - 90px);max-width:440px;top:4%;bottom:4%}
.compact-game .dance-stage #dancer{overflow:hidden}
.compact-game .impact{border-top:0;background:none}
.compact-game .impact>span{border-top-width:3px}
@media(max-width:600px){
 .compact-game .arena{--lane-left:36px;--lane-right:calc(100% - 36px)}
 .compact-game[data-game-state="playing"] .dance-stage{width:calc(100% - 152px);max-width:none;top:5%;bottom:5%}
 .compact-game .note{width:54px;margin-left:-27px;gap:3px}
 .compact-game .note svg{width:22px}
 .compact-game .impact>span{width:54px}
 .compact-game .lane-labels{font-size:8px;letter-spacing:.4px}
 .compact-game .note.tap small,.compact-game .note.tap.r small{left:50%;right:auto;top:calc(100% + 3px);transform:translateX(-50%);font-size:8px;line-height:10px;padding:0 3px}
}
