/* PrimeSec Joyride · page shell + DOM overlays.
   Brand: primesec.ai black + neon yellow. Pixel-crisp: 2px borders, hard offset shadows, square corners
   (the sponsored ad card is the only rounded element, so it reads as "not part of the game"). */

:root {
  --black: #131313;
  --ink: #1a1a1a;
  --panel: #242424;
  --line: #343434;
  --mid: #5e5e5d;
  --gray: #b8b8b5;
  --cream: #f5f5f0;
  --yellow: #f9fe2e;
  --gold: #ffbe0b;
  --orange: #ff704c;
  --green: #00d69f;

  --pixel: 'Silkscreen', ui-monospace, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: var(--black);
  color: var(--cream);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  font-family: var(--sans);
}

button, input, a { -webkit-tap-highlight-color: transparent; }
input { -webkit-user-select: text; user-select: text; }

/* ---------- Stage + canvas ---------- */

#stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--black);
  overflow: hidden;
}

#game {
  display: block;
  /* Fallback fit (main.js may set explicit inline width/height, which wins). */
  width: min(100vw, 160dvh);
  height: auto;
  aspect-ratio: 320 / 200;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--black);
  touch-action: none;
}

/* ---------- Portrait brand frame (positioned by ui.js) ---------- */

.frame {
  position: fixed;
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--sat) calc(16px + var(--sar)) var(--sab) calc(16px + var(--sal)); /* top right bottom left */
  pointer-events: none;
  text-align: center;
}
.frame.on { display: flex; }

#frame-top { justify-content: flex-end; padding-bottom: 0; }
#frame-bottom { justify-content: flex-start; }

.frame-logo {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 1px;
  color: var(--yellow);
  text-shadow: 3px 3px 0 #5e5f12;
}

.frame-sub,
.frame-credit {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gray);
  text-transform: uppercase;
}
.frame-credit { letter-spacing: 1px; text-transform: none; color: var(--mid); }

.frame-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--pixel);
  font-size: 16px;
  color: var(--cream);
  margin-top: 10px;
}
.hint-dot {
  width: 12px;
  height: 12px;
  background: var(--yellow);
  box-shadow: 0 0 0 3px var(--black), 0 0 0 5px var(--yellow);
  animation: pulse 1.1s steps(2, jump-none) infinite;
}

/* Yellow/black hazard stripe hugging the canvas edge */
.frame-stripe {
  width: 100vw;
  height: 6px;
  margin: 10px 0 0;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 8px, var(--black) 8px 16px);
}
#frame-bottom .frame-stripe { margin: 0; }

/* ---------- Overlay root (exactly covers the canvas) ---------- */

#ui {
  --s: 1; /* game-pixel scale, set by ui.js from the canvas width */
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  font-family: var(--pixel);
  color: var(--cream);
  z-index: 10;
}
#ui [hidden] { display: none !important; }

.no-input,
.btn,
.icon-btn { pointer-events: auto; }

/* ---------- Buttons ---------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  white-space: nowrap;
  border: 2px solid var(--yellow);
  border-radius: 0;
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--pixel);
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.5px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--yellow);
  transition: transform 80ms steps(2), box-shadow 80ms steps(2);
}
.btn:active,
.btn.pressed { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--yellow); }
.btn:focus-visible,
.icon-btn:focus-visible,
.field input:focus-visible,
.check input:focus-visible + span { outline: 2px solid var(--cream); outline-offset: 3px; }
.btn[disabled] { opacity: 0.5; cursor: default; }

.btn-primary { background: var(--yellow); color: var(--black); box-shadow: 4px 4px 0 var(--cream); }
.btn-primary:active { box-shadow: 0 0 0 var(--cream); }
.btn-block { width: 100%; }

.btn-text {
  appearance: none;
  background: none;
  border: 0;
  padding: 12px 10px;
  min-height: 44px;
  min-width: 44px;
  color: var(--gray);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-text:hover { color: var(--cream); }

.icon-btn {
  appearance: none;
  display: grid;
  place-items: center;
  width: calc(var(--s) * 14px + 8px);
  height: calc(var(--s) * 14px + 8px);
  min-width: 44px; /* tap-target minimum on every phone */
  min-height: 44px;
  padding: 0;
  border: 2px solid var(--yellow);
  border-radius: 0;
  background: rgba(19, 19, 19, 0.82);
  color: var(--yellow);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--yellow);
}
.icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.icon-btn svg { width: 60%; height: 60%; shape-rendering: crispEdges; }
.icon-btn .ic-off { display: none; }
.icon-btn.muted .ic-on { display: none; }
.icon-btn.muted .ic-off { display: block; }
.icon-btn.muted { color: var(--gray); border-color: var(--gray); box-shadow: 2px 2px 0 var(--gray); }

/* ---------- Title screen (over the canvas) ---------- */

.title {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--s) * 6px);
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(19, 19, 19, 0.35), rgba(19, 19, 19, 0.82) 75%);
  animation: fade-in 240ms ease-out both;
}

.title .chip {
  font-family: var(--mono);
  font-weight: 700;
  font-size: calc(var(--s) * 7px);
  letter-spacing: 0.18em;
  color: var(--black);
  background: var(--yellow);
  padding: calc(var(--s) * 2px) calc(var(--s) * 5px);
}

.logo {
  margin: 0;
  font-family: var(--pixel);
  font-weight: 700;
  font-size: calc(var(--s) * 34px);
  line-height: 0.9;
  letter-spacing: calc(var(--s) * 1px);
  color: var(--yellow);
  text-shadow:
    calc(var(--s) * 2px) calc(var(--s) * 2px) 0 #4a4b0e,
    calc(var(--s) * 4px) calc(var(--s) * 4px) 0 var(--black);
}

.tap {
  margin-top: calc(var(--s) * 6px);
  font-size: calc(var(--s) * 10px);
  color: var(--cream);
  text-shadow: 2px 2px 0 var(--black);
  animation: blink 1s steps(2, jump-none) infinite;
}
.tap-sub {
  font-family: var(--mono);
  font-size: max(10px, calc(var(--s) * 6px));
  color: var(--gray);
  text-shadow: 1px 1px 0 var(--black);
}
.best {
  font-size: calc(var(--s) * 8px);
  color: var(--yellow);
  text-shadow: 2px 2px 0 var(--black);
}

.title .credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--s) * 5px);
  font-family: var(--mono);
  font-size: max(10px, calc(var(--s) * 6px));
  color: var(--gray);
}
#ui.framed .title .credit { display: none; } /* the portrait frame already credits primesec.ai */
/* portrait: the frame above already shows the logo + stage, so the canvas keeps Zeus visible */
#ui.framed .title .chip,
#ui.framed .title .logo { display: none; }
.title .credit a { color: var(--yellow); text-decoration: none; pointer-events: auto; }

.corner {
  position: absolute;
  top: calc(var(--s) * 5px);
  right: calc(var(--s) * 5px);
  display: flex;
  gap: 8px;
}

/* ---------- HUD ---------- */

.hud { position: absolute; inset: 0; }

.hud-left {
  position: absolute;
  top: calc(var(--s) * 19px); /* just below the 16px ceiling strip */
  left: calc(var(--s) * 6px);
  display: flex;
  flex-direction: column;
  gap: calc(var(--s) * 2px);
  text-shadow:
    2px 0 0 var(--black), -2px 0 0 var(--black), 0 2px 0 var(--black), 0 -2px 0 var(--black),
    2px 2px 0 var(--black);
}
.hud-dist {
  font-weight: 700;
  font-size: calc(var(--s) * 15px);
  line-height: 1;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.hud-dist small { font-size: 0.6em; color: var(--yellow); margin-left: 2px; }
.hud-tokens {
  display: flex;
  align-items: center;
  gap: calc(var(--s) * 3px);
  font-size: calc(var(--s) * 9px);
  line-height: 1;
  color: var(--yellow);
}
.hud-best {
  font-family: var(--mono);
  font-size: max(9px, calc(var(--s) * 5px));
  color: var(--gray);
}

/* CSS pixel AI token coin */
.coin {
  display: inline-grid;
  place-items: center;
  width: calc(var(--s) * 9px);
  height: calc(var(--s) * 9px);
  min-width: 12px;
  min-height: 12px;
  background: var(--yellow);
  color: var(--black);
  font-family: var(--pixel);
  font-weight: 700;
  font-size: calc(var(--s) * 4px);
  line-height: 1;
  text-shadow: none;
  clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%);
  box-shadow: inset -2px -2px 0 var(--gold);
}
.coin.lg { width: 22px; height: 22px; font-size: 9px; }

/* Keep the HUD buttons off the right edge, where missile warnings and hazards
   arrive. Landscape / desktop: under the distance stack on the left (behind Zeus). */
.hud .corner {
  top: calc(var(--s) * 60px);
  right: auto;
  left: calc(var(--s) * 6px);
}
/* Portrait: up in the empty black frame above the canvas (--ui-top is set by ui.js). */
#ui.framed .corner {
  top: calc(var(--sat) + 12px - var(--ui-top, 0px));
  right: calc(12px + var(--sar));
  left: auto;
}

/* ---------- Pause (over the canvas) ---------- */

.paused {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--s) * 7px);
  background: rgba(19, 19, 19, 0.78);
  cursor: pointer;
  animation: fade-in 160ms ease-out both;
}
.paused-title {
  font-weight: 700;
  font-size: calc(var(--s) * 22px);
  color: var(--yellow);
  text-shadow: calc(var(--s) * 2px) calc(var(--s) * 2px) 0 #4a4b0e;
}

/* ---------- Game over modal covers the whole viewport ---------- */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(12px + var(--sat)) calc(16px + var(--sar)) calc(12px + var(--sab)) calc(16px + var(--sal));
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px),
    rgba(10, 10, 10, 0.8);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  pointer-events: auto;
  font-family: var(--sans);
  animation: fade-in 200ms ease-out both;
}

/* ---------- Game over ---------- */

.over-panel {
  width: min(100%, 420px);
  margin: auto;
  display: grid;
  gap: 14px;
  animation: slide-up 380ms cubic-bezier(0.2, 1, 0.3, 1) both;
}

.box {
  background: var(--ink);
  border: 2px solid var(--yellow);
  box-shadow: 4px 4px 0 var(--yellow);
  padding: 16px;
}

.over-head {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 6px;
}
.over-title {
  margin: 0;
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  color: var(--yellow);
  text-shadow: 2px 2px 0 #4a4b0e;
  white-space: nowrap;
}
.over-stage { font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; color: var(--gray); }

.score-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 0 12px;
}
.score-big {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 46px;
  line-height: 0.9;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.score-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; color: var(--gray); margin-bottom: 4px; }
.new-best {
  font-family: var(--pixel);
  font-size: 12px;
  color: var(--black);
  background: var(--yellow);
  padding: 5px 8px;
  animation: pop 400ms 300ms cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin: 0;
  background: var(--line);
  border: 2px solid var(--line);
}
.stat { background: var(--black); padding: 8px 6px; text-align: center; }
.stat dt { font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; color: var(--gray); text-transform: uppercase; }
.stat dd { margin: 4px 0 0; font-family: var(--pixel); font-size: 16px; color: var(--cream); font-variant-numeric: tabular-nums; }
.stat dd.y { color: var(--yellow); }

.over-buttons {
  display: grid;
  grid-template-columns: 1.4fr 1fr; /* PLAY AGAIN gets the room it needs */
  gap: 12px;
  margin-top: 16px;
}
.over-buttons .btn { padding-inline: 10px; font-size: clamp(12px, 3.6vw, 15px); }

.board h3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 10px;
  font-family: var(--pixel);
  font-size: 15px;
  color: var(--yellow);
}
.board h3 small { font-family: var(--mono); font-size: 10px; color: var(--mid); letter-spacing: 0.08em; }

.lb {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  counter-reset: rank;
  font-family: var(--mono);
  font-size: 13px;
}
.lb li {
  counter-increment: rank;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 8px;
  padding: 5px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--cream);
}
.lb li::before { content: counter(rank); color: var(--mid); }
.lb li:nth-child(-n + 3)::before { color: var(--yellow); }
.lb li.me { background: rgba(249, 254, 46, 0.12); }
.lb li.me .n { color: var(--yellow); }
.lb .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .s { font-variant-numeric: tabular-nums; color: var(--yellow); }
.lb .empty { grid-template-columns: 1fr; color: var(--mid); }
.lb .empty::before { content: none; }

.form { display: grid; gap: 8px; }
.form-title { margin: 4px 0 2px; font-family: var(--pixel); font-size: 12px; color: var(--cream); }
.field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--black);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 16px; /* >=16px avoids iOS focus zoom */
  outline: none;
  touch-action: manipulation;
}
.field input::placeholder { color: var(--mid); }
.field input:focus { border-color: var(--yellow); }
.field input[aria-invalid='true'] { border-color: var(--orange); }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--gray);
  cursor: pointer;
  padding: 8px 0;
}
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box-ui {
  flex: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--yellow);
  background: var(--black);
  display: grid;
  place-items: center;
}
.check input:checked + .box-ui { background: var(--yellow); }
.check input:checked + .box-ui::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid var(--black);
  border-width: 0 3px 3px 0;
  transform: translateY(-1px) rotate(45deg);
}

.form-msg { min-height: 18px; margin: 0; font-family: var(--mono); font-size: 12px; color: var(--gray); }
.form-msg.err { color: var(--orange); }
.form-msg.ok { color: var(--green); }

.over-foot {
  display: flex;
  justify-content: center;
}
.demo-link {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--yellow);
  text-decoration: none;
  padding: 8px 12px;
  background: var(--black);
  pointer-events: auto;
}
.demo-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--sab));
  transform: translateX(-50%);
  padding: 10px 14px;
  background: var(--yellow);
  color: var(--black);
  font-family: var(--pixel);
  font-size: 13px;
  box-shadow: 3px 3px 0 var(--cream);
  z-index: 30;
  pointer-events: none;
  white-space: nowrap;
  animation: pop 240ms cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

/* ---------- Stages: HUD chip + gate banner ---------- */

/* "2/5 BUILD": top center, on the ceiling slab (landscape) or in the plenum band (portrait) */
.hud-stage {
  position: absolute;
  top: calc(var(--s) * 3px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  border: 2px solid var(--yellow);
  background: var(--black);
  box-shadow: 2px 2px 0 var(--black);
  font-family: var(--pixel);
  font-size: max(10px, calc(var(--s) * 5.5px));
  line-height: 1;
  white-space: nowrap;
}
.hud-stage b { padding: 3px 5px 2px; background: var(--yellow); color: var(--black); font-weight: 700; }
.hud-stage span { padding: 3px 6px 2px; color: var(--cream); letter-spacing: 0.06em; }

/* Gate banner (2.5s, see ui.js BANNER_MS). It never sits on the playfield, where the next chunk's hazards
   arrive right after a gate. Landscape: one line inside the 16px ceiling strip, over the stage chip.
   Portrait (#ui.band): two lines in the skyline band above the ceiling slab, right of the distance counter.
   The title + cost show first, then the tagline takes their place. */
.stage-banner {
  position: absolute;
  top: calc(var(--s) * 1px);
  left: 50%;
  height: calc(var(--s) * 14px);
  width: max-content;
  max-width: 96%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 calc(var(--s) * 5px);
  background: var(--black);
  border: 2px solid var(--yellow);
  box-shadow: 2px 2px 0 var(--black);
  text-align: center;
  white-space: nowrap;
  animation:
    banner-in 280ms steps(7, end) both,
    banner-out 360ms 2140ms steps(2, jump-none) both;
}
.sb-main {
  display: flex;
  align-items: baseline;
  gap: calc(var(--s) * 6px);
  animation: sb-off 1ms 1250ms both;
}
.sb-title {
  font-family: var(--pixel);
  font-size: calc(var(--s) * 7px);
  line-height: 1;
  color: var(--cream);
}
.sb-title b { color: var(--yellow); font-weight: 700; }
.sb-tag {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: calc(var(--s) * 5.5px);
  letter-spacing: 0.06em;
  color: var(--cream);
  text-transform: uppercase;
  visibility: hidden;
  animation: sb-on 1ms 1250ms both;
}
.sb-cost {
  font-family: var(--pixel);
  font-size: calc(var(--s) * 6px);
  line-height: 1;
  color: var(--yellow);
}
.sb-cost b { font-size: 1.3em; font-weight: 700; color: var(--yellow); text-shadow: 1px 1px 0 #4a4b0e; }

/* Portrait: the band above the ceiling slab (y 0..BAND) is scenery, so the banner can stack there. */
#ui.band .stage-banner {
  top: calc(var(--s) * 18px);
  left: auto;
  right: calc(var(--s) * 5px);
  height: calc(var(--s) * 26px);
  transform: none;
  max-width: calc(100% - var(--s) * 80px);
  padding: calc(var(--s) * 2px + 2px) calc(var(--s) * 5px) 0;
}
#ui.band .stage-banner::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(var(--s) * 2px);
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 5px, var(--black) 5px 10px);
}
#ui.band .sb-main { flex-direction: column; align-items: center; gap: calc(var(--s) * 3px); }
#ui.band .sb-tag { white-space: normal; padding: calc(var(--s) * 2px + 2px) calc(var(--s) * 4px) 0; line-height: 1.25; }

@keyframes banner-in { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 0 0 0); } }
@keyframes banner-out { to { opacity: 0; } }
@keyframes sb-off { to { visibility: hidden; } }
@keyframes sb-on { to { visibility: visible; } }

/* ---------- Landscape phones: two-column modals so nothing scrolls off ---------- */

@media (orientation: landscape) and (max-height: 520px) {
  .over-panel {
    width: min(100%, 780px);
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .over-foot { grid-column: 1 / -1; }
  .lb { max-height: 128px; overflow-y: auto; overscroll-behavior: contain; font-size: 12px; }
  .lb li { padding: 4px; }
  .form { grid-template-columns: 1fr 1fr; gap: 8px; }
  .form-title,
  .form .field, /* full width: the email placeholder was clipped at half width */
  .form .check,
  .form .btn,
  .form-msg { grid-column: 1 / -1; }
  .field input { min-height: 40px; padding: 8px 10px; }
  .box { padding: 12px 14px; }
  .score-row { margin: 10px 0 8px; }
  .score-big { font-size: 38px; }
  .over-buttons { margin-top: 12px; }
}

/* ---------- Motion ---------- */

@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(48px) scale(0.98); } }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } }
@keyframes blink { 50% { opacity: 0.15; } }
@keyframes pulse { 50% { transform: scale(0.6); } }

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

.noscript { padding: 24px; text-align: center; font-family: var(--mono); }
.noscript a { color: var(--yellow); }

/* ---------------------------------------------------------------------------
   PrimeSec Joyride logo lockup (title screen + portrait frame). Sized by the
   parent's font-size: JOYRIDE is 1em, PRIMESEC sits above it at ~0.3em.
   --------------------------------------------------------------------------- */
.brand-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  text-shadow: none;
  letter-spacing: 0;
}
.bl-top {
  display: flex;
  align-items: center;
  gap: 0.35em;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.3em;
  letter-spacing: 0.42em;
  margin-right: -0.42em; /* balance the trailing letter-spacing */
  color: var(--cream);
}
.bl-top::before,
.bl-top::after {
  content: '';
  width: 1.6em;
  height: 0.16em;
  background: var(--yellow);
}
.bl-main {
  position: relative;
  margin-top: 0.06em;
  padding: 0 0.12em;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: 1.32em;
  letter-spacing: -0.02em;
  color: var(--yellow);
  transform: skewX(-6deg);
  -webkit-text-stroke: 0.045em #131313;
  paint-order: stroke fill;
  /* stepped 3D extrusion down-right, then a hard drop shadow */
  text-shadow:
    0.02em 0.02em 0 #c9cd1f,
    0.04em 0.04em 0 #a7aa17,
    0.06em 0.06em 0 #85880f,
    0.08em 0.08em 0 #5e600a,
    0.1em 0.1em 0 #131313,
    0.13em 0.13em 0 #131313;
}
/* speed lines streaking off the left */
.bl-main::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 22%;
  width: 0.9em;
  height: 56%;
  background: repeating-linear-gradient(180deg, var(--yellow) 0 0.06em, transparent 0.06em 0.16em);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000);
  mask-image: linear-gradient(90deg, transparent, #000);
}
/* thunderbolt crashing into the last letter */
.bl-bolt {
  position: absolute;
  right: -0.22em;
  top: -0.32em;
  width: 0.36em;
  height: 0.6em;
  fill: var(--cream);
  stroke: #131313;
  stroke-width: 1.4px;
  paint-order: stroke fill;
  transform: rotate(14deg);
  filter: drop-shadow(0.03em 0.03em 0 #131313);
}
.frame-logo .brand-logo,
.logo .brand-logo { font-family: Inter, system-ui, sans-serif; }
.logo .brand-logo { font-size: 0.7em; } /* keep clear of Zeus hovering mid-screen */
@media (prefers-reduced-motion: no-preference) {
  .title .bl-bolt { animation: bl-flash 2.4s steps(1) infinite; }
}
@keyframes bl-flash {
  0%, 88%, 100% { fill: var(--cream); }
  90%, 94% { fill: var(--yellow); }
}
