:root {
  --black: #000;
  --white: #fff;
  --red: #ff0000;
  --ink: #080808;
  --smoke: #a5a5a5;
  --dim: #5d5d5d;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.32);
  --display: "Archivo Black", Impact, sans-serif;
  --body: "Inter", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: 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),
    var(--black);
  background-size: 48px 48px;
  color: var(--white);
  font-family: var(--body);
  font-weight: 800;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 0, 0, 0.18), transparent 28%),
    radial-gradient(circle at 85% 72%, rgba(255, 255, 255, 0.07), transparent 24%),
    #000;
  pointer-events: none;
}

body::after {
  content: "+ - × ÷ =";
  position: fixed;
  right: -5vw;
  bottom: 7vh;
  z-index: -2;
  color: rgba(255, 255, 255, 0.045);
  font-family: var(--display);
  font-size: clamp(7rem, 18vw, 21rem);
  line-height: 1;
  transform: rotate(-11deg);
  white-space: nowrap;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

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

h1,
h2,
h3,
.button,
.ticker,
.brand,
.eyebrow,
.label,
.hud__item,
.run-panel,
.leaderboard,
.drop__meta,
.footer {
  font-family: var(--display);
  letter-spacing: 0;
  text-transform: uppercase;
}

.site-noise {
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: 0.16;
  mix-blend-mode: screen;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.2) 0 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 0, 0, 0.12) 0 1px, transparent 1px);
  background-position: 0 0, 2px 2px;
  background-size: 5px 5px, 7px 7px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ticker {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 15;
  width: 100%;
  height: 34px;
  overflow: hidden;
  background: var(--red);
  color: var(--white);
  font-size: 0.76rem;
  line-height: 34px;
}

.ticker__track {
  display: flex;
  width: max-content;
  animation: ticker 24s linear infinite;
}

.ticker span {
  flex: 0 0 auto;
  padding-inline: 26px;
  white-space: nowrap;
}

.nav {
  position: fixed;
  top: 34px;
  left: 0;
  z-index: 14;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: 0.72rem;
}

.brand__box {
  display: grid;
  place-items: center;
  width: 74px;
  height: 36px;
  background: var(--red);
  color: var(--white);
  font-size: 1.05rem;
}

.brand__name {
  display: none;
  white-space: nowrap;
}

.nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  width: 100%;
  color: rgba(255, 255, 255, 0.76);
  font-family: var(--display);
  font-size: 0.68rem;
}

.nav__links a {
  position: relative;
  padding-block: 6px;
  transition: color 180ms ease;
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.nav__links a:hover,
.nav__links a:focus-visible {
  color: var(--white);
}

.nav__links a:hover::after,
.nav__links a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border: 2px solid var(--white);
  border-radius: 0;
  background: transparent;
  color: var(--white);
  font-size: 0.82rem;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translate(-4px, -4px);
  box-shadow: 6px 6px 0 var(--white);
}

.button--primary {
  border-color: var(--red);
  background: var(--red);
}

.button--ghost:hover,
.button--ghost:focus-visible {
  background: var(--white);
  color: var(--black);
  box-shadow: 6px 6px 0 var(--red);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
  box-shadow: none;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 28px;
  align-content: center;
  min-height: 100svh;
  padding: 150px 18px 34px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero__math {
  position: absolute;
  inset: 96px 0 0;
  z-index: -2;
  opacity: 0.9;
  background:
    linear-gradient(rgba(255, 0, 0, 0.12) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 0, 0, 0.12) 2px, transparent 2px),
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 144px 144px, 144px 144px, 36px 36px, 36px 36px;
  animation: gridShift 10s linear infinite;
}

.axis {
  position: absolute;
  background: rgba(255, 255, 255, 0.16);
}

.axis--x {
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
}

.axis--y {
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
}

.curve {
  position: absolute;
  inset: 16% auto auto 50%;
  width: min(760px, 78vw);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  transform: translateX(-50%) rotate(13deg) scaleY(0.42);
}

.curve--two {
  top: 28%;
  border-color: rgba(255, 0, 0, 0.28);
  transform: translateX(-50%) rotate(-18deg) scaleY(0.35);
}

.hero-symbol {
  position: absolute;
  color: rgba(255, 255, 255, 0.22);
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 9rem);
  animation: floatSymbol 6s ease-in-out infinite;
}

.hero-symbol--one {
  top: 18%;
  left: 8%;
  color: rgba(255, 0, 0, 0.75);
}

.hero-symbol--two {
  right: 10%;
  bottom: 18%;
}

.hero-symbol--three {
  left: 14%;
  bottom: 16%;
  animation-delay: -2s;
}

.hero__identity {
  justify-self: center;
  width: min(72vw, 390px);
  transition: transform 120ms ease-out;
  will-change: transform;
}

.hero__logo {
  width: 100%;
  filter: drop-shadow(0 0 46px rgba(255, 0, 0, 0.28));
}

.hero__copy {
  max-width: 1040px;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--red);
  font-size: 0.72rem;
}

h1 {
  max-width: 1040px;
  margin-bottom: 16px;
  font-size: clamp(3.35rem, 11vw, 6.4rem);
  line-height: 0.86;
  text-wrap: balance;
}

.hero-title {
  display: grid;
  gap: 0.02em;
}

.hero-title > span:not(.hero-title__phrase) {
  display: block;
  white-space: nowrap;
}

.hero-title > .hero-title__phrase {
  display: grid;
  gap: 0.04em;
}

.hero-title__phrase span {
  display: block;
  white-space: nowrap;
}

.hero__subtext,
.section__header p,
.drop__copy p,
.join-section p {
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(1rem, 2.4vw, 1.45rem);
  line-height: 1.25;
}

.hero__actions,
.game-actions,
.name-save__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__actions {
  margin-top: 28px;
}

.hero__rail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin-top: 12px;
  background: var(--line);
  font-family: var(--display);
  font-size: 0.72rem;
}

.hero__rail span {
  padding: 16px;
  background: rgba(0, 0, 0, 0.84);
}

.section {
  scroll-margin-top: 122px;
  padding: 70px 18px;
  border-bottom: 1px solid var(--line);
}

.section__header {
  display: grid;
  gap: 10px;
  max-width: 1180px;
  margin-bottom: 28px;
}

.section__header h2,
.join-section h2 {
  margin: 0;
  max-width: 940px;
  font-size: clamp(2.75rem, 10vw, 6.8rem);
  line-height: 0.9;
  text-wrap: balance;
}

.section__header p {
  margin-bottom: 0;
}

.game-section {
  padding-top: 52px;
}

.game-shell {
  display: grid;
  gap: 18px;
}

.game-board,
.run-panel {
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.86);
}

.game-board {
  position: relative;
  min-height: 620px;
  padding: 16px;
  overflow: hidden;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.03);
}

.game-board::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.game-board > * {
  position: relative;
  z-index: 1;
}

.hud {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 16px;
  background: var(--line);
}

.hud__item {
  min-height: 88px;
  padding: 15px;
  background: var(--black);
}

.hud__item span,
.label {
  display: block;
  margin-bottom: 8px;
  color: var(--smoke);
  font-size: 0.68rem;
}

.hud__item strong {
  font-size: clamp(1.45rem, 7vw, 3rem);
  line-height: 1;
}

.runway {
  position: relative;
  height: 36px;
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.runway__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: var(--red);
  transform-origin: left center;
}

.runway__time,
.runway__tag {
  position: absolute;
  z-index: 1;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--display);
  font-size: 0.75rem;
}

.runway__time {
  left: 16px;
}

.runway__tag {
  right: 16px;
}

.question-zone {
  display: grid;
  align-content: center;
  min-height: 250px;
  margin-bottom: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.question-zone.is-correct {
  animation: correctFlash 260ms ease;
}

.question-zone.is-wrong {
  animation: wrongFlash 320ms ease;
}

.question-zone__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  color: var(--smoke);
  font-family: var(--display);
  font-size: 0.68rem;
}

.game-status {
  margin-bottom: 10px;
  color: var(--smoke);
  font-family: var(--display);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.goat-mode {
  justify-self: start;
  margin-bottom: 12px;
  padding: 7px 12px;
  background: var(--red);
  color: var(--white);
  font-family: var(--display);
  font-size: 0.72rem;
}

.question {
  min-height: 1.9em;
  overflow-wrap: anywhere;
  font-family: var(--display);
  font-size: clamp(2.7rem, 13vw, 8rem);
  line-height: 0.92;
}

.answer-form {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

input {
  width: 100%;
  min-width: 0;
  height: 58px;
  border: 2px solid var(--white);
  border-radius: 0;
  outline: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--display);
  font-size: 1rem;
  text-transform: uppercase;
  padding: 0 16px;
}

input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.24);
}

input:disabled {
  opacity: 0.42;
}

.game-over {
  position: absolute;
  inset: 12px;
  z-index: 5;
  display: grid;
  align-content: center;
  gap: 28px;
  padding: 22px;
  border: 1px solid var(--red);
  background: rgba(0, 0, 0, 0.94);
}

.game-over[hidden] {
  display: none;
}

.game-over h3 {
  margin-bottom: 10px;
  color: var(--white);
  font-size: clamp(4rem, 20vw, 10rem);
  line-height: 0.82;
}

.game-over p {
  color: var(--smoke);
  font-family: var(--display);
  text-transform: uppercase;
}

.name-save label {
  display: block;
  margin-bottom: 10px;
  color: var(--smoke);
  font-family: var(--display);
  font-size: 0.72rem;
}

.run-panel {
  display: grid;
  align-content: start;
  padding: 18px;
}

.run-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  color: var(--red);
  font-size: 0.74rem;
}

.run-panel__top img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.run-panel__row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  min-height: 66px;
  border-top: 1px solid var(--line);
}

.run-panel__row:last-child {
  border-bottom: 1px solid var(--line);
}

.run-panel__row span {
  color: var(--red);
}

.run-panel__row strong {
  font-size: 1rem;
}

.run-panel__row.is-live {
  background: rgba(255, 0, 0, 0.12);
}

.run-panel__row.is-live strong {
  color: var(--white);
}

.leaderboard {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  counter-reset: rank;
  list-style: none;
}

.leaderboard li {
  counter-increment: rank;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.leaderboard li::before {
  content: counter(rank, decimal-leading-zero);
  color: var(--red);
  font-size: 1.15rem;
}

.leaderboard li:first-child {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.leaderboard li:first-child::before,
.leaderboard li:first-child .leaderboard__meta {
  color: var(--white);
}

.leaderboard li:hover {
  transform: translateX(5px);
  border-color: var(--red);
}

.leaderboard__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.05rem;
}

.leaderboard__meta {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--smoke);
  font-size: 0.72rem;
}

.drop {
  display: grid;
  gap: 18px;
}

.drop__image {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #101010;
}

.drop__image img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}

.drop__copy {
  display: grid;
  align-content: end;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(rgba(255, 0, 0, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 0, 0.12) 1px, transparent 1px),
    #000;
  background-size: 32px 32px;
}

.drop__copy h3 {
  margin: 0;
  font-size: clamp(2.1rem, 8vw, 5.4rem);
  line-height: 0.9;
}

.drop__copy p {
  margin-bottom: 0;
}

.drop__meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  font-size: 0.72rem;
}

.drop__meta span {
  padding: 14px;
  background: var(--black);
}

.join-section {
  scroll-margin-top: 122px;
  display: grid;
  place-items: start;
  gap: 18px;
  min-height: 70svh;
  padding: 88px 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(255, 0, 0, 0.92), rgba(255, 0, 0, 0.92)),
    var(--red);
  color: var(--white);
}

.join-section .eyebrow,
.join-section p {
  color: var(--white);
}

.join-section .button--primary {
  border-color: var(--white);
  background: var(--white);
  color: var(--black);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 18px;
  color: var(--smoke);
  font-size: 0.72rem;
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@keyframes gridShift {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0;
  }

  to {
    background-position: 144px 144px, 144px 144px, 36px 36px, 36px 36px;
  }
}

@keyframes floatSymbol {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0);
  }

  50% {
    transform: translate3d(10px, -16px, 0) rotate(7deg);
  }
}

@keyframes correctFlash {
  0% {
    border-color: var(--line);
  }

  50% {
    border-color: var(--red);
    background: rgba(255, 0, 0, 0.16);
  }

  100% {
    border-color: var(--line);
  }
}

@keyframes wrongFlash {
  0% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-8px);
  }

  50% {
    transform: translateX(8px);
    background: rgba(255, 255, 255, 0.08);
  }

  100% {
    transform: translateX(0);
  }
}

@media (min-width: 700px) {
  .brand__name {
    display: inline;
  }

  .hero,
  .section,
  .join-section,
  .footer {
    padding-inline: clamp(32px, 5vw, 84px);
  }

  .hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.72fr);
    align-items: center;
    padding-top: 136px;
  }

  .hero__identity {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: min(42vw, 580px);
  }

  .hero__copy {
    grid-column: 1;
    grid-row: 1;
  }

  .hero__rail {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  h1 {
    font-size: clamp(5rem, 7.25vw, 9.6rem);
  }

  .hero-title > .hero-title__phrase {
    display: inline-flex;
    gap: 0.22em;
  }

  .hud {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .answer-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .leaderboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drop {
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  }

  .drop__meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .join-section {
    place-items: center start;
  }
}

@media (min-width: 1040px) {
  .nav {
    padding: 20px clamp(32px, 5vw, 84px);
  }

  .nav__links {
    width: auto;
    gap: 34px;
    font-size: 0.74rem;
  }

  .hero {
    min-height: 960px;
  }

  .hero__identity {
    width: min(40vw, 680px);
  }

  .section {
    padding-block: 94px;
  }

  .section__header {
    grid-template-columns: minmax(180px, 0.25fr) minmax(0, 1fr) minmax(220px, 0.3fr);
    align-items: end;
    margin-bottom: 40px;
    max-width: none;
  }

  .section__header .eyebrow {
    margin-bottom: 0;
  }

  .section__header h2 {
    max-width: 900px;
  }

  .game-shell {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 370px);
    gap: 24px;
  }

  .game-board {
    min-height: 700px;
    padding: 28px;
  }

  .question-zone {
    min-height: 320px;
  }

  .run-panel {
    padding: 28px;
  }

  .leaderboard {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
  }

  .leaderboard li {
    grid-template-columns: 1fr;
    align-content: space-between;
    min-height: 190px;
  }

  .leaderboard li::before,
  .leaderboard__meta {
    grid-column: auto;
  }

  .leaderboard__meta {
    display: grid;
    gap: 8px;
  }

  .leaderboard__name {
    white-space: normal;
    line-height: 0.95;
  }

  .drop__image img {
    min-height: 620px;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: clamp(2.25rem, 9.2vw, 2.85rem);
  }

  .hero-title {
    gap: 0.04em;
  }

  .hero-title__phrase {
    display: grid;
    gap: 0.04em;
  }

  .hero-title__phrase span {
    display: block;
    white-space: nowrap;
  }

  .section__header h2,
  .join-section h2 {
    font-size: clamp(2.55rem, 13vw, 4rem);
  }

  .button {
    width: 100%;
  }

  .brand {
    width: 100%;
  }

  .game-actions,
  .hero__actions,
  .name-save__controls {
    width: 100%;
  }

  .question {
    font-size: clamp(2.3rem, 12vw, 3.4rem);
  }
}
