@font-face {
  font-family: "Geist Sans";
  src: url("/fonts/Geist_Variable-s.p.0-te~ja_gpvcf.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}

@font-face {
  font-family: "Geist Pixel Square";
  src: url("/fonts/GeistPixel_Square.p.0tw8-iz4k0690.woff2") format("woff2");
  font-display: swap;
  font-weight: 500;
}

@font-face {
  font-family: "Geist Pixel Grid";
  src: url("/fonts/GeistPixel_Grid.p.0zc0qh60q6fhp.woff2") format("woff2");
  font-display: swap;
  font-weight: 500;
}

@font-face {
  font-family: "Geist Pixel Circle";
  src: url("/fonts/GeistPixel_Circle.p.05.s3p06xvhvp.woff2") format("woff2");
  font-display: swap;
  font-weight: 500;
}

@font-face {
  font-family: "Geist Pixel Triangle";
  src: url("/fonts/GeistPixel_Triangle.p.088sohq24lw~s.woff2") format("woff2");
  font-display: swap;
  font-weight: 500;
}

@font-face {
  font-family: "Geist Pixel Line";
  src: url("/fonts/GeistPixel_Line.p.08i~a2gz-qqs4.woff2") format("woff2");
  font-display: swap;
  font-weight: 500;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f7f7f7;
  --ink: #0a0a0a;
  --muted: rgba(10, 10, 10, 0.62);
  --soft: rgba(10, 10, 10, 0.08);
  --border: rgba(10, 10, 10, 0.13);
  --accent: #00a8d4;
  --button-ink: #ffffff;
  --font-sans: "Geist Sans", Arial, sans-serif;
  --dur-1: 160ms;
  --dur-2: 260ms;
  --ease-out: cubic-bezier(0.2, 0.9, 0.2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050608;
  --surface: #111216;
  --ink: #f7f7f5;
  --muted: rgba(247, 247, 245, 0.64);
  --soft: rgba(247, 247, 245, 0.09);
  --border: rgba(247, 247, 245, 0.17);
  --button-ink: #050608;
}

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

html,
body {
  min-height: 100%;
  margin: 0;
}

html {
  background: var(--bg);
}

body {
  min-width: 320px;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  transition: background-color var(--dur-2) ease, color var(--dur-2) ease;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--button-ink);
  transform: translateY(-150%);
}

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

.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;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
}

.nav-shell {
  display: flex;
  width: 100%;
  max-width: 1280px;
  height: 80px;
  margin: 0 auto;
  padding: 0 40px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  height: 44px;
  padding: 0 16px;
  align-items: center;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  transition: background-color var(--dur-1) ease;
}

.brand:hover {
  background: var(--soft);
}

.brand-word {
  display: inline-flex;
  align-items: baseline;
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.pixel-square { font-family: "Geist Pixel Square", monospace; }
.pixel-grid { font-family: "Geist Pixel Grid", monospace; }
.pixel-circle { font-family: "Geist Pixel Circle", monospace; }
.pixel-triangle { font-family: "Geist Pixel Triangle", monospace; }
.pixel-line { font-family: "Geist Pixel Line", monospace; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.direction-mark,
.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
}

.direction-mark {
  font-family: "Geist Pixel Grid", monospace;
  font-size: 17px;
}

.icon-button {
  cursor: pointer;
  transition: background-color var(--dur-1) ease, transform var(--dur-1) var(--ease-out);
}

.icon-button:hover {
  background: var(--soft);
}

.icon-button:active {
  transform: scale(0.92);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.sun-icon,
html[data-theme="dark"] .moon-icon {
  display: none;
}

html[data-theme="dark"] .sun-icon {
  display: block;
}

.game-chip {
  display: inline-flex;
  height: 38px;
  padding: 0 16px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
}

.hero {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
}

.hero-container {
  position: relative;
  display: grid;
  width: 100%;
  max-width: 1280px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 80px 40px 48px;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  align-items: center;
  gap: 80px;
}

.hero-content {
  display: flex;
  width: 100%;
  max-width: 780px;
  flex-direction: column;
  justify-self: start;
  gap: 24px;
  transform: translateY(-2px);
}

.heading-lockup {
  width: 100%;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  cursor: default;
  font-weight: 500;
  white-space: nowrap;
}

h1 {
  width: 100%;
  font-size: 96px;
  line-height: 0.92;
}

h2 {
  width: 100%;
  margin-top: 8px;
  color: color-mix(in srgb, var(--ink) 86%, transparent);
  font-size: 72px;
  line-height: 0.94;
}

.word-space {
  display: inline-block;
  width: 0.25em;
}

#predict-form {
  display: flex;
  width: 100%;
  max-width: 470px;
  height: 46px;
  gap: 8px;
}

.number-field {
  position: relative;
  flex: 1;
  min-width: 0;
}

#remaining-time {
  width: 100%;
  height: 100%;
  padding: 0 66px 0 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: "Geist Pixel Square", var(--font-sans);
  font-size: 17px;
  font-weight: 500;
  transition: border-color var(--dur-1) ease, box-shadow var(--dur-1) ease;
}

#remaining-time::placeholder {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
}

#remaining-time:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--soft);
}

#remaining-time::-webkit-inner-spin-button,
#remaining-time::-webkit-outer-spin-button {
  opacity: 0.56;
}

.unit {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--muted);
  font-family: "Geist Pixel Grid", monospace;
  font-size: 12px;
  transform: translateY(-50%);
  pointer-events: none;
}

.predict-button {
  min-width: 92px;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: var(--ink);
  color: var(--button-ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 560;
  transition: transform var(--dur-1) var(--ease-out), opacity var(--dur-1) ease;
}

.predict-button:hover {
  opacity: 0.82;
}

.predict-button:active {
  transform: scale(0.97);
}

.result-line {
  display: grid;
  width: min(100%, 560px);
  min-height: 58px;
  grid-template-columns: auto 1px auto 1fr;
  grid-template-rows: 34px 20px;
  align-items: center;
  column-gap: 14px;
}

#countdown {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-width: 110px;
  font-family: "Geist Pixel Square", monospace;
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.result-divider {
  width: 1px;
  height: 38px;
  grid-column: 2;
  grid-row: 1 / span 2;
  background: var(--border);
}

.result-position {
  grid-column: 3;
  grid-row: 1 / span 2;
  font-size: 18px;
  font-weight: 570;
  white-space: nowrap;
}

#event-meta {
  grid-column: 4;
  grid-row: 1 / span 2;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.input-error {
  position: absolute;
  min-height: 18px;
  margin-top: -18px;
  color: #c63838;
  font-size: 12px;
}

.orb-stage {
  width: 336px;
  height: 336px;
  justify-self: center;
}

#dither-orb {
  display: block;
  width: 336px;
  height: 336px;
  image-rendering: pixelated;
}

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

@media (max-width: 1023px) {
  .nav-shell {
    height: 64px;
    padding: 0 20px;
  }

  .brand {
    height: 40px;
    padding: 0 12px;
  }

  .brand-word {
    font-size: 34px;
  }

  .game-chip {
    display: none;
  }

  .hero-container {
    padding: 96px 20px 48px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 24px;
  }

  .hero-content {
    max-width: none;
    align-self: stretch;
    justify-content: center;
    gap: 16px;
    text-align: center;
    transform: translateY(-12px);
  }

  h1 {
    font-size: 42.4px;
    line-height: 0.92;
  }

  h2 {
    font-size: 32px;
    line-height: 0.94;
  }

  #predict-form {
    width: 100%;
    max-width: 353px;
    height: 48px;
    margin: 0 auto;
  }

  #remaining-time,
  .predict-button {
    height: 48px;
  }

  .result-line {
    width: 100%;
    min-height: 56px;
    margin: 0 auto;
    grid-template-columns: auto 1px auto;
    justify-content: center;
  }

  #event-meta {
    display: none;
  }

  .input-error {
    position: static;
    min-height: 18px;
    margin-top: -12px;
    text-align: center;
  }

  .orb-stage {
    display: none;
  }
}

@media (max-width: 410px) {
  .direction-mark {
    width: 32px;
  }

  #countdown {
    min-width: 102px;
    font-size: 30px;
  }
}

@media (max-height: 650px) and (max-width: 1023px) {
  .hero-content {
    transform: none;
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 27px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
