/* Final phone-only contract. Tablet and desktop layouts intentionally stay untouched. */
.game-exit{position:fixed;z-index:10000;top:max(12px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));display:flex;align-items:center;gap:7px;min-height:42px;padding:0 16px;border:1px solid rgba(226,190,111,.4);border-radius:999px;background:rgba(18,16,12,.82);color:#f0d99f;font:700 10px/1 Inter,sans-serif;letter-spacing:.08em;text-decoration:none;text-transform:uppercase;box-shadow:0 12px 35px rgba(0,0,0,.28);backdrop-filter:blur(14px)}
.game-exit:hover{background:#f0d99f;color:#21190e}
@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
  :root { --phone-vh: 100dvh; }
  html, body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: var(--phone-vh);
    min-height: 0;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
    -webkit-text-size-adjust: 100%;
  }
  #premium-game {
    position: fixed;
    inset: 0;
    width: 100%;
    height: var(--phone-vh);
    min-height: 0;
    overflow: hidden;
  }
  canvas#game {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: var(--phone-vh) !important;
    max-width: none !important;
    max-height: none !important;
  }
  #premium-hud {
    top: max(6px, env(safe-area-inset-top)) !important;
    left: max(7px, env(safe-area-inset-left)) !important;
    width: calc(100% - max(14px, env(safe-area-inset-left) + env(safe-area-inset-right))) !important;
    max-width: none !important;
    padding: 5px 7px !important;
    border-radius: 15px !important;
  }
  #premium-hud .hud-row { overflow: hidden !important; }
  #premium-hud .hud-block { height: 34px !important; padding-inline: 4px !important; }
  #premium-hud .hud-account-name { max-width: 54px !important; font-size: 10px !important; }
  #premium-hud .hud-block b { font-size: 11px !important; }
  #premium-hud .hud-icon { font-size: 13px !important; }
  #game-joystick {
    left: max(8px, env(safe-area-inset-left)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    width: clamp(112px, 31vw, 132px) !important;
    height: clamp(112px, 31vw, 132px) !important;
  }
  #game-joystick button { width: 42px; height: 42px; border-radius: 13px; }
  #game-joystick .joy-up { left: calc(50% - 21px); top: 4px; }
  #game-joystick .joy-down { left: calc(50% - 21px); bottom: 4px; }
  #game-joystick .joy-left { left: 4px; top: calc(50% - 21px); }
  #game-joystick .joy-right { right: 4px; top: calc(50% - 21px); }
  #game-joystick .joy-center { left: calc(50% - 15px); top: calc(50% - 15px); width: 30px; height: 30px; }
  .game-result { padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)) !important; }
  .game-result__card { width: min(100%, 430px) !important; max-height: calc(var(--phone-vh) - 16px) !important; padding: 20px 16px !important; border-radius: 20px !important; overflow: auto; -webkit-overflow-scrolling: touch; }
  .game-result h2 { margin-block: 10px 6px; font-size: 24px; }
  .game-result p { margin-bottom: 12px; }
  .game-result__stats { margin-block: 10px; }
  .portal-ready { bottom: max(92px, calc(env(safe-area-inset-bottom) + 82px)) !important; font-size: 12px; }
  a.yeti-credit { transform: scale(.78) !important; transform-origin: right bottom !important; opacity: .74 !important; }
  .game-exit{top:auto;right:max(8px,env(safe-area-inset-right));bottom:max(8px,env(safe-area-inset-bottom));left:auto;width:46px;min-height:46px;padding:0;justify-content:center;font-size:17px}.game-exit span{display:none}
}

@media (max-height: 500px) and (pointer: coarse) and (orientation: landscape) {
  #premium-hud { width: min(72vw, 650px) !important; left: 50% !important; transform: translateX(-50%) !important; }
  #game-joystick { width: 108px !important; height: 108px !important; }
  #game-joystick button { width: 38px; height: 38px; }
  #game-joystick .joy-up { left: calc(50% - 19px); }
  #game-joystick .joy-down { left: calc(50% - 19px); }
  #game-joystick .joy-left { top: calc(50% - 19px); }
  #game-joystick .joy-right { top: calc(50% - 19px); }
  .game-result__card { width: min(540px, calc(100vw - 32px)) !important; padding: 12px 18px !important; }
  .game-result__glyph { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #premium-game *, .game-result * { scroll-behavior: auto !important; }
}
