:root {
  --bg: #1c1815;
  --panel: rgba(34, 29, 25, 0.76);
  --panel-border: rgba(232, 198, 138, 0.34);
  --gold: #e6c282;
  --gold-bright: #ffeaBE;
  --text: #fbf8f3;
  --muted: rgba(251, 248, 243, 0.76);
  --orbital: #d8c6f0;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
}

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

#hud-header {
  position: fixed;
  top: 22px;
  left: 28px;
  right: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 10;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 6px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.signal {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 10px var(--gold-bright);
}

.divider {
  opacity: 0.45;
}

h1 {
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(22px, 2.3vw, 32px);
  letter-spacing: 0.03em;
  color: #fffdf9;
  text-shadow: 0 4px 22px rgba(20, 14, 8, 0.72);
}

h1 span {
  color: var(--gold);
}

#zone-caption {
  margin-top: 5px;
  max-width: 580px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  text-shadow: 0 2px 12px rgba(18, 12, 8, 0.82);
}

.header-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.motto-bar {
  font-size: 10.5px;
  letter-spacing: 0.24em;
  color: rgba(255, 250, 242, 0.85);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.motto-bar .dot {
  margin: 0 6px;
  color: var(--gold);
}

#telemetry {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--orbital);
  background: rgba(28, 23, 21, 0.72);
  border: 1px solid rgba(216, 198, 240, 0.32);
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

#zone-bar {
  position: fixed;
  top: 108px;
  left: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  z-index: 12;
}

button {
  appearance: none;
  background: var(--panel);
  color: var(--text);
  border: 1px solid rgba(255, 248, 235, 0.18);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.18s ease;
}

button:hover {
  border-color: var(--gold);
  color: #fff;
}

button.active,
button[aria-pressed="true"] {
  background: rgba(230, 194, 130, 0.26);
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: 0 0 16px rgba(230, 194, 130, 0.24);
}

#hud-footer {
  position: fixed;
  bottom: 20px;
  left: 28px;
  right: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  z-index: 12;
}

.left-controls,
.right-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(28, 23, 19, 0.78);
  border: 1px solid var(--panel-border);
  padding: 8px 14px;
  border-radius: 999px;
  backdrop-filter: blur(14px);
}

.mode-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.group-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-right: 4px;
}

.hint {
  font-size: 11px;
  color: var(--muted);
  padding-left: 4px;
}

.right-controls label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.right-controls input[type="range"] {
  width: 82px;
  accent-color: var(--gold);
  cursor: pointer;
}

#loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(circle at center, #2d251e 0%, #15110e 100%);
  z-index: 40;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

#loading.finished {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-orbit {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(230, 194, 130, 0.28);
  border-top-color: var(--gold-bright);
  animation: spin 1.05s linear infinite;
}

#load-label {
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: var(--text);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#sheet-drawer {
  position: fixed;
  top: 156px;
  right: 28px;
  width: min(560px, 44vw);
  background: rgba(26, 22, 18, 0.94);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px;
  z-index: 25;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(16px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#sheet-drawer.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

#drawer-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: block;
}
