/* Zymix Play shared styles. Route stylesheets load alongside this one. */

@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/assets/fonts/instrument-sans.woff2?v=6219bc4bfd") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/assets/fonts/barlow-condensed.woff2?v=5bc49d41f3") format("woff2");
}

:root {
  color-scheme: dark;
  --page: #101312;
  --panel: #191d1c;
  --panel-hi: #252a28;
  --rule: #333936;
  --text: #f5f5f0;
  --muted: #a9b1ab;
  --faint: #7d867f;
  --green: #26d93e;
  --soft-green: #abf4a5;
  --lime: #d9f5a5;
  --lime-hi: #f1ffd9;
  --header: 66px;
  --gutter: clamp(16px, 3.7vw, 66px);
  --max: 1570px;
  --ui-font: "Instrument Sans", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --display-font: "Barlow Condensed", "Arial Narrow", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 14px); }
body { margin: 0; background: var(--page); color: var(--text); font: 16px/1.4 var(--ui-font); }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { padding: 0; border: 0; background: none; cursor: pointer; appearance: none; }
button, a, input { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
img, video, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--soft-green); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: fixed; z-index: 50; top: 8px; left: 8px; padding: 8px 12px; border-radius: 8px;
  background: var(--green); color: #08150c; font-weight: 700; transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* Icons: <i data-icon> slots and bare svg.icon */
i[data-icon] { display: inline-flex; flex: none; width: 19px; height: 19px; font-style: normal; }
i[data-icon] > svg { width: 100%; height: 100%; }
svg.icon { flex: none; width: 1.1em; height: 1.1em; }

/* Covers: wide art, or the icon on a backdrop in the game's colour */
.cover { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--cover-focus, 50% 50%); }
.cover--icon {
  display: grid; place-items: center; overflow: hidden;
  background: #26302b;
  background: radial-gradient(75% 85% at 50% 42%, color-mix(in srgb, var(--game, #3a5a48) 82%, #fff), color-mix(in srgb, var(--game, #3a5a48) 42%, #0b0f0d));
}
.cover--icon img { width: auto; height: 56%; max-height: 120px; aspect-ratio: 1; border-radius: 22%; object-fit: cover; box-shadow: 0 8px 24px #0006; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px;
  background: var(--panel-hi); color: var(--text);
  font: 680 15px/1.1 var(--ui-font); text-align: center; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg.icon { width: 15px; height: 15px; }
.btn i[data-icon] { width: 15px; height: 15px; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn--lg { min-height: 52px; padding: 0 22px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--lime { background: var(--lime); color: #162317; }
.btn--lime:hover { background: var(--lime-hi); }
.btn--ghost { background: transparent; border-color: #455246; color: #e3ebdf; }
.btn--ghost:hover { background: #293029; }
.btn--on-dark { background: transparent; border-color: #4a544d; color: var(--text); }
.btn--on-dark:hover { background: #ffffff12; }
.btn--quiet { min-height: 40px; background: transparent; color: var(--muted); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn--quiet:hover { color: var(--text); }

.icon-btn { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: #2d352e; color: var(--text); }
.icon-btn:hover { background: #3a443b; }
.icon-btn i[data-icon] { width: 18px; height: 18px; }

.secondary-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 14px; border: 1px solid #455246; border-radius: 20px;
  background: #232a24; color: #e3ebdf; font-size: 13px; font-weight: 650; white-space: nowrap;
}
.secondary-cta:hover { background: #29422d; border-color: #718b74; }
.secondary-cta i[data-icon], .secondary-cta svg.icon { width: 16px; height: 16px; }

.top-app {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: none;
  min-height: 38px; padding: 0 14px; border: 1px solid #47604b; border-radius: 20px;
  background: #1b2a1e; color: #cbf4c9; font-size: 13px; font-weight: 650; white-space: nowrap;
}
.top-app:hover { background: #2b3f2c; }
.top-app i[data-icon] { width: 13px; height: 13px; }

.play-cta {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px;
  background: var(--accent, var(--lime)); color: #162317; font-size: 14px; font-weight: 700; line-height: 1;
  transition: background-color .18s ease, transform .12s ease;
}
.play-cta:hover { background: #fff; }
.play-cta:active { transform: translateY(1px); }
.play-cta svg.icon { width: 15px; height: 15px; }

/* ---------- Masthead ---------- */

.mast {
  position: sticky; top: 0; z-index: 20;
  background: #101312f2; border-bottom: 1px solid #2a302c;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.mast__inner, .shell { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.mast__inner { display: flex; align-items: center; gap: clamp(16px, 3vw, 55px); min-height: var(--header); }
.brand { display: inline-flex; align-items: center; gap: 5px; flex: none; white-space: nowrap; }
.brand img { width: 30px; height: 30px; margin-right: 3px; border-radius: 8px; }
.brand strong, .brand span { font-size: 24px; line-height: 1; letter-spacing: -.051em; }
.brand strong { font-weight: 680; }
.brand span { font-weight: 420; color: #b2bcb5; }
.brand--sm img { width: 23px; height: 23px; border-radius: 6px; }
.brand--sm strong, .brand--sm span { font-size: 18px; }
.mast__nav { display: flex; align-self: stretch; gap: clamp(18px, 2vw, 35px); }
.mast__nav a { position: relative; display: inline-flex; align-items: center; color: var(--muted); font-size: 14px; font-weight: 600; }
.mast__nav a:hover { color: var(--soft-green); }
.mast__nav [aria-current="page"] { color: var(--text); }
.mast__nav [aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--green); }
.mast__tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.search-open {
  display: flex; align-items: center; gap: 8px; width: clamp(150px, 16vw, 245px); height: 36px; padding: 0 10px 0 13px;
  border: 1px solid var(--rule); border-radius: 20px; background: #202522; color: #b7c0b9; font-size: 13px;
}
.search-open:hover { border-color: #5b665e; }
.search-open i[data-icon] { width: 16px; height: 16px; }
.search-open kbd { margin-left: auto; padding: 0 5px; border: 1px solid #424944; border-radius: 4px; font: 12px/16px ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 900px) {
  .mast__nav { gap: 16px; }
  .search-open { justify-content: center; width: 40px; height: 40px; padding: 0; }
  .search-open span, .search-open kbd { display: none; }
}
@media (max-width: 700px) {
  :root { --header: 56px; }
  .mast__nav { display: none; }
  .brand img { width: 28px; height: 28px; }
  .brand strong, .brand span { font-size: 22px; }
}
@media (max-width: 360px) { .mast .brand span { display: none; } }

.store-row { display: flex; flex-wrap: wrap; gap: 8px; }
.store-tile {
  display: inline-flex; align-items: center; gap: 10px; min-width: 150px; min-height: 52px; padding: 8px 16px 8px 12px;
  border: 1px solid #3b443e; border-radius: 10px; background: #202522; color: var(--text);
}
.store-tile:hover { border-color: #718b74; background: #263027; }
.store-tile img { flex: none; width: 22px; height: 22px; }
.store-tile small { display: block; color: var(--muted); font-size: 11px; line-height: 1.1; }
.store-tile strong { display: block; font-size: 15px; font-weight: 680; line-height: 1.2; }

.handoff__qr { width: 132px; padding: 8px; border-radius: 12px; background: #fff; }
.handoff__qr svg { width: 100%; height: auto; }

@media (max-width: 760px) {
  .store-tile { flex: 1; min-width: 0; }
}

/* ---------- Footer ---------- */

.site-footer { margin-top: clamp(30px, 3vw, 48px); padding: 22px 0 calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); }
.site-footer__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.site-footer__nav { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; color: var(--muted); font-size: 13px; }
.site-footer__nav a:hover, .site-footer__nav button:hover, .site-footer__legal a:hover { color: var(--soft-green); }
.site-footer__fine { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; margin-top: 14px; color: var(--faint); font-size: 12px; }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------- Dialogs and sheets ---------- */

dialog { padding: 0; border: 0; color: var(--text); background: transparent; }
dialog::backdrop { background: #050905c2; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.dialog, .sheet {
  position: relative; width: min(460px, calc(100vw - 24px)); max-width: none; max-height: min(86dvh, 820px);
  overflow: auto; overscroll-behavior: contain;
  border: 1px solid #444f47; border-radius: 16px; background: #191e1a; box-shadow: 0 24px 80px #000a;
}
.dialog__close { position: absolute; top: 12px; right: 12px; z-index: 2; }
@media (max-width: 599px) {
  .sheet {
    width: 100%; max-height: 92dvh; margin: auto 0 0; padding-bottom: env(safe-area-inset-bottom);
    border-width: 1px 0 0; border-radius: 22px 22px 0 0;
  }
  .sheet::before { content: ""; display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 4px; background: #4a544d; }
  .sheet[open] { animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }

/* ---------- "Keep playing in Zymix" panel ---------- */

.handoff { display: flex; flex-direction: column; gap: 14px; padding: 24px 22px 18px; }
.handoff__head { display: flex; align-items: center; gap: 14px; padding-right: 36px; }
.handoff__icon { flex: none; width: 56px; height: 56px; border-radius: 14px; background: #252b27; }
.handoff__kicker { color: var(--soft-green); font-size: 12px; font-weight: 650; }
.handoff__title { margin-top: 2px; font-size: 22px; font-weight: 700; line-height: 1.12; letter-spacing: -.04em; text-wrap: balance; word-break: keep-all; overflow-wrap: anywhere; }
.handoff__body { color: var(--muted); font-size: 14px; text-wrap: pretty; }
.handoff__label { margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.handoff__download .store-tile { flex: 1; min-width: 0; }
.handoff__scan { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--rule); border-radius: 12px; background: #141816; }
.handoff__scan .handoff__qr { flex: none; width: 112px; padding: 6px; border-radius: 10px; }
.handoff__scan strong { display: block; font-size: 15px; }
.handoff__scan p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.handoff__actions { display: grid; gap: 8px; }
.handoff__hint { padding: 10px 12px; border-radius: 10px; background: #232a24; color: #dfe7dc; font-size: 14px; }
.handoff__leave { align-self: center; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.handoff__fine { color: var(--faint); font-size: 12px; text-align: center; }

/* Navigation shared by the game preview and player. */

.portal { flex: none; z-index: 20; padding-top: env(safe-area-inset-top); background: var(--page); border-bottom: 1px solid #2a302c; }
.portal__inner {
  display: flex; align-items: center; gap: 10px; max-width: var(--max); min-height: 54px; margin-inline: auto;
  padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
}
.portal__context { display: flex; align-items: center; gap: 8px; min-width: 0; }
.portal__context img { flex: none; width: 26px; height: 26px; border-radius: 7px; }
.portal__context span { min-width: 0; }
.portal__context small { display: block; color: var(--muted); font-size: 11px; line-height: 1.1; }
.portal__context strong { display: block; overflow: hidden; font-size: 15px; font-weight: 680; line-height: 1.2; letter-spacing: -.02em; white-space: nowrap; text-overflow: ellipsis; }
.portal__brand, .portal__nav { display: none; }
.portal__tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.portal .top-app { min-height: 36px; padding: 0 12px; }

@media (min-width: 900px) and (min-height: 560px) {
  .portal { position: sticky; top: 0; }
  .portal__inner { gap: clamp(16px, 2.4vw, 40px); min-height: var(--header); padding-inline: var(--gutter); }
  .portal__context, .portal__more { display: none; }
  .portal__brand { display: inline-flex; }
  .portal__nav { display: flex; gap: 26px; }
  .portal__nav a { color: var(--muted); font-size: 14px; font-weight: 600; }
  .portal__nav a:hover { color: var(--soft-green); }
}

/* ---------- Analytics consent, notices ---------- */

.consent {
  position: fixed; z-index: 45; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom));
  display: grid; gap: 12px; max-width: 560px; margin-inline: auto; padding: 14px 16px;
  border: 1px solid #444f47; border-radius: 14px; background: #1b201df5; box-shadow: 0 20px 50px #0009;
}
.consent p { color: #dfe7dc; font-size: 14px; }
.consent a { color: var(--soft-green); text-decoration: underline; }
.consent__actions { display: flex; justify-content: flex-end; gap: 8px; }

.notice {
  position: fixed; z-index: 60; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
  padding: 9px 14px; border-radius: 9px; background: #e3f2df; color: #142719; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity .15s, transform .15s;
}
.notice.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
