:root {
  --bg: #08080b;
  --surface: #101014;
  --surface-raised: #15151b;
  --line: #292831;
  --text: #f7f7fa;
  --text-muted: #a7a5b0;
  --accent: #8b79f4;
  --accent-soft: #b4a9ff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'liga' 1, 'calt' 1;
  scroll-padding-top: calc(88px + env(safe-area-inset-top));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

.landing-page,
.legal-page,
.simple-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
}

.page-header {
  position: sticky;
  z-index: 50;
  top: 0;
  width: 100%;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.page-header-inner {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) auto minmax(88px, 1fr);
  width: 100%;
  min-height: 76px;
  align-items: center;
  margin: 0 auto;
  padding: 16px 32px;
}

.site-header .page-header-inner {
  max-width: 1280px;
}

.subpage-header .page-header-inner {
  max-width: 900px;
}

.site-header .brand-link,
.subpage-header .back-link {
  justify-self: start;
}

.site-header .header-link,
.header-balance {
  justify-self: end;
}

.subpage-header .brand-link {
  justify-self: center;
}

.brand-link {
  display: inline-flex;
  align-items: center;
}

.brand-link img {
  display: block;
  width: 148px;
  height: auto;
}

.subpage-header .brand-link img {
  width: 132px;
}

.header-link,
.back-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.back-icon {
  font-size: 1.08rem;
  line-height: 1;
}

.header-balance {
  width: 88px;
}

.header-link:hover,
.header-link:focus-visible,
.back-link:hover,
.back-link:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--text);
}

.hero {
  display: flex;
  min-width: 0;
  min-height: 520px;
  align-items: center;
  justify-content: center;
  padding: 64px 32px 80px;
}

.hero-inner {
  width: min(100%, 780px);
  min-width: 0;
  text-align: center;
}

.hero-wordmark {
  display: block;
  width: min(100%, 520px);
  height: auto;
  margin: 0 auto 42px;
}

.hero h1 {
  max-width: 720px;
  margin: 0 auto;
  color: var(--text);
  font-size: clamp(2.25rem, 6vw, 4rem);
  font-weight: 680;
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.hero-description {
  max-width: 720px;
  margin: 24px auto 0;
  color: #d3d1da;
  font-size: 1.08rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.coming-soon {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 14px;
  margin: 34px 0 0;
  color: var(--accent-soft);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.coming-soon span {
  min-width: 0;
  line-height: 1.4;
}

.coming-soon img {
  display: block;
  width: 72px;
  height: 72px;
}

.site-footer {
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  padding: 24px 32px 32px;
  border-top: 1px solid var(--line);
}

.site-footer a {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.legal {
  width: 100%;
  min-width: 0;
  padding: 40px 28px 88px;
}

.legal-container {
  width: min(100%, 760px);
  min-width: 0;
  margin: 0 auto;
}

.legal-section {
  margin: 0 0 72px;
}

.legal-section:last-child {
  margin-bottom: 0;
}

.legal-section h1 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: clamp(2rem, 7vw, 3.25rem);
  font-weight: 680;
  line-height: 1.08;
  letter-spacing: 0;
}

.effective-date {
  margin: 0 0 34px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.legal-section h2 {
  margin: 40px 0 14px;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0;
}

.legal-section h3 {
  margin: 26px 0 10px;
  color: var(--accent-soft);
  font-size: 1rem;
  font-weight: 650;
}

.legal-section p,
.legal-section li {
  color: #d3d1da;
  font-size: 0.96rem;
  line-height: 1.72;
}

.legal-section p {
  margin: 0 0 16px;
}

.legal-section ul {
  margin: 0 0 18px;
  padding-left: 22px;
}

.legal-section li {
  margin-bottom: 8px;
}

.legal-section a {
  color: var(--accent-soft);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.legal-section h1,
.legal-section h2,
.legal-section h3,
#health-privacy {
  scroll-margin-top: calc(96px + env(safe-area-inset-top));
}

.legal-caps {
  font-size: 0.86rem !important;
}

.legal-divider {
  height: 1px;
  margin: 72px 0;
  border: 0;
  background: var(--line);
}

.simple-content {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  padding: 64px 28px 96px;
}

.simple-content .legal-container {
  max-width: 620px;
}

.simple-content .legal-section {
  margin: 0;
}

.support-page .simple-content,
.support-page .legal-section {
  text-align: center;
}

.support-page .legal-section p {
  max-width: 560px;
  margin-right: auto;
  margin-left: auto;
}

.rules-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  margin: 0 0 34px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.rules-meta span {
  white-space: nowrap;
}

.rules-section {
  margin-top: 28px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.rules-section h2 {
  margin-top: 28px;
}

.rules-sponsor {
  margin-top: 36px !important;
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: calc(78px + env(safe-area-inset-top));
  }

  .page-header-inner {
    grid-template-columns: minmax(72px, 1fr) auto minmax(72px, 1fr);
    min-height: 68px;
    padding: 12px 20px;
  }

  .brand-link img {
    width: 124px;
  }

  .subpage-header .brand-link img {
    width: 118px;
  }

  .header-balance {
    width: 72px;
  }

  .hero {
    min-height: 420px;
    padding: 56px 22px 72px;
  }

  .hero-wordmark {
    width: min(100%, 360px);
    margin-bottom: 34px;
  }

  .hero-description {
    margin-top: 20px;
    font-size: 1rem;
    line-height: 1.6;
  }

  .site-footer {
    gap: 12px 18px;
    padding: 22px 20px 28px;
  }

  .legal {
    padding: 32px 20px 72px;
  }

  .legal-section h1 {
    overflow-wrap: anywhere;
  }

  .legal-section h1,
  .legal-section h2,
  .legal-section h3,
  #health-privacy {
    scroll-margin-top: calc(86px + env(safe-area-inset-top));
  }

  .rules-meta-separator {
    display: none;
  }
}

@media (max-width: 360px) {
  .page-header-inner {
    grid-template-columns: 68px minmax(0, 1fr) 68px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .brand-link img {
    width: 112px;
  }

  .subpage-header .brand-link img {
    width: min(112px, 100%);
  }

  .header-balance {
    width: 68px;
  }

  .back-link {
    gap: 5px;
    font-size: 0.84rem;
  }

  .coming-soon {
    gap: 10px;
    font-size: 0.84rem;
    letter-spacing: 0.05em;
  }

  .coming-soon img {
    width: 60px;
    height: 60px;
  }

  .site-footer {
    flex-direction: column;
    align-items: center;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .header-link,
  .back-link,
  .site-footer a {
    transition: color 160ms ease;
  }
}
