/* UNO LUCK v1.1 PWA viewport and ambient motion. Loaded last so these
   constraints win over the original golden-master desktop sizing rules. */
:root{--uno-viewport-height:100dvh;--uno-wheel-drop:11px}
/* Standalone iOS PWA has no Safari browser chrome: use full large viewport,
   including the area underneath the home indicator (controls use padding). */
@supports (height:100lvh){
  @media (display-mode:standalone){
    :root{--uno-viewport-height:100lvh}
  }
}
/* The clipping ancestors must use the same viewport as gameplay. In iOS
   standalone, percentage height can resolve to the shorter initial containing
   block while 100lvh includes the status bar: overflow:hidden then cuts both
   the dragon and the fixed background before the bottom safe area. */
html,body{
  width:100%;max-width:100%;
  height:var(--uno-viewport-height,100dvh)!important;
  min-height:var(--uno-viewport-height,100dvh)!important;
  overflow:hidden;overscroll-behavior:none;
}
.game-shell{
  height:var(--uno-viewport-height,100dvh)!important;
  max-height:var(--uno-viewport-height,100dvh)!important;
  min-height:0!important;
  padding-top:calc(env(safe-area-inset-top,0px) + 9px)!important;
  padding-bottom:max(env(safe-area-inset-bottom,0px),5px)!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
/* The left logo track balances gift + profile on the right, keeping the
   wallet centered. All three controls share one responsive height. */
.game-header{
  --uno-hud-size:max(29px,min(52px,6dvh,13.44vw));
  min-height:0!important;
  grid-template-columns:29% minmax(0,1fr) 14% 14%!important;
}
.game-header .balance-chip{height:var(--uno-hud-size)!important}
.game-header #gift-btn,.game-header #profile-btn{
  width:var(--uno-hud-size)!important;
  height:var(--uno-hud-size)!important;
  justify-self:end;
}
/* 29% track × 71.37931% = 20.7%: 15% larger than the prior 18% logo. */
.game-header .uno-logo{width:71.37931%}
/* Keep the Coin total fixed while only the server bet history scrolls. */
.coin-modal .modal-card{height:min(76dvh,580px)}
.coin-modal .modal-content{display:flex;flex-direction:column;overflow:hidden;flex:1;min-height:0}
.coin-summary{flex:none;text-align:center;padding:8px 0 15px}
.coin-summary p{margin:0;color:#ffe09b}
.coin-summary strong{display:block;font-size:32px;font-variant-numeric:tabular-nums}
.coin-modal h3{flex:none;margin:0 0 10px;font-size:15px}
.coin-history{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
.coin-history-row{padding:10px 0;border-bottom:1px solid #ffe2a51f}
.coin-history-row time{display:block;color:#d2b6a1;font-size:11px}
.coin-history-row strong{display:block;font-size:13px;margin:3px 0}
.coin-history-row p{font-size:12px;margin:0;overflow-wrap:anywhere}
@media(orientation:landscape) and (max-height:470px){
  .game-header{--uno-hud-size:36px}
}
.game-header .uno-logo{
  transform-origin:32% 48%;
  animation:unoLuckLogoBreathe 2.65s cubic-bezier(.3,.06,.4,1) infinite!important;
  backface-visibility:hidden;
  will-change:transform,filter;
}
@keyframes unoLuckLogoBreathe{
  0%,100%{
    transform:translate3d(0,0,0) scale(1) rotate(-1deg);
    filter:brightness(1.02) drop-shadow(0 0 4px #ff8d3a88);
  }
  35%{
    transform:translate3d(1px,-1px,0) scale(1.27) rotate(1.8deg);
    filter:brightness(1.35) drop-shadow(0 0 16px #ffd461);
  }
  54%{
    transform:translate3d(1px,-1px,0) scale(1.19) rotate(-.8deg);
    filter:brightness(1.26) drop-shadow(0 0 14px #ff8129);
  }
  72%{
    transform:translate3d(0,0,0) scale(1.12) rotate(.5deg);
    filter:brightness(1.16) drop-shadow(0 0 9px #ffac37);
  }
}
.wheel-area{overflow:hidden!important;min-height:0!important}
.wheel-area .wheel-stage{
  width:var(--uno-wheel-size,min(100%,45dvh))!important;
  top:var(--uno-wheel-drop,11px)!important;
  max-width:100%!important;
  height:auto!important;
  aspect-ratio:1!important;
}
/* Number/color content and LED illumination advance in the same JS tick.
   Fixed nine frames and pointer never translate; only luminosity eases. */
.wheel-led-ring .led-symbol{
  animation:none!important;
  transform:none!important;
  /* A 60ms CSS filter transition on a 34/48ms tick never completed,
     forcing iOS WebKit to rasterize nine clipped cards continuously. */
  transition:opacity .035s linear!important;
}
.wheel-led-ring .led-slot .led-screen{
  transition:opacity .04s linear!important;
}
.wheel-led-ring.led-ambient .led-symbol,
.wheel-led-ring.led-ambient .led-slot .led-screen{
  transition-duration:.15s!important;
}
.wheel-led-ring:is(.led-ambient,.led-running) .led-slot.led-dimmed .led-symbol{
  opacity:.62;
  filter:none!important;
}
.wheel-led-ring:is(.led-ambient,.led-running) .led-slot.led-illuminated .led-symbol{
  opacity:1;
  filter:none!important;
  text-shadow:0 0 3px #fff,0 0 6px #fffbd1,0 1px 3px #24131f;
}
.wheel-led-ring.led-locked .led-slot:nth-child(5) .led-symbol{
  opacity:1;
}
.wheel-led-ring:is(.led-ambient,.led-running) .led-slot.led-dimmed .led-screen{
  filter:none!important;
  opacity:.58;
}
.wheel-led-ring:is(.led-ambient,.led-running) .led-slot.led-illuminated .led-screen{
  filter:none!important;
  opacity:1;
  box-shadow:inset 0 0 5px #fff3bb,0 0 12px #ffb52aa8!important;
}
.wheel-led-ring .led-slot.led-illuminated{
  box-shadow:0 0 14px #ffb83ec9,inset 0 1px 3px #fff7ca!important;
}
.wheel-led-ring.led-running .led-slot:not(.led-illuminated) .led-sheen{
  animation:none!important;
}
.boot-overlay{
  height:var(--uno-viewport-height,100dvh)!important;
  max-height:var(--uno-viewport-height,100dvh)!important;
}
.boot-softtech-logo{
  width:min(80vw,630px)!important;
  max-height:52dvh!important;
  transform-origin:50% 50%;
  /* Continues zooming for as long as the user has not pressed PLAY. */
  animation:unoSoftTechIdleZoom 2.6s ease-in-out infinite!important;
  will-change:transform,opacity;
}
@keyframes unoSoftTechIdleZoom{
  0%,100%{transform:translate3d(0,0,0) scale(.87);opacity:.90}
  50%{transform:translate3d(0,0,0) scale(1.16);opacity:1}
}
.boot-softtech.is-zooming .boot-softtech-logo{
  /* Trusted PLAY succeeds: leave the idle loop and run cinematic intro once. */
  animation:unoSoftTechZoom 1.7s cubic-bezier(.19,.67,.32,1) both!important;
}
@keyframes unoSoftTechZoom{
  0%{transform:translateZ(0) scale(.70);opacity:.25;filter:brightness(.7) drop-shadow(0 0 6px #00bfff)}
  55%{transform:translateZ(0) scale(1.09);opacity:1;filter:brightness(1.45) drop-shadow(0 0 22px #fa31fc)}
  100%{transform:translateZ(0) scale(1.21);opacity:1;filter:brightness(1.16) drop-shadow(0 0 14px #08caff)}
}
/* Original 48–74 px bar reduced to 70% at equal viewport height. */
.boot-loading-panel{min-height:0!important;bottom:calc(env(safe-area-inset-bottom,0px) + 12px)!important}
.boot-loading-track{
  height:clamp(34px,5.6dvh,52px)!important;
  min-height:0!important;
}
.boot-loading-percent{right:12px!important}
.boot-ready-actions,.boot-sound-gate{display:none!important}
@media(max-width:350px){
  .game-shell{padding-top:calc(env(safe-area-inset-top,0px) + 7px)!important}
}
@media(orientation:landscape) and (max-height:470px){
  .game-shell{
    padding-top:max(env(safe-area-inset-top,0px),3px)!important;
    padding-bottom:max(env(safe-area-inset-bottom,0px),3px)!important;
  }
  .wheel-area .wheel-stage{top:50%!important;transform:translate3d(-50%,-50%,0)!important}
}
@media(prefers-reduced-motion:reduce){
  .game-header .uno-logo,.boot-softtech-logo,
  .wheel-led-ring .led-symbol{animation:none!important}
  .boot-softtech-logo{opacity:1!important;transform:none!important}
}
/* Mobile-only Soft Tech asset is 30% smaller; retain cinematic zoom curve. */
@media (max-width:600px){
  .boot-softtech-logo{
    width:min(56vw,441px)!important;
    max-height:36.4dvh!important;
  }
}
/* Full-bleed from the physical screen top through the iOS home-indicator.
   Separate the background from .game-shell's content height/safe area.
   The controls remain inside their existing safe-area bounded grid. */
/* Paint a real image on the HTML canvas as well as the fixed visual layer.
   If iOS WebKit shortens/clips the pseudo-element during safe-area or toolbar
   transitions, the last pixels show the same lava-temple image, not body black. */
html{
  background-color:#120004!important;
  background-image:linear-gradient(180deg,rgba(13,0,5,.52),rgba(19,0,4,.14)),
    url('/assets/art/v4/lava-temple.webp')!important;
  background-repeat:no-repeat!important;
  background-position:center bottom,center bottom!important;
  background-size:100% 100%,cover!important;
}
body{
  position:relative;
  isolation:isolate;
  background:transparent!important;
}
body::before{
  content:'';
  position:fixed;
  pointer-events:none;
  z-index:0;
  inset:0 0 auto;
  width:100%;
  height:100vh;
  height:100lvh;  /* maximum visible iPhone height, below home indicator */
  background-image:linear-gradient(180deg,rgba(13,0,5,.52),rgba(19,0,4,.14)),
    url('/assets/art/v4/lava-temple.webp');
  background-repeat:no-repeat;
  background-position:center bottom;
  background-size:100% 100%,cover;
  transform:translateZ(0);
}
@supports not (height:100lvh){
  body::before{height:100vh}
}
/* The portrait artwork is wider than tall-phone viewports at equal height.
   Fit its full height without stretching; crop only the sides. Wide windows
   keep cover so landscape and desktop also have no empty side bands. */
@media(max-aspect-ratio:9/16){
  html,body::before{
    background-size:100% 100%,auto 100%!important;
    background-position:center top!important;
  }
}
.game-shell{
  z-index:1;
  background:transparent!important;
}
.game-shell::before{opacity:.4}
.game-shell::after{opacity:.65}
@media(prefers-reduced-motion:reduce){
  .game-header .uno-logo{animation:none!important;will-change:auto}
}

/* One deliberate iPhone activation button. Intro waits until pressed so the
   device never misses the only gesture that is allowed to start sound. */
.boot-softtech{position:absolute}
.boot-softtech .boot-play{
  position:absolute;
  z-index:6;
  left:50%;
  bottom:calc(max(22px,env(safe-area-inset-bottom,0px)) + 7dvh);
  transform:translate3d(-50%,0,0);
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:13px;
  width:min(77vw,300px);
  min-height:58px;
  padding:11px 23px;
  border:2px solid #ffe29c;
  border-radius:999px;
  color:#fff;
  background:linear-gradient(145deg,#fb761b,#d52916 53%,#870012);
  box-shadow:0 0 21px #ff642b8c,inset 0 1px 0 #ffefbda6,0 5px 0 #4c0610;
  font-weight:950;
  font-size:clamp(14px,3.8vw,19px);
  letter-spacing:1px;
  line-height:1.1;
  text-shadow:0 2px 4px #5b0511;
  white-space:nowrap;
  touch-action:manipulation;
  animation:unoBootPlayPulse 2.4s ease-in-out infinite;
}
.boot-softtech .boot-play[hidden]{display:none!important}
.boot-softtech .boot-play:disabled{opacity:.82;animation:none;filter:saturate(.65)}
.boot-softtech .boot-play:not(:disabled):active{
  transform:translate3d(-50%,3px,0) scale(.97);
}
.boot-softtech .boot-play-symbol{font-size:21px;line-height:1}
@keyframes unoBootPlayPulse{
  0%,100%{box-shadow:0 0 12px #ff8f3b86,0 5px 0 #4c0610;filter:brightness(1)}
  52%{box-shadow:0 0 29px #ffd65ec8,0 5px 0 #4c0610;filter:brightness(1.16)}
}
@media(max-height:570px){
  .boot-softtech .boot-play{
    bottom:calc(max(7px,env(safe-area-inset-bottom,0px)) + 3dvh);
    min-height:44px;
    padding:7px 17px;
  }
}
@media(prefers-reduced-motion:reduce){
  .boot-softtech .boot-play{animation:none!important}
}

/* Keep audio errors readable without introducing a second confirmation card. */
.boot-softtech .boot-play-error{
  position:absolute;z-index:7;left:50%;transform:translateX(-50%);
  bottom:calc(max(22px,env(safe-area-inset-bottom,0px)) + 7dvh + 72px);
  width:min(88vw,390px);margin:0;padding:0;
  color:#ffe4c0;text-align:center;line-height:1.35;
  font-size:clamp(12px,3.1vw,15px);font-weight:650;
  text-shadow:0 2px 6px #200000,0 0 6px #200000;
}
.boot-softtech .boot-play-error[hidden]{display:none!important}
@media(max-height:570px){
  .boot-softtech .boot-play-error{
    bottom:calc(max(7px,env(safe-area-inset-bottom,0px)) + 3dvh + 54px);
    font-size:12px;
  }
}

/* UNO LUCK v1.2: one horizontal line for each HUD label and its live value.
   Keeps the approved metal frame without stealing vertical space from cards. */
.game-shell > .result-bar{
  width:88%!important;
  padding:1.5% 3.2%!important;
}
.game-shell > .result-bar::before{inset:-10% -4%!important}
.game-shell > .result-bar > div{
  display:flex!important;
  flex-direction:row!important;
  justify-content:center!important;
  align-items:center!important;
  gap:clamp(3px,.85vw,6px)!important;
  white-space:nowrap;
  min-width:0;
  line-height:1!important;
}
.game-shell > .result-bar small{
  flex:none;
  font-size:clamp(8px,2vw,11px)!important;
  font-weight:900;
  line-height:1!important;
  letter-spacing:.02em;
}
.game-shell > .result-bar strong{
  flex:0 1 auto;
  min-width:0;
  font-size:clamp(12px,3.45vw,18px)!important;
  font-weight:1000;
  line-height:1!important;
  font-variant-numeric:tabular-nums;
  letter-spacing:-.035em;
}
@media(max-width:350px){
  .game-shell > .result-bar{width:91%!important;padding-left:2.1%!important;padding-right:2.1%!important}
  .game-shell > .result-bar small{font-size:8px!important}
  .game-shell > .result-bar strong{font-size:clamp(11px,3.45vw,13px)!important}
}
@media(orientation:landscape) and (max-height:470px){
  .game-shell > .result-bar{width:94%!important;padding:1% 2.5%!important}
  .game-shell > .result-bar small{font-size:clamp(8px,1vw,11px)!important}
  .game-shell > .result-bar strong{font-size:clamp(11px,1.6vw,17px)!important}
}


/* UNO LUCK solid-face LED roulette: no translucent cards.
   Fixed nine card positions; JS moves active illumination and glyph together. */
.wheel-led-ring .led-slot{
  isolation:isolate!important;
  overflow:visible!important;
  border-radius:9%!important;
}
.wheel-led-ring .led-slot .led-screen{
  clip-path:none!important;
  border-radius:9%!important;
  background-color:#123fd3!important;
  opacity:1!important;
  border:2px solid #fff8df!important;
  box-shadow:inset 0 0 0 2px #ffffff8c,inset 0 -5px 10px #0005!important;
  transition:box-shadow .07s linear!important;
}
.wheel-led-ring .led-slot[data-color='red'] .led-screen{background:#e82032!important}
.wheel-led-ring .led-slot[data-color='blue'] .led-screen{background:#1169e9!important}
.wheel-led-ring .led-slot[data-color='green'] .led-screen{background:#16ae50!important}
.wheel-led-ring .led-slot[data-color='yellow'] .led-screen{background:#f5c916!important}
.wheel-led-ring .led-slot[data-color='wild'] .led-screen{
  background:conic-gradient(#e82032 0 25%,#f5c916 25% 50%,#16ae50 50% 75%,#1169e9 75%)!important;
}
.wheel-led-ring .led-screen::before{
  content:''!important;
  position:absolute!important;
  inset:15% 8%!important;
  border:2px solid #fff9!important;
  border-radius:50%!important;
  transform:rotate(-27deg)!important;
  background:none!important;
  mix-blend-mode:normal!important;
  pointer-events:none!important;
}
.wheel-led-ring .led-slot .led-symbol{
  opacity:1!important;
  color:#fff!important;
  -webkit-text-stroke:1px #18223e!important;
  text-shadow:0 2px 2px #000b!important;
  filter:none!important;
}
.wheel-led-ring:is(.led-ambient,.led-running,.led-locked,.led-idle) .led-slot.led-dimmed .led-screen{
  opacity:1!important;
  filter:brightness(.37) saturate(.72)!important;
  box-shadow:inset 0 0 0 2px #ffffff4a,inset 0 0 15px #000a!important;
}
.wheel-led-ring:is(.led-ambient,.led-running) .led-slot.led-dimmed .led-symbol{
  opacity:1!important;
  color:#c8cbd4!important;
}
.wheel-led-ring:is(.led-ambient,.led-running,.led-idle) .led-slot.led-illuminated .led-screen,
.wheel-led-ring.led-locked .led-slot:nth-child(5) .led-screen{
  opacity:1!important;
  filter:brightness(1.35) saturate(1.25)!important;
  box-shadow:inset 0 0 7px #fff,0 0 15px #ffc22e,0 0 26px #ff8d1b!important;
}
.wheel-led-ring:is(.led-ambient,.led-running) .led-slot.led-illuminated .led-symbol{
  color:#fff!important;
  text-shadow:0 0 5px #fff,0 1px 3px #161020!important;
}
