/* Game pages (src/game-pages.mjs). Each page sets its own palette and fonts in :root (--g-*), taken from
   the game's store look, so the header and footer stay the studio's and everything in between is the game's. */

body.game {
  background:
    radial-gradient(900px 600px at 88% -5%, color-mix(in srgb, var(--g-glow1) 40%, transparent), transparent 62%),
    radial-gradient(800px 600px at -10% 40%, color-mix(in srgb, var(--g-glow2) 22%, transparent), transparent 62%),
    radial-gradient(900px 700px at 110% 85%, color-mix(in srgb, var(--g-glow1) 18%, transparent), transparent 62%),
    linear-gradient(180deg, var(--g-bg1) 0, var(--g-bg2) 1400px, var(--g-bg2) 100%);
  background-color: var(--g-bg2);
  color: var(--g-ink);
  font-family: var(--g-body);
  font-weight: var(--g-body-w);
}
.game .nav.scrolled { background: var(--g-nav); color: var(--foam); }
.game .foot { background: var(--abyss); color: var(--foam); }
.g-main { overflow-x: clip; }
.g-main h1, .g-main h2 {
  font-family: var(--g-title); font-weight: var(--g-title-w); letter-spacing: 0; line-height: 1.08;
  font-synthesis: none; margin: 0 0 18px;
}
.g-main h2 { font-size: clamp(30px, 3.6vw, 46px); color: var(--g-head); }
.g-main h3 { font-family: var(--g-body); font-weight: 700; font-size: 20px; margin: 0 0 6px; letter-spacing: 0; }
.g-main p { margin: 0 0 12px; }
.g-main a { color: var(--g-head); }

/* Hero */
.g-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 4vw, 64px);
  align-items: center; padding: 118px var(--gutter) 40px; max-width: 1360px; margin: 0 auto;
}
.g-crumbs { font-size: 14px; color: var(--g-muted); margin-bottom: 22px; }
.g-crumbs a { color: var(--g-muted); text-decoration: none; }
.g-crumbs a:hover { color: var(--g-ink); text-decoration: underline; }
.g-title { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.g-icon { width: 96px; height: 96px; border-radius: 22%; box-shadow: 0 14px 40px -10px rgba(0, 0, 0, 0.6); flex: none; }
.g-hero h1 {
  /* sized so the name fits on one line next to the icon, in whatever title font the game uses */
  font-size: clamp(30px, calc((min(100vw, 1360px) * 0.39 - 140px) / (var(--g-h1em) * 1.12)), 88px);
  margin: 0; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.18); white-space: nowrap;
}
@media (max-width: 900px) { .g-hero h1 { font-size: clamp(26px, calc((100vw - 2 * var(--gutter) - 110px) / (var(--g-h1em) * 1.12)), 72px); } }
.g-store-title { margin: 4px 0 0 !important; color: var(--g-muted); font-weight: 700; font-size: 16px; }
.g-tagline { font-family: var(--g-title); font-weight: var(--g-title-w); font-size: clamp(22px, 2.3vw, 30px); line-height: 1.2; color: var(--g-head); }
.g-short { font-size: 19px; color: var(--g-muted); max-width: 34em; }
.g-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.g-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 15px 26px; border-radius: 999px;
  font-weight: 800; font-size: 16px; text-decoration: none; border: 2px solid transparent; line-height: 1.1;
}
.g-btn svg { width: 18px; height: 18px; fill: currentColor; }
.g-play { background: var(--g-accent); color: var(--g-accent-ink) !important; box-shadow: 0 12px 34px -12px var(--g-accent); }
.g-soon { background: color-mix(in srgb, var(--g-accent) 18%, transparent); border-color: var(--g-accent); color: var(--g-ink); }
.g-ghost { border-color: color-mix(in srgb, var(--g-ink) 30%, transparent); color: var(--g-ink) !important; }
.g-ghost:hover, .g-play:hover { transform: translateY(-2px); }
.g-note { font-size: 14px; color: var(--g-muted); margin-top: 12px !important; }
.g-key { margin: 0; position: relative; }
.g-key img {
  display: block; width: 100%; height: auto; border-radius: 26px; transform: rotate(1.5deg);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.7), 0 0 0 4px color-mix(in srgb, var(--g-accent) 55%, transparent);
}
.g-key figcaption {
  position: absolute; left: 18px; bottom: -14px; background: var(--g-accent); color: var(--g-accent-ink);
  font-weight: 800; font-size: 13px; padding: 6px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em;
}

/* At a glance */
.g-facts {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px auto 0; padding: 0 var(--gutter);
  max-width: 1200px;
}
.g-facts div {
  background: color-mix(in srgb, var(--g-ink) 7%, transparent); border: 1px solid color-mix(in srgb, var(--g-ink) 14%, transparent);
  border-radius: 16px; padding: 10px 18px; min-width: 120px; text-align: center;
}
.g-facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--g-muted); font-weight: 700; }
.g-facts dd { margin: 2px 0 0; font-weight: 800; font-size: 16px; }

/* Sections */
.g-section { max-width: 1200px; margin: 0 auto; padding: clamp(48px, 6vw, 80px) var(--gutter) 0; }
.g-trailer { max-width: 960px; }
.g-video {
  position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: #000;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
}
.g-video img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(1.05) brightness(.82); }
.g-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.g-video-play {
  position: absolute; inset: 0; margin: auto; width: 96px; height: 68px; border: 0; padding: 0; background: none; cursor: pointer;
  transition: transform .2s;
}
.g-video-play svg { width: 100%; height: 100%; }
.g-video-play path:first-child { fill: var(--g-accent); }
.g-video-play path:last-child { fill: var(--g-accent-ink); }
.g-video:hover .g-video-play { transform: scale(1.08); }
.g-video-link { position: absolute; left: 16px; bottom: 16px; background: #fff; color: #000; padding: 8px 14px; border-radius: 8px; }

.g-about { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(28px, 5vw, 80px); font-size: 18px; }
.g-how {
  background: color-mix(in srgb, var(--g-ink) 6%, transparent); border-radius: 24px; padding: 28px 30px;
  border: 1px solid color-mix(in srgb, var(--g-ink) 12%, transparent);
}
.g-how h2 { font-size: clamp(26px, 2.6vw, 34px); }
.g-how ol { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.g-how li { counter-increment: step; position: relative; padding-left: 50px; margin-bottom: 16px; }
.g-how li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--g-accent); color: var(--g-accent-ink); font-weight: 900;
  font-family: var(--g-title);
}

.g-mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 22px; }
.g-mode {
  display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center; padding: 18px;
  background: color-mix(in srgb, var(--g-ink) 6%, transparent); border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--g-ink) 12%, transparent);
}
.g-mode.no-shot { grid-template-columns: 1fr; padding: 24px 26px; border-left: 6px solid var(--g-accent); }
.g-mode p { color: var(--g-muted); margin: 0; }
.g-phone { margin: 0; }
.g-phone img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.75); }
.g-phone figcaption { font-size: 14px; color: var(--g-muted); margin-top: 8px; text-align: center; }

.g-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(62vw, 240px); gap: 18px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding: 6px 2px 18px; scrollbar-color: var(--g-accent) transparent;
}
.g-strip > * { scroll-snap-align: start; }
.g-strip:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 4px; }

.g-features ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 18px; }
.g-features li {
  padding: 22px 22px 18px; border-radius: 22px; background: color-mix(in srgb, var(--g-ink) 6%, transparent);
  border-top: 4px solid var(--g-accent);
}
.g-features p { color: var(--g-muted); margin: 0; }

.g-stage {
  display: flex; justify-content: center; align-items: flex-end; gap: clamp(12px, 3vw, 40px); min-height: 200px;
  padding: 10px 0 0; margin-bottom: 26px;
  background: radial-gradient(60% 30px at 50% 100%, rgba(0, 0, 0, 0.35), transparent 70%);
}
.g-stage img { width: auto; max-width: 42vw; object-fit: contain; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.35)); }
@media (max-width: 640px) { .g-stage img { height: auto !important; max-height: 200px; } }
.g-cast-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 18px; }
.g-cast-cards article { padding: 22px; border-radius: 22px; background: color-mix(in srgb, var(--g-ink) 6%, transparent); }
.g-cast-cards h3 { font-family: var(--g-title); font-weight: var(--g-title-w); color: var(--g-head); font-size: 24px; }
.g-cast-cards p { color: var(--g-muted); margin: 0; }

.g-update-list { display: grid; gap: 18px; max-width: 960px; }
.g-update { padding: 22px 24px 16px; border-radius: 22px; background: color-mix(in srgb, var(--g-ink) 6%, transparent); }
.g-update.latest { border-left: 5px solid var(--g-accent); }
.g-update header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 10px; }
.g-update h3 { font-family: var(--g-title); font-weight: var(--g-title-w); color: var(--g-head); font-size: 22px; margin: 0; }
.g-update time, .g-update-next { color: var(--g-muted); font-size: 15px; }
.g-update-next { padding: 2px 10px; border-radius: 999px; background: var(--g-accent); color: var(--g-accent-ink); }
.g-update ul { margin: 0; padding-left: 1.2em; }
.g-update li { margin: 4px 0; }
.g-update li::marker { color: var(--g-accent); }

.g-music { display: flex; gap: 26px; align-items: flex-start; max-width: 960px; }
.g-music-icon { flex: none; width: 76px; height: 76px; border-radius: 50%; background: var(--g-accent); display: grid; place-items: center; }
.g-music-icon svg { width: 40px; height: 40px; fill: none; stroke: var(--g-accent-ink); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.g-music p { font-size: 18px; color: var(--g-muted); }

.g-faq { max-width: 900px; }
.g-faq details { border-bottom: 1px solid color-mix(in srgb, var(--g-ink) 15%, transparent); padding: 6px 0; }
.g-faq summary { cursor: pointer; list-style: none; padding: 14px 40px 14px 0; position: relative; }
.g-faq summary::-webkit-details-marker { display: none; }
.g-faq summary::after { content: "+"; position: absolute; right: 6px; top: 8px; font-size: 28px; color: var(--g-accent); transition: transform .2s; }
.g-faq details[open] summary::after { transform: rotate(45deg); }
.g-faq summary h3 { display: inline; font-size: 19px; }
.g-faq details p { color: var(--g-muted); padding: 0 0 12px; }
.g-privacy { margin-top: 18px !important; }

.g-more { max-width: 1200px; margin: 0 auto; padding: clamp(64px, 8vw, 110px) var(--gutter) 90px; }
.g-more h2 { color: var(--g-ink); font-size: clamp(26px, 3vw, 38px); }
.g-more ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.g-more a {
  display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 18px; text-decoration: none;
  color: var(--g-ink); background: color-mix(in srgb, var(--g-ink) 5%, transparent); transition: background .2s, transform .2s;
}
.g-more a:hover { background: color-mix(in srgb, var(--g-ink) 11%, transparent); transform: translateY(-2px); }
.g-more img { width: 64px; height: 64px; border-radius: 22%; flex: none; }
.g-more b { display: block; font-size: 17px; }
.g-more small { display: block; color: var(--g-muted); font-size: 13.5px; line-height: 1.35; }

@media (max-width: 900px) {
  .g-hero { grid-template-columns: 1fr; padding-top: 100px; }
  .g-key { order: -1; }
  .g-key img { transform: none; }
  .g-about { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .g-mode { grid-template-columns: 110px 1fr; gap: 14px; padding: 14px; }
  .g-icon { width: 72px; height: 72px; }
  .g-facts div { min-width: calc(50% - 5px); }
}
@media (prefers-reduced-motion: reduce) { .g-btn, .g-more a, .g-video-play { transition: none; } }
