html{-webkit-text-size-adjust:100%;text-size-adjust:100%;height:100%}body{min-height:100%;min-height:100dvh;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);-webkit-tap-highlight-color:transparent}button,.card,.stageCard,.slotHead{touch-action:manipulation}.gameWrap>canvas{image-rendering:auto;touch-action:none}.previewCanvas,.card canvas,#labCanvas{image-rendering:auto}.touchControls{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}.touchControls button{position:relative;overflow:hidden;min-width:48px;min-height:48px;border-radius:14px;background:linear-gradient(180deg,#1d2a49e8,#0d1426ed);box-shadow:inset 0 1px #ffffff1f,0 4px 14px #0006}.touchControls button:active,.touchControls button.active{transform:scale(.96);filter:brightness(1.2);box-shadow:inset 0 2px 8px #0008}.touchControls button[data-touch="punch"]{border-color:#65d8ff}.touchControls button[data-touch="kick"]{border-color:#ff94bd}.touchControls button[data-touch="special"]{border-color:#ffd166}.touchControls button[data-touch="block"]{border-color:#8cff9c}
@media(pointer:coarse),(hover:none){body.playing{overscroll-behavior:none}.screen#matchScreen.active{touch-action:none}.touchControls{display:flex;padding-bottom:max(4px,env(safe-area-inset-bottom))}.touchControls button{font-size:clamp(.68rem,2.2vw,.92rem)}.topActions button,.topActions a,.modeRow button,.stageCard,.card{min-height:44px}}
@media(max-width:900px){.app{padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}.selectLayout{grid-template-columns:1fr 1fr}.centerSelect{grid-column:1/-1;grid-row:2}.previewCard{position:static}.topActions{width:100%;justify-content:flex-start}.rosterGrid{grid-template-columns:repeat(5,minmax(0,1fr))}.stageGrid{grid-template-columns:repeat(3,minmax(0,1fr))}body.playing .touchControls{display:flex}}
@media(max-width:600px){.app{padding-top:max(8px,env(safe-area-inset-top))}.topbar{padding-top:4px}.brand h1{font-size:1.15rem}.brand p{display:none}.topActions{gap:5px}.topActions button,.topActions a,.topActions .pill{font-size:.67rem;padding:.42rem .52rem}.selectLayout{grid-template-columns:1fr 1fr}.previewCard{padding:8px}.previewCanvas{max-height:104px}.centerSelect{padding:10px}.rosterGrid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.card{padding:4px}.card .tiny{display:none}.stageGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.modeRow label{min-width:120px}.gameWrap{border-radius:8px}.touchControls{gap:6px}.touchGroup{gap:4px}.touchControls button{padding:.5rem .25rem}}
@media(max-width:380px){.app{padding-left:6px;padding-right:6px}.rosterGrid{grid-template-columns:repeat(3,minmax(0,1fr))}.previewCanvas{max-height:88px}.previewCard{padding:6px}.stageInfo strong{font-size:.62rem}}
@media (orientation:landscape) and (max-width:900px){body.playing{overflow:hidden;height:var(--visual-viewport-height,100dvh);min-height:0;padding:0}.playing .app{width:100%;height:var(--visual-viewport-height,100dvh);padding:0 max(4px,env(safe-area-inset-right)) 0 max(4px,env(safe-area-inset-left));overflow:hidden}.playing .topbar{display:none}.playing #matchScreen{height:100%;display:flex;flex-direction:column}.playing .matchToolbar{position:absolute;z-index:12;top:max(3px,env(safe-area-inset-top));left:max(5px,env(safe-area-inset-left));right:max(5px,env(safe-area-inset-right));height:34px;padding:0 3px;pointer-events:none}.playing .matchToolbar>*{pointer-events:auto}.playing .matchToolbar #matchStageLabel{display:none}.playing .matchToolbar button{min-height:32px;padding:.25rem .5rem;background:#080d18cc;backdrop-filter:blur(5px)}.playing .gameWrap{position:fixed;z-index:1;inset:0;width:100vw;max-width:none;height:var(--visual-viewport-height,100dvh);border:0;border-radius:0;background:#050914}.playing .gameWrap>canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:center}.playing .hud{padding:max(8px,env(safe-area-inset-top)) max(82px,calc(env(safe-area-inset-right) + 72px)) 8px max(82px,calc(env(safe-area-inset-left) + 72px));gap:8px;background:linear-gradient(#050914dd,#05091422,transparent)}.playing .hudName{font-size:clamp(.58rem,1.4vw,.82rem)}.playing .health{height:13px}.playing .meter{height:5px}.playing .clock strong{font-size:1.25rem}.playing .touchControls{position:fixed;z-index:20;left:max(7px,env(safe-area-inset-left));right:max(7px,env(safe-area-inset-right));bottom:max(5px,env(safe-area-inset-bottom));margin:0;display:flex;justify-content:space-between;align-items:end;pointer-events:none}.playing .touchGroup{display:grid;grid-template-columns:repeat(2,minmax(54px,76px));max-width:none;flex:0 0 auto;pointer-events:auto}.playing .touchControls button{width:clamp(54px,9.4vw,76px);height:clamp(45px,8.6vh,62px);min-height:0;border-radius:16px;padding:0;font-size:clamp(.68rem,1.7vw,.88rem);background:#0c1427d8;backdrop-filter:blur(4px)}.playing .trainingHint{bottom:max(5px,env(safe-area-inset-bottom));font-size:.52rem}.playing .arenaOverlay{padding:max(40px,env(safe-area-inset-top)) max(80px,env(safe-area-inset-right)) max(40px,env(safe-area-inset-bottom)) max(80px,env(safe-area-inset-left))}}
@media (orientation:portrait) and (max-width:900px){body.playing .touchControls{display:flex;position:sticky;bottom:0;z-index:15;padding:7px max(5px,env(safe-area-inset-right)) max(7px,env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left));margin-left:-9px;margin-right:-9px;background:linear-gradient(transparent,#090e1bea 18%,#090e1bf7);backdrop-filter:blur(5px)}.touchGroup{grid-template-columns:repeat(2,minmax(58px,1fr));max-width:48%}.touchControls button{min-height:54px}.gameWrap{position:relative}.hud{padding:7px}}
@media(prefers-reduced-motion:reduce){.touchControls button:active,.touchControls button.active{transform:none}}
