/* Fix My Fail 0.9.3 build32 — display-only lock for the ONE premium map.
 * Original illustration, cosmetics, game physics, levels and interactions remain unchanged.
 * Prevent WKWebView/restoration from exposing arbitrary scrolled pieces of the map.
 */
.world-hub {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
}
.hub-shell {
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  margin: 0 auto !important;
  overflow: hidden !important;
  background-position: center top !important;
  background-size: 100% 100% !important;
}
.hub-topbar {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 24 !important;
}
.hub-map {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}
.hub-node.n0 {top: 76.0% !important;}
.hub-node.n1 {top: 64.1% !important;}
.hub-node.n2 {top: 52.0% !important;}
.hub-node.n3 {top: 40.0% !important;}
.hub-node.n4 {top: 28.0% !important;}
.hub-node.n5 {top: 16.1% !important;}
.hub-special, .hub-pass {top: 15.0% !important;}
.hub-daily, .hub-wheel {top: 38.0% !important;}
.hub-vault-mini {top: 67% !important;}
.hub-bottom-nav {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  transform: none !important;
  margin: 0 !important;
  z-index: 30 !important;
}
.hub-node {transition: filter .15s ease !important;}
@media (max-height: 740px) {
  .hub-card {width: 20vw !important;}
  .hub-card .pic {height: 32px !important;}
  .hub-card small {font-size: 8px !important;}
  .hub-node {transform: scale(.87) !important;transform-origin:center !important;}
  .hub-bottom-nav button {min-height: 56px !important;}
}

/* Isolated 3D terrain candidate, enabled only with ?terrain3d=1. */
.hub-shell.terrain-ready{background-image:none!important;background-color:#249bb6!important}
.hub-shell.terrain-ready:before,.hub-shell.terrain-ready:after{display:none!important}

/* The shell holds fixed controls; the route beneath it uses native vertical scrolling. */
.hub-route-scroll{position:absolute;inset:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;scrollbar-width:none;z-index:1}
.hub-route-scroll::-webkit-scrollbar{display:none}
.hub-route-content{position:relative;width:100%;min-height:100%;background:#249bb6}
.hub-route-world{position:absolute;left:0;width:100%;overflow:hidden;background:#249bb6}
.hub-route-world .hub-node{position:absolute!important;z-index:3!important;touch-action:pan-y!important}
.hub-map>.hub-card,.hub-map>.hub-vault-mini{z-index:5!important}
.hub-zone-sign{pointer-events:none!important;z-index:6!important}
.hub-shell:has(.hub-route-world.terrain-ready){background-image:none!important;background-color:#249bb6!important}
.hub-shell:has(.hub-route-world.terrain-ready):before,.hub-shell:has(.hub-route-world.terrain-ready):after{display:none!important}

/* Build40: restrained depth and one-shot delivery celebrations. */
.result-content{position:relative;isolation:isolate}
.delivery-celebration{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:45;contain:layout paint}
.delivery-celebration i{position:absolute;display:block;pointer-events:none}
.delivery-confetti{width:3px;height:3px;border-radius:50%;box-shadow:0 0 3px #fff2cdaa}
.delivery-win-star{font:700 10px/1 system-ui;text-shadow:0 1px 2px #a3793b44}
.delivery-win-ring{width:44px;height:23px;border-radius:50%;border:1px solid #ffe6a088;box-shadow:0 0 5px #ffd36f44}
.hub-route-world .hub-node.current .stamp{box-shadow:inset 0 3px 1px #fff5b9,inset 0 -4px 0 #e99927,0 0 16px #ffe18055!important}
.hub-route-world .hub-node:not(.locked) .stars{filter:drop-shadow(0 2px 1px #734c22)}
.hub-node.delivery-arrived .stamp{animation:delivery-arrival-stamp .65s ease-out both}
@keyframes delivery-arrival-stamp{0%{filter:brightness(1);scale:1}35%{filter:brightness(1.3);scale:1.12}70%{filter:brightness(1.1);scale:.98}100%{filter:brightness(1);scale:1}}
@media(prefers-reduced-motion:reduce){.hub-node.delivery-arrived .stamp{animation:none}}

.journey-atmosphere{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:35}
.journey-atmosphere svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.journey-dust{position:absolute;left:-8px;top:-8px;width:16px;height:16px;border-radius:50%;background:radial-gradient(circle,#f6e6bf 0%,#e0d1aa99 45%,transparent 72%);opacity:0}
.journey-arrival-beam{position:absolute;width:75px;height:145px;background:linear-gradient(to top,#ffe6a0aa,transparent);clip-path:polygon(38% 100%,62% 100%,100% 0,0 0);transform-origin:50% 100%;opacity:0}

/* Route coordinates own scroll anchoring; virtual DOM updates must not move the viewport. */
.hub-route-scroll,.hub-route-content,.hub-route-world{overflow-anchor:none}

/* Light falls from the physical front lamps onto the road. The truck itself
   stays above this layer, so its body occludes light behind the vehicle. */
.journey-running-light{
  position:absolute;left:0;top:-6px;width:46px;height:12px;
  transform-origin:0 50%;pointer-events:none;
  background:linear-gradient(90deg,#fffbd99c,rgba(255,237,185,.29) 48%,transparent 100%);
  clip-path:polygon(0 39%,100% 0,100% 100%,0 61%);
}
.journey-arrival-beam.is-lit{animation:journey-delivered-light .65s ease-out both}
@keyframes journey-delivered-light{
  0%{opacity:0;transform:translate(-50%,-100%) scaleY(.25)}
  32%{opacity:.57;transform:translate(-50%,-100%) scaleY(.95)}
  100%{opacity:0;transform:translate(-50%,-100%) scaleY(1.12)}
}
.journey-world-crossing{
  position:absolute;width:0;height:0;pointer-events:none;
  --crossing-light:#b9e5dd;
}
.journey-world-crossing>i{position:absolute;display:block;opacity:0}
.journey-gate-fan{
  width:min(75vw,340px);height:min(35vh,225px);bottom:0;left:0;transform-origin:50% 100%;
  background:
    radial-gradient(ellipse at 50% 100%,#fff9d6b3,transparent 52%),
    conic-gradient(from -38deg at 50% 100%,transparent 0deg,var(--crossing-light) 9deg,transparent 16deg,
      transparent 24deg,#fffbdf 29deg,transparent 32deg,transparent 39deg,var(--crossing-light) 46deg,
      transparent 53deg,transparent 64deg,#fff5cf 71deg,transparent 77deg);
  -webkit-mask-image:linear-gradient(to top,#000 5%,rgba(0,0,0,.67) 38%,transparent);
  mask-image:linear-gradient(to top,#000 5%,rgba(0,0,0,.67) 38%,transparent);
}
.journey-gate-ring{
  left:-62px;top:-20px;width:124px;height:40px;border-radius:50%;box-sizing:border-box;
  border:3px solid var(--crossing-light);box-shadow:0 0 0 2px #285e65bd,0 0 8px #fff7dba6,inset 0 0 4px var(--crossing-light);
}
.journey-gate-glints{
  width:3px;height:3px;border-radius:50%;background:#fffbe7;
  box-shadow:-34px -17px 0 var(--crossing-light),-57px -30px 1px #fffdf2,43px -26px 0 #fffdf2,
    64px -13px 1px var(--crossing-light),23px -48px 1px #fffbea,-20px -54px 0 var(--crossing-light);
}
.journey-world-crossing[data-crossed] .journey-gate-fan{
  animation:journey-gate-rays 1s ease-out both;
}
.journey-world-crossing[data-crossed] .journey-gate-ring{
  animation:journey-gate-wave 1.2s cubic-bezier(.21,.6,.36,1) both;
}
.journey-world-crossing[data-crossed] .journey-gate-ring+.journey-gate-ring{
  animation-delay:.14s;border-width:1px;
}
.journey-world-crossing[data-crossed] .journey-gate-glints{
  animation:journey-gate-sparks .96s ease-out both;
}
@keyframes journey-gate-rays{
  0%{opacity:0;transform:translateX(-50%) scale(.52,.48)}
  30%{opacity:.7}
  100%{opacity:0;transform:translateX(-50%) scale(1.08,1.08)}
}
@keyframes journey-gate-wave{
  0%{opacity:0;transform:scale(.12)}
  15%,45%{opacity:.96}
  100%{opacity:0;transform:scale(2.1)}
}
@keyframes journey-gate-sparks{
  0%{opacity:0;transform:translateY(2px) scale(.32)}
  23%{opacity:.9}
  100%{opacity:0;transform:translateY(-18px) scale(1.55)}
}
@media(prefers-reduced-motion:reduce){
  .journey-atmosphere{display:none}
}

.hub-route-world.terrain-ready .hub-gateway-anchor canvas{display:none}

/* The landscape takes the full width while a delivery passes through a portal. */
.hub-map:has(.journey-world-crossing) :is(.hub-card,.hub-vault-mini,.royal-world-marker,.hub-world-gate){opacity:0;pointer-events:none}
.journey-destination-title{
  position:absolute;left:50%;top:max(14%,95px);transform:translateX(-50%);max-width:84%;width:max-content;
  padding:9px 18px 11px;text-align:center;border-radius:14px;opacity:0;
  background:linear-gradient(150deg,#fffdf2f7,#e3f3e9ed);color:#224d52;
  box-shadow:inset 0 1px #fff,0 4px 12px #172f3526
}
.journey-destination-title small{display:block;font:800 10px/1.4 system-ui;letter-spacing:.15em;color:#397067}
.journey-destination-title strong{display:block;font:800 clamp(17px,4.7vw,24px)/1.16 system-ui}
.journey-atmosphere:has(.journey-world-crossing[data-crossed]) .journey-destination-title{animation:destination-arrival .48s both}
@keyframes destination-arrival{
 from{opacity:0;transform:translate(-50%,7px)}
 to{opacity:1;transform:translate(-50%,0)}
}
@media(prefers-reduced-motion:reduce){.journey-destination-title{animation:none}}
