/* zymix.game: one stylesheet for all pages. No web fonts, no inline styles (CSP: style-src 'self'). */

:root {
  --bg: #f5f6f0;
  --surface: #ffffff;
  --surface-2: #eff1e8;
  --ink: #14161a;
  --ink-2: #454a52;
  --muted: #6f7580;
  --line: #e2e5da;
  --lime: #d2f36c;
  --lime-2: #bfe650;
  --lime-soft: #f1fad6;
  --focus: #2f62e8;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 1px 2px rgba(20, 22, 26, 0.05), 0 8px 24px rgba(20, 22, 26, 0.06);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 30; padding: 8px 12px; border-radius: 8px; background: var(--surface); }
.skip:focus { left: 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font: 650 15px/1.1 var(--font); text-align: center; text-decoration: none; cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn--lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--lime { background: var(--lime); }
.btn--lime:hover { background: var(--lime-2); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #2b2e35; }
.btn--ghost { background: transparent; border-color: #d3d7cb; }
.btn--ghost:hover { background: var(--surface); }
.btn--on-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.btn--on-dark:hover { background: rgba(255, 255, 255, 0.08); }
.btn--quiet { min-height: 40px; background: transparent; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(245, 246, 240, 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 9px; }
.brand__name { font-weight: 850; letter-spacing: 0.04em; }
.brand__sub { margin-left: -4px; color: var(--muted); font-weight: 650; }
.topbar__nav { display: none; gap: 24px; margin-left: auto; }
.topbar__nav a { color: var(--ink-2); font-size: 15px; font-weight: 600; text-decoration: none; }
.topbar__nav a:hover { color: var(--ink); }
.topbar__inner > .btn { margin-left: auto; }
@media (min-width: 720px) {
  .topbar__nav { display: flex; }
  .topbar__inner > .btn { margin-left: 8px; }
}

/* Hero */
.hero { display: grid; gap: 40px; align-items: center; padding: 40px 0 16px; }
.eyebrow {
  display: inline-block; padding: 6px 12px; border: 1px solid #dff0b0; border-radius: 999px;
  background: var(--lime-soft); color: var(--ink-2);
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.hero h1 { margin-top: 16px; font-size: clamp(36px, 7vw, 62px); font-weight: 850; }
.hl { background: linear-gradient(transparent 60%, var(--lime) 60%); }
.lede { max-width: 34em; margin-top: 18px; color: var(--ink-2); font-size: clamp(17px, 2.2vw, 19px); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__art { display: flex; justify-content: center; padding: 8px 0 16px; }
/* On phones the games list matters more than the illustration. */
@media (max-width: 599px) { .hero__art { display: none; } }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.2fr 0.8fr; padding: 72px 0 40px; }
}

.phone {
  width: min(280px, 72vw); aspect-ratio: 9 / 18.5; padding: 10px;
  border-radius: 44px; background: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(20, 22, 26, 0.4);
  transform: rotate(-3deg);
}
.phone__screen {
  --game: #5b4bd6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  height: 100%; padding: 24px; border-radius: 34px; overflow: hidden;
  background: var(--game);
  background: radial-gradient(130% 80% at 50% 0%, color-mix(in srgb, var(--game) 65%, #ffffff), var(--game));
  color: #fff; text-align: center;
}
.phone__icon { width: 96px; height: 96px; border-radius: 26px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25); }
.phone__name { margin-top: 6px; font-size: 22px; font-weight: 800; line-height: 1.15; }
.phone__tagline { font-size: 14px; opacity: 0.85; }
.phone__play { margin-top: 10px; padding: 12px 28px; border-radius: 999px; background: var(--lime); color: var(--ink); font-weight: 750; }

/* Sections */
.section { padding: 48px 0; }
.section h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 820; }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 20px; }
.section__head p { color: var(--muted); }

.game-grid {
  display: grid; gap: 14px; margin: 0; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.game-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.game-card__link {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px; border-radius: inherit; text-decoration: none;
}
a.game-card__link:hover .btn--lime { background: var(--lime-2); }
.game-card__icon { width: 72px; height: 72px; border-radius: 18px; }
.game-card__name { display: block; font-size: 17px; font-weight: 750; }
.game-card__meta { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.game-card__desc { display: block; margin-top: 4px; color: var(--ink-2); font-size: 14px; }
.game-card--soon .game-card__icon { filter: grayscale(0.6); opacity: 0.75; }
.badge { padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 700; white-space: nowrap; }
.empty { padding: 28px; border: 1px dashed #d3d7cb; border-radius: var(--radius); color: var(--muted); text-align: center; }

.steps { display: grid; gap: 14px; margin: 24px 0 0; padding: 0; list-style: none; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.step__num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--lime); font-weight: 850; }
.step h3 { margin-top: 14px; font-size: 19px; }
.step p { margin-top: 6px; color: var(--ink-2); }

.app-band {
  display: grid; gap: 20px; align-items: center;
  margin-block: 16px 56px; padding: 32px;
  border-radius: var(--radius-lg); background: var(--ink); color: #fff;
}
.app-band h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 820; }
.app-band p { margin-top: 8px; color: rgba(255, 255, 255, 0.72); }
.store-links { display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 720px) { .app-band { grid-template-columns: 1fr auto; padding: 40px 44px; } }

.footer { padding: 24px 0 calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer__links a { color: var(--ink-2); }

/* Dialogs and the in-game sheet */
dialog { padding: 0; border: 0; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(14, 16, 20, 0.55); }
.dialog, .sheet {
  width: min(440px, 100vw - 32px); max-width: none; max-height: min(760px, 100dvh - 32px);
  border-radius: var(--radius-lg); overflow: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}
.dialog__close {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: rgba(20, 22, 26, 0.07); color: var(--ink);
  font-size: 22px; line-height: 1; cursor: pointer;
}
@media (max-width: 599px) {
  .sheet {
    width: 100%; max-height: 92dvh; margin: auto 0 0;
    border-radius: 24px 24px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sheet[open] { animation: sheet-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }

/* Handoff panel */
.handoff {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 32px 24px 22px; text-align: center;
  background: linear-gradient(180deg, var(--lime-soft), var(--surface) 150px);
}
.handoff__icon { width: 64px; height: 64px; border-radius: 18px; box-shadow: var(--shadow); }
.handoff__title { font-size: 24px; font-weight: 820; text-wrap: balance; }
.handoff__body { max-width: 30em; color: var(--ink-2); text-wrap: pretty; }
.handoff__qr { width: 188px; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.handoff__caption { color: var(--muted); font-size: 14px; }
.handoff__stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.handoff__actions { display: grid; gap: 8px; width: 100%; margin-top: 6px; }
.handoff__hint { width: 100%; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: 14px; }
.handoff__leave { color: var(--muted); font-size: 14px; }
.handoff__fine { color: var(--muted); font-size: 12px; }

/* Game page */
.page-player { min-height: 100dvh; overflow: hidden; background: #0f1115; color: #fff; }
.player__stage {
  position: fixed; inset: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--game, #0f1115);
}
.player__frame { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--game, #0f1115); }
.player__frame iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }
.player__overlay {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-content: center; justify-items: center; gap: 16px;
  padding: 24px; background: var(--game, #0f1115); color: #fff; text-align: center;
}
.player__overlay-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.spinner { width: 36px; height: 36px; border: 3px solid rgba(255, 255, 255, 0.25); border-top-color: #fff; border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player__side { display: none; }
.page-player .consent { top: calc(12px + env(safe-area-inset-top)); bottom: auto; }

@media (min-width: 900px) and (min-height: 560px) {
  .page-player { overflow: auto; background: var(--bg); color: var(--ink); }
  .player {
    display: grid; grid-template-columns: auto minmax(300px, 360px); gap: 56px;
    justify-content: center; align-items: center; min-height: 100dvh; padding: 32px;
  }
  .player__stage { position: relative; inset: auto; padding: 0; background: none; }
  .player__frame {
    width: auto; height: min(844px, 100dvh - 64px); aspect-ratio: 390 / 844;
    border: 10px solid var(--ink); border-radius: 44px;
    box-shadow: 0 40px 80px -30px rgba(20, 22, 26, 0.5);
  }
  .player__side { display: flex; flex-direction: column; gap: 20px; }
  .side-handoff .handoff { border: 1px solid var(--line); border-radius: var(--radius-lg); }
}
.backlink { color: var(--ink-2); font-weight: 650; text-decoration: none; }
.backlink:hover { color: var(--ink); }
.side-game { display: flex; align-items: center; gap: 14px; }
.side-game img { width: 56px; height: 56px; border-radius: 16px; }
.side-game h1 { font-size: 24px; font-weight: 820; }

/* /get/ and 404 */
.page-get { display: grid; align-content: center; justify-items: center; gap: 16px; min-height: 100dvh; padding: 24px 16px; }
.get-card { width: min(440px, 100%); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.get-loading { padding: 48px; color: var(--muted); text-align: center; }
.get-alt { padding: 0 24px 22px; color: var(--ink-2); font-size: 14px; text-align: center; }
.get-foot { color: var(--muted); font-size: 13px; }

/* Analytics consent */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  display: grid; gap: 12px; max-width: 560px; margin-inline: auto; padding: 16px;
  border-radius: 18px; background: var(--ink); color: #fff; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.consent p { color: rgba(255, 255, 255, 0.86); font-size: 14px; }
.consent a { color: #fff; }
.consent__actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
