/* MAIN40.425 · Single shared header definition; keep existing game handlers and layout spacers. */
:root{--shortgame-bar-size:37px;--shortgame-bar-height:calc(var(--shortgame-bar-size) + env(safe-area-inset-top,0px));--shortgame-bar-bg:#090d19}
/* Game gestures must not start native text selection or image/link dragging. */
body[data-shortgame-id],body[data-shortgame-id] *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-user-drag:none}
body[data-shortgame-id] input,body[data-shortgame-id] textarea,body[data-shortgame-id] [contenteditable]:not([contenteditable="false"]),body[data-shortgame-id] [contenteditable]:not([contenteditable="false"]) *{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
.shortgame-unified-surface{position:fixed;inset:0 0 auto;height:var(--shortgame-bar-height);background:var(--shortgame-bar-bg);z-index:2147482800;pointer-events:none}
.shortgame-header-surface{display:none}
body[data-shortgame-id] .shortgame-header-host{position:relative!important;z-index:2147482900!important;box-sizing:border-box!important;height:var(--shortgame-bar-height)!important;min-height:var(--shortgame-bar-height)!important;flex-shrink:0!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;padding:env(safe-area-inset-top,0px) 10px 0!important;margin:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important;pointer-events:none!important}
body[data-shortgame-id] .shortgame-header-host button,body[data-shortgame-id] .shortgame-header-host a{pointer-events:auto}
.shortgame-header-title,.play-nav>span,body[data-shortgame-id="driving"]>header>span{visibility:hidden}
/* Visible height is 37px; transparent input targets stay 44px for reliable touch. */
body[data-shortgame-id] .shortgame-global-nav{position:fixed!important;inset:env(safe-area-inset-top,0px) auto auto env(safe-area-inset-left,0px)!important;display:flex!important;align-items:flex-start!important;width:max-content!important;height:44px!important;min-height:44px!important;padding:0!important;margin:0!important;border:0!important;background:transparent!important;justify-content:flex-start!important;gap:4px!important;flex:none!important;z-index:2147483200!important;pointer-events:auto!important;touch-action:manipulation}
body[data-shortgame-id] .shortgame-brand-link{display:inline-flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;min-height:44px!important;height:44px!important;padding:0 8px 7px!important;gap:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important;color:#38d9ff!important;font:800 13px/1.2 -apple-system,BlinkMacSystemFont,"Segoe UI",Pretendard,sans-serif!important;letter-spacing:-.02em!important;text-decoration:none!important;touch-action:manipulation!important;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
body[data-shortgame-id] .shortgame-brand-link>span{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:27px;padding:0 10px;border:1px solid currentColor;border-radius:7px;background:#0f2331;line-height:1}
body[data-shortgame-id] .shortgame-brand-short{color:#fff}
.shortgame-unified-title{position:fixed;left:120px;right:120px;top:env(safe-area-inset-top,0px);height:var(--shortgame-bar-size);display:flex;align-items:center;justify-content:center;color:#a0afd3;font:400 13px/1.2 -apple-system,BlinkMacSystemFont,"Segoe UI",Pretendard,sans-serif;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;z-index:2147483100;pointer-events:none}
.shortgame-unified-title[hidden]{display:none}
body[data-shortgame-id] .shortgame-header-control{position:fixed!important;top:env(safe-area-inset-top,0px)!important;right:calc(max(2px,env(safe-area-inset-right,0px)) + var(--shortgame-control-slot,0)*44px)!important;left:auto!important;bottom:auto!important;box-sizing:border-box!important;width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;min-height:44px!important;max-height:44px!important;margin:0!important;padding:0!important;border:0!important;border-radius:50%!important;background:transparent!important;color:#eaf0f3!important;box-shadow:none!important;backdrop-filter:none!important;transform:none!important;text-shadow:none!important;line-height:1!important;letter-spacing:0!important;z-index:2147483000;pointer-events:auto!important;touch-action:manipulation!important}
.shortgame-header-control[data-shortgame-slot="1"]{--shortgame-control-slot:1}.shortgame-header-control[data-shortgame-slot="2"]{--shortgame-control-slot:2}.shortgame-header-control[data-shortgame-slot="3"]{--shortgame-control-slot:3}
body[data-shortgame-id] .shortgame-header-control[data-shortgame-icon]{font-size:0!important}
.shortgame-header-control[data-shortgame-icon]::before{position:absolute;top:4px;left:8px;display:grid;place-items:center;width:28px;height:28px;box-sizing:border-box;border:1px solid #53627b;border-radius:50%;background-color:#172138;font:900 17px/1 Inter,Pretendard,"Noto Sans KR",system-ui,-apple-system,sans-serif;color:#eaf0f3}
.shortgame-header-control[data-shortgame-icon="settings"]::before{content:'⚙'}.shortgame-header-control[data-shortgame-icon="pause"]::before{content:'Ⅱ'}.shortgame-header-control[data-shortgame-icon="fullscreen"]::before{content:'⛶'}.shortgame-header-control[data-shortgame-icon="motion"]::before{content:'◉'}
.shortgame-header-control[data-shortgame-icon="sound"]::before{content:"";background-image:url("/games/shared/sound-on-v420.svg");background-size:19px 19px;background-position:center;background-repeat:no-repeat}
.shortgame-header-control[data-shortgame-icon="sound"][data-shortgame-muted="true"]::before{background-image:url("/games/shared/sound-off-v420.svg")}
body[data-shortgame-id] .shortgame-header-control[data-shortgame-icon]>*{display:none!important}
.shortgame-header-control:focus-visible,.shortgame-brand-link:focus-visible{outline:2px solid white!important;outline-offset:-2px!important}
body[data-shortgame-id] .shortgame-global-nav button:not(.shortgame-header-control){height:29px;min-height:29px;width:auto;padding:0 10px;margin:4px 0 0;border:1px solid #53627b;border-radius:16px;background:#172138;color:#65bcff;font:700 11px system-ui;pointer-events:auto;touch-action:manipulation}
/* Per-game layout adapters. These do not define alternate header designs. */
body[data-shortgame-id="chess"] .top-actions{display:flex!important}
body:is([data-shortgame-id="chess"],[data-shortgame-id="gomoku"],[data-shortgame-id="baduk"],[data-shortgame-id="sky-ring"]) #frame{height:calc(100dvh - var(--shortgame-bar-height))!important}
body[data-shortgame-id="element-defense"] #frame{height:calc(var(--app-height) - var(--shortgame-bar-height))!important}
body[data-shortgame-id="element-clash"] .topbar{z-index:31}
body[data-shortgame-id="puzzles"] .collection-shell{height:calc(100dvh - var(--shortgame-bar-height) - 28px)!important}
body[data-shortgame-id="rail-runner"],body[data-shortgame-header-layout="inset"]{padding-top:var(--shortgame-bar-height)!important}
body[data-shortgame-id="rail-runner"] .rail-web-title,body[data-shortgame-header-layout="inset"] .top,body[data-shortgame-id="neon-dash"] .header,body[data-shortgame-id="cloud-hop"] .site-header,body[data-shortgame-id="neon-dash"] #soundLabel,body[data-shortgame-id="pacman"] .shortgame-home,body[data-shortgame-id="pacman"] .shell>header>.brand{display:none!important}
body[data-shortgame-id="neon-pulse"] .stage-page{padding-top:calc(var(--shortgame-bar-height) + 16px)!important}
body[data-shortgame-id="loop-runner"] .stage-page{padding-top:max(82px,calc(var(--shortgame-bar-height) + 16px))!important}
body[data-shortgame-id="block-drop"] .topbar>.brand,body[data-shortgame-id="block-drop"] .topbar>.back,body[data-shortgame-id="broken-orbit"] .bar>.brand,body[data-shortgame-id="broken-orbit"] .bar>.hub,body[data-shortgame-id="loop-runner"] .topbar>.brand,body[data-shortgame-id="loop-runner"] .topbar>.edition,body[data-shortgame-id="neon-pulse"] .brand-wrap,body[data-shortgame-id="neon-pulse"] .hub-return,body[data-shortgame-id="star-breaker-v2"] .flight-header>.back,body[data-shortgame-id="star-breaker-v2"] .flight-header>.wordmark{display:none!important}
body[data-shortgame-id="bounce-face"]:not(.shortgame-stage-mode) .shortgame-header-host{display:flex!important}
body[data-shortgame-id="bounce-face"]:not(.shortgame-stage-mode) .shortgame-header-host>.brand{display:none!important}
body[data-shortgame-id="gyro-ball"] .play-nav{height:var(--shortgame-bar-height);padding-top:env(safe-area-inset-top,0px)}
body[data-shortgame-id="gyro-ball"] .board{height:calc(100dvh - var(--shortgame-bar-height))}
body[data-shortgame-id="driving"]>main{height:calc(100% - var(--shortgame-bar-height))}
@media(max-width:700px){
 body[data-shortgame-id="cloud-hop"] #pauseButton,body[data-shortgame-id="neon-dash"] #soundButton{--shortgame-control-slot:0}
 body[data-shortgame-id="cloud-hop"] #soundButton{--shortgame-control-slot:1}
 body[data-shortgame-id="puzzles"] .collection-shell{height:calc(100dvh - var(--shortgame-bar-height))!important}
}
