:root {
  --bg: #000000;
  --fg: #e8e6e1;
  --dim: #7a7772;
  --accent: #c9c5bb;
  --icon: #cfcfcf;
  --icon-hover: #eaeaea;
  --ring: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "OCR A Extended", "OCR-A", "OCR A Std", Consolas, "Courier New", monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 5vh 20px;
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(32px, 8vmin, 90px);
  text-align: center;
  padding: 24px;
}

.status-text {
  margin: 0;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(1.1rem, 5vmin, 2.75rem);
  color: var(--fg);
  transition: opacity 0.6s ease;
}

.status-text.fading {
  opacity: 0;
}

.play-button {
  appearance: none;
  border: none;
  background: none;
  border-radius: 50%;
  width: clamp(140px, 30vmin, 340px);
  height: clamp(140px, 30vmin, 340px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--icon);
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.06));
  transition: color 0.3s ease, filter 0.4s ease, transform 0.2s ease;
  touch-action: manipulation;
}

.play-button:hover {
  color: var(--icon-hover);
  filter: drop-shadow(0 0 28px rgba(255, 255, 255, 0.12));
}

.play-button:active {
  transform: scale(0.97);
}

.play-button svg {
  width: 100%;
  height: 100%;
}

.icon-pause {
  display: none;
}

.play-button.is-playing .icon-play {
  display: none;
}

.play-button.is-playing .icon-pause {
  display: block;
}

.consent-text {
  margin: 0;
  font-size: clamp(0.85rem, 2.4vmin, 1.25rem);
  color: var(--dim);
  font-weight: 300;
  letter-spacing: 0.02em;
}

.terms-link {
  color: var(--dim);
  text-decoration: underline;
  text-decoration-style: solid;
  text-underline-offset: 3px;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  padding: 0;
  touch-action: manipulation;
}

.terms-link:hover {
  color: var(--fg);
}

/* Legal section (inline, not a popup) */
.legal-section {
  width: 100%;
  max-width: 640px;
  margin-top: clamp(28px, 7vmin, 56px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #0a0a0a;
  text-align: left;
  color: var(--fg);
}

.legal-header {
  position: sticky;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px 10px 0 0;
  padding: 16px 20px;
  z-index: 1;
}

.legal-title {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.legal-hide {
  appearance: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--fg);
  border-radius: 6px;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  touch-action: manipulation;
}

.legal-hide:hover {
  background: rgba(255, 255, 255, 0.06);
}

.legal-body {
  padding: 8px 24px 90px;
}

.legal-body h2 {
  font-weight: 400;
  letter-spacing: 0.04em;
  font-size: 1rem;
  margin: 1.6em 0 0.5em;
  color: var(--accent);
}

.legal-body h2:first-child {
  margin-top: 1.2em;
}

.legal-body p {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--dim);
  font-weight: 300;
  margin: 0.4em 0;
}

.legal-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  background: rgba(6, 6, 6, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 20px max(10px, env(safe-area-inset-bottom));
  z-index: 20;
}

.back-to-top {
  appearance: none;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 14px;
  color: var(--dim);
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
  transition: color 0.2s ease;
}

.back-to-top:hover {
  color: var(--fg);
}

.back-to-top svg {
  width: 16px;
  height: 16px;
}

.back-to-top span {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 420px) {
  body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .legal-header {
    padding: 14px 16px;
  }

  .legal-body {
    padding: 8px 16px 90px;
  }

  .legal-footer {
    padding: 8px 16px max(10px, env(safe-area-inset-bottom));
  }
}
