/* Desert Run (Arena13). Based on the Chromium offline runner styles
 * (Copyright 2013 The Chromium Authors, BSD-style license, see LICENSE),
 * reduced to what the game needs and restyled. */

@font-face {
  font-family: "DotGothic16";
  src: url("fonts/dotgothic16-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #14171f;
  --ink-2: #1a1e28;
  --cream: #ebe5ce;
  --dim: rgba(235, 229, 206, 0.55);
  --line: rgba(235, 229, 206, 0.16);
  --red: #ff1919;
  --pixel: "DotGothic16", ui-monospace, Consolas, monospace;
}

html,
body {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--pixel);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}

/* faint HUD grid + ground glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.35;
}

.hidden {
  display: none;
}

#main-content,
.icon-offline {
  display: none;
}

#offline-resources {
  display: none;
}

/* ---------- Game container ---------- */
.offline .interstitial-wrapper {
  position: relative;
  margin: 0 auto;
  max-width: 600px;
  width: 100%;
  height: 100vh;
  top: 12vh; /* leaves room for the title; same anchor before and during play */
}

.offline .runner-container {
  height: 150px;
  max-width: 600px;
  overflow: hidden;
  position: absolute;
  top: 35px;
  width: 44px;
}

.offline .runner-canvas {
  height: 150px;
  max-width: 600px;
  opacity: 1;
  overflow: hidden;
  position: absolute;
  top: 0;
  z-index: 2;
}

/* Full-screen touch surface created by the game on phones */
.offline .controller {
  background: transparent;
  height: 100vh;
  left: 0;
  position: fixed;
  top: 0;
  width: 100vw;
  z-index: 1;
}

.arcade-mode,
.arcade-mode .runner-container,
.arcade-mode .runner-canvas {
  image-rendering: pixelated;
  max-width: 100%;
  overflow: hidden;
}

.arcade-mode .interstitial-wrapper {
  height: 100vh;
  max-width: 100%;
  overflow: hidden;
}

.arcade-mode .runner-container {
  left: 0;
  margin: auto;
  right: 0;
  transform-origin: top center;
  transition: transform 250ms cubic-bezier(0.4, 0, 1, 1) 400ms;
  z-index: 2;
}

/* ---------- Arena13 HUD ---------- */
.dr-title {
  position: fixed;
  left: 0;
  right: 0;
  top: max(14px, env(safe-area-inset-top));
  margin: 0;
  text-align: center;
  font: 800 clamp(26px, 8vw, 44px)/0.9 system-ui, "Segoe UI", Arial, sans-serif;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.3s ease;
}

.dr-title .o {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--cream);
}

.dr-start {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(12vh + 205px);
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  pointer-events: none; /* taps pass through to the game */
  z-index: 3;
}

.dr-start .cta {
  color: var(--red);
  font-size: 15px;
}

.dr-start .cta::before {
  content: "[ ";
}

.dr-start .cta::after {
  content: " ]";
}

.dr-hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(14px, env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  pointer-events: none;
  z-index: 3;
}

.dr-hint b {
  color: var(--cream);
  font-weight: 400;
}

body.dr-playing .dr-start {
  display: none;
}

body.dr-playing .dr-title {
  opacity: 0.25;
}

/* the touch hint vs keyboard hint */
.dr-touch-only {
  display: none;
}

body.dr-touch .dr-touch-only {
  display: inline;
}

body.dr-touch .dr-key-only {
  display: none;
}
