:root {
  color-scheme: dark;
  --bg: #071018;
  --bg-2: #0b1621;
  --surface: #111d29;
  --surface-2: #1c2b3a;
  --border: #2d4658;
  --text: #f8fbff;
  --muted: #b8c8d7;
  --soft: #7f96a8;
  --primary: #0877f2;
  --primary-2: #36c4ff;
  --accent: #ffcf3f;
  --accent-2: #f09a18;
  --success: #3ddc97;
  --error: #ff5a5f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(54, 196, 255, 0.2), transparent 30rem),
    radial-gradient(circle at 85% 18%, rgba(255, 207, 63, 0.18), transparent 28rem),
    linear-gradient(180deg, #071018 0%, #0b1621 46%, #071018 100%);
  color: var(--text);
}

a {
  color: inherit;
}

img,
svg {
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--accent);
  color: #161209;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-weight: 800;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(7, 16, 24, 0.78);
  border-bottom: 1px solid rgba(45, 70, 88, 0.72);
}

.nav {
  width: min(1120px, calc(100% - 2rem));
  min-height: 4.25rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0;
}

.brand img {
  width: 2.35rem;
  height: 2.35rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.language-link {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
}

.button {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid transparent;
  font-weight: 850;
  text-decoration: none;
  line-height: 1;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #161209;
  box-shadow: 0 14px 36px rgba(255, 207, 63, 0.24);
}

.button-secondary {
  color: var(--text);
  border-color: rgba(248, 251, 255, 0.22);
  background: rgba(248, 251, 255, 0.06);
}

.hero {
  position: relative;
  min-height: 88svh;
  overflow: hidden;
  display: grid;
  align-items: center;
  isolation: isolate;
  border-bottom: 1px solid rgba(45, 70, 88, 0.5);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(105deg, rgba(7, 16, 24, 0.42), rgba(7, 16, 24, 0.9)),
    repeating-linear-gradient(
      112deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 28px
    );
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -8rem -9rem -8rem;
  height: 22rem;
  z-index: -2;
  background: radial-gradient(ellipse at center, rgba(8, 119, 242, 0.34), transparent 72%);
}

.hero-stage {
  position: absolute;
  inset: 4rem 0 0 0;
  z-index: -1;
  pointer-events: none;
}

.score-beam {
  position: absolute;
  width: 44rem;
  height: 44rem;
  right: -10rem;
  top: 3rem;
  border-radius: 999px;
  border: 1px solid rgba(54, 196, 255, 0.26);
  background:
    conic-gradient(from 210deg, rgba(255, 207, 63, 0.2), transparent, rgba(54, 196, 255, 0.28), transparent),
    radial-gradient(circle, rgba(28, 43, 58, 0.84), rgba(7, 16, 24, 0.2) 64%, transparent 65%);
  transform: rotate(-10deg);
}

.challenge-visual {
  position: absolute;
  right: max(1rem, calc((100vw - 1120px) / 2));
  bottom: 2.5rem;
  width: min(38rem, 48vw);
  display: grid;
  grid-template-columns: 0.82fr 1fr;
  align-items: end;
  gap: 1rem;
}

.phone {
  min-height: 34rem;
  border: 1px solid rgba(54, 196, 255, 0.46);
  border-radius: 2rem;
  background:
    linear-gradient(180deg, rgba(17, 29, 41, 0.96), rgba(9, 19, 29, 0.98)),
    radial-gradient(circle at top, rgba(54, 196, 255, 0.18), transparent 18rem);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.phone-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 1.2rem;
}

.timer {
  color: var(--accent);
  font-weight: 900;
}

.problem {
  min-height: 10rem;
  display: grid;
  align-content: center;
  gap: 0.8rem;
  border-radius: 1.1rem;
  background: rgba(8, 119, 242, 0.16);
  border: 1px solid rgba(54, 196, 255, 0.26);
  padding: 1.2rem;
}

.problem-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.problem-equation {
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  font-weight: 950;
  line-height: 0.95;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-top: 1rem;
}

.key {
  min-height: 3.1rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: rgba(248, 251, 255, 0.08);
  border: 1px solid rgba(248, 251, 255, 0.1);
}

.key-submit {
  background: var(--accent);
  color: #161209;
}

.ranking-tile {
  align-self: center;
  border: 1px solid rgba(255, 207, 63, 0.4);
  border-radius: 1rem;
  background: rgba(17, 29, 41, 0.88);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.ranking-tile h3 {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 0.95rem;
}

.ranking-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0;
  border-top: 1px solid rgba(45, 70, 88, 0.62);
  font-size: 0.88rem;
}

.ranking-row:first-of-type {
  border-top: 0;
}

.rank {
  color: var(--accent);
  font-weight: 900;
}

.score {
  font-weight: 900;
}

.hero-content {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 5.5rem 0 7rem;
}

.hero-copy {
  width: min(42rem, 100%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1.1rem;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 20px rgba(61, 220, 151, 0.8);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1.1rem;
  font-size: clamp(3.2rem, 8vw, 7.2rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 36rem;
  color: var(--muted);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.45;
  margin-bottom: 1.6rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.3rem;
}

.product-hunt-badge {
  width: fit-content;
  display: block;
  margin: -0.2rem 0 1.25rem;
  line-height: 0;
}

.product-hunt-badge img {
  width: 250px;
  height: 54px;
  display: block;
}

.hero-note {
  color: var(--soft);
  max-width: 32rem;
  line-height: 1.6;
  font-size: 0.96rem;
}

.hero-stats {
  width: min(1120px, calc(100% - 2rem));
  margin: -4rem auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  position: relative;
  z-index: 2;
}

.stat {
  border: 1px solid rgba(45, 70, 88, 0.72);
  border-radius: 0.85rem;
  background: rgba(17, 29, 41, 0.92);
  padding: 1rem;
}

.stat strong {
  display: block;
  font-size: 1.6rem;
  color: var(--accent);
}

.stat span {
  color: var(--muted);
  font-size: 0.92rem;
}

.section {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 6rem 0;
}

.section-header {
  max-width: 44rem;
  margin-bottom: 2rem;
}

.section-kicker {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.84rem;
}

.section h2 {
  font-size: clamp(2rem, 4.5vw, 4rem);
  line-height: 1;
  margin: 0.4rem 0 1rem;
  letter-spacing: 0;
}

.section p {
  color: var(--muted);
  line-height: 1.7;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.feature-card {
  min-height: 16rem;
  border: 1px solid rgba(45, 70, 88, 0.72);
  border-radius: 0.8rem;
  background: linear-gradient(180deg, rgba(28, 43, 58, 0.72), rgba(17, 29, 41, 0.72));
  padding: 1.25rem;
}

.feature-card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.6rem;
}

.feature-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  background: rgba(255, 207, 63, 0.12);
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 950;
}

.league-band {
  border-block: 1px solid rgba(45, 70, 88, 0.6);
  background:
    linear-gradient(90deg, rgba(8, 119, 242, 0.18), rgba(255, 207, 63, 0.1)),
    rgba(17, 29, 41, 0.44);
}

.league-layout {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}

.league-panel {
  border: 1px solid rgba(255, 207, 63, 0.34);
  border-radius: 0.85rem;
  background: rgba(7, 16, 24, 0.64);
  padding: 1.1rem;
}

.invite-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(255, 207, 63, 0.12);
  border: 1px dashed rgba(255, 207, 63, 0.48);
  padding: 1rem;
  color: var(--accent);
  font-weight: 950;
}

.league-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.league-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(45, 70, 88, 0.66);
}

.final-cta {
  text-align: center;
  padding-bottom: 7rem;
}

.final-cta p {
  max-width: 38rem;
  margin-inline: auto;
}

.legal-layout {
  width: min(860px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4rem 0 6rem;
}

.legal-layout h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
}

.legal-layout h2 {
  margin-top: 2.2rem;
  font-size: 1.55rem;
}

.legal-layout p,
.legal-layout li {
  color: var(--muted);
  line-height: 1.75;
}

.legal-note {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  background: rgba(17, 29, 41, 0.72);
}

.site-footer {
  border-top: 1px solid rgba(45, 70, 88, 0.72);
  background: rgba(7, 16, 24, 0.86);
}

.footer-inner {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  min-height: 7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--text);
}

@media (max-width: 920px) {
  .nav-links a:not(.language-link):not(.button) {
    display: none;
  }

  .hero {
    min-height: auto;
  }

  .hero-content {
    padding: 4rem 0 22rem;
  }

  .challenge-visual {
    right: 1rem;
    left: 1rem;
    bottom: 1.4rem;
    width: auto;
    grid-template-columns: 1fr;
  }

  .phone {
    min-height: 20rem;
  }

  .ranking-tile {
    display: none;
  }

  .hero-stats,
  .feature-grid,
  .league-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .nav {
    min-height: 4rem;
  }

  .brand span {
    display: none;
  }

  .nav-links {
    gap: 0.55rem;
  }

  .button {
    width: 100%;
  }

  .nav .button {
    width: auto;
    padding-inline: 0.8rem;
  }

  .hero-content {
    padding-top: 3rem;
  }

  .hero-stats {
    margin-top: 0;
  }

  .section {
    padding: 4rem 0;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 2rem 0;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* NUM-59 visual refinement: app-faithful hero */
.hero {
  min-height: auto;
  display: block;
  padding: 0 0 6.75rem;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 22%, rgba(0, 126, 242, 0.32), transparent 26rem),
    radial-gradient(circle at 88% 76%, rgba(255, 207, 63, 0.16), transparent 25rem),
    linear-gradient(180deg, #07324a 0%, #071018 76%);
  background-size: 72px 72px, 72px 72px, auto, auto, auto;
}

.hero::before {
  z-index: 0;
  background: linear-gradient(180deg, rgba(7, 16, 24, 0.08), rgba(7, 16, 24, 0.62));
}

.hero::after {
  width: min(54vw, 46rem);
  height: min(54vw, 46rem);
  right: -12rem;
  bottom: -16rem;
  border-color: rgba(0, 162, 255, 0.2);
  background: radial-gradient(circle at 42% 42%, rgba(0, 162, 255, 0.18), rgba(0, 162, 255, 0.03) 54%, transparent 70%);
}

.hero-seven {
  position: absolute;
  right: max(1rem, calc((100vw - 1120px) / 2));
  bottom: -4.8rem;
  z-index: 0;
  color: rgba(255, 207, 63, 0.16);
  font-size: clamp(18rem, 30vw, 34rem);
  font-weight: 950;
  line-height: 0.76;
  pointer-events: none;
  text-shadow: 0 0 80px rgba(0, 126, 242, 0.2);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(560px, 1.18fr);
  align-items: center;
  gap: clamp(2rem, 4vw, 4.5rem);
  padding: clamp(4.25rem, 7vw, 7rem) 0 4.75rem;
}

.hero-copy {
  width: 100%;
  max-width: 34rem;
}

.hero-subtitle {
  max-width: 32rem;
  font-size: clamp(1.08rem, 1.55vw, 1.34rem);
}

.challenge-visual {
  position: relative;
  right: auto;
  bottom: auto;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(285px, 0.82fr) minmax(320px, 1fr);
  gap: 1rem;
  align-items: end;
  transform: none;
}

.phone {
  min-height: 610px;
  border-radius: 2rem;
  padding: 1.15rem;
  border: 1px solid rgba(255, 207, 63, 0.34);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(7, 49, 73, 0.98), rgba(7, 16, 24, 0.98));
  background-size: 42px 42px, 42px 42px, auto;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}

.phone-status,
.phone-top,
.progress-track {
  display: flex;
  align-items: center;
}

.phone-status {
  justify-content: space-between;
  margin-bottom: 1.5rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
}

.status-icons {
  letter-spacing: 0.04em;
}

.phone-top {
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.back-button {
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border: 1px solid rgba(151, 179, 201, 0.28);
  border-radius: 1rem;
  background: rgba(18, 34, 48, 0.88);
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 900;
}

.mode-pill,
.timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.35rem;
  border-radius: 999px;
  font-weight: 900;
}

.mode-pill {
  border: 1px solid rgba(255, 207, 63, 0.66);
  color: var(--yellow);
  background: rgba(12, 33, 48, 0.72);
}

.timer {
  color: #091018;
  background: var(--yellow);
}

.progress-track {
  height: 0.58rem;
  margin-bottom: 0.8rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(27, 43, 57, 0.9);
}

.progress-fill {
  width: 15%;
  height: 100%;
  border-radius: inherit;
  background: var(--yellow);
}

.calculation-step {
  margin-bottom: 1rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
}

.problem {
  display: grid;
  place-items: center;
  min-height: 16.8rem;
  margin-bottom: 1.25rem;
  padding: 1.5rem;
  border: 1px solid rgba(255, 207, 63, 0.42);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 20% 22%, rgba(0, 126, 242, 0.26), transparent 54%),
    radial-gradient(circle at 78% 60%, rgba(255, 207, 63, 0.12), transparent 52%),
    rgba(13, 26, 36, 0.86);
}

.problem-label {
  align-self: end;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.equation {
  color: var(--text);
  font-size: clamp(3.9rem, 5.8vw, 5.4rem);
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.answer-box {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 4.6rem;
  border: 3px solid var(--yellow);
  border-radius: 1rem;
  color: var(--muted);
  font-size: 1.32rem;
  font-weight: 900;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.72rem;
}

.key {
  display: grid;
  place-items: center;
  min-height: 3.85rem;
  border: 1px solid rgba(80, 121, 148, 0.56);
  border-radius: 1rem;
  background: rgba(30, 48, 64, 0.96);
  color: var(--text);
  font-size: 1.32rem;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.key-ok {
  border-color: rgba(0, 126, 242, 0.92);
  background: #087ef2;
}

.ranking-tile {
  position: relative;
  min-height: auto;
  padding: 1.05rem;
  border-color: rgba(0, 126, 242, 0.64);
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    rgba(6, 35, 51, 0.9);
  background-size: 42px 42px, 42px 42px, auto;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.32);
}

.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.podium-card {
  display: grid;
  place-items: center;
  min-height: 7.1rem;
  padding: 0.8rem 0.55rem;
  border: 1px solid rgba(80, 121, 148, 0.5);
  border-radius: 1rem;
  background: rgba(18, 34, 48, 0.9);
  text-align: center;
}

.podium-card.first {
  min-height: 8.5rem;
  border-color: rgba(255, 207, 63, 0.78);
  background: linear-gradient(180deg, rgba(255, 207, 63, 0.17), rgba(18, 34, 48, 0.9));
}

.podium-rank {
  color: var(--yellow);
  font-size: 1.7rem;
  font-weight: 950;
  line-height: 1;
}

.podium-name,
.rank-name {
  color: var(--text);
  font-weight: 900;
}

.podium-score,
.rank-score {
  color: var(--muted);
  font-weight: 800;
}

.ranking-result {
  padding: 1rem;
  border: 2px solid #087ef2;
  border-radius: 1rem;
  background: rgba(0, 126, 242, 0.12);
}

.ranking-result h3 {
  margin: 0 0 0.85rem;
  color: var(--text);
  font-size: 1.25rem;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.metric {
  padding: 0.75rem;
  border: 1px solid rgba(80, 121, 148, 0.42);
  border-radius: 0.65rem;
  background: rgba(18, 34, 48, 0.92);
}

.metric strong {
  display: block;
  color: var(--text);
  font-size: 1.16rem;
  font-weight: 950;
}

.metric span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ranking-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.rank-row {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.62rem 0.7rem;
  border: 1px solid rgba(45, 70, 88, 0.72);
  border-radius: 0.75rem;
  background: rgba(18, 34, 48, 0.76);
}

.rank-place {
  color: var(--yellow);
  font-weight: 950;
}

.hero-stats {
  position: relative;
  z-index: 2;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: -3rem auto 0;
}

.stat {
  min-height: 7.25rem;
}

.stat strong {
  font-size: 2.1rem;
}

@media (max-width: 1180px) {
  .hero-content {
    grid-template-columns: 1fr;
    padding-bottom: 4rem;
  }

  .hero-copy {
    max-width: 46rem;
  }

  .hero-subtitle {
    max-width: 42rem;
  }

  .challenge-visual {
    max-width: 780px;
    margin: 0 auto;
  }
}

@media (max-width: 920px) {
  .hero-content {
    padding: 3.5rem 0 4rem;
  }

  .challenge-visual {
    right: auto;
    left: auto;
    bottom: auto;
    width: 100%;
    grid-template-columns: minmax(270px, 0.86fr) minmax(280px, 1fr);
  }

  .phone {
    min-height: 570px;
  }

  .ranking-tile {
    display: block;
  }
}

@media (max-width: 760px) {
  .hero {
    padding-bottom: 4.5rem;
  }

  .hero-content {
    padding: 3rem 0 3rem;
  }

  .challenge-visual {
    grid-template-columns: 1fr;
  }

  .phone {
    min-height: auto;
  }

  .ranking-tile {
    max-width: 100%;
  }

  .result-metrics,
  .podium {
    grid-template-columns: 1fr;
  }

  .podium-card,
  .podium-card.first {
    min-height: auto;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    margin-top: -1.5rem;
  }
}

@media (max-width: 520px) {
  .hero-seven {
    right: -1rem;
    bottom: -2.6rem;
    font-size: 15rem;
  }

  .equation {
    font-size: 3.2rem;
  }

  .key {
    min-height: 3.4rem;
  }

  .hero-actions {
    align-items: stretch;
  }
}

/* NUM-59 follow-up: keep hero content and ranking metrics readable */
.hero-content {
  align-items: start;
}

.equation {
  font-size: clamp(3.05rem, 4.3vw, 4.25rem);
  letter-spacing: 0;
}

.result-metrics {
  gap: 0.5rem;
}

.metric {
  min-width: 0;
  padding: 0.62rem 0.45rem;
}

.metric strong,
.metric span {
  display: block;
  line-height: 1.08;
}

.metric strong {
  font-size: 0.98rem;
}

.metric span {
  margin-top: 0.12rem;
  font-size: 0.62rem;
}

.ranking-result h3 {
  font-size: 1.08rem;
}

@media (max-width: 760px) {
  .hero-content {
    align-items: stretch;
  }

  .equation {
    font-size: clamp(3rem, 16vw, 4.1rem);
  }
}

/* NUM-59 selector alignment for existing landing markup */
.problem-equation {
  color: var(--text);
  font-size: clamp(3.15rem, 4.4vw, 4.2rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.ranking-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.ranking-metrics > div {
  min-width: 0;
  padding: 0.62rem 0.45rem;
  border: 1px solid rgba(80, 121, 148, 0.42);
  border-radius: 0.65rem;
  background: rgba(18, 34, 48, 0.92);
}

.ranking-metrics strong,
.ranking-metrics span {
  display: block;
  line-height: 1.08;
}

.ranking-metrics strong {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 950;
}

.ranking-metrics span {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .problem-equation {
    font-size: clamp(3rem, 16vw, 4.1rem);
  }

  .ranking-metrics {
    grid-template-columns: 1fr;
  }
}

/* NUM-59 wireframe-aligned hero mockups */
.brand img {
  border-radius: 0.7rem;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.28));
}

.practice-phone {
  width: min(100%, 282px);
  height: 610px;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(245, 247, 251, 0.14);
  border-radius: 2.15rem;
  background: #02070d;
  box-shadow: inset 0 0 0 8px #050a10, 0 24px 84px rgba(0, 0, 0, 0.42);
}

.practice-phone .screen {
  position: relative;
  height: 100%;
  padding: 1.18rem 1rem 1rem;
  background:
    linear-gradient(180deg, rgba(8, 119, 242, 0.16), transparent 13rem),
    radial-gradient(circle at 90% 12%, rgba(255, 207, 63, 0.15), transparent 8rem),
    var(--bg);
}

.practice-phone .screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 46%);
}

.practice-phone .content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.practice-phone .topbar {
  height: 38px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0;
}

.practice-phone .icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(17, 29, 41, 0.78);
  color: var(--text);
}

.practice-phone svg,
.app-ranking svg {
  display: block;
}

.practice-phone .icon-button svg,
.practice-phone .key svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.practice-phone .chip,
.app-ranking .screen-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 0.85rem;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 1000;
  white-space: nowrap;
}

.practice-phone .chip.challenge,
.app-ranking .screen-chip {
  justify-self: start;
  border: 1px solid rgba(255, 207, 63, 0.32);
  background: rgba(255, 207, 63, 0.15);
  color: var(--yellow);
}

.practice-phone .timer-chip {
  min-width: 3.85rem;
  border: 0;
  background: rgba(255, 207, 63, 0.96);
  color: #161209;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.practice-phone .progress-block {
  margin-top: 0.92rem;
}

.practice-phone .progress-track {
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(28, 43, 58, 0.92);
  box-shadow: inset 0 0 0 1px rgba(184, 200, 215, 0.1);
}

.practice-phone .progress-fill {
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), #ffe27b);
}

.practice-phone .step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.56rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.practice-phone .step-row strong {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 1000;
}

.practice-phone .operation-card {
  position: relative;
  overflow: hidden;
  margin-top: 1rem;
  padding: 1.25rem 0.88rem 0.88rem;
  border: 1px solid rgba(255, 207, 63, 0.32);
  border-radius: 1.15rem;
  background:
    linear-gradient(135deg, rgba(8, 119, 242, 0.22), rgba(255, 207, 63, 0.1)),
    rgba(17, 29, 41, 0.92);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.practice-phone .operation-label {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
}

.practice-phone .operation {
  margin-top: 0.5rem;
  color: var(--text);
  font-size: clamp(2.85rem, 4vw, 3.25rem);
  line-height: 1.08;
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.practice-phone .answer-box {
  height: 3.25rem;
  display: grid;
  place-items: center;
  margin-top: 0.88rem;
  border: 2px solid rgba(255, 207, 63, 0.72);
  border-radius: 0.88rem;
  background: rgba(9, 19, 29, 0.82);
  color: var(--text);
  font-size: 1.56rem;
  line-height: 1;
  font-weight: 1000;
}

.practice-phone .answer-box.placeholder {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
}

.practice-phone .feedback {
  min-height: 1.1rem;
  margin-top: 0.5rem;
}

.practice-phone .keypad {
  display: grid;
  gap: 0.44rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

.practice-phone .keyrow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.44rem;
}

.practice-phone .key {
  min-height: 2.65rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 0.82rem;
  background: rgba(28, 43, 58, 0.94);
  color: var(--text);
  font-size: 1.38rem;
  line-height: 1;
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
}

.practice-phone .key.submit {
  border-color: transparent;
  background: linear-gradient(180deg, var(--primary), #065dc0);
  color: #fff;
  font-size: 0.84rem;
  box-shadow: 0 10px 24px rgba(8, 119, 242, 0.28);
}

.app-ranking {
  align-self: center;
  display: grid;
  gap: 0.72rem;
  padding: 1rem;
  border: 1px solid rgba(184, 200, 215, 0.14);
  border-radius: 1.35rem;
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    rgba(7, 16, 24, 0.92);
  background-size: 22px 22px, 22px 22px, auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.app-ranking .ranking-topbar {
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.app-ranking .screen-chip {
  justify-self: center;
}

.app-ranking .ranking-scope,
.app-ranking .badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 207, 63, 0.28);
  border-radius: 999px;
  padding: 0.35rem 0.56rem;
  background: rgba(255, 207, 63, 0.11);
  color: var(--yellow);
  font-size: 0.66rem;
  line-height: 1;
  font-weight: 950;
}

.app-ranking .ranking-hero {
  border: 1px solid rgba(255, 207, 63, 0.32);
  border-radius: 1rem;
  padding: 0.9rem;
  background: linear-gradient(140deg, rgba(255, 207, 63, 0.13), rgba(8, 119, 242, 0.1) 52%, rgba(17, 29, 41, 0.88)), rgba(17, 29, 41, 0.88);
}

.app-ranking .ranking-hero h3 {
  margin: 0.6rem 0 0;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.15;
  font-weight: 1000;
}

.app-ranking .ranking-hero p {
  margin: 0.38rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  font-weight: 760;
}

.app-ranking .podium {
  display: grid;
  grid-template-columns: 1fr 1.12fr 1fr;
  gap: 0.5rem;
  align-items: end;
  margin: 0;
}

.app-ranking .pod {
  min-width: 0;
  min-height: 5.5rem;
  display: grid;
  align-content: center;
  border: 1px solid rgba(184, 200, 215, 0.18);
  border-radius: 1rem;
  padding: 0.62rem 0.45rem;
  background: rgba(17, 29, 41, 0.9);
  text-align: center;
}

.app-ranking .pod.first {
  min-height: 6.9rem;
  border-color: rgba(255, 207, 63, 0.42);
  background: linear-gradient(180deg, rgba(255, 207, 63, 0.16), rgba(17, 29, 41, 0.88));
}

.app-ranking .rank {
  color: var(--yellow);
  font-size: 1.12rem;
  line-height: 1;
  font-weight: 1000;
}

.app-ranking .alias,
.app-ranking .name {
  min-width: 0;
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.2;
  font-weight: 1000;
}

.app-ranking .alias {
  margin-top: 0.4rem;
}

.app-ranking .score,
.app-ranking .pts {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
}

.app-ranking .list {
  display: grid;
  gap: 0.44rem;
  margin: 0;
}

.app-ranking .entry {
  display: grid;
  grid-template-columns: 1.85rem 1fr auto;
  gap: 0.5rem;
  align-items: center;
  border: 1px solid rgba(184, 200, 215, 0.18);
  border-radius: 0.9rem;
  padding: 0.5rem 0.56rem;
  background: rgba(17, 29, 41, 0.86);
}

.app-ranking .entry.me {
  border-color: rgba(8, 119, 242, 0.42);
  background: rgba(8, 119, 242, 0.16);
}

.app-ranking .n {
  color: var(--yellow);
  font-size: 0.74rem;
  font-weight: 1000;
}

.app-ranking .own {
  margin: 0;
  border: 1px solid rgba(8, 119, 242, 0.48);
  border-radius: 1rem;
  padding: 0.78rem;
  background: rgba(8, 119, 242, 0.14);
}

.app-ranking .own h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.2;
  font-weight: 1000;
}

.app-ranking .own-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.app-ranking .metric {
  min-width: 0;
  border: 1px solid rgba(184, 200, 215, 0.14);
  border-radius: 0.75rem;
  padding: 0.5rem;
  background: rgba(7, 16, 24, 0.42);
}

.app-ranking .metric strong,
.app-ranking .metric span {
  display: block;
  line-height: 1.08;
}

.app-ranking .metric strong {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 1000;
}

.app-ranking .metric span {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 850;
  text-transform: uppercase;
}

@media (max-width: 920px) {
  .practice-phone {
    width: min(100%, 282px);
    margin: 0 auto;
  }

  .app-ranking {
    width: min(100%, 360px);
    margin: 0 auto;
  }
}

@media (max-width: 760px) {
  .practice-phone {
    height: 610px;
  }

  .app-ranking .podium,
  .app-ranking .own-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}



/* NUM-59 practice keypad correction */
.practice-phone .keypad {
  grid-template-columns: 1fr;
  width: 100%;
  gap: 0.52rem;
  margin-top: auto;
  padding-top: 0.8rem;
}

.practice-phone .keyrow {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.52rem;
}

.practice-phone .key {
  width: 100%;
  min-width: 0;
  height: 3rem;
  min-height: 3rem;
  border-radius: 0.9rem;
  background: #1c2b3a;
  border-color: #2d4658;
  color: #f8fbff;
  font-size: 1.55rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.practice-phone .key svg {
  width: 1.45rem;
  height: 1.45rem;
}

.practice-phone .key.submit {
  background: linear-gradient(180deg, #0877f2, #0769dc);
  font-size: 0.95rem;
  letter-spacing: 0;
}

/* NUM-59 legal page structure */
.legal-layout a {
  color: var(--text);
  text-decoration-color: rgba(255, 207, 63, 0.7);
  text-underline-offset: 0.18em;
}

.legal-layout a:hover,
.legal-layout a:focus-visible {
  color: var(--accent);
}

.legal-note strong {
  color: var(--text);
}

.legal-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.4rem 0 2.5rem;
}

.legal-summary > div,
.legal-card,
.legal-cta {
  border: 1px solid rgba(45, 70, 88, 0.72);
  border-radius: 0.85rem;
  background: linear-gradient(180deg, rgba(28, 43, 58, 0.72), rgba(17, 29, 41, 0.72));
}

.legal-summary > div {
  padding: 1rem;
}

.legal-summary strong,
.legal-summary span {
  display: block;
}

.legal-summary strong {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 950;
}

.legal-summary span {
  margin-top: 0.35rem;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.legal-section {
  scroll-margin-top: 5.5rem;
}

.legal-section h3 {
  margin: 0 0 0.55rem;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.22;
}

.legal-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.legal-card {
  min-width: 0;
  padding: 1rem;
}

.legal-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
}

.legal-steps {
  display: grid;
  gap: 0.75rem;
  padding-left: 1.25rem;
  color: var(--muted);
  line-height: 1.75;
}

.legal-steps strong,
.legal-layout li strong {
  color: var(--text);
}

.legal-cta {
  margin-top: 2rem;
  padding: 1.1rem;
}

.legal-cta h2 {
  margin-top: 0;
}

.legal-cta .button {
  width: fit-content;
  margin-top: 0.4rem;
}

@media (max-width: 720px) {
  .legal-summary,
  .legal-card-grid {
    grid-template-columns: 1fr;
  }

  .legal-cta .button {
    width: 100%;
  }
}