/*
  PLAYRS CLUB
  ORACLE TERMINAL v1

  Appearance only. Spatial rendering lives in js/void-renderer.js,
  travel state in js/playrs-oracle-nav-v1.js, destination truth in
  js/playrs-travel-registry-v1.js. This file owns none of that.
*/

#void-root {
  position: fixed;
  inset: 0;
  background: var(--playrs-bg, #050505);
  color: var(--playrs-text, #f2f2f2);
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow: hidden;
}

#void-stage {
  position: absolute;
  inset: 0;
}

/* The void itself stays dark/neutral regardless of platform theme
   (V7.1 section 09) -- it's spatial depth, not terminal chrome. Only
   the CSS fallback (no WebGL) uses this background, so it never
   fights the Three.js canvas either way. */
#void-stage.css-fallback {
  background:
    radial-gradient(
      ellipse at 50% 42%,
      #141414 0%,
      #050505 60%,
      #000 100%
    );
}

#void-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Page title law (V4): the top of the page carries only a title, no
   navigation. MENU stays top-left as the manual-nav trigger; this sits
   centered so the two never compete for the same space.
   V8 section 08: larger/sleeker/more confident -- system title, not a
   marketing headline -- still restrained uppercase/tracked type. */
#page-title {
  position: fixed;
  top: calc(env(safe-area-inset-top,0px) + 20px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 59;

  margin: 0;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .92;
  pointer-events: none;
}

@media (max-width: 700px) {

  #page-title {
    top: calc(env(safe-area-inset-top,0px) + 16px);
    font-size: 18px;
  }

}

#menu {
  position: fixed;
  top: calc(env(safe-area-inset-top,0px) + 20px);
  left: calc(env(safe-area-inset-left,0px) + 24px);
  z-index: 60;
  border: 1px solid transparent;
  padding: 6px 9px;
  margin: -6px -9px;
  background: transparent;
  color: var(--playrs-text-secondary, rgba(255,255,255,.62));
  font: inherit;
  font-size: 9px;
  letter-spacing: .15em;
  cursor: pointer;
  border-radius: 2px;
  transition: color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

#menu:hover,
#menu:focus-visible {
  color: var(--playrs-text, #fff);
  border-color: var(--playrs-border, rgba(255,255,255,.22));
  box-shadow: 0 0 16px var(--playrs-hover, rgba(255,255,255,.09));
}

/* ============================
   ORACLE TERMINAL CONTROL DECK
   Frosted glass -- intentional exception to the no-glassmorphism rule,
   kept restrained: monochrome, hairline border, no color, no bloom.
============================ */

#oracle-deck {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;

  display: flex;
  flex-direction: column;

  background: var(--playrs-frosted, rgba(10,10,12,.55));
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
  border-top: 1px solid var(--playrs-border, rgba(255,255,255,.10));

  color: var(--playrs-text);

  padding-bottom:
    calc(env(safe-area-inset-bottom,0px) + 22px);
}

/* Fallback for browsers without backdrop-filter support: an opaque
   dark panel instead of a translucent glass one. Still fully legible,
   still on-brand. */
@supports not (
  (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
) {
  #oracle-deck {
    background: var(--playrs-frosted-fallback, rgba(7,7,8,.95));
  }
}

.deck-eyebrow {
  font-size: 8px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--playrs-text-faint);
  margin-bottom: 6px;
}

/* Large monitors: the frosted bar spans the full width, but its
   content stays deliberately sized rather than stretching into an
   enormous empty horizontal bar (section 14). */
.deck-status {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--playrs-border);
}

.deck-primary {
  font-size: 13px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--playrs-text);
  margin-bottom: 4px;
}

.deck-secondary {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--playrs-text-secondary);
}

.deck-signal {
  font-size: 9px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--playrs-text-muted);
  margin-top: 8px;
  min-height: 12px;
  transition: opacity 400ms ease;
}

.deck-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(100%, 640px);
  margin: 0 auto;
}

.deck-panel {
  padding: 14px 20px 18px;
  border-right: 1px solid var(--playrs-border);
  border-bottom: 1px solid var(--playrs-border);
  min-width: 0;
}

.deck-panel:last-child {
  border-right: 0;
}

.deck-row:last-child .deck-panel {
  border-bottom: 0;
}

.deck-label {
  font-size: 8px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--playrs-text-faint);
  margin-bottom: 8px;
}

#universe-select {
  appearance: none;
  background: transparent;
  color: var(--playrs-text);
  border: 1px solid var(--playrs-border-strong);
  border-radius: 2px;
  padding: 10px 10px;
  font: inherit;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  width: 100%;
  min-height: 44px;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

#universe-select:hover {
  border-color: var(--playrs-focus);
}

#universe-select:focus-visible {
  outline: none;
  border-color: var(--playrs-focus);
  box-shadow: 0 0 16px var(--playrs-hover);
}

.deck-action,
.deck-action-secondary {
  display: block;
  width: 100%;
  min-height: 44px;
  background: transparent;
  color: var(--playrs-text);
  border: 1px solid var(--playrs-border-strong);
  border-radius: 2px;
  padding: 10px 12px;
  font: inherit;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    opacity 150ms ease;
}

.deck-action:hover,
.deck-action:focus-visible,
.deck-action-secondary:hover,
.deck-action-secondary:focus-visible {
  border-color: var(--playrs-focus);
  box-shadow:
    0 0 18px var(--playrs-hover),
    inset 0 0 12px var(--playrs-hover);
}

.deck-action:focus-visible,
.deck-action-secondary:focus-visible,
#universe-select:focus-visible,
#menu:focus-visible {
  outline: 1px solid var(--playrs-focus, rgba(255,255,255,.55));
  outline-offset: 2px;
}

.deck-action[disabled] {
  opacity: .5;
  cursor: default;
}

.deck-action[disabled]:hover {
  border-color: var(--playrs-border-strong);
  box-shadow: none;
}

#home-row[hidden] { display: none !important; }

#home-row {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 10px 20px 16px;
  display: flex;
  justify-content: center;
}

/* HOME reads centrally in the deck (creator request) rather than
   left-aligned under the UNIVERSE/DESTINATION row above it. */
#home-action {
  max-width: 220px;
}

/* playrs-root-menu-system-v1's injected panel (index.html). Full
   ownership of its appearance lives here, not split across files --
   index.html's inline style block only owns the toggle logic.

   CONFIRMED BUG (V4): this rule previously read plain
   "#playrs-root-system-links { display:flex; ... }". An ID selector
   (specificity 1,0,0) always beats the browser's default UA rule
   "[hidden] { display:none }" (specificity 0,1,0), so setting
   links.hidden = true in JS never actually hid the panel -- it has
   been visible unconditionally since page load, and the MENU click
   handler's hidden-toggle was silently doing nothing. Scoping this
   rule to :not([hidden]) lets the UA's [hidden] rule win when hidden
   is true, and this rule wins (same specificity, later in source, and
   more specific than the bare attribute selector) when it is not. */
#playrs-root-system-links:not([hidden]) {
  position: fixed;
  top: calc(env(safe-area-inset-top,0px) + 52px);
  left: calc(env(safe-area-inset-left,0px) + 28px);
  z-index: 61;

  display: flex;
  flex-direction: column;
  gap: 10px;

  font-size: 9px;
  letter-spacing: .15em;

  background: var(--playrs-frosted, rgba(10,10,12,.72));
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--playrs-border-strong, rgba(255,255,255,.16));
  border-radius: 2px;
  padding: 16px 18px;
}

#playrs-root-system-links[hidden] {
  display: none;
}

@supports not (
  (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
) {
  #playrs-root-system-links:not([hidden]) {
    background: var(--playrs-frosted-fallback, rgba(7,7,8,.96));
  }
}

#playrs-root-system-links a,
#playrs-root-system-links button {
  display: block;
  width: 100%;
  background: transparent;
  color: var(--playrs-text-secondary, rgba(255,255,255,.62));
  text-decoration: none;
  text-align: left;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  padding: 6px 2px;
  border-radius: 2px;
  cursor: pointer;
  transition: color 150ms ease, text-shadow 150ms ease;
}

#playrs-root-system-links a:hover,
#playrs-root-system-links a:focus-visible,
#playrs-root-system-links button:hover,
#playrs-root-system-links button:focus-visible {
  color: var(--playrs-text, #fff);
  text-shadow: 0 0 12px var(--playrs-hover, rgba(255,255,255,.35));
}

/* Theme control sits inside MENU, visually separated from the route
   links above it (V7.1 section 05). */
#playrs-root-menu-theme-v1 {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--playrs-border);
  opacity: .8;
}

@media (max-width: 700px) {

  #playrs-root-system-links {
    top: calc(env(safe-area-inset-top,0px) + 44px);
    left: calc(env(safe-area-inset-left,0px) + 18px);
    font-size: 8px;
  }

}

@media (max-width: 700px) {

  #menu {
    top: calc(env(safe-area-inset-top,0px) + 16px);
    left: calc(env(safe-area-inset-left,0px) + 18px);
  }

  .deck-status {
    padding: 12px 16px 10px;
  }

  .deck-row {
    grid-template-columns: 1fr 1fr;
  }

  .deck-panel {
    padding: 12px 16px 14px;
  }

  #home-row {
    padding: 8px 16px 14px;
  }

}

@media (max-width: 420px) {

  /* Two tight columns still fit; only the row order/copy needs to
     stay short. Do not collapse to one column here -- UNIVERSE and
     DESTINATION belong side by side per the information hierarchy. */
  .deck-label {
    font-size: 7px;
  }

}

@media (max-height: 560px) {

  .deck-primary {
    font-size: 11px;
  }

  .deck-status {
    padding: 10px 16px 8px;
  }

  .deck-panel {
    padding: 10px 16px 12px;
  }

  .deck-signal {
    margin-top: 5px;
  }

}

#void-root *, #void-root *::before, #void-root *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: reduce) {
  #void-root * { transition: none !important; }
}

/* World selection shares the existing deck owner and remains separate from ENTER. */
#void-root [hidden] { display: none !important; }
#world-select { width:100%; min-height:44px; margin-bottom:8px; padding:8px; font:inherit; font-size:10px; color:var(--playrs-text); background:var(--playrs-bg); border:1px solid var(--playrs-border-strong); }
