:root {
  color-scheme: dark;
  --panel: rgba(3, 10, 15, 0.72);
  --line: rgba(129, 232, 255, 0.28);
  --text: #f4fbff;
  --muted: #a9c6cc;
  --cyan: #67e7ff;
  --green: #77ff9d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #02070b;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell,
#scene {
  position: fixed;
  inset: 0;
}

#scene {
  display: block;
  width: 100vw;
  height: 100vh;
}

button,
.mode-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(10, 28, 36, 0.82);
  font: inherit;
  font-weight: 850;
  text-decoration: none;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(2, 7, 11, 0.20), rgba(2, 7, 11, 0.88));
}

.overlay.hidden {
  display: none;
}

.brand {
  color: var(--green);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 112px);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 0 40px rgba(103, 231, 255, 0.48);
}

p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.45;
}

#startButton {
  min-width: 170px;
  min-height: 50px;
  padding: 0 24px;
  background: linear-gradient(135deg, rgba(103, 231, 255, 0.96), rgba(119, 255, 157, 0.94));
  color: #031116;
  box-shadow: 0 0 34px rgba(103, 231, 255, 0.34);
  cursor: pointer;
}

.mode-link {
  min-height: 42px;
  padding: 10px 16px;
  color: var(--cyan);
}

.hud {
  position: fixed;
  z-index: 4;
  top: max(14px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  pointer-events: none;
}

.hud > div {
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.hud span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.hud strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(15px, 2vw, 22px);
  line-height: 1.1;
}

.reticle {
  position: fixed;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(244, 251, 255, 0.66);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 16px rgba(103, 231, 255, 0.55);
  pointer-events: none;
}

.touch {
  position: fixed;
  z-index: 5;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: none;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.touch-left,
.touch-right {
  display: flex;
  gap: 9px;
}

.touch button {
  width: 72px;
  height: 58px;
  pointer-events: auto;
  touch-action: none;
}

.touch button:active {
  transform: translateY(1px);
  background: rgba(103, 231, 255, 0.26);
}

@media (hover: none), (pointer: coarse) {
  .touch {
    display: flex;
  }
}

@media (max-width: 720px) {
  .touch {
    display: flex;
  }

  .hud {
    grid-template-columns: 1fr;
    right: auto;
    width: min(240px, calc(100vw - 28px));
  }

  .hud > div {
    min-height: 44px;
  }

  .touch {
    align-items: flex-end;
  }

  .touch-left {
    display: grid;
    grid-template-columns: repeat(3, 64px);
  }
}
