/* === 53 RUNZ V1.4.2 IPHONE FULLSCREEN + TOAST LAYER === */
html,body,#root,.runz-mobile-app{background:#050506!important;}
html,body,#root{margin:0!important;padding:0!important;width:100%!important;min-width:100%!important;overflow:hidden!important;}

/* Always show Pause + Fullscreen. This final override also beats the older mobile rules. */
.runz-mobile-app .runz-console-actions{
  position:relative!important;z-index:120!important;display:flex!important;align-items:center!important;gap:5px!important;
  visibility:visible!important;opacity:1!important;
}
.runz-mobile-app .runz-console-actions button,
.runz-mobile-app .runz-console-actions button:last-child{
  display:inline-flex!important;visibility:visible!important;opacity:1!important;
  width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;
  align-items:center!important;justify-content:center!important;padding:0!important;margin:0!important;
  border-radius:11px!important;border:1px solid rgba(220,199,255,.36)!important;
  color:#fff7ff!important;background:linear-gradient(180deg,rgba(38,29,48,.96),rgba(13,11,18,.96))!important;
  box-shadow:0 6px 18px rgba(0,0,0,.24),inset 0 1px 0 rgba(255,255,255,.08)!important;
  font:900 .76rem/1 "Baloo 2","Fredoka",Arial,sans-serif!important;
}
.runz-mobile-app .runz-console-actions button:last-child{
  border-color:rgba(202,158,255,.72)!important;
  background:linear-gradient(180deg,rgba(125,76,172,.98),rgba(66,37,95,.98))!important;
  box-shadow:0 6px 18px rgba(0,0,0,.24),inset 0 1px 0 rgba(255,255,255,.18),0 0 18px rgba(185,108,255,.26)!important;
}
.runz-mobile-app .runz-console-actions button:active{transform:scale(.9)!important;}

/* Hide the React toast inside the canvas. V1.4.2 mirrors it to a top-level layer. */
.runz-canvas-wrap .runz-toast{visibility:hidden!important;opacity:0!important;pointer-events:none!important;}
.runz-toast-portal{
  position:fixed!important;z-index:2800!important;left:50%!important;
  top:calc(max(4px,env(safe-area-inset-top)) + 77px)!important;
  transform:translate(-50%,-7px) scale(.94)!important;
  width:max-content!important;max-width:min(82vw,520px)!important;
  padding:.48rem .92rem!important;border-radius:999px!important;
  border:1px solid rgba(218,187,255,.68)!important;
  background:linear-gradient(180deg,rgba(55,34,74,.97),rgba(16,11,23,.95))!important;
  color:#fff7ff!important;text-align:center!important;
  font:900 clamp(.5rem,1.45vw,.72rem)/1.1 "Baloo 2","Fredoka",Arial,sans-serif!important;
  letter-spacing:.035em!important;text-shadow:0 2px 0 rgba(51,24,71,.76),0 0 13px rgba(206,157,255,.35)!important;
  box-shadow:0 12px 28px rgba(0,0,0,.38),0 0 30px rgba(154,79,245,.28),inset 0 1px 0 rgba(255,255,255,.12)!important;
  -webkit-backdrop-filter:blur(12px)!important;backdrop-filter:blur(12px)!important;
  opacity:0!important;visibility:hidden!important;pointer-events:none!important;
  transition:opacity .14s ease,transform .18s cubic-bezier(.2,.9,.24,1.25),visibility .14s!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
}
.runz-toast-portal.active{
  opacity:1!important;visibility:visible!important;transform:translate(-50%,0) scale(1)!important;
}

/* Native fullscreen / immersive fallback. */
:fullscreen,:fullscreen body,:fullscreen #root,:fullscreen .runz-mobile-app,:fullscreen .runz-console,
:-webkit-full-screen,:-webkit-full-screen body,:-webkit-full-screen #root,:-webkit-full-screen .runz-mobile-app,:-webkit-full-screen .runz-console{
  width:100vw!important;height:100vh!important;min-height:100vh!important;margin:0!important;padding:0!important;overflow:hidden!important;background:#050506!important;
}
html.runz-immersive-fallback,html.runz-immersive-fallback body,html.runz-immersive-fallback #root,
html.runz-immersive-fallback .runz-mobile-app,html.runz-immersive-fallback .runz-console{
  width:100vw!important;height:100lvh!important;min-height:100lvh!important;margin:0!important;overflow:hidden!important;background:#050506!important;
}

/* Standalone iPhone/PWA: paint BEHIND the home-indicator safe area instead of leaving a black strip. */
html.runz-standalone,
html.runz-standalone body,
html.runz-standalone #root,
html.runz-standalone .runz-mobile-app,
html.runz-standalone .runz-shell,
html.runz-standalone .runz-console{
  position:fixed!important;inset:0!important;width:100vw!important;height:100lvh!important;min-height:100lvh!important;
  max-height:none!important;margin:0!important;padding:0!important;overflow:hidden!important;background:#050506!important;
}
html.runz-standalone .runz-canvas-wrap,
html.runz-standalone .runz-canvas-wrap.is-menu,
html.runz-standalone .runz-console.is-fullscreen .runz-canvas-wrap{
  position:fixed!important;
  top:0!important;left:0!important;right:0!important;
  bottom:calc(-1 * env(safe-area-inset-bottom))!important;
  width:100vw!important;height:auto!important;min-height:calc(100lvh + env(safe-area-inset-bottom))!important;
  margin:0!important;border:0!important;overflow:hidden!important;background:#17131d!important;
}
html.runz-standalone .runz-canvas-wrap canvas,
html.runz-standalone .runz-console.is-fullscreen .runz-canvas-wrap canvas{
  position:absolute!important;top:50%!important;left:50%!important;
  width:max(100vw,177.7778lvh)!important;height:auto!important;
  min-width:100vw!important;min-height:calc(100lvh + env(safe-area-inset-bottom))!important;
  max-width:none!important;max-height:none!important;
  transform:translate(-50%,-50%)!important;object-fit:cover!important;background:#17131d!important;
}
html.runz-standalone .runz-native-grain{
  position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:calc(-1 * env(safe-area-inset-bottom))!important;
}

/* Controls stay INSIDE the safe area even though the game artwork extends underneath it. */
@media (orientation:landscape) and (max-height:650px){
  .runz-mobile-app .runz-console-top{padding-right:.35rem!important;}
  .runz-mobile-app .runz-console-actions,.runz-mobile-app .runz-console-actions button:last-child{display:flex!important;visibility:visible!important;opacity:1!important;}
  .runz-toast-portal{top:calc(max(4px,env(safe-area-inset-top)) + 76px)!important;}
}
@media (orientation:landscape) and (max-height:390px){
  .runz-toast-portal{top:calc(max(3px,env(safe-area-inset-top)) + 67px)!important;padding:.36rem .72rem!important;font-size:clamp(.44rem,1.2vw,.6rem)!important;}
}

/* Old WebKit viewport fallback. */
@supports (-webkit-touch-callout:none){
  html.runz-standalone,html.runz-standalone body,html.runz-standalone #root,
  html.runz-standalone .runz-mobile-app,html.runz-standalone .runz-shell,html.runz-standalone .runz-console{
    height:100vh!important;min-height:100vh!important;
  }
  html.runz-standalone .runz-canvas-wrap,
  html.runz-standalone .runz-canvas-wrap.is-menu,
  html.runz-standalone .runz-console.is-fullscreen .runz-canvas-wrap{
    min-height:calc(100vh + env(safe-area-inset-bottom))!important;
  }
}
