:root{color-scheme:dark;--navy:#020819;--cyan:#00ceff;--gold:#ffdb27}
*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;min-height:100%;overflow:hidden;background:#020819;color:white;font-family:system-ui,-apple-system,'Arial Black',Arial,sans-serif}
body{display:flex;align-items:center;justify-content:center;overscroll-behavior:none;user-select:none;-webkit-user-select:none}
#stage{position:relative;width:min(100vw,177.777778dvh);height:min(100dvh,56.25vw);overflow:hidden;outline:none;touch-action:none;background:#07133c}
#stage.portrait{width:min(100vw,56.25dvh);height:min(100dvh,177.777778vw)}
canvas{display:block;width:100%;height:100%;outline:none}
#status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#loading{position:absolute;inset:0;display:grid;place-items:center;z-index:6;background:#020819;font-weight:900;font-size:clamp(18px,3vw,36px);text-align:center;padding:1rem}
#loading[hidden],#start-overlay[hidden],#exit-fallback[hidden],#touch-controls[hidden]{display:none}
#start-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(8px,1.5vw,18px);z-index:5;background:linear-gradient(0deg,rgba(1,7,31,.92),rgba(1,7,31,.62) 65%,rgba(1,7,31,.5));text-align:center;padding:1rem}
#start-overlay h1{margin:0;font-size:clamp(20px,5.4vw,60px);font-weight:1000;line-height:1.05;text-transform:uppercase;text-shadow:0 3px 4px #001039}
#start-overlay p{max-width:32em;margin:0;font-size:clamp(13px,2.0vw,23px);line-height:1.4}
button,.link-btn{font-family:inherit;font-weight:900;cursor:pointer;border-radius:16px;touch-action:manipulation}
button:focus-visible,a:focus-visible{outline:3px solid #fff;outline-offset:3px}
#start-btn{padding:.7em 1.6em;font-size:clamp(17px,2.6vw,30px);border:3px solid #6bedff;background:linear-gradient(#f8ec4a,#ffa114);color:#07143b;box-shadow:0 6px 0 #8b3f00,0 0 25px #0092ff7b}
#touch-controls{position:absolute;bottom:2%;left:3%;right:3%;z-index:4;display:flex;justify-content:space-between;gap:1rem;pointer-events:none}
#touch-controls button{width:clamp(74px,12vw,122px);height:clamp(55px,8vw,90px);font-size:clamp(22px,3.5vw,38px);border:2px solid #91eeff;background:rgba(0,32,91,.88);color:#fff;box-shadow:0 2px 12px #0009;pointer-events:auto;touch-action:none}
#touch-controls button:active{background:rgba(0,144,196,.95)}
#exit-fallback{position:absolute;z-index:8;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:16px;background:rgba(2,8,25,.95);text-align:center;padding:20px}
#exit-fallback a{background:#ffc927;color:#07143b;text-decoration:none;padding:14px 20px;border-radius:14px;font-weight:900}
#exit-fallback button{background:none;color:#fff;border:2px solid #7bf1ff;padding:10px 18px}
@media (pointer:coarse){#touch-controls{display:flex}}
@media (pointer:fine){#touch-controls{display:none}}
@media (orientation:portrait) and (max-width:1024px){
 #start-overlay{padding:5%;gap:15px}
 #start-overlay h1{font-size:clamp(22px,6vw,42px)}
 #start-overlay p{font-size:clamp(13px,3vw,19px)}
 #start-btn{font-size:clamp(18px,4.5vw,30px)}
 #touch-controls{bottom:3%}
 #touch-controls button{width:27%;height:clamp(64px,12vw,102px);font-size:clamp(24px,8vw,42px)}
}
@media (prefers-reduced-motion:reduce){#start-btn{box-shadow:none}}


/* Oscar Game Navigation V1: game identity + one return action; no full-width bar. */
#game-navigation{
 position:absolute;z-index:7;
 top:max(8px,env(safe-area-inset-top));
 left:max(10px,env(safe-area-inset-left));
 right:max(10px,env(safe-area-inset-right));
 display:flex;align-items:flex-start;justify-content:space-between;
 gap:clamp(8px,1.6vw,24px);pointer-events:none;
}
.game-brand{
 display:flex;flex-direction:column;flex:0 1 auto;min-width:0;
 max-width:calc(100% - 158px);
 padding:2px 0 0;
 font-family:system-ui,-apple-system,'Arial Black',Arial,sans-serif;
 font-weight:1000;letter-spacing:-.045em;
 line-height:.95;text-align:left;white-space:nowrap;
 filter:drop-shadow(0 3px 2px #001039) drop-shadow(0 0 9px #002a70);
}
.game-brand__top{
 display:block;font-size:clamp(13px,2vw,27px);color:#fff;
 text-shadow:0 2px 0 #0639ba;
}
.game-brand__bottom{
 display:block;font-size:clamp(18px,2.6vw,37px);color:#02d4ff;
 -webkit-text-stroke:.45px #b9f5ff;
}
.game-brand__a{color:#fff;-webkit-text-stroke:0}
#exit-btn{
 pointer-events:auto;flex:0 0 auto;
 display:inline-flex;align-items:center;justify-content:center;gap:8px;
 min-height:clamp(46px,4vw,64px);
 padding:10px clamp(12px,1.5vw,22px);
 border:2.5px solid #5beaff;border-radius:999px;
 background:rgba(0,16,56,.93);color:#fff;
 font-size:clamp(12px,1.1vw,16px);line-height:1;
 text-shadow:0 1px 2px #0007;
 box-shadow:inset 0 0 0 1px #0c9bc780,0 0 13px #00b8ff65;
 white-space:nowrap;
}
#exit-btn:hover{background:rgba(0,51,108,.96);box-shadow:inset 0 0 0 1px #baf7ff55,0 0 18px #00b8ff88}
#exit-btn:active{transform:translateY(1px)}
.back-arrow{display:inline-block;font-size:1.55em;font-weight:900;line-height:.6;transform:translateY(-1px)}
@media(max-width:600px){
 #game-navigation{top:max(8px,env(safe-area-inset-top));left:11px;right:11px;gap:9px}
 .game-brand{max-width:calc(100% - 150px);padding-top:5px}
 .game-brand__top{font-size:clamp(16px,4.5vw,22px)}
 .game-brand__bottom{font-size:clamp(21px,5.4vw,28px)}
 #exit-btn{min-height:48px;padding:9px 12px;border-width:3px;font-size:12px;gap:6px}
}
@media(max-width:360px){
 #game-navigation{left:8px;right:8px;gap:6px}
 .game-brand{max-width:calc(100% - 138px)}
 .game-brand__top{font-size:15px}
 .game-brand__bottom{font-size:20px}
 #exit-btn{font-size:11px;padding:9px 10px;min-height:46px;gap:5px}
}
@media (orientation:landscape) and (max-height:480px){
 #game-navigation{top:6px;left:10px;right:10px}
 .game-brand__top{font-size:clamp(13px,1.8vw,18px)}
 .game-brand__bottom{font-size:clamp(18px,2.4vw,25px)}
 #exit-btn{min-height:44px;font-size:clamp(11px,1.5vw,13px);padding:8px 13px}
}

/* Exact official logo slot: automatically displays supplied transparent PNG. */
.game-brand{align-items:flex-start;justify-content:center;max-width:min(36%,360px);width:min(36%,360px)}
.game-brand__image{display:block;max-width:100%;width:auto;height:auto;max-height:clamp(52px,6.4vw,92px);object-fit:contain;object-position:left top}
.game-brand__fallback{display:flex;flex-direction:column;min-width:0}
.game-brand__image[hidden],.game-brand__fallback[hidden]{display:none!important}
@media(max-width:600px){
 .game-brand{width:min(55%,210px);max-width:calc(100% - 151px);align-items:flex-start;padding-top:2px}
 .game-brand__image{max-height:68px}
}
@media(max-width:360px){
 .game-brand{width:min(50%,172px);max-width:calc(100% - 139px)}
 .game-brand__image{max-height:59px}
}
@media (orientation:landscape) and (max-height:480px){
 .game-brand__image{max-height:53px}
}

/* Official Build Oscar a Rocket logo: preserves supplied artwork, no text fallback once loaded. */
@media(max-width:600px){.game-brand__image{max-height:69px}}
@media(max-width:360px){.game-brand__image{max-height:54px}}
@media(orientation:landscape) and (max-height:480px){.game-brand__image{max-height:53px}}

/* V7.3.1 - Universal Back to Oscar Games Hub CTA. CSS-built button using exact official logo art. */
#exit-btn {
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  justify-content:center;
  gap:clamp(4px,.65vw,10px);
  min-height:clamp(48px,4.6vw,65px);
  width:clamp(158px,17vw,237px);
  padding:6px clamp(9px,1vw,15px);
  background:linear-gradient(180deg,#0a2351 0%,#001747 58%,#001035 100%);
  border:3px solid #45f2ff;
  border-radius:999px;
  box-shadow: inset 0 0 0 2px #018ada,0 0 0 1px #1ca7e7,0 0 16px rgba(0,212,255,.55);
  color:#fff;
  text-shadow:none;
  white-space:nowrap;
}
#exit-btn:hover {background:linear-gradient(180deg,#0e3b72,#002457);box-shadow:inset 0 0 0 2px #61dfff,0 0 22px #00d5ff8c}
.exit-btn__text {flex:0 0 auto;font-family:system-ui,-apple-system,Arial,sans-serif;font-size:clamp(10px,1.1vw,15px);font-weight:1000;letter-spacing:-.02em;line-height:1.05}
.exit-btn__hub-logo {display:block;flex:0 1 auto;width:clamp(62px,6.5vw,96px);height:auto;max-height:clamp(26px,2.9vw,39px);object-fit:contain;pointer-events:none}
@media (max-width:600px) {
  #exit-btn {width:clamp(157px,43vw,190px);height:clamp(49px,13vw,57px);padding:5px 8px;gap:5px}
  .exit-btn__text {font-size:clamp(10px,2.7vw,12px)}
  .exit-btn__hub-logo {width:clamp(60px,18vw,75px);max-height:33px}
}
@media (max-width:360px) {
  #exit-btn {width:clamp(152px,48vw,170px);min-height:47px;padding:5px 7px;gap:4px}
  .exit-btn__text {font-size:10px}
  .exit-btn__hub-logo {width:62px;max-height:30px}
}
@media (orientation:landscape) and (max-height:480px) {
  #exit-btn {min-height:42px;height:44px;width:clamp(154px,19vw,190px);padding:4px 8px}
  .exit-btn__text {font-size:11px}
  .exit-btn__hub-logo {width:66px;max-height:28px}
}

/* V7.3.2: Give the official Rocket identity room away from screen edges.
   Margins affect only the left logo, leaving the return CTA anchored to the right. */
.game-brand { margin-top:clamp(7px,.75vw,13px); margin-left:clamp(12px,1.4vw,24px); }
@media (max-width:600px) {
  .game-brand { margin-top:8px; margin-left:12px; }
}
@media (max-width:360px) {
  .game-brand { margin-top:7px; margin-left:10px; }
}
@media (orientation:landscape) and (max-height:480px) {
  .game-brand { margin-top:5px; margin-left:12px; }
}
