/* Hollow Reign player page.
   One rule the stock Unity template breaks and this one keeps: the canvas is
   the page. No fixed pixel size, no user-agent branch, no white gutter, no
   engine branding around the game. */

:root {
  --hr-void:      #120820;
  --hr-primary:   #7B2FBE;
  --hr-accent:    #FFD700;
  --hr-highlight: #FFFACD;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--hr-void);
  color: var(--hr-highlight);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

/* No text selection or long-press callout: a drag on the canvas is the
   movement stick, and the browser must not treat it as a text gesture. */
body { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

#unity-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(123, 47, 190, 0.18) 0%, rgba(18, 8, 32, 0) 60%),
    var(--hr-void);
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--hr-void);
  touch-action: none;   /* the canvas owns every touch; no browser panning */
  outline: none;
}

/* Hollow Reign is authored portrait. On a phone, and on any viewport that is
   taller than it is wide, the canvas simply fills the screen. On a desktop
   window it must NOT stretch to 16:9 — every screen in the game is a vertical
   column, and a wide canvas renders that column as a thin strip of tiny text
   across the middle of a very large window.

   So on wide viewports the canvas takes the full height and a phone's aspect,
   centred, with the page's own gradient behind it. That is a deliberate frame,
   not the stock template's letterbox: the stock page pinned a fixed 960x600
   pixel box to the middle of a white document regardless of window size. This
   is responsive, aspect-correct, and the same dark field as the game. */
@media (min-aspect-ratio: 1/1) {
  #unity-canvas {
    width: auto;
    height: 100%;
    aspect-ratio: 9 / 19.5;
    box-shadow: 0 0 0 1px rgba(255, 250, 205, 0.08), 0 0 80px rgba(0, 0, 0, 0.6);
  }
}

/* ── Boot curtain ─────────────────────────────────────────────────────── */

#hr-boot {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2vh;
  padding: max(4vh, env(safe-area-inset-top)) 6vw max(4vh, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse at 50% 38%, rgba(123, 47, 190, 0.35) 0%, rgba(18, 8, 32, 0) 62%),
    var(--hr-void);
  transition: opacity 0.5s ease;
  z-index: 2;
}

#hr-boot.hr-gone { opacity: 0; pointer-events: none; }

#hr-boot-title {
  font-size: clamp(30px, 8.5vw, 68px);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--hr-accent);
  text-shadow: 0 0 24px rgba(255, 215, 0, 0.35);
  text-align: center;
}

#hr-boot-tag {
  font-size: clamp(11px, 2.9vw, 18px);
  letter-spacing: 0.22em;
  color: rgba(255, 250, 205, 0.55);
  text-align: center;
}

#hr-boot-track {
  width: min(66vw, 340px);
  height: 6px;
  margin-top: 1.5vh;
  border-radius: 3px;
  background: rgba(255, 250, 205, 0.12);
  overflow: hidden;
}

#hr-boot-fill {
  width: 0%;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--hr-primary), var(--hr-accent));
  transition: width 0.2s ease;
}

#hr-boot-pct {
  font-size: clamp(10px, 2.6vw, 15px);
  letter-spacing: 0.18em;
  color: rgba(255, 250, 205, 0.4);
}

/* ── Error / warning banner ───────────────────────────────────────────── */

#hr-banner {
  position: absolute;
  left: 50%;
  top: max(12px, env(safe-area-inset-top));
  transform: translateX(-50%);
  width: min(90vw, 560px);
  display: none;
  z-index: 3;
}

.hr-banner-line {
  margin-bottom: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  background: rgba(18, 8, 32, 0.92);
  border: 1px solid rgba(255, 250, 205, 0.25);
  color: var(--hr-highlight);
}

.hr-banner-line.hr-warn  { border-color: rgba(255, 215, 0, 0.6); }
.hr-banner-line.hr-error { border-color: rgba(255, 69, 0, 0.8); color: #ffd9cc; }
