/* Outfit and IBM Plex Mono are under the SIL Open Font License. See fonts/OFL.txt. */

@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #020a18;
  --text: #eef4ff;
  --muted: #c5d5ea;
  --faint: #9fb6d4;
  --blue: #8ec2ff;
  --line: rgba(140, 180, 255, 0.16);
  --card: rgba(6, 16, 36, 0.88);
  --sans: "Outfit", "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --header: 4.25rem;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(80, 150, 255, 0.35);
  color: #fff;
}

:focus-visible {
  outline: 2px solid #9dcbff;
  outline-offset: 3px;
}

img {
  max-width: 100%;
}

h3, p {
  overflow-wrap: break-word;
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: #fff;
  color: var(--bg);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-weight: 600;
}

.skip:focus {
  top: 0.8rem;
}

#rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
  background: var(--bg);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  min-height: var(--header);
  padding: 0.75rem 1.25rem;
  background: linear-gradient(to bottom, rgba(2, 10, 24, 0.88), rgba(2, 10, 24, 0.35) 75%, transparent);
}

.site-header.scrolled {
  background: rgba(2, 10, 24, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--blue);
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-left: auto;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.2rem 0;
}

.site-nav a:hover,
.site-nav a[aria-current="true"] {
  color: #fff;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  position: relative;
  padding-top: calc(var(--header) + 2.5rem);
  padding-bottom: 0.5rem;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: calc(var(--header) + 0.5rem) -1.5rem -0.5rem -1.5rem;
  background: linear-gradient(180deg, rgba(2, 10, 24, 0.82), rgba(2, 10, 24, 0.55) 68%, rgba(2, 10, 24, 0.12));
  pointer-events: none;
}

.eyebrow,
.as-eyebrow {
  margin: 0 0 0.85rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
}

h1 {
  margin: 0;
  font-size: clamp(3.6rem, 13vw, 7.4rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.88;
  color: #f7fbff;
  text-shadow: 0 8px 28px rgba(2, 10, 24, 0.9);
}

.handle {
  margin: 0.55rem 0 0;
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  color: var(--blue);
  text-shadow: 0 2px 12px rgba(2, 10, 24, 0.9);
}

.pitch {
  margin: 1.4rem 0 0;
  max-width: 16em;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #e9f2ff;
  text-shadow: 0 2px 16px rgba(2, 10, 24, 0.95);
}

.subline {
  margin: 1rem 0 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  text-shadow: 0 2px 14px rgba(2, 10, 24, 0.95);
}

.block {
  margin-top: 4.75rem;
  scroll-margin-top: calc(var(--header) + 0.75rem);
}

.block h2 {
  margin: 0 0 1.15rem;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-shadow: 0 2px 16px rgba(2, 10, 24, 0.9);
}

.ccu-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ccu-head .as-eyebrow {
  margin: 0;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.22rem 0.6rem 0.22rem 0.48rem;
  border-radius: 999px;
  border: 1px solid rgba(140, 186, 255, 0.4);
  background: rgba(16, 42, 82, 0.62);
  color: #d7e8ff;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.live-pill.is-off {
  color: #d5deea;
  border-color: rgba(180, 196, 214, 0.35);
  background: rgba(28, 36, 48, 0.7);
}

.dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #8ec2ff;
  box-shadow: 0 0 0 0 rgba(142, 194, 255, 0.65);
  animation: pulse 1.8s ease-out infinite;
}

.live-pill.is-off .dot {
  background: #aeb8c6;
  animation: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(142, 194, 255, 0.65); }
  100% { box-shadow: 0 0 0 9px rgba(142, 194, 255, 0); }
}

.ccu-wrap,
#playing {
  position: relative;
}

#playing::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -2rem;
  top: 1.5rem;
  width: min(36rem, 90vw);
  height: 9rem;
  background: radial-gradient(ellipse, rgba(48, 120, 220, 0.28), transparent 70%);
  pointer-events: none;
}

.ccu {
  margin: 0.35rem 0 0;
  max-width: 100%;
  font-size: clamp(3.5rem, 12vw, 7.6rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  color: #f5f8ff;
  text-shadow: 0 12px 40px rgba(40, 110, 220, 0.38);
}

.ccu-caption {
  margin: 0.85rem 0 0;
  font-size: 1.15rem;
  color: #d7e6f8;
}

.ccu-meta {
  margin: 0.4rem 0 0;
  min-height: 1.2em;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--faint);
}

.history-note {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.history-chart {
  margin-top: 0.85rem;
  background: rgba(6, 16, 36, 0.78);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.65rem 0.35rem 0.35rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.history-chart svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
}

.history-chart .grid {
  stroke: rgba(150, 190, 255, 0.16);
  stroke-width: 1;
}

.history-chart .area {
  fill: rgba(78, 157, 255, 0.22);
  stroke: none;
}

.history-chart .line {
  fill: none;
  stroke: #8eb6ff;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.history-chart .axis {
  fill: #9eb0c8;
  font-family: var(--mono);
  font-size: 12px;
}

.history-chart .dot {
  fill: #d7e8ff;
  stroke: #4c9dff;
  stroke-width: 2;
}

.history-chart .guide {
  stroke: rgba(190, 214, 255, 0.45);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.history-chart .tip-box {
  fill: rgba(7, 16, 36, 0.94);
  stroke: rgba(150, 190, 255, 0.45);
  stroke-width: 1;
}

.history-chart .tip-text {
  fill: #eaf2ff;
  font-family: var(--mono);
  font-size: 13px;
}

.notice {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(7, 16, 36, 0.94);
  border: 1px solid rgba(150, 190, 255, 0.38);
  color: #eaf2ff;
  font-size: 0.98rem;
  line-height: 1.5;
}

.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

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

.game {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.game:hover {
  border-color: rgba(160, 198, 255, 0.4);
  transform: translateY(-3px);
}

.game-media {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 20% 15%, rgba(80, 140, 230, 0.4), transparent 50%),
    linear-gradient(160deg, #163056, #07111f);
}

.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 1rem 1rem;
}

.game-heading {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  margin-top: -26px;
  position: relative;
}

.icon,
.icon-fallback {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #102038;
  border: 2px solid rgba(6, 14, 30, 0.95);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.icon {
  object-fit: cover;
  display: block;
}

.icon-fallback {
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 500;
  color: #d7e8ff;
  background: #14325f;
}

.game h3 {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.creator {
  margin: 0.12rem 0 0;
  color: #b7c9e2;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.95rem 0 0;
}

.stats dt {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.stats dd {
  margin: 0.15rem 0 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 1.02rem;
  color: #f4f8ff;
}

.play,
.cta,
.retry {
  font-family: inherit;
}

.play {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.75rem;
  border-radius: 12px;
  background: #0d68d8;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.play:hover,
.cta:hover {
  background: #1a76ea;
}

.play:active,
.cta:active {
  background: #0b57b6;
}

.game-failed {
  padding: 1.2rem 1rem;
  justify-content: center;
  min-height: 14rem;
}

.game-failed h3 {
  display: block;
  -webkit-line-clamp: unset;
}

.game-failed p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.empty {
  grid-column: 1 / -1;
  padding: 1.35rem 1.2rem;
  border-radius: 18px;
  border: 1px dashed rgba(150, 190, 255, 0.32);
  background: rgba(6, 16, 36, 0.62);
}

.empty h3 {
  margin: 0;
  font-size: 1.15rem;
}

.empty p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  max-width: 40rem;
}

.retry {
  margin-top: 0.95rem;
  background: transparent;
  color: #e7f1ff;
  border: 1px solid rgba(150, 190, 255, 0.45);
  border-radius: 999px;
  min-height: 2.75rem;
  padding: 0.45rem 1rem;
  cursor: pointer;
}

.retry:hover {
  border-color: #c5dcff;
}

.skel {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  background-size: 200% 100%;
  animation: shine 1.3s ease-in-out infinite;
}

.skel-media {
  aspect-ratio: 16 / 9;
}

.skel-line {
  height: 0.85rem;
  margin: 1rem 1rem 0;
  border-radius: 999px;
}

.skel-short {
  width: 55%;
  margin-bottom: 1.2rem;
}

@keyframes shine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.contact .subline {
  margin-bottom: 0;
}

.contact h2 {
  font-size: clamp(2.3rem, 6vw, 3.6rem);
  margin-bottom: 0.7rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 3.4rem;
  padding: 0.85rem 1.45rem;
  border-radius: 999px;
  background: #0d68d8;
  color: #fff;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(13, 104, 216, 0.35);
}

.cta svg {
  display: block;
  flex: none;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  flex-wrap: wrap;
  margin: 4.5rem 0 1.75rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #d5e4f8;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

@media (max-width: 980px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .site-header {
    padding: 0.6rem 0.75rem;
  }

  .site-nav {
    gap: 0.15rem 0.7rem;
  }

  .site-nav a {
    font-size: 0.88rem;
  }

  .page {
    width: min(1120px, calc(100% - 1.4rem));
  }

  .hero {
    padding-top: calc(var(--header) + 1.4rem);
  }

  .block {
    margin-top: 3.25rem;
  }

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

  .cta {
    width: 100%;
  }

  .pitch {
    max-width: 14em;
  }
}

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

  .dot,
  .skel {
    animation: none;
  }

  .game,
  .game:hover {
    transform: none;
    transition: none;
  }
}

@media print {
  #rain,
  .site-header,
  .cta,
  .play {
    display: none;
  }

  body {
    background: #fff;
    color: #111;
  }

  .page {
    width: 100%;
  }
}
