
.cover-controls,.controls-guide-edit,.help-guide-link{display:none}
.app-screen.touch-ui .game-cover{bottom:var(--touch-reserved-band,0px);align-items:flex-start;overflow-y:auto;padding:56px 18px 16px}
.app-screen.touch-ui #welcome-content{position:relative;z-index:9;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;width:min(100%,360px);margin:auto 0}
.app-screen.touch-ui #welcome-content>*{grid-column:1/-1;min-width:0}
.app-screen.touch-ui #welcome-content>:is(.game-toolbar,.cover-controls){display:contents}
.app-screen.touch-ui #welcome-content>#game-status{order:1}
.app-screen.touch-ui #welcome-content>#game-progress{order:2;justify-self:center}
.app-screen.touch-ui #welcome-content>#boot-retry{order:3;justify-self:center}
.app-screen.touch-ui #welcome-content #start{order:4;grid-column:1/-1;min-width:0;height:52px;min-height:52px;gap:10px;font-size:18px}
.app-screen.touch-ui #welcome-content .cover-controls>button{order:5;grid-column:span 3;display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;height:48px;min-height:48px;padding:0 8px;font-size:16px;line-height:20px;white-space:nowrap}
.app-screen.touch-ui #welcome-content .game-toolbar>:is(#wiki-link,#community,#leaderboard){order:6;grid-column:span 2;min-width:0;height:48px;min-height:48px;padding:0 4px;gap:6px;font-size:15px}
.app-screen.touch-ui #welcome-content>.cover-help-row{order:7;flex-wrap:nowrap;gap:4px}
.app-screen.touch-ui #welcome-content>.welcome-version{order:8}
.app-screen.touch-ui #welcome-content>#controls-guide{display:none}
.app-screen.touch-ui.playing #welcome-content>.cover-controls{display:none}
.app-screen.touch-ui:has(#touch-controls[data-editing=true]) #welcome-content{z-index:auto}
.app-screen.touch-ui .cover-help,.app-screen.touch-ui .cover-help:hover:not(:disabled){min-height:44px;padding:0 14px;border:0;background:none;box-shadow:none;color:var(--text);font-size:15px;text-decoration:underline;text-underline-offset:5px}
.app-screen.touch-ui .game-cover .welcome-version{font-size:13px;line-height:18px}
.app-screen.touch-ui.touch-land .game-cover{padding:10px 0 8px}
.app-screen.touch-ui.touch-land #welcome-content{gap:8px;width:var(--cover-w,min(380px,calc(100% - 280px)));left:var(--cover-shift,0px)}
.app-screen.touch-ui.touch-land #game-status{line-height:22px}
.app-screen.touch-ui.touch-land #welcome-content #start{height:46px;min-height:46px}
.app-screen.touch-ui.touch-land #welcome-content :is(.cover-controls>button,.game-toolbar>:is(#wiki-link,#community,#leaderboard)){height:44px;min-height:44px}

#controls-dialog{width:min(520px,calc(100vw - 24px))}
#controls-dialog .help-body{padding-bottom:2px}
#controls-dialog .controls-guide{width:100%;margin:0}
#controls-dialog .controls-guide-tabs{position:sticky;top:0;z-index:1;display:flex;gap:8px;margin:0;padding:0 0 12px;background:var(--menu-color)}
#controls-dialog .controls-guide-tabs button{flex:1;min-width:0;min-height:44px;padding:6px 8px;font-size:15px;line-height:20px}
#controls-dialog #controls-guide :is(.joystick-guide-stick){display:block}
#controls-dialog #controls-guide .joystick-guide-buttons{display:grid}
#controls-dialog .joystick-guide{gap:14px 26px;padding:4px 0}
#controls-dialog .joystick-guide-stick{width:114px;height:114px}
#controls-dialog .joystick-guide-knob{width:52px;height:52px;margin:-26px 0 0 -26px}
#controls-dialog .joystick-guide-buttons{grid-template-columns:repeat(2,68px);gap:10px}
#controls-dialog .joystick-guide-buttons[data-control-mode="split"]{grid-template-columns:repeat(3,68px)}
#controls-dialog .joystick-guide-button{width:68px;height:68px;font-size:16px;line-height:18px}
#controls-dialog .joystick-guide-button small{font-size:13px}
#controls-dialog .dash-guide{width:276px;height:130px}
#controls-dialog .keyboard-board.stacked{flex-direction:column;align-items:center;gap:6px}
#controls-dialog .joystick-guide-notes{display:block;margin:10px 0 0;padding-left:20px;font-size:14px;line-height:22px;color:var(--text)}
#controls-dialog .joystick-guide-notes li{margin:6px 0}
#controls-dialog .controls-guide-edit{display:block;width:100%;min-height:48px;margin:14px 0 0;font-size:16px}
#controls-dialog .keyboard-board{width:max-content;margin:0 auto}
#controls-dialog .controls-keyboard{padding:4px 0}
html.touch-land:not([data-screen-turn]) #controls-dialog{width:min(760px,calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 24px))}
html.touch-land #controls-dialog{padding:12px 16px}
html.touch-land #controls-dialog form{gap:8px}
html.touch-land #controls-dialog .controls-guide-tabs{position:absolute;top:12px;left:128px;right:76px;padding:0;background:none}
html.touch-land #controls-dialog .controls-joystick:not([hidden]){display:grid;grid-template-columns:290px minmax(0,1fr);grid-template-rows:auto 1fr;column-gap:18px;align-items:start}
html.touch-land #controls-dialog .controls-joystick .joystick-guide{position:sticky;top:0;grid-column:1;grid-row:1/span 2;justify-content:center;gap:8px 20px;padding:0}
html.touch-land #controls-dialog .dash-guide{width:276px;height:130px}
html.touch-land #controls-dialog .controls-joystick .joystick-guide-notes{grid-column:2;grid-row:1;margin:0;font-size:13px;line-height:20px}
html.touch-land #controls-dialog .controls-joystick .joystick-guide-notes li{margin:0 0 6px}
html.touch-land #controls-dialog .controls-joystick .controls-guide-edit{grid-column:2;grid-row:2;align-self:end;margin-top:8px}
html.touch-ui .help-guide-link{display:block;margin:0 0 10px}
html.touch-ui .help-guide-link button{min-height:44px;padding:8px 16px}

:root{--dlg-top:max(12px,env(safe-area-inset-top));--dlg-right:max(12px,env(safe-area-inset-right));--dlg-bottom:max(12px,env(safe-area-inset-bottom));--dlg-left:max(12px,env(safe-area-inset-left));
  --dlg-room:calc(100dvh - var(--dlg-top) - var(--dlg-bottom));--dlg-wide:calc(100vw - var(--dlg-left) - var(--dlg-right))}
:is(#leaderboard-dialog,#mobile-help-dialog,.help-dialog,.game-settings-dialog,#keyboard-mapping-dialog,#gamepad-mapping-dialog,#community-dialog,#bug-report-dialog,#confirm-dialog,.mobile-cheats-dialog,.admin-console-dialog,#visitor-members-dialog){inset:var(--dlg-top) var(--dlg-right) var(--dlg-bottom) var(--dlg-left);max-width:var(--dlg-wide)}
:is(#leaderboard-dialog,#mobile-help-dialog,.help-dialog,.game-settings-dialog){max-height:min(90dvh,var(--dlg-room))}
:is(#leaderboard-dialog,#mobile-help-dialog,.help-dialog) form,.game-settings-frame{max-height:calc(min(90dvh,var(--dlg-room)) - 42px)}
:is(#keyboard-mapping-dialog,#gamepad-mapping-dialog,#community-dialog,#bug-report-dialog,.mobile-cheats-dialog,.admin-console-dialog){max-height:var(--dlg-room)}
:is(#keyboard-mapping-dialog,#gamepad-mapping-dialog) form{max-height:calc(var(--dlg-room) - 38px)}
:is(#keyboard-mapping-dialog,#gamepad-mapping-dialog).mobile form{max-height:calc(var(--dlg-room) - 26px)}
@media(max-height:500px){:is(#keyboard-mapping-dialog,#gamepad-mapping-dialog) form{max-height:calc(var(--dlg-room) - 26px)}}
#visitor-members-dialog{max-height:min(560px,var(--dlg-room))}
#confirm-dialog{max-width:min(calc(100vw - 32px),var(--dlg-wide));max-height:min(calc(100dvh - 32px),var(--dlg-room))}
#confirm-dialog form{max-height:calc(min(calc(100dvh - 32px),var(--dlg-room)) - 32px)}
#confirm-dialog.compact-confirm #confirm-message{max-height:calc(min(calc(100dvh - 32px),var(--dlg-room)) - 138px)}
html.touch-ui:not([data-screen-turn]) #community-dialog{height:min(760px,var(--dlg-room))}
html.touch-ui:not([data-screen-turn]) #bug-report-dialog{height:min(780px,var(--dlg-room))}
html.touch-ui:not([data-screen-turn]) :is(#community-dialog,#bug-report-dialog).guest{height:fit-content}
html.touch-ui:not([data-screen-turn]) :is(#community-dialog,#bug-report-dialog).guest .community-frame{height:auto;max-height:calc(var(--dlg-room) - 2px)}
html.touch-land:not([data-screen-turn]) :is(#mode-help-dialog,#intro-dialog,#play-help-dialog,#mobile-help-dialog){width:min(760px,calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 24px))}
html.touch-land :is(#mode-help-dialog,#intro-dialog,#play-help-dialog,#mobile-help-dialog) .button-row{display:none}
html.touch-land:not([data-screen-turn]) #leaderboard-dialog{padding:12px 18px}
html.touch-land:not([data-screen-turn]) #leaderboard-dialog form{max-height:calc(min(90dvh,var(--dlg-room)) - 26px)}
html.touch-land #leaderboard-dialog form{gap:8px}
html.touch-land #leaderboard-dialog .leaderboard-body{flex:1 1 auto;min-height:0;max-height:none}
html.touch-land #leaderboard-dialog .leaderboard-body:has(#leaderboard-login:not([hidden])) #leaderboard-note{display:inline-block;margin:8px 14px 0 0;vertical-align:middle}
html.touch-land #leaderboard-dialog .leaderboard-login:not([hidden]){display:inline-block;margin:8px 0 0;vertical-align:middle}

html.touch-ui :is(#leaderboard-dialog,#mobile-help-dialog,.help-dialog,.game-settings-dialog,#community-dialog,#bug-report-dialog,#visitor-members-dialog) header button{width:44px;height:44px;min-height:44px}
.app-screen.touch-ui .sidebar .check-label{min-height:44px;margin-top:4px;margin-bottom:4px}
.app-screen.touch-ui .sidebar-tabs button{min-height:44px}
.app-screen.touch-ui .sidebar :is(.touch-layout-row button,#all-saves,.text-button){min-height:44px}
html.touch-ui .game-settings-row{min-height:44px}
html.touch-ui .game-settings-row :is(select,.dropdown-face){min-height:44px}
html.touch-ui .game-settings-cycle button{min-width:44px;min-height:44px}
html.touch-ui .game-settings-row input[type=checkbox]{width:24px;height:24px}
html.touch-ui .leaderboard-tabs button{height:44px;min-height:44px}
html.touch-ui .leaderboard-mode{flex-wrap:wrap;column-gap:18px;row-gap:0}
html.touch-ui .leaderboard-mode label{min-height:44px;margin:0}
html.touch-ui #leaderboard-cycle:not([hidden]){border-inline-start:0;padding-inline-start:0}
html.touch-ui .plaza-report-reasons label{min-height:44px;margin:0}
html.touch-ui .bug-filter{min-height:44px}
html.touch-ui .community-login button{min-height:44px}
.leaderboard-login{margin:12px 0 0}
.leaderboard-login button{min-height:40px;padding:6px 20px;font-size:15px}
html.touch-ui .leaderboard-login button{min-height:44px}

.app-screen.touch-ui{--tr-top:max(10px,var(--sa-top,env(safe-area-inset-top)));--tr-right:max(10px,var(--sa-right,env(safe-area-inset-right)));--tr-next:calc(var(--tr-right) + 52px)}
.app-screen.touch-ui:has(#screen-turn-quick:not([hidden])){--tr-next:calc(var(--tr-right) + 104px)}
.app-screen.touch-ui.game-battle.menu-closed{--tr-top:max(66px,calc(var(--sa-top,env(safe-area-inset-top)) + 66px))}
.app-screen.touch-ui.touch-land.game-battle.menu-closed{--tr-top:max(86px,calc(var(--sa-top,env(safe-area-inset-top)) + 86px))}
.app-screen.touch-ui.game-battle.menu-closed :is(#menu-toggle,#screen-turn-quick,#update-game){top:var(--tr-top)}
.menu-toggle-spot{position:absolute;top:max(10px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));width:42px;height:42px;visibility:hidden;pointer-events:none}
html[data-screen-turn] .menu-toggle-spot{top:max(10px,var(--sa-top));right:max(10px,var(--sa-right))}

.app-screen.menu-tabs .sidebar{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;grid-template-areas:"head" "tabs" "body" "foot";padding:max(10px,env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom)) 12px}
.app-screen.menu-tabs .menu-head{grid-area:head;display:flex;align-items:center;gap:10px;min-width:0;min-height:42px;margin:0 0 8px;padding:0 56px 0 2px}
.app-screen.menu-tabs .menu-head img{flex:none;width:24px;height:24px;border-radius:5px;image-rendering:pixelated;box-shadow:0 0 0 1px #ffffff33}
.app-screen.menu-tabs .menu-head h2{min-width:0;margin:0;overflow:hidden;font-size:18px;line-height:24px;color:var(--accent);white-space:nowrap;text-overflow:ellipsis}
.app-screen.menu-tabs .sidebar-tabs{grid-area:tabs;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;margin:0 0 8px;padding:0 0 8px}
.app-screen.menu-tabs .sidebar-tabs>span{display:none}
.app-screen.menu-tabs .sidebar-tabs button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;min-height:54px;padding:4px 0;border:1px solid transparent;border-radius:4px;font-size:13px;line-height:16px;letter-spacing:-.5px;color:var(--text)}
.app-screen.menu-tabs .sidebar-tabs button[aria-selected=true]{color:var(--accent);border-color:#ffffff30;background:var(--menu-shade);box-shadow:inset 0 -3px var(--accent)}
.app-screen.menu-tabs .sidebar-tabs .tab-icon{display:inline-flex;flex:none;width:22px;height:22px}
.app-screen.menu-tabs .sidebar-tabs .tab-icon svg{width:22px;height:22px}
.app-screen.menu-tabs .sidebar-tabs .tab-label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.app-screen.menu-tabs .sidebar-brand{display:none}
.menu-head-actions{display:none}
.app-screen:is(.menu-tabs,.menu-full) .menu-head{container:menu-head / inline-size}
.app-screen:is(.menu-tabs,.menu-full) .menu-head-actions{display:flex;flex:none;align-items:center;gap:4px;margin:0 -6px 0 auto}
.menu-head-actions button{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:40px;min-width:40px;height:40px;min-height:40px;padding:0;border-radius:3px;box-shadow:inset 1px 1px #ffffff22,1px 1px #0008;line-height:1}
.menu-head-actions .btn-icon{width:24px;height:24px}
.menu-head-actions .btn-icon svg{width:22px;height:22px}
.menu-head-actions #menu-plaza{width:auto;min-width:0;padding:0 6px;font:14px/1 KctMenu,"GulimChe",sans-serif;white-space:nowrap}
.menu-head-actions #menu-community.has-new::after{content:'';position:absolute;top:2px;right:2px;width:8px;height:8px;border-radius:50%;background:#ff4d4d;box-shadow:0 0 0 1px #1c1c1c;pointer-events:none}
@container menu-head (max-width:242px){.menu-head>img{display:none}}
@container menu-head (max-width:208px){.menu-head>h2{display:none}}
@container menu-head (max-width:320px){.menu-head:has(#menu-plaza:not([hidden]))>img{display:none}}
@container menu-head (max-width:286px){.menu-head:has(#menu-plaza:not([hidden]))>h2{display:none}}
.app-screen.menu-full .menu-head-actions button{width:44px;min-width:44px;height:44px;min-height:44px}
@container menu-head (max-width:254px){.app-screen.menu-full .menu-head>img{display:none}}
@container menu-head (max-width:220px){.app-screen.menu-full .menu-head>h2{display:none}}
@container menu-head (max-width:332px){.app-screen.menu-full .menu-head:has(#menu-plaza:not([hidden]))>img{display:none}}
@container menu-head (max-width:298px){.app-screen.menu-full .menu-head:has(#menu-plaza:not([hidden]))>h2{display:none}}
@container menu-head (max-width:211px){.menu-head:has(#menu-plaza:not([hidden])) .menu-head-actions{gap:2px}.menu-head:has(#menu-plaza:not([hidden])) .menu-head-actions button{width:32px;min-width:32px}.menu-head:has(#menu-plaza:not([hidden])) .menu-head-actions #menu-plaza{padding:0 4px;font-size:13px}}
.app-screen:is(.menu-tabs,.menu-full) .sidebar-iconbar .game-toolbar{grid-template-columns:minmax(0,1fr)}
.app-screen:is(.menu-tabs,.menu-full) .sidebar-iconbar .game-toolbar>:is(#wiki-link,#community,#leaderboard){display:none}
.app-screen:is(.menu-tabs,.menu-full) .sidebar-iconbar .game-toolbar #start{flex-direction:row;gap:8px;min-height:48px;padding:6px 12px;font-size:15px;line-height:20px}
.app-screen:is(.menu-tabs,.menu-full) .sidebar-iconbar .game-toolbar #start .btn-label{font-size:15px;line-height:20px}
.app-screen.menu-tabs .sidebar-common{grid-area:body;display:flex;flex-direction:column;gap:14px;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:4px 4px 12px 2px}
.app-screen.menu-tabs .sidebar-content{grid-area:body;min-height:0}
.app-screen.menu-tabs .sidebar-foot{grid-area:foot;margin:0}
.app-screen.menu-tabs .sidebar[data-section=game] .sidebar-content,
.app-screen.menu-tabs .sidebar:not([data-section=game]) .sidebar-common,
.app-screen.menu-tabs .sidebar:not([data-section=game]) .sidebar-foot{display:none}
.app-screen.menu-tabs .sidebar-common .panel{margin:0;padding:0;border:0;box-shadow:none}
.app-screen.menu-tabs .sidebar-iconbar{order:0;margin:0}
.app-screen.menu-tabs .sidebar-common #matching-panel{order:1;gap:10px}
.app-screen.menu-tabs .sidebar-common .account-panel{order:2}
.app-screen.menu-tabs .sidebar :is(#story-open,#matching-open){min-height:52px}
.app-screen.menu-tabs .help-row.menu-rail-only{display:flex}
.app-screen.menu-tabs .sidebar[data-section=settings] .help-row.menu-rail-only,
.app-screen.menu-tabs .sidebar[data-section=controls] #pane-settings>:not(.input-panel),
.app-screen.menu-tabs .sidebar[data-section=controls] .input-panel>h2,
.app-screen.menu-tabs .sidebar[data-section=help] #pane-settings>:not(.settings-panel),
.app-screen.menu-tabs .sidebar[data-section=help] .settings-panel>:not(.help-row),
.app-screen.menu-tabs .sidebar[data-section=help] #game-settings-open{display:none}
.app-screen.menu-tabs .sidebar[data-section=controls] .input-panel{padding-top:0;border:0;box-shadow:none}
.app-screen.menu-tabs .sidebar[data-section=help] .settings-panel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:0;border:0;box-shadow:none}
.app-screen.menu-tabs .sidebar[data-section=help] .help-row{display:contents}
.app-screen.menu-tabs .sidebar[data-section=help] .help-row button{height:auto;min-height:56px;margin:0;padding:8px 10px;line-height:22px;white-space:normal}
.app-screen.menu-tabs .sidebar[data-section=help] #play-help-open{order:0}
.app-screen.menu-tabs .sidebar[data-section=help] #mode-help-open{order:1}
.app-screen.menu-tabs .sidebar[data-section=help] #menu-wiki-open{order:2}
.app-screen.menu-tabs .sidebar[data-section=help] #menu-intro-open{order:3}
.app-screen.menu-tabs .sidebar[data-section=help] #mobile-help{order:4}
