/* RESET & BASE */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --app-width: 100vw;
  --app-height: 100dvh;
  --ui-scale: 1;
  --frame-x: clamp(18px, calc(32px * var(--ui-scale)), 64px);
  --frame-y: clamp(20px, calc(40px * var(--ui-scale)), 72px);
  --space-xs: clamp(8px, calc(8px * var(--ui-scale)), 18px);
  --space-sm: clamp(12px, calc(12px * var(--ui-scale)), 24px);
  --space-md: clamp(16px, calc(18px * var(--ui-scale)), 30px);
  --space-lg: clamp(24px, calc(28px * var(--ui-scale)), 44px);
  --space-xl: clamp(32px, calc(40px * var(--ui-scale)), 64px);
  --space-2xl: clamp(40px, calc(56px * var(--ui-scale)), 96px);
  --title-lg: clamp(34px, calc(62px * var(--ui-scale)), 128px);
  --title-md: clamp(22px, calc(38px * var(--ui-scale)), 72px);
  --title-sm: clamp(18px, calc(30px * var(--ui-scale)), 54px);
  --body-lg: clamp(14px, calc(17px * var(--ui-scale)), 30px);
  --body-md: clamp(13px, calc(15px * var(--ui-scale)), 24px);
  --body-sm: clamp(10px, calc(12px * var(--ui-scale)), 18px);
  --caption: clamp(9px, calc(10px * var(--ui-scale)), 16px);
  --button-width: min(100%, clamp(240px, calc(280px * var(--ui-scale)), 520px));
  --field-width: min(100%, clamp(260px, calc(320px * var(--ui-scale)), 640px));
  --basket-width: 88px;
  --road-height: 56px;
  --road-offset: 0px;
  --basket-bottom: 28px;
  --fire-width: 108px;
  --cloud-width: 80px;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: #000;
}

body {
  position: relative;
  font-family: 'Inter', sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
  color: #fff;
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

/* SCREEN SYSTEM */
.screen {
  position: fixed;
  left: 50%;
  top: 50%;
  width: var(--app-width);
  height: var(--app-height);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  overflow: hidden;
  isolation: isolate;
  container-type: size;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Desktop landscape: render screens as a centered portrait frame so
   layouts don't stretch out across a wide viewport. ── */
@media (orientation: landscape) and (min-width: 900px) {
  :root {
    --app-width: min(56vh, 100vw);
    --app-height: min(100vh, 178vh);
  }

  html, body {
    background: radial-gradient(ellipse at center, #1a1a1a 0%, #000 70%);
  }

  .screen {
    aspect-ratio: 9 / 16;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55),
                0 0 0 1px rgba(255, 255, 255, 0.04);
  }
}

/* ── Brand logo (lives inside each screen that should carry it).
   Kiosk-anchored values via clamp(): 220px from bottom, 40px tall.
   Phone/desktop pin to floors for legibility. Width auto-derives from
   aspect ratio (logo SVG is 80×14, ~5.71:1). ── */
.brand-logo {
  position: absolute;
  bottom: clamp(40px, 11.46cqh, 220px);
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: clamp(20px, 2.083cqh, 40px);
  z-index: 50;
  pointer-events: none;
}
