/*
 * HUD stage behind every page that uses _Layout: a Blue ground drawn like a game HUD. The stage's own backgrounds give the
 * edge ticks, the hazard band at the bottom and a diagonal band; ::before adds a dot grid; .elx-stage__hud (in _Layout)
 * holds the radar rings. Umber is the only secondary set, kept to thin accents.
 * Text straight on the stage reads White; the White cards set Blue again. The stage is static.
 */
.elx-stage {
  --elx-stage-line: color-mix(in srgb, var(--elx-blue-light) 22%, transparent);
  --elx-stage-tick: color-mix(in srgb, var(--elx-blue-light) 50%, transparent);
  position: relative;
  isolation: isolate;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  color: var(--elx-white);
  background:
    repeating-linear-gradient(180deg, var(--elx-stage-tick) 0 2px, transparent 2px 24px) left 2px top 24px / 8px calc(100% - 60px) no-repeat,
    repeating-linear-gradient(180deg, var(--elx-stage-tick) 0 2px, transparent 2px 24px) right 2px top 24px / 8px calc(100% - 60px) no-repeat,
    repeating-linear-gradient(-45deg, color-mix(in srgb, var(--elx-umber-light) 85%, transparent) 0 10px, transparent 10px 20px) left bottom / 100% 12px no-repeat,
    linear-gradient(
      115deg,
      transparent 38%,
      color-mix(in srgb, var(--elx-blue-mid) 18%, transparent) 38% 46%,
      transparent 46% 49%,
      color-mix(in srgb, var(--elx-umber-light) 14%, transparent) 49% 50.5%,
      transparent 50.5%
    ),
    var(--elx-blue);
  /* Browsers without color-mix() drop the whole shorthand above (it fails at computed time), which left the White text on White. */
  background-color: var(--elx-blue);
}

/* Headings follow their ground: White on the stage, Blue inside the White cards. */
/* A plain list, not :is(): Safari < 14 and Chrome < 88 drop the whole rule and leave the headings Blue on Blue. */
.elx-stage h1,
.elx-stage h2,
.elx-stage h3,
.elx-stage h4 {
  color: inherit;
}

/* Dot grid, faded out in the middle so it never sits behind copy. Masks only read alpha, so any opaque token works. */
.elx-stage::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--elx-blue-light) 35%, transparent) 1px, transparent 1.5px);
  background-size: 16px 16px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, transparent 25%, var(--elx-blue) 90%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, transparent 25%, var(--elx-blue) 90%);
}

/*
 * The rings overhang the screen edges, so this layer clips them: clipping .elx-stage itself would make it the scroll
 * container of the quiz's sticky Back/Check dock.
 */
.elx-stage__hud {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.elx-stage__radar {
  position: absolute;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--elx-blue-light) 30%, transparent);
  border-radius: 50%;
  background:
    linear-gradient(var(--elx-stage-line), var(--elx-stage-line)) 50% 0 / 1px 100% no-repeat,
    linear-gradient(var(--elx-stage-line), var(--elx-stage-line)) 0 50% / 100% 1px no-repeat,
    repeating-radial-gradient(
      circle,
      transparent 0 calc(var(--elx-stage-ring) - 1px),
      var(--elx-stage-line) calc(var(--elx-stage-ring) - 1px) var(--elx-stage-ring)
    );
}
.elx-stage__radar--top {
  --elx-stage-ring: 44px;
  top: -240px;
  right: -260px;
  width: 560px;
}
.elx-stage__radar--bottom {
  --elx-stage-ring: 30px;
  bottom: 40px;
  left: -150px;
  width: 300px;
}

