/* tokens.css is linked from index.html so it downloads in parallel with this
   file instead of being discovered only after this one is parsed. */

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

html,
body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg-0);
}

html {
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(circle at 50% 44%, rgba(21, 77, 102, 0.18), transparent 42%),
    linear-gradient(145deg, #02070c, #04111b 48%, #01050a);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.game-shell,
.game-frame {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.game-frame {
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 44%, rgba(34, 107, 139, 0.13), transparent 43%),
    var(--bg-0);
}

.game-render-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
}

#game-canvas {
  display: block;
  flex: none;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: #020813;
  image-rendering: auto;
  touch-action: none;
  pointer-events: auto;
  cursor: crosshair;
  box-shadow: 0 0 0 1px rgba(111, 202, 231, 0.04), 0 32px 120px rgba(0, 0, 0, 0.48);
}

#game-canvas:focus-visible {
  outline: 2px solid rgba(231, 184, 77, 0.7);
  outline-offset: -2px;
}

.game-ui-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
  color: var(--text);
  font-family: var(--font-ui);
  font-feature-settings: "kern" 1, "liga" 1;
}

.game-ui-layer [data-interactive],
.game-ui-layer button,
.game-ui-layer a {
  pointer-events: auto;
}

.orientation-hint {
  display: none;
  position: fixed;
  z-index: 30;
  inset-inline: max(22px, env(safe-area-inset-left)) max(22px, env(safe-area-inset-right));
  top: 50%;
  translate: 0 -50%;
  max-width: 520px;
  margin-inline: auto;
  padding: 28px 30px;
  text-align: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(4, 15, 23, 0.96);
  box-shadow: var(--shadow-float), var(--inset-highlight);
  backdrop-filter: blur(16px) saturate(120%);
}

.orientation-hint::before {
  content: "";
  display: block;
  width: 58px;
  height: 2px;
  margin-block-end: 17px;
  border-radius: 999px;
  background: var(--amber);
}

.orientation-hint strong,
.orientation-hint span {
  display: block;
}

.orientation-hint strong {
  margin-block-end: 9px;
  color: var(--text-strong);
  font-size: clamp(1.25rem, 4.8vw, 1.65rem);
  line-height: 1.25;
  font-weight: 800;
}

.orientation-hint span {
  color: var(--text-soft);
  font-size: clamp(0.82rem, 3.2vw, 0.98rem);
  line-height: 1.65;
}

html[dir="rtl"] .orientation-hint {
  text-align: right;
}

.visually-hidden {
  position: fixed;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (orientation: portrait) and (max-width: 900px) {
  .orientation-hint {
    display: block;
  }

  .game-frame > :not(.orientation-hint) {
    opacity: 0.14;
    filter: blur(2px) saturate(0.62);
  }
}

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

  .orientation-hint {
    translate: none;
    top: 35%;
  }
}
