@font-face {
  font-family: "Bagel Fat One";
  src: url("/fonts/bagel-fat-one.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Gabarito";
  src: url("/fonts/gabarito.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --yolk: #ffd21f;
  --ultramarine: #1b1fc4;
  --midnight: #0e1060;
  --bubblegum: #ff7ab8;
  --white: #fff;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--yolk);
  color: var(--ultramarine);
  font: 400 1.0625rem/1.5 "Gabarito", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: 68rem;
  margin: 0 auto;
  padding: var(--gutter);
}

h1,
h2,
p,
ol,
pre {
  margin: 0;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--midnight);
  outline-offset: 3px;
}

header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 0 1.25rem;
  margin-bottom: 1.25rem;
}

h1 {
  font: 400 clamp(3.5rem, 11vw, 6.5rem)/0.8 "Bagel Fat One", system-ui, sans-serif;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 24ch;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

#copy {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  background: var(--ultramarine);
  color: var(--white);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 120ms ease;
}

#copy:hover {
  background: var(--midnight);
}

#copy[data-state="copied"] {
  background: var(--bubblegum);
  color: var(--midnight);
}

/* The bezel: one big corner, like the casing of a handheld toy. */
.stage {
  padding: clamp(0.5rem, 1.5vw, 0.9rem);
  border-radius: 1rem 1rem 3.5rem 1rem;
  background: var(--ultramarine);
}

.stage iframe {
  display: block;
  width: 100%;
  height: clamp(20rem, 58vh, 35rem);
  border: 0;
  border-radius: 0.4rem;
  background: var(--white);
}

.caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  padding: 0.75rem 1.5rem 0.4rem 0.4rem;
  color: var(--white);
  font-size: 1.125rem;
}

#owner {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.counter {
  --digit-height: clamp(2.25rem, 7vw, 3.25rem);
  display: inline-flex;
  gap: 3px;
  font: 400 calc(var(--digit-height) * 0.8)/var(--digit-height) "Bagel Fat One", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

.digit {
  display: block;
  width: calc(var(--digit-height) * 0.72);
  height: var(--digit-height);
  overflow: hidden;
  border-radius: 5px;
  background: var(--yolk);
  color: var(--ultramarine);
  text-align: center;
}

.strip {
  display: block;
  transform: translateY(calc(var(--value, 0) * var(--digit-height) * -1));
  transition: transform 500ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.strip span {
  display: block;
  height: var(--digit-height);
}

.below {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(0, 2fr);
  gap: 2.5rem;
  margin-top: 2.5rem;
}

h2 {
  margin-bottom: 0.6rem;
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.2;
}

#standings {
  padding: 0;
  list-style: none;
  counter-reset: rank;
}

#standings li {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) auto;
  gap: 0.5rem;
  padding: 0.15rem 0;
  counter-increment: rank;
}

#standings li::before {
  content: counter(rank);
}

#standings li:first-child {
  font-weight: 800;
}

.name {
  overflow-wrap: anywhere;
}

.hits {
  font-variant-numeric: tabular-nums;
}

#status:empty,
#standings-empty[hidden] {
  display: none;
}

#status {
  margin-top: 0.5rem;
  font-weight: 700;
}

.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding-left: 1.5rem;
}

.steps li::marker {
  font-weight: 800;
}

pre {
  margin-top: 0.3rem;
  border-radius: 0.4rem;
  padding: 0.6rem 0.75rem;
  background: var(--midnight);
  color: var(--white);
  font: 0.875rem/1.5 ui-monospace, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

footer {
  display: grid;
  gap: 0.25rem;
  margin-top: 2.5rem;
  font-size: 0.9375rem;
}

noscript p {
  margin-top: 1rem;
}

@media (max-width: 52rem) {
  header {
    grid-template-columns: auto 1fr;
    row-gap: 0.9rem;
  }

  #copy {
    grid-column: 1 / -1;
    justify-self: start;
  }

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

@media (max-width: 26rem) {
  .lede {
    font-size: 1.0625rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .strip,
  #copy {
    transition: none;
  }
}
