@font-face {
  font-family: 'Orbitron';
  src: url('fonts/Orbitron-Variable.ttf') format('truetype');
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000000;
  --pink: #FF2975;
  --purple: #B026FF;
  --cyan: #2DE2E6;
  --yellow: #FFD319;
  --mint: #01F9C6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: #E8E3F5;
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-user-select: none;
  user-select: none;
}

body.reduced-flash .scanlines { display: none; }

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.18) 0px,
    rgba(0, 0, 0, 0.18) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

.brand { text-align: center; }
.brand-over {
  font-size: clamp(10px, 1.6vh, 13px);
  letter-spacing: 0.55em;
  margin-left: 0.55em;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(45, 226, 230, 0.8);
}
.title {
  font-size: clamp(28px, 5vh, 48px);
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.12em;
  background: linear-gradient(180deg, #fff 0%, var(--cyan) 35%, var(--purple) 65%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(176, 38, 255, 0.6));
}

.board-wrap {
  position: relative;
  border: 2px solid var(--cyan);
  border-radius: 0;
  box-shadow: 0 0 24px rgba(45, 226, 230, 0.45), inset 0 0 30px rgba(255, 41, 117, 0.08);
  line-height: 0;
}

#field {
  display: block;
  touch-action: none;
  width: auto;
  height: 56dvh;
  max-height: 56dvh;
  max-width: 100%;
  aspect-ratio: 480 / 270;
  background: #000;
}

#core-warn {
  position: absolute;
  left: 50%;
  top: 14%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 2;
  line-height: 1.15;
  padding: 8px 14px 10px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid var(--pink);
  box-shadow: 0 0 18px rgba(255, 41, 117, 0.35);
  white-space: nowrap;
}
#core-warn[hidden] { display: none; }
.core-warn-kicker {
  color: var(--yellow);
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  margin: 0;
}
.core-warn-line {
  color: var(--pink);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-shadow: 0 0 12px rgba(255, 41, 117, 0.7);
  margin: 0;
}

.hud-hp {
  display: block;
  width: 80px;
  height: 10px;
  border: 1px solid var(--pink);
  background: rgba(255, 41, 117, 0.12);
  margin-top: 4px;
}
#hud-core-hp {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--pink);
  box-shadow: 0 0 8px rgba(255, 41, 117, 0.7);
}

.chrome-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: min(100%, 52rem);
}

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.hud-cell {
  border: 1px solid var(--cyan);
  box-shadow: 0 0 12px rgba(45, 226, 230, 0.28), inset 0 0 14px rgba(255, 41, 117, 0.08);
  padding: 4px 8px;
  min-width: 3.4em;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-cell[hidden] { display: none; }

.hud-label {
  font-size: 8px;
  letter-spacing: 0.18em;
  color: rgba(45, 226, 230, 0.7);
}

.hud-value, .hud-pips {
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(45, 226, 230, 0.6);
}

.hud-pips { color: var(--pink); text-shadow: 0 0 8px rgba(255, 41, 117, 0.6); }

#toast {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--mint);
  min-height: 1.2em;
}
#toast[hidden] { display: none; }

#pause {
  font-size: 11px;
  padding: 4px 10px;
  letter-spacing: 0.2em;
  align-self: stretch;
}
#pause[hidden] { display: none; }

.touch-bar {
  display: flex;
  gap: 12px;
}
.touch-bar button { min-width: 7em; }

#title-overlay, #overlay, #wheel-overlay, #end-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  padding: 20px;
  padding-bottom: env(safe-area-inset-bottom);
  text-align: center;
}
#title-overlay {
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.4) 70%);
}
#title-overlay[hidden], #overlay[hidden], #wheel-overlay[hidden], #end-overlay[hidden] { display: none; }

.cabinet-plate {
  border: 1px solid var(--cyan);
  box-shadow: 0 0 28px rgba(45, 226, 230, 0.28), inset 0 0 40px rgba(255, 41, 117, 0.08);
  padding: 22px 26px 20px;
  max-width: 28rem;
  width: min(100%, 28rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.72);
}

.cabinet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

#title-wheel, #wheel-canvas {
  display: block;
}

.tagline {
  letter-spacing: 0.35em;
  color: var(--pink);
  text-shadow: 0 0 10px rgba(255, 41, 117, 0.7);
  font-size: clamp(12px, 2vh, 16px);
}
.blurb {
  max-width: 28em;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(232, 227, 245, 0.75);
}

#wheel-title {
  font-size: clamp(22px, 4vh, 36px);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--yellow);
  text-shadow: 0 0 16px rgba(255, 211, 25, 0.7);
}

#wheel-desc {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(232, 227, 245, 0.8);
}

button {
  font: inherit;
  letter-spacing: 0.15em;
  padding: 10px 18px;
  color: var(--cyan);
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--cyan);
  border-radius: 0;
  box-shadow: 0 0 14px rgba(45, 226, 230, 0.22);
}

.end-plate #end-title {
  letter-spacing: 0.35em;
  color: var(--pink);
  font-size: 12px;
}

.end-score-label {
  font-size: 9px;
  letter-spacing: 0.28em;
  color: rgba(45, 226, 230, 0.7);
}

#end-depth {
  letter-spacing: 0.16em;
  color: var(--yellow);
  font-size: 13px;
}

.end-split {
  border-top: 1px solid rgba(45, 226, 230, 0.35);
  padding-top: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(232, 227, 245, 0.8);
}

.end-submit {
  min-height: 1.2em;
  color: var(--mint);
  letter-spacing: 0.15em;
  font-size: 12px;
}
.end-entry {
  display: flex;
  gap: 8px;
  align-items: center;
}
.end-entry[hidden] { display: none; }
.end-entry button[data-slot] {
  min-width: 2.4em;
  font-size: 22px;
  padding: 8px 10px;
}
.end-challenge {
  letter-spacing: 0.3em;
  color: var(--pink);
  font-size: 18px;
}
.end-challenge[hidden], #end-challenge[hidden] { display: none; }
