/* Title screen. Same type language as the deck UI (ui.css) — condensed caps,
   thin borders, dark slabs — but everything sizes off `--u`, one unit of the
   letterboxed 16:9 frame, so the lockup holds its proportions against the
   canvas at any window size instead of drifting with the viewport. */

html, body {
  margin: 0;
  height: 100%;
  background: #050308;
  overflow: hidden;
}

#stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#frame {
  --u: min(1vw, 1.7778vh);      /* 1% of the frame's width */
  --cyan: #28e0d0;
  --amber: #ffd23c;
  --text: #c8d2e0;
  --muted: #6d7a8c;
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
}

#frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#overlay {
  position: absolute;
  inset: 0;
  font-family: "Bahnschrift", "Arial Narrow", Arial, sans-serif;
  color: var(--text);
  user-select: none;
}
#overlay .hidden { display: none; }

/* ---- Lockup: centered on the attract screen, parked top-left behind the
   menu so the lit floor of the pit stays visible ---- */
.lockup {
  position: absolute;
  white-space: nowrap;   /* an absolute box at left:50% only gets half the
                            frame to lay out in — the name must never wrap */
  left: 50%;
  top: 37%;
  transform: translate(-50%, -50%);
  text-align: center;
  transition: left 0.45s ease, top 0.45s ease, transform 0.45s ease;
}
.lockup.small {
  left: calc(8 * var(--u));
  top: calc(13 * var(--u));
  transform: translate(0, -50%);
  text-align: left;
}

.kicker {
  font-size: calc(1.5 * var(--u));
  letter-spacing: calc(0.9 * var(--u));
  color: var(--cyan);
  margin-bottom: calc(1 * var(--u));
  text-shadow: 0 0 calc(1.4 * var(--u)) rgba(40, 224, 208, 0.55);
}

.game-title {
  margin: 0;
  font-size: calc(11 * var(--u));
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: calc(1.6 * var(--u));
  /* Indent by one tracking step so the optical center matches the block —
     letter-spacing hangs an empty slot off the last glyph. */
  text-indent: calc(1.6 * var(--u));
  color: #f2f6fb;
  text-shadow:
    0 0 calc(2.4 * var(--u)) rgba(255, 46, 136, 0.45),
    0 0 calc(6 * var(--u)) rgba(255, 122, 46, 0.30),
    0 calc(0.5 * var(--u)) 0 rgba(0, 0, 0, 0.6);
  transition: font-size 0.45s ease, letter-spacing 0.45s ease;
}
.lockup.small .game-title { font-size: calc(6.4 * var(--u)); }

/* ---- Attract prompt ----
   Centered, and dropped to the very bottom so it clears the near duel — the
   band down there is the blurred foreground silhouette, which is the darkest,
   flattest thing on screen and the best backing this text can get. */
.prompt {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(3 * var(--u));
  text-align: center;
  font-size: calc(1.5 * var(--u));
  letter-spacing: calc(0.7 * var(--u));
  color: var(--amber);
  animation: pulse 2.1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.28; }
  50%      { opacity: 1; }
}

/* ---- Menu column ---- */
.menu {
  position: absolute;
  left: calc(8 * var(--u));
  bottom: calc(11 * var(--u));
  width: calc(26 * var(--u));
  display: flex;
  flex-direction: column;
  gap: calc(0.7 * var(--u));
}
.menu.settings {
  width: calc(32 * var(--u));
  background: rgba(8, 10, 16, 0.82);
  border: 1px solid #222a3a;
  border-top: calc(0.3 * var(--u)) solid var(--cyan);
  padding: calc(1.4 * var(--u));
  gap: calc(0.9 * var(--u));
}

.save-line, .panel-head {
  font-size: calc(1.1 * var(--u));
  letter-spacing: calc(0.35 * var(--u));
  color: var(--muted);
  margin-bottom: calc(0.6 * var(--u));
  font-variant-numeric: tabular-nums;
}
.panel-head { color: var(--cyan); }

.menu-btn {
  background: rgba(10, 14, 22, 0.78);
  border: 1px solid #2a3346;
  border-left: calc(0.35 * var(--u)) solid #2a3346;
  color: var(--text);
  font-family: inherit;
  font-size: calc(1.7 * var(--u));
  font-weight: 700;
  letter-spacing: calc(0.5 * var(--u));
  text-align: left;
  padding: calc(1 * var(--u)) calc(1.2 * var(--u));
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.menu-btn:hover:not(:disabled),
.menu-btn:focus-visible,
.menu-btn:focus {
  outline: none;
  border-left-color: var(--cyan);
  border-color: #3d4a63;
  background: rgba(20, 30, 44, 0.9);
  color: #fff;
}
.menu-btn:disabled { opacity: 0.32; cursor: default; }

.menu-note {
  font-size: calc(1.05 * var(--u));
  letter-spacing: calc(0.3 * var(--u));
  color: #e05050;
  min-height: calc(1.4 * var(--u));
}

/* ---- Settings rows ---- */
.opt {
  display: flex;
  align-items: center;
  gap: calc(0.8 * var(--u));
}
.opt-label {
  flex: 1;
  font-size: calc(1.25 * var(--u));
  letter-spacing: calc(0.35 * var(--u));
  color: var(--muted);
}
.opt-val {
  font-size: calc(1.2 * var(--u));
  letter-spacing: calc(0.2 * var(--u));
  color: var(--amber);
  width: calc(4.5 * var(--u));
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.menu-btn.small {
  font-size: calc(1.2 * var(--u));
  letter-spacing: calc(0.3 * var(--u));
  padding: calc(0.5 * var(--u)) calc(0.9 * var(--u));
  width: calc(6.5 * var(--u));
  text-align: center;
  border-left-width: 1px;
}
.menu-btn.small.on { color: var(--cyan); border-color: rgba(40, 224, 208, 0.45); }
.menu-btn.wide {
  font-size: calc(1.3 * var(--u));
  text-align: center;
  padding: calc(0.7 * var(--u)) 0;
  border-left-width: 1px;
  margin-top: calc(0.4 * var(--u));
}

.slider {
  flex: 0 0 calc(13 * var(--u));
  -webkit-appearance: none;
  appearance: none;
  height: calc(0.5 * var(--u));
  background: #1b2231;
  border: 1px solid #2a3346;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: calc(1.1 * var(--u));
  height: calc(1.8 * var(--u));
  background: var(--cyan);
  border: none;
}
.slider::-moz-range-thumb {
  width: calc(1.1 * var(--u));
  height: calc(1.8 * var(--u));
  background: var(--cyan);
  border: none;
  border-radius: 0;
}
.slider:focus { outline: 1px solid rgba(40, 224, 208, 0.5); }

/* ---- Build tag ---- */
.build {
  position: absolute;
  right: calc(2 * var(--u));
  bottom: calc(1.6 * var(--u));
  font-size: calc(1 * var(--u));
  letter-spacing: calc(0.3 * var(--u));
  color: #3a4354;
}
