:root {
  color-scheme: dark;
  --bg: #0b1020;
  --surface: #131c2f;
  --surface-2: #18243a;
  --text: #f7f9fc;
  --muted: #a9b4c7;
  --line: rgba(255, 255, 255, 0.10);
  --accent: #68e0cf;
  --accent-strong: #34cbb6;
  --waiting: #2867c7;
  --go: #17a964;
  --early: #c84343;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --radius-lg: 24px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(63, 113, 190, 0.25), transparent 34rem),
    var(--bg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: #08141a;
  background: var(--accent);
  border-radius: 10px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.page-shell,
.site-footer {
  width: min(100% - 32px, 680px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding-top: env(safe-area-inset-top);
}

.brand {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: rgba(104, 224, 207, 0.14);
  border: 1px solid rgba(104, 224, 207, 0.22);
  border-radius: 11px;
}

.header-badge,
.feature-row span {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.header-badge {
  padding: 6px 10px;
  font-size: 0.78rem;
  border-radius: 999px;
}

.page-shell {
  padding: 32px 0 48px;
}

.hero {
  padding: 24px 4px 30px;
  text-align: center;
}

.eyebrow,
.section-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 620px;
  margin: 0 auto;
  font-size: clamp(2.2rem, 9vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 540px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 1.03rem;
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

.feature-row span {
  padding: 7px 10px;
  font-size: 0.78rem;
  border-radius: 999px;
}


.smart-frame-wrap {
  width: min(100% - 32px, 680px);
  margin: 16px auto 0;
}

.smart-frame-card {
  overflow: hidden;
  padding: 12px;
  background: rgba(19, 28, 47, 0.94);
  border: 1px solid rgba(104, 224, 207, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.smart-frame-topline {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.smart-frame-topline .sponsor-label {
  margin: 0;
}

.smart-frame-meta,
.smart-frame-note {
  color: var(--muted);
  font-size: 0.72rem;
}

.smart-frame-meta code {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.smart-frame {
  display: block;
  width: 100%;
  height: 360px;
  background: #fff;
  border: 0;
  border-radius: 14px;
}

.smart-frame-note {
  margin: 9px 2px 0;
  line-height: 1.4;
}

.test-card,
.results-card,
.info-card,
.sponsor-card,
.legal-card {
  background: rgba(19, 28, 47, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.test-card,
.results-card,
.info-card,
.sponsor-card {
  margin-top: 18px;
  padding: 20px;
}

.test-card-topline {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.test-card h2,
.results-card h2,
.info-card h2,
.sponsor-card h2,
.legal-card h1,
.legal-card h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.test-card h2,
.results-card h2,
.info-card h2,
.sponsor-card h2 {
  font-size: 1.25rem;
}

.round-label {
  flex: 0 0 auto;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.progress-dots {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.progress-dot {
  width: 100%;
  height: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
}

.progress-dot.is-current,
.progress-dot.is-complete {
  background: var(--accent);
}

.test-area {
  display: flex;
  width: 100%;
  min-height: 290px;
  padding: 28px 20px;
  touch-action: manipulation;
  cursor: pointer;
  user-select: none;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--surface-2);
  border: 0;
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  transition: transform 120ms ease, background 160ms ease;
}

.test-area:active {
  transform: scale(0.992);
}

.test-area:focus-visible,
.secondary-button:focus-visible,
.sponsor-button:focus-visible,
.brand:focus-visible,
.site-footer a:focus-visible {
  outline: 3px solid rgba(104, 224, 207, 0.55);
  outline-offset: 3px;
}

.test-area.state-waiting {
  background: var(--waiting);
}

.test-area.state-go {
  background: var(--go);
}

.test-area.state-early {
  background: var(--early);
}

.test-icon {
  font-size: 2.15rem;
  line-height: 1;
}

.test-area strong {
  font-size: clamp(1.65rem, 7vw, 2.5rem);
  letter-spacing: -0.04em;
}

.test-area span:last-child {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.94rem;
}

.test-help {
  min-height: 24px;
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.round-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.round-result span {
  color: var(--muted);
  font-size: 0.88rem;
}

.round-result strong {
  font-size: 1.05rem;
}

.score-display {
  display: flex;
  gap: 5px;
  align-items: baseline;
  margin-top: 14px;
}

.score-display strong {
  font-size: clamp(3rem, 15vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.07em;
}

.score-display span {
  color: var(--muted);
  font-size: 0.9rem;
}

.rating {
  display: inline-flex;
  margin: 16px 0 0;
  padding: 7px 11px;
  color: #081712;
  background: var(--accent);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
}

.rating-copy {
  margin: 12px 0 0;
  color: var(--muted);
}

.round-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.round-list li {
  display: flex;
  justify-content: space-between;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.round-list span {
  color: var(--muted);
}

.secondary-button,
.sponsor-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-weight: 800;
  text-decoration: none;
}

.secondary-button {
  width: 100%;
  margin-top: 18px;
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.sponsor-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(104, 224, 207, 0.25);
}

.sponsor-card::after {
  position: absolute;
  right: -70px;
  bottom: -110px;
  width: 220px;
  height: 220px;
  content: "";
  pointer-events: none;
  background: radial-gradient(circle, rgba(104, 224, 207, 0.15), transparent 68%);
}

.sponsor-label {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sponsor-card p,
.info-card p,
.info-card li,
.legal-card p,
.legal-card li {
  color: var(--muted);
}

.sponsor-card p {
  margin: 10px 0 16px;
}

.sponsor-button {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 13px 16px;
  color: #071513;
  background: var(--accent);
}

.sponsor-button:active {
  background: var(--accent-strong);
}

.sponsor-button.is-unconfigured {
  cursor: not-allowed;
  opacity: 0.55;
}

.info-card ol {
  margin: 14px 0;
  padding-left: 22px;
}

.info-card li + li {
  margin-top: 6px;
}

.info-card p:last-child {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.site-footer {
  display: flex;
  min-height: 84px;
  padding-bottom: env(safe-area-inset-bottom);
  color: var(--muted);
  border-top: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
}

.site-footer nav {
  display: flex;
  gap: 16px;
}

.site-footer a {
  color: var(--muted);
}

.legal-shell {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 42px 0 64px;
}

.legal-card {
  padding: clamp(22px, 5vw, 42px);
}

.legal-card h1 {
  font-size: clamp(2rem, 8vw, 3.3rem);
}

.legal-card h2 {
  margin-top: 28px;
  font-size: 1.2rem;
}

.legal-card a {
  color: var(--accent);
}

.legal-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 420px) {
  .site-header,
  .page-shell,
  .site-footer,
  .legal-shell,
  .smart-frame-wrap {
    width: min(100% - 24px, 680px);
  }

  .page-shell {
    padding-top: 16px;
  }

  .hero {
    padding-top: 20px;
  }

  .test-card,
  .results-card,
  .info-card,
  .sponsor-card {
    padding: 16px;
    border-radius: 20px;
  }

  .test-area {
    min-height: 260px;
  }

  .smart-frame-card {
    padding: 8px;
    border-radius: 18px;
  }

  .smart-frame {
    height: 320px;
    border-radius: 12px;
  }

  .smart-frame-topline {
    align-items: flex-start;
  }

  .site-footer {
    flex-direction: column;
    gap: 8px;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
