/* Vezzom universal responsive layer for standalone/static games.
   Loaded by every public HTML game so canvas, images, HUDs and menus adapt on phones, tablets and desktop. */
:root {
  --vz-vw: 100vw;
  --vz-vh: 100dvh;
  --vz-safe-top: env(safe-area-inset-top, 0px);
  --vz-safe-right: env(safe-area-inset-right, 0px);
  --vz-safe-bottom: env(safe-area-inset-bottom, 0px);
  --vz-safe-left: env(safe-area-inset-left, 0px);
  --vz-game-scale: 1;
}

html {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior: none;
}

*, *::before, *::after {
  box-sizing: border-box;
}

img, picture, video, canvas, svg, iframe {
  max-width: 100%;
}

img, picture, video, svg {
  height: auto;
}

button, input, select, textarea, [role="button"] {
  font: inherit;
}

button, [role="button"], a, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
}

#root, #app, #game-root, #game, .game-root, .app, .game, .canvas-wrap, .game-container, .slot-game, .slot-machine {
  max-width: 100vw;
}

canvas {
  display: block;
  object-fit: contain;
}

iframe {
  border: 0;
}

.vz-responsive-fixed-stage {
  max-width: none !important;
  max-height: none !important;
  transform-origin: top left !important;
  will-change: transform;
}

.vz-responsive-scroll {
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
}

@supports (height: 100dvh) {
  .fullscreen, .full-screen, .game-fullscreen, #root, #app, #game-root {
    min-height: 100dvh;
  }
}

@media (max-width: 900px) {
  html, body {
    width: 100vw;
    min-height: 100dvh;
  }

  body {
    font-size: clamp(12px, 2.8vw, 16px);
  }

  button, [role="button"], input, select, textarea {
    min-height: 42px;
  }

  input, select, textarea {
    font-size: 16px !important;
  }

  .modal, .dialog, .popup, .overlay-card, [role="dialog"] {
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
  }

  .hud, .topbar, .toolbar, .controls, .control-panel, .panel, .sidebar, .menu {
    max-width: calc(100vw - 16px) !important;
  }

  .topbar, .toolbar, .controls, .actions, .menu {
    gap: clamp(6px, 2vw, 12px) !important;
  }
}

@media (max-width: 640px) {
  body {
    font-size: clamp(11px, 3.2vw, 15px);
  }

  h1 { font-size: clamp(1.35rem, 7vw, 2rem) !important; }
  h2 { font-size: clamp(1.1rem, 5.4vw, 1.55rem) !important; }
  h3 { font-size: clamp(1rem, 4.5vw, 1.25rem) !important; }

  .desktop-only, .hide-mobile {
    display: none !important;
  }

  .mobile-stack, .controls, .buttons, .actions, .footer-actions {
    flex-wrap: wrap !important;
  }

  .panel, .card, .menu, .modal-content, .dialog-content {
    border-radius: min(18px, 5vw) !important;
  }
}

@media (max-width: 520px) and (orientation: portrait) {
  .landscape-preferred::after {
    content: "Gira tu dispositivo para una mejor experiencia";
    position: fixed;
    left: 50%;
    bottom: calc(10px + var(--vz-safe-bottom));
    transform: translateX(-50%);
    z-index: 2147483000;
    width: calc(100vw - 28px);
    max-width: 360px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    text-align: center;
    font: 800 11px/1.2 system-ui, -apple-system, Segoe UI, sans-serif;
    pointer-events: none;
    backdrop-filter: blur(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
