/* ZiMi Games: shared structure. Colors and fonts come from the active theme in static/themes */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 6px 12px; z-index: 50; }
.skip:focus { inset-inline-start: 8px; }
.wrap {
  width: 100%; max-width: 1200px; margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.narrow { max-width: 820px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .9em; }
h1, h2, h3, .brand-name, .section-title {
  font-family: var(--font-display); font-weight: var(--display-weight, 700);
  letter-spacing: var(--display-tracking, 0); text-wrap: balance; line-height: 1.25; margin: 0;
}
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .06em; color: var(--accent); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; margin: 0; }
.empty { color: var(--muted); padding-block: 24px; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700;
  padding: 12px 22px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease; line-height: 1.3;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.btn-ghost:hover { border-color: var(--accent); }
.btn.is-static { cursor: default; }
.btn-play { background: var(--ink); color: var(--bg); padding: 10px 20px; }
.btn-play svg { width: 26px; height: 26px; fill: currentColor; }
.btn-play span { display: grid; text-align: start; font-size: 1.05rem; }
.btn-play small { font-size: .7rem; font-weight: 500; opacity: .8; }
@media (prefers-reduced-motion: no-preference) { .btn:hover { transform: translateY(-2px); } }

/* Admin bar */
.admin-bar { background: var(--ink); color: var(--bg); font-size: .85rem; }
.admin-bar .wrap { display: flex; justify-content: space-between; gap: 12px; padding-block: 6px; }
.admin-bar a { color: var(--bg); font-weight: 700; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-name { font-size: 1.45rem; line-height: 1; }
.brand-logo { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 600; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: 0 2px 0 var(--accent); }
.nav .nav-cta { background: var(--accent); color: var(--accent-ink); padding: 6px 16px; border-radius: var(--radius-sm); }
.nav-toggle, .nav-burger { display: none; }
@media (max-width: 760px) {
  .nav-burger { display: grid; gap: 5px; cursor: pointer; padding: 8px; }
  .nav-burger span { width: 24px; height: 2px; background: var(--ink); display: block; }
  .nav { display: none; position: absolute; inset-inline: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0;
         background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px max(20px, env(safe-area-inset-right, 0px)) 16px max(20px, env(safe-area-inset-left, 0px)); }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { box-shadow: none; color: var(--accent); }
  .nav .nav-cta { margin-top: 12px; text-align: center; }
  .nav-toggle:checked ~ .nav { display: flex; }
}

.flashes { padding-block: 12px 0; }
.flash { margin: 0 0 8px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }

/* Sections */
.section { padding-block: 72px; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-bottom: 24px; }
.section-head .section-title { margin: 0; }
.more-link { color: var(--accent); font-weight: 700; text-decoration: none; }
.page-head { padding-block: 64px 8px; }
.page-head .wrap { display: grid; gap: 14px; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.meta { color: var(--muted); margin: 0; font-size: .9rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.filters a { text-decoration: none; padding: 6px 18px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 600; color: var(--muted); }
.filters a[aria-current="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }

/* Game card */
.game-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); min-width: 0; }
.game-card-media { position: relative; aspect-ratio: 16 / 9; display: block; overflow: hidden; background: var(--surface-2); }
.game-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
@media (prefers-reduced-motion: no-preference) { .game-card:hover .game-card-media img { transform: scale(1.04); } }
.game-card-body { padding: 18px 20px 22px; display: grid; gap: 8px; }
.game-card-body p { margin: 0; color: var(--muted); font-size: .95rem; }
.game-card-title { display: flex; gap: 12px; align-items: center; }
.game-card h3 { font-size: 1.25rem; }
.game-card h3 a { text-decoration: none; }
.game-icon { width: 48px; height: 48px; border-radius: 22%; object-fit: cover; flex: none; }
.game-icon-lg { width: 96px; height: 96px; box-shadow: var(--shadow); }
.dim-badge { position: absolute; top: 12px; inset-inline-start: 12px; background: var(--accent); color: var(--accent-ink); font: 700 .75rem/1 ui-monospace, Menlo, monospace; letter-spacing: .08em; padding: 6px 9px; border-radius: 6px; }

/* Placeholder art */
.art { width: 100%; height: 100%; display: grid; place-items: center; color: var(--ink);
  background: radial-gradient(circle at 70% 20%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%),
              linear-gradient(160deg, var(--surface-2), var(--bg)); }
.art svg { width: min(40%, 160px); height: auto; filter: drop-shadow(0 12px 24px rgba(0,0,0,.25)); }

/* Article card */
.article-card { display: grid; gap: 14px; align-content: start; min-width: 0; }
.article-card-media { display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius); }
.article-card-media img { width: 100%; height: 100%; object-fit: cover; }
.article-card-body { display: grid; gap: 6px; }
.article-card h3 { font-size: 1.3rem; }
.article-card h3 a { text-decoration: none; }
.article-card h3 a:hover { color: var(--accent); }
.article-card p { margin: 0; color: var(--muted); }

/* ===== Home: Spotlight ===== */
.hero-spotlight { position: relative; overflow: hidden; padding-block: 88px 96px; background: var(--hero-bg, var(--bg)); }
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .28; filter: saturate(1.1) blur(2px); }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: var(--hero-tint); }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero-copy { display: grid; gap: 18px; min-width: 0; }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 4.8rem); line-height: 1.12; }
.hero-feature { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg, var(--shadow)); transform: rotate(var(--feature-tilt, -2deg)); transition: transform .3s ease; }
.hero-feature:hover { transform: rotate(0); }
.hero-feature-media { position: relative; aspect-ratio: 4 / 3; }
.hero-feature-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-feature-body { display: grid; gap: 2px; padding: 16px 20px 20px; }
.hero-feature-body strong { font-family: var(--font-display); font-size: 1.4rem; }
.hero-feature-body span:last-child { color: var(--muted); font-size: .95rem; }
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; } .hero-feature { transform: none; } }

/* ===== Home: Showcase ===== */
.hero-showcase { padding-block: 80px 24px; text-align: center; }
.hero-showcase .wrap { display: grid; gap: 16px; justify-items: center; }
.showcase-list { display: grid; gap: 64px; }
.showcase-item { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.showcase-item:nth-child(even) .showcase-media { order: 2; }
.showcase-media { display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg, var(--shadow)); background: var(--surface-2); }
.showcase-media img { width: 100%; height: 100%; object-fit: cover; }
.showcase-body { display: grid; gap: 12px; min-width: 0; }
.showcase-body h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.showcase-body h2 a { text-decoration: none; }
.showcase-body p { margin: 0; color: var(--muted); font-size: 1.1rem; }
@media (max-width: 800px) { .showcase-item { grid-template-columns: 1fr; gap: 20px; } .showcase-item:nth-child(even) .showcase-media { order: 0; } }

/* ===== Home: Magazine ===== */
.hero-magazine { padding-block: 64px 0; }
.hero-magazine .wrap { display: grid; gap: 14px; border-bottom: 3px double var(--line); padding-bottom: 32px; }
.magazine { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 56px; }
.magazine-main { display: grid; gap: 40px; align-content: start; }
.lead-story { display: grid; gap: 12px; }
.lead-story img { border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.lead-story h2 { font-size: clamp(2rem, 4vw, 3rem); }
.lead-story h2 a { text-decoration: none; }
.lead-story p { margin: 0; color: var(--muted); font-size: 1.1rem; }
.magazine-side { display: grid; gap: 12px; align-content: start; border-inline-start: 1px solid var(--line); padding-inline-start: 32px; }
.side-title { font-size: 1.4rem; margin-bottom: 4px; }
.side-game { display: flex; gap: 14px; align-items: center; text-decoration: none; padding: 10px; border-radius: var(--radius-sm); }
.side-game:hover { background: var(--surface); }
.side-thumb { width: 64px; height: 64px; border-radius: 22%; overflow: hidden; flex: none; background: var(--surface-2); }
.side-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-game strong { display: block; line-height: 1.4; }
.side-game small { color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
@media (max-width: 860px) { .magazine { grid-template-columns: 1fr; } .magazine-side { border: 0; padding: 0; } }

/* About */
.about-inner { max-width: 820px; }

/* Game page */
.game-hero { position: relative; overflow: hidden; }
.game-hero-media { position: absolute; inset: 0; }
.game-hero-media img, .game-hero-media .art { width: 100%; height: 100%; object-fit: cover; }
.game-hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 8%, color-mix(in srgb, var(--bg) 55%, transparent) 60%, color-mix(in srgb, var(--bg) 25%, transparent)); }
.game-hero-inner { position: relative; display: flex; align-items: flex-end; gap: 28px; padding-block: 200px 48px; flex-wrap: wrap; }
.game-hero-copy { display: grid; gap: 12px; min-width: 0; flex: 1 1 320px; }
.game-hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; }
.facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 22px; position: sticky; top: 96px; }
.facts dl { margin: 0; }
.facts dl > div { display: flex; justify-content: space-between; gap: 12px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.facts dl > div:last-child { border: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; text-align: end; overflow-wrap: anywhere; }
@media (max-width: 860px) { .game-layout { grid-template-columns: 1fr; } .facts { position: static; } }
.video { position: relative; aspect-ratio: 16 / 9; margin-top: 28px; border-radius: var(--radius); overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.shots { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; }
.shots a { flex: none; scroll-snap-align: start; }
.shots img { height: 360px; width: auto; max-width: none; border-radius: var(--radius-sm); border: 1px solid var(--line); }
@media (max-width: 600px) { .shots img { height: 260px; } }

/* Article */
.article-head { max-width: 820px; display: grid; gap: 14px; padding-block: 64px 32px; }
.article-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.article-cover { max-width: 1040px; }
.article-cover img { width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; }
.article-body { max-width: 720px; margin-inline: auto; padding-block: 40px 64px; }
.article-game { max-width: 720px; margin: 0 auto 64px; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 4px; background: var(--surface); }
.article-game a { text-decoration: none; font-size: 1.15rem; }

/* Long-form text */
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.7rem; margin: 1.6em 0 .5em; }
.prose h3 { font-size: 1.3rem; margin: 1.4em 0 .4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose a { color: var(--accent); }
.prose img { border-radius: var(--radius-sm); margin-block: 1em; }
.prose blockquote { margin: 1.4em 0; padding-inline-start: 20px; border-inline-start: 3px solid var(--accent); color: var(--muted); }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.prose pre { background: var(--surface-2); padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; direction: ltr; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; }
.legal { padding-top: 24px; }
.legal .prose h2 { font-size: 1.4rem; }
.legal .prose h3 { font-size: 1.1rem; }
.back-link { margin-top: 48px; }
.back-link a { color: var(--accent); font-weight: 700; text-decoration: none; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.facts-inline { margin: 24px 0 0; display: grid; gap: 14px; }
.facts-inline dt { font-size: .8rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.facts-inline dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.facts-inline a { color: var(--accent); }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 36px); box-shadow: var(--shadow); }
.contact-form { display: grid; gap: 16px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }
.f { display: grid; gap: 6px; min-width: 0; }
.f label { font-weight: 600; font-size: .9rem; }
.f input, .f textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; }
.f input:focus, .f textarea:focus { outline: none; border-color: var(--accent); }
.contact-form .btn { justify-self: start; cursor: pointer; font: inherit; font-weight: 700; }
.form-note { margin: 0; color: var(--muted); font-size: .85rem; }
.form-note a { color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sent { display: grid; gap: 12px; justify-items: start; }
.sent p { margin: 0; color: var(--muted); }
.flash-error { border-color: #c62f3c; }
.flash-success { border-color: #1d8a52; }

/* Cookie notice */
.cookie-bar { position: fixed; z-index: 40; inset-inline: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); max-width: 640px; margin-inline: auto;
  display: flex; gap: 16px; align-items: center; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.cookie-bar p { margin: 0; font-size: .9rem; flex: 1; }
.cookie-bar a { color: var(--accent); }
.cookie-bar .btn { padding: 8px 18px; border: 0; cursor: pointer; font: inherit; font-weight: 700; white-space: nowrap; }
@media (max-width: 520px) { .cookie-bar { flex-direction: column; align-items: stretch; } }

.pager { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 48px; }
.pager a { color: var(--accent); font-weight: 700; text-decoration: none; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 0; font-size: .95rem; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 40px; padding-block: 56px 32px; }
.foot-brand p { color: var(--muted); max-width: 36ch; }
.site-foot h4 { margin: 0 0 12px; font-size: .85rem; letter-spacing: .06em; color: var(--muted); }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-foot ul a { text-decoration: none; overflow-wrap: anywhere; }
.site-foot ul a:hover { color: var(--accent); }
.foot-base { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
.game-hero-media .art { place-items: center end; padding-inline-end: 8%; }
.game-hero-media .art svg { width: min(30%, 280px); }
@media (max-width: 760px) { .game-hero-media .art svg { opacity: .35; } }
h1, h2, h3, strong { font-synthesis: none; }

/* WebGL player */
.player { position: relative; width: 100%; max-width: 100%; max-height: 80vh; margin-inline: auto; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lg, var(--shadow)); }
.player-portrait { max-width: min(100%, 480px); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player:fullscreen { border-radius: 0; max-height: none; }
.player-start { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; cursor: pointer; display: grid; place-content: center; justify-items: center; gap: 10px; color: #fff; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 40%, #000), #000 75%); font: inherit; }
.player-start img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.player-cta { position: relative; display: inline-flex; align-items: center; gap: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 1.15rem; padding: 14px 26px; border-radius: var(--radius-sm); }
.player-start small { position: relative; opacity: .85; padding-inline: 16px; text-align: center; }
.player-start:hover .player-cta { filter: brightness(1.1); }
.player-bar { display: flex; justify-content: flex-end; margin-top: 12px; }
.player-bar .btn { cursor: pointer; font: inherit; font-weight: 700; }
.web-badge { position: absolute; bottom: 12px; inset-inline-start: 12px; background: rgba(0,0,0,.7); color: #fff; font-size: .78rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; backdrop-filter: blur(6px); }
.play-section, #play { scroll-margin-top: 80px; }
