:root {
  color-scheme: dark;
  --ink: #f4fbff;
  --muted: rgba(244, 251, 255, 0.62);
  --glass: rgba(8, 22, 28, 0.25);
  --line: rgba(255, 255, 255, 0.13);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #081219;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  touch-action: none;
  user-select: none;
}

body {
  min-height: 100svh;
}

.app {
  position: relative;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 20%, rgba(67, 172, 156, 0.22), transparent 30%),
    radial-gradient(circle at 84% 18%, rgba(213, 123, 100, 0.15), transparent 28%),
    radial-gradient(circle at 70% 78%, rgba(90, 132, 192, 0.18), transparent 34%),
    linear-gradient(135deg, #071116 0%, #10251f 46%, #111925 100%);
}

#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hud {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
  opacity: 0.86;
  transition: opacity 500ms ease;
}

.app.is-engaged .hud {
  opacity: 0.28;
}

.eyebrow {
  margin: 0 0 8px;
  color: rgba(181, 235, 217, 0.78);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: min(620px, calc(100vw - 36px));
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 6.4vw, 68px);
  line-height: 1.04;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 14px 48px rgba(0, 0, 0, 0.4);
}

.sound-toggle {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  min-width: 108px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.25);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.14);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.sound-toggle:focus-visible {
  outline: 3px solid rgba(176, 238, 224, 0.85);
  outline-offset: 3px;
}

.sound-toggle .icon {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.sound-toggle .icon::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
}

.sound-toggle[aria-pressed="true"] .icon {
  box-shadow: 0 0 18px rgba(176, 238, 224, 0.95);
}

.hint {
  position: absolute;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 2;
  transform: translateX(-50%);
  max-width: calc(100vw - 36px);
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(8, 22, 28, 0.2);
  backdrop-filter: blur(18px);
  font-size: 14px;
  white-space: nowrap;
  transition:
    opacity 500ms ease,
    transform 500ms ease;
  pointer-events: none;
}

.hint.is-hidden {
  opacity: 0;
  transform: translate(-50%, 10px);
}

@media (max-width: 680px) {
  .hud {
    align-items: stretch;
    flex-direction: column;
  }

  .sound-toggle {
    align-self: flex-start;
  }

  h1 {
    max-width: 12ch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hud,
  .hint {
    transition: none;
  }
}
