@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/fredoka.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #0f1116;
  --bg-2: #15171d;
  --surface: #1d2029;
  --line: #2a2e38;
  --text: #ece8e1;
  --muted: #9a968f;
  --pink: #e8558f;
  --amber: #f2a900;
  --blue: #4a90d9;
  --green: #7bd389;
  --gutter: clamp(16px, 5vw, 64px);
  --display: 'Fredoka', ui-rounded, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 18px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: clamp(34px, 5.5vw, 64px); line-height: 1.05; }
h3 { font-size: 22px; }
p { margin: 0; }
button { font: inherit; color: inherit; }

/* ------------------------------------------------------------ nav */
.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 14px;
  background: linear-gradient(var(--bg) 0%, rgba(15, 17, 22, 0.75) 60%, transparent);
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font: 600 22px var(--display);
}
.brand svg { width: 34px; height: 34px; }
.lang-toggle {
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.lang-toggle:hover { color: var(--text); border-color: var(--muted); }
.pill {
  font-size: 14px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--amber);
  color: #1b1d24;
}

/* ------------------------------------------------------------ hero */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 50% 62%, rgba(242, 169, 0, 0.13), transparent 70%),
    radial-gradient(45% 40% at 85% 20%, rgba(74, 144, 217, 0.14), transparent 70%),
    radial-gradient(40% 40% at 10% 85%, rgba(232, 85, 143, 0.1), transparent 70%),
    var(--bg);
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-fallback { display: none !important; }
.no-webgl .hero canvas:first-child { display: none; }
.no-webgl .hero-fallback {
  display: block !important;
  inset: auto;
  left: 50%;
  top: 58%;
  width: min(80vw, 640px);
  height: auto;
  transform: translate(-50%, -50%);
  image-rendering: pixelated;
}

.hero-copy {
  position: absolute;
  inset: 13vh var(--gutter) auto;
  text-align: center;
  pointer-events: none;
}
.eyebrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}
.title {
  font-size: clamp(64px, 13vw, 168px);
  line-height: 0.95;
  margin: 10px 0 16px;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
.title .char, .title div { display: inline-block; }
.lead {
  max-width: 34ch;
  margin: 0 auto;
  font-size: clamp(18px, 2vw, 22px);
  color: var(--muted);
}

.hero-step, .hero-caption {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 11vh;
  margin: 0 auto;
  max-width: 22ch;
  text-align: center;
  font: 500 clamp(26px, 3.6vw, 44px)/1.15 var(--display);
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
  visibility: hidden;
  pointer-events: none;
}
.hero-caption { top: auto; bottom: 7vh; max-width: none; }
.hero-caption strong { display: block; font-weight: 600; }
.hero-caption span { display: block; font: 400 17px system-ui, sans-serif; color: var(--muted); margin-top: 6px; }

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.scroll-hint i {
  width: 2px;
  height: 36px;
  background: linear-gradient(var(--amber), transparent);
  border-radius: 2px;
  animation: hint 1.8s ease-in-out infinite;
  transform-origin: top;
}
@keyframes hint {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ------------------------------------------------------------ sections */
section:not(.hero) { padding: clamp(80px, 14vh, 160px) var(--gutter); }
.section-head { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.section-head p, .play-copy > p:not(.play-status) { margin-top: 18px; font-size: clamp(18px, 1.8vw, 21px); color: var(--muted); }
.count { color: var(--amber); font-variant-numeric: tabular-nums; }

/* play */
.play {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
}
.play-status {
  margin-top: 28px;
  font: 500 22px var(--display);
  color: var(--text);
  min-height: 1.5em;
  transition: color 0.2s;
}
.play-status.blocked { color: #ff6b6f; }
.play-status.won { color: var(--green); }
.button {
  margin-top: 20px;
  padding: 12px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  cursor: pointer;
}
.play-board {
  position: relative;
  aspect-ratio: 9 / 11;
  max-height: 80vh;
  width: 100%;
  margin: 0 auto;
  border-radius: 28px;
  background: radial-gradient(70% 60% at 50% 40%, rgba(242, 169, 0, 0.09), transparent 75%);
}
.play-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: manipulation; }

/* showcase: trailer + screenshots */
.showcase { padding-left: 0 !important; padding-right: 0 !important; }
.showcase .section-head { padding: 0 var(--gutter); }
.trailer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.trailer video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, 0.5);
}
.shots {
  display: flex;
  gap: clamp(16px, 2.4vw, 32px);
  margin-top: clamp(56px, 9vh, 96px);
  padding: 8px var(--gutter) 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.shots::-webkit-scrollbar { display: none; }
/* Center the row when it fits. */
.shots::before, .shots::after { content: ''; flex: 1 0 0; }
.shot { flex: none; margin: 0; width: clamp(170px, 12.5vw, 230px); scroll-snap-align: start; text-align: center; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 26px;
  border: 5px solid #2a2e38;
  background: var(--bg-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.shot figcaption { margin-top: 14px; font-size: 15px; line-height: 1.35; color: var(--muted); }

/* gallery */
.gallery { padding-left: 0 !important; padding-right: 0 !important; overflow: hidden; }
.gallery .section-head { padding: 0 var(--gutter); }
.gallery-rows { display: flex; flex-direction: column; gap: 18px; transform: rotate(-4deg) scale(1.08); }
.gallery-row { display: flex; gap: 18px; width: max-content; will-change: transform; }
.tile {
  flex: none;
  width: clamp(120px, 15vw, 190px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  padding: 14px;
}
.tile canvas { max-width: 100%; max-height: 100%; }

/* story */
.story-scroller { overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.story-scroller::-webkit-scrollbar { display: none; }
.story-row {
  position: relative;
  display: flex;
  gap: clamp(14px, 2vw, 28px);
  width: max-content;
  margin: 0 auto;
  /* Room for the tile ring, the shadow and the 16px slide-in: the scroller clips. */
  padding: 8px 0 32px;
}
.story-line {
  position: absolute;
  left: 4%;
  right: 4%;
  top: calc(8px + clamp(110px, 12vw, 150px) / 2);
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 10px, transparent 10px 20px);
  transform-origin: left;
  z-index: 0;
}
.story-tile { position: relative; z-index: 1; margin: 0; width: clamp(110px, 12vw, 150px); text-align: center; }
.story-pic {
  position: relative;
  aspect-ratio: 1;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 0 0 6px var(--bg), 0 12px 30px rgba(0, 0, 0, 0.35);
}
.story-pic canvas {
  position: absolute;
  inset: 12%;
  width: 76%;
  height: 76%;
  object-fit: contain;
}
.story-tile figcaption { margin-top: 14px; font-size: 15px; color: var(--muted); }

/* features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
}
.feature {
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(160deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
}
.feature .dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 18px var(--c);
  margin-bottom: 22px;
}
.feature p { margin-top: 10px; color: var(--muted); font-size: 17px; }

/* cta */
.cta { text-align: center; }
.cta-icon { width: clamp(140px, 18vw, 220px); height: auto; overflow: visible; }
.cta h2 { margin-top: 18px; }
.cta p { margin-top: 16px; color: var(--muted); font-size: 20px; }

/* footer */
.bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 28px var(--gutter) max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.bottom a { color: var(--text); text-decoration-color: var(--amber); text-underline-offset: 3px; }
.bottom span { margin-left: auto; }

/* ------------------------------------------------------------ small screens */
@media (max-width: 820px) {
  .pill { display: none; }
  .play { grid-template-columns: 1fr; text-align: center; }
  .play-board { max-width: 480px; }
  .bottom span { margin-left: 0; width: 100%; }
  .hero-copy { top: 11vh; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint i { animation: none; }
  .gallery-rows { transform: none; }
  .gallery-row { flex-wrap: wrap; width: auto; justify-content: center; }
  .hero-caption { visibility: visible; }
}
