:root {
  --bg: #05040a;
  --ink: #e6e9f2;
  --dim: #8b93a8;
  --line: rgba(120, 200, 255, 0.16);
  --cyan: #33f0ff;
  --pink: #ff2e88;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* ------------------------------------------------------------------- HUD */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 5;
}

#hud.on { opacity: 1; }

#brand {
  position: absolute;
  left: 22px;
  top: 18px;
  display: flex;
  align-items: center;
  gap: 11px;
}

#brand .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 12px var(--pink);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

#brand h1 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #eaf6ff;
  text-shadow: 0 0 18px rgba(51, 240, 255, 0.35);
}

#brand p {
  margin: 3px 0 0;
  font: 400 9.5px/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(190, 210, 230, 0.45);
}

#stats {
  position: absolute;
  right: 22px;
  top: 20px;
  font: 400 10px/1.6 var(--mono);
  letter-spacing: 0.08em;
  color: rgba(200, 225, 240, 0.55);
  text-align: right;
  opacity: 0;
  transition: opacity 0.3s;
}

#stats.on { opacity: 1; }

#hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(6, 8, 16, 0.55);
  backdrop-filter: blur(8px);
  font: 400 10.5px/1 var(--mono);
  letter-spacing: 0.10em;
  color: rgba(200, 220, 235, 0.6);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.6s;
}

#hint.show { opacity: 1; }

#hint b { color: var(--cyan); font-weight: 500; }

/* ---------------------------------------------------------------- loader */
#loader {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(circle at 50% 60%, #120a1c 0%, #05040a 70%);
  transition: opacity 0.9s ease;
}

#loader.hidden {
  opacity: 0;
  pointer-events: none;
}

#loader .mark {
  font: 600 11px/1 var(--font);
  letter-spacing: 0.52em;
  text-transform: uppercase;
  color: rgba(230, 240, 255, 0.8);
  text-indent: 0.52em;
}

#loader .track {
  width: 210px;
  height: 1px;
  background: rgba(120, 200, 255, 0.18);
  overflow: hidden;
}

#loader .track i {
  display: block;
  width: 2%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  box-shadow: 0 0 10px rgba(51, 240, 255, 0.7);
  transition: width 0.35s ease;
}

#loader .label {
  font: 400 9.5px/1 var(--mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(160, 180, 200, 0.45);
}

/* ------------------------------------------------------------------ menu */
#menu {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 50%, rgba(5, 4, 10, 0.35) 0%, rgba(5, 4, 10, 0.82) 70%);
  backdrop-filter: blur(3px);
  transition: opacity 0.45s ease;
}

#menu.hidden {
  opacity: 0;
  pointer-events: none;
}

#menu .panel {
  width: min(620px, 100%);
  padding: 30px 32px 20px;
  border: 1px solid rgba(120, 200, 255, 0.13);
  border-radius: 4px;
  background: linear-gradient(160deg, rgba(12, 16, 30, 0.86), rgba(8, 6, 16, 0.9));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.eyebrow {
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.75;
  margin-bottom: 12px;
}

#menu h1 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: linear-gradient(100deg, #ffffff 10%, #9fe8ff 55%, #ff8ec4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#menu .tag {
  margin: 0 0 22px;
  max-width: 46ch;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(210, 222, 236, 0.62);
}

button {
  font-family: inherit;
  cursor: pointer;
}

#enter {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid rgba(51, 240, 255, 0.45);
  border-radius: 3px;
  background: rgba(51, 240, 255, 0.10);
  color: #c8f8ff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s, transform 0.08s;
}

#enter:hover {
  background: rgba(51, 240, 255, 0.19);
  border-color: rgba(51, 240, 255, 0.8);
  box-shadow: 0 0 30px rgba(51, 240, 255, 0.12);
}

#enter:active { transform: translateY(1px); }

#menu .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 26px 0 20px;
  padding-top: 22px;
  border-top: 1px solid rgba(120, 200, 255, 0.10);
}

#menu h2 {
  margin: 0 0 12px;
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(180, 200, 220, 0.5);
}

.keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 14px;
  margin: 0;
  font-size: 12px;
}

.keys dt {
  font: 500 10.5px/1.4 var(--mono);
  color: rgba(51, 240, 255, 0.85);
  letter-spacing: 0.06em;
}

.keys dd {
  margin: 0;
  color: rgba(200, 215, 230, 0.6);
}

.quality {
  display: flex;
  gap: 6px;
}

.quality button {
  flex: 1;
  padding: 8px 4px;
  border: 1px solid rgba(120, 200, 255, 0.16);
  border-radius: 3px;
  background: transparent;
  color: rgba(200, 215, 230, 0.6);
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.18s;
}

.quality button:hover {
  border-color: rgba(120, 200, 255, 0.4);
  color: #dfeaf5;
}

.quality button.on {
  border-color: rgba(51, 240, 255, 0.6);
  background: rgba(51, 240, 255, 0.12);
  color: #bff6ff;
}

.note {
  margin: 9px 0 18px;
  font-size: 10.5px;
  color: rgba(160, 180, 200, 0.4);
}

#sound-btn {
  padding: 8px 14px;
  border: 1px solid rgba(120, 200, 255, 0.16);
  border-radius: 3px;
  background: transparent;
  color: rgba(200, 215, 230, 0.65);
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#sound-btn:hover { color: #dfeaf5; border-color: rgba(120, 200, 255, 0.4); }

#menu footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(120, 200, 255, 0.08);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(150, 168, 190, 0.35);
}

#menu footer .mono { font-family: var(--mono); }

@media (max-width: 620px) {
  #menu .panel { padding: 22px 20px 16px; }
  #menu h1 { font-size: 26px; }
  #menu .grid { grid-template-columns: 1fr; gap: 20px; }
  #hint { display: none; }
  #brand p { display: none; }
}
