@font-face {
  font-family: "Mitr";
  src: url("/ztrivia-join/assets/fonts/mitr-300.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Mitr";
  src: url("/ztrivia-join/assets/fonts/mitr-500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Mitr";
  src: url("/ztrivia-join/assets/fonts/mitr-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --bg-deep: #120819;
  --bg-purple: #74107f;
  --bg-magenta: #b000ae;
  --text: #ffffff;
  --text-muted: #e7d9ec;
  --accent: #5eead4;
  --focus: #fff176;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-deep);
  color-scheme: dark;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Mitr", sans-serif;
  font-weight: 500;
  background:
    radial-gradient(circle at 15% -10%, rgba(176, 0, 174, 0.72), transparent 46%),
    radial-gradient(circle at 100% 100%, rgba(94, 234, 212, 0.2), transparent 38%),
    linear-gradient(160deg, var(--bg-purple), var(--bg-deep) 65%);
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #111;
  background: var(--focus);
  font-weight: 600;
  transform: translateY(-150%);
}

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

.page-shell {
  display: grid;
  min-height: calc(100vh - 64px);
  padding: max(36px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 44px
    max(16px, env(safe-area-inset-left));
  place-items: center;
}

.join-content {
  width: min(100%, 720px);
  text-align: center;
}

.legal-content {
  width: min(100%, 720px);
}

.brand-art {
  display: block;
  width: min(100%, 560px);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.join-copy,
.action-stack {
  padding-inline: clamp(20px, 5vw, 42px);
}

.join-copy {
  padding-top: clamp(20px, 4vw, 32px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Mitr", sans-serif;
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3.35rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.intro {
  max-width: 58ch;
  margin: 16px auto 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 3.8vw, 1.08rem);
  line-height: 1.55;
}

.lobby-context {
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
  margin: 20px clamp(20px, 5vw, 42px) 0;
  color: var(--text-muted);
  font-weight: 500;
}

.game-code {
  overflow-wrap: anywhere;
  color: #ffffff;
  font-family: "Mitr", sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0.035em;
}

.lobby-context[hidden] {
  display: none;
}

.action-stack {
  padding-top: 20px;
  padding-bottom: 28px;
}

.store-grid {
  display: grid;
  gap: 14px 18px;
  align-items: center;
  justify-content: center;
  grid-template-columns: repeat(2, max-content);
}

.button {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 14px;
  text-align: center;
  text-decoration: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:focus-visible,
.store-link:focus-visible,
.web-option a:focus-visible,
.site-footer a:focus-visible,
.legal-nav a:focus-visible,
.text-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.store-link {
  display: block;
  border-radius: 8px;
  transition: transform 150ms ease;
}

.store-link:hover {
  transform: translateY(-2px);
}

.store-link img {
  display: block;
  width: auto;
}

#app-store img {
  height: 48px;
}

#play-store img {
  height: 72px;
}

.button--open {
  margin-top: 12px;
  border-color: rgba(94, 234, 212, 0.46);
  color: var(--accent);
  background: rgba(94, 234, 212, 0.08);
  font-weight: 600;
}

.is-hidden {
  display: none;
}

.open-help {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 300;
  text-align: center;
}

.web-option {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.86rem;
  text-align: center;
}

.web-option a,
.text-link {
  color: var(--accent);
  font-weight: 600;
  text-underline-offset: 3px;
}

.site-footer {
  display: flex;
  min-height: 64px;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  justify-content: center;
  padding: 14px 20px max(14px, env(safe-area-inset-bottom));
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  font-weight: 300;
}

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

.site-footer a {
  text-underline-offset: 3px;
}

.legal-shell {
  min-height: calc(100vh - 64px);
  padding: 28px 16px;
}

.legal-content {
  margin: 0 auto;
  padding: clamp(24px, 6vw, 52px);
}

.legal-brand {
  width: min(260px, 72vw);
  height: auto;
  margin: -8px 0 24px;
}

.legal-content h1 {
  font-size: clamp(2.1rem, 8vw, 3.5rem);
}

.legal-content h2 {
  margin: 34px 0 10px;
  font-size: 1.35rem;
}

.legal-content h3 {
  margin: 24px 0 8px;
  font-size: 1.08rem;
}

.legal-content p,
.legal-content li {
  color: var(--text-muted);
  line-height: 1.65;
}

.legal-content li + li {
  margin-top: 8px;
}

.legal-meta {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.88rem;
  font-weight: 300;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.legal-nav a {
  color: var(--accent);
  font-weight: 600;
}

.support-actions {
  margin: 26px 0;
}

.deletion-callout,
#data-deletion {
  scroll-margin-top: 20px;
}

.deletion-callout {
  margin: 24px 0 0;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
}

.deletion-callout p {
  margin: 0;
}

#data-deletion {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid rgba(94, 234, 212, 0.34);
}

#data-deletion:target {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

@media (max-width: 480px) {
  .page-shell {
    padding: max(28px, env(safe-area-inset-top)) 18px 32px;
  }

  .brand-art {
    width: min(100%, 420px);
  }

  .join-copy {
    padding-top: 18px;
  }

  .intro {
    margin-top: 12px;
    line-height: 1.45;
  }

  .action-stack {
    padding-top: 16px;
    padding-bottom: 22px;
  }

  .store-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    transition-duration: 0.01ms;
  }
}
