/* =========================================================
   MADBLACK STUDIOS — MASTER BRAND STYLES
   Game brands override the --game-* tokens in their own theme
   file (e.g. /assets/games/zombie-catapult/theme.css), scoped
   to [data-theme="<game-slug>"]. Never edit studio tokens for a game.
   ========================================================= */

:root {
  /* Studio tokens */
  --bg: #08080b;
  --bg-2: #0f0f14;
  --surface: #14141b;
  --surface-2: #1b1b24;
  --line: #262632;
  --text: #f2f2f5;
  --muted: #9a9aab;
  --accent: #ff2e5b;        /* MadBlack neon red */
  --accent-2: #2ee6ff;      /* cold cyan, used sparingly */
  --radius: 14px;
  --radius-sm: 9px;
  --gutter: 16px;
  --max: 1200px;
  --header-h: 64px;
  --font-display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Game tokens (default = studio look; games override these) */
  --game-primary: var(--accent);
  --game-secondary: var(--accent-2);
  --game-play-bg: linear-gradient(180deg, #ff4d73, #e01445);
  --game-play-text: #fff;
  --game-play-shadow: 0 8px 28px rgba(255, 46, 91, .35);
  --game-font: var(--font-display);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.nav-locked { overflow: hidden; }
img, video { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 .5em; letter-spacing: .01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip-link:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 8, 11, .82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 34px; height: 34px; }
.brand span { font: 700 17px/1 var(--font-display); letter-spacing: .14em; }
.brand span b { color: var(--accent); font-weight: 700; }
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-menu a { text-decoration: none; font: 600 13px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; padding: 10px 12px; border-radius: 8px; color: var(--muted); }
.nav-menu a:hover, .nav-menu a[aria-current="page"] { color: var(--text); background: var(--surface); }
.nav-cta { margin-left: 8px; }
.nav-toggle { display: none; }

@media (max-width: 880px) {
  .nav-toggle {
    display: inline-grid; place-items: center; width: 44px; height: 44px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); cursor: pointer;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ""; display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s, background .2s;
  }
  .nav-toggle span::before { position: absolute; top: -6px; }
  .nav-toggle span::after { position: absolute; top: 6px; }
  .is-open .nav-toggle span { background: transparent; }
  .is-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
  .is-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }
  .nav-menu {
    position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg);
    flex-direction: column; align-items: stretch; gap: 0; padding: 16px var(--gutter) 32px;
    opacity: 0; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease, visibility .2s; visibility: hidden; overflow-y: auto;
  }
  .is-open .nav-menu { opacity: 1; transform: none; visibility: visible; }
  .nav-menu a { font-size: 18px; padding: 18px 8px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-cta { margin: 24px 0 0; }
  .nav-menu .nav-cta { border: 0; text-align: center; }
  .header-play { display: none; }
}
@media (min-width: 881px) { .header-play { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 12px; border: 1px solid transparent;
  font: 700 15px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s;
  -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-play {
  background: var(--game-play-bg); color: var(--game-play-text);
  box-shadow: var(--game-play-shadow); font-family: var(--game-font);
}
.btn-play:hover { transform: translateY(-2px); }
.btn-play.btn-xl { min-height: 64px; padding: 18px 34px; font-size: 22px; border-radius: 16px; }
.btn-studio { background: var(--accent); color: #fff; }
.nav-menu .btn-studio { color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-soon { background: var(--surface-2); color: var(--muted); border-color: var(--line); cursor: default; }
.btn-sm { min-height: 40px; padding: 10px 16px; font-size: 13px; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section--tight { padding: 48px 0; }
.eyebrow { font: 600 12px/1 var(--font-display); letter-spacing: .3em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; display: block; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(28px, 6vw, 44px); margin: 0; }
.lead { font-size: clamp(16px, 2.4vw, 19px); color: var(--muted); max-width: 62ch; }

/* ---------- Studio hero ---------- */
.studio-hero { position: relative; padding: clamp(72px, 14vw, 140px) 0 clamp(56px, 10vw, 96px); overflow: hidden; isolation: isolate; }
.studio-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 70% at 85% 10%, rgba(255, 46, 91, .22), transparent 70%),
    radial-gradient(50% 60% at 0% 100%, rgba(46, 230, 255, .10), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 59px, rgba(255,255,255,.035) 59px 60px);
}
.studio-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; z-index: -1;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.studio-hero h1 { font-size: clamp(46px, 13vw, 128px); letter-spacing: .02em; line-height: .92; margin-bottom: 18px; }
.studio-hero h1 .outline { color: transparent; -webkit-text-stroke: 1.5px var(--text); }
.studio-hero h1 b { color: var(--accent); font-weight: inherit; text-shadow: 0 0 34px rgba(255, 46, 91, .5); }
.tagline { font: 600 clamp(15px, 3.4vw, 22px)/1.3 var(--font-display); letter-spacing: .22em; text-transform: uppercase; color: var(--text); margin-bottom: 14px; }
.studio-hero .lead { margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Game cards (reusable) ---------- */
.game-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.game-card {
  --card-accent: var(--accent);
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: border-color .2s, transform .2s;
}
.game-card:hover { border-color: var(--card-accent); transform: translateY(-3px); }
.game-card__media { position: relative; aspect-ratio: 16 / 10; background: var(--bg-2); display: block; overflow: hidden; }
.game-card__media > img:first-child { width: 100%; height: 100%; object-fit: cover; }
.game-card__logo { position: absolute; left: 14px; bottom: 12px; width: 46%; max-width: 190px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.game-card__body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.game-card__genre { font: 600 11px/1 var(--font-display); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.game-card h3 { font-size: 24px; margin-bottom: 8px; }
.game-card h3 a { text-decoration: none; }
.game-card__desc { color: var(--muted); font-size: 15px; }
.game-card__actions { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.game-card__actions .btn { flex: 1 1 auto; }
.game-card--placeholder { border-style: dashed; }
.game-card--placeholder .game-card__media {
  display: grid; place-items: center;
  background: repeating-linear-gradient(135deg, var(--bg-2) 0 14px, var(--surface) 14px 28px);
}
.placeholder-mark { font: 700 72px/1 var(--font-display); color: var(--line); }
.status {
  position: absolute; top: 12px; right: 12px; padding: 7px 10px; border-radius: 999px;
  font: 700 11px/1 var(--font-display); letter-spacing: .16em; background: rgba(0,0,0,.7); border: 1px solid var(--line);
}
.status--live { color: #b6ff5c; border-color: rgba(182, 255, 92, .4); }
.status--live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 7px; box-shadow: 0 0 10px currentColor; }
.status--soon { color: var(--muted); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 16px; }
.chip { font-size: 12px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); }
.chip--soon { color: var(--muted); }

/* ---------- Featured game block (game-themed area) ---------- */
.featured-game { position: relative; overflow: hidden; isolation: isolate; background: var(--game-bg, var(--bg-2)); }
.featured-game__bg { position: absolute; inset: 0; z-index: -1; }
.featured-game__bg img { width: 100%; height: 100%; object-fit: cover; opacity: .32; }
.featured-game__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--bg) 0%, transparent 25%, transparent 60%, var(--bg) 100%); }
.featured-game__grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 960px) { .featured-game__grid { grid-template-columns: 1fr 1.15fr; gap: 48px; } }
.featured-label { display: inline-block; font: 700 12px/1 var(--font-display); letter-spacing: .28em; color: var(--text); border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; margin-bottom: 18px; background: rgba(0,0,0,.4); }
.game-logo { width: min(100%, 380px); height: auto; margin-bottom: 18px; border-radius: 10px; }
.feature-ticks { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.feature-ticks li { padding-left: 26px; position: relative; font-weight: 600; }
.feature-ticks li::before { content: ""; position: absolute; left: 0; top: .45em; width: 12px; height: 12px; border-radius: 3px; background: var(--game-primary); transform: rotate(45deg); }

/* ---------- Trailer (reusable) ---------- */
.trailer { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line); }
.trailer video { width: 100%; height: 100%; object-fit: cover; }
.trailer__pending {
  display: none; position: absolute; inset: 0; place-items: center; text-align: center; padding: 16px;
  background: linear-gradient(0deg, rgba(0,0,0,.65), rgba(0,0,0,.2));
  font: 700 14px/1.4 var(--font-display); letter-spacing: .2em; text-transform: uppercase;
}
.trailer--pending .trailer__pending { display: grid; }
.trailer--pending video { pointer-events: none; }

/* ---------- Screenshot gallery (reusable) ---------- */
.shots { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.shots a { display: block; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 3 / 2; background: var(--bg-2); }
.shots img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.shots a:hover img { transform: scale(1.04); }
.shots--strip { grid-auto-flow: column; grid-auto-columns: minmax(240px, 72%); grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; overscroll-behavior-x: contain; }
.shots--strip a { scroll-snap-align: start; }
@media (min-width: 720px) { .shots--strip { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; } }

.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 92vh; }
.lightbox::backdrop { background: rgba(0,0,0,.88); }
.lightbox figure { margin: 0; }
.lightbox img { max-height: 84vh; width: auto; margin: 0 auto; border-radius: 10px; }
.lightbox figcaption { color: var(--muted); text-align: center; padding: 10px; font-size: 14px; }
.lightbox__close { position: fixed; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 22px; cursor: pointer; }

/* ---------- Content blocks ---------- */
.cards-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel h3 { font-size: 20px; }
.panel p:last-child { margin-bottom: 0; }
.panel--media { padding: 0; overflow: hidden; }
.panel--media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.panel--media .panel__body { padding: 18px 20px 20px; }
.split { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 48px; } .split--flip > :first-child { order: 2; } }
.split img { border-radius: var(--radius); border: 1px solid var(--line); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.steps li::before { content: counter(s, decimal-leading-zero); display: block; font: 700 30px/1 var(--game-font); color: var(--game-primary); margin-bottom: 10px; }
.steps strong { display: block; font-family: var(--font-display); font-size: 18px; margin-bottom: 4px; }
.steps span { color: var(--muted); font-size: 15px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }
.stat b { display: block; font: 700 clamp(30px, 7vw, 44px)/1 var(--game-font); color: var(--game-primary); margin-bottom: 6px; }
.stat span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .12em; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.tag-list li { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.tag-list small { color: var(--muted); font-weight: 400; }

/* ---------- Store / platform badges (reusable) ---------- */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 18px;
  border-radius: 12px; background: #000; border: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge small { display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.store-badge strong { display: block; font: 700 17px/1.1 var(--font-display); }
.store-badge--soon { opacity: .72; cursor: default; }

/* ---------- Studio band ---------- */
.studio-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-2); }
.pillars { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.pillars h3 { font-size: 18px; letter-spacing: .1em; text-transform: uppercase; }
.pillars h3::before { content: ""; display: block; width: 28px; height: 3px; background: var(--accent); margin-bottom: 14px; }
.pillars p { color: var(--muted); }

/* ---------- Page header (inner pages) ---------- */
.page-hero { padding: 64px 0 32px; border-bottom: 1px solid var(--line); background: radial-gradient(60% 120% at 100% 0%, rgba(255,46,91,.14), transparent 70%); }
.page-hero h1 { font-size: clamp(36px, 9vw, 72px); }

/* ---------- Prose (about / legal) ---------- */
.prose { max-width: 72ch; }
.prose h2 { font-size: 24px; margin-top: 1.8em; }
.prose p, .prose li { color: #cfcfd8; }
.prose a { color: var(--accent-2); }
.note { border-left: 3px solid var(--accent); background: var(--surface); padding: 14px 16px; border-radius: 0 10px 10px 0; color: var(--muted); font-size: 14px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.contact-grid a.panel { text-decoration: none; display: block; transition: border-color .2s; }
.contact-grid a.panel:hover { border-color: var(--accent); }
.contact-grid .mail { color: var(--accent-2); font-weight: 600; word-break: break-all; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 32px; background: var(--bg); color: var(--muted); font-size: 14px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 32px; }
.site-footer h4 { color: var(--text); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* ---------- Sticky mobile PLAY bar (game pages) ---------- */
.mobile-play-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(8,8,11,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.mobile-play-bar .btn { width: 100%; }
@media (min-width: 881px) { .mobile-play-bar { display: none; } }
@media (max-width: 880px) { body.has-play-bar { padding-bottom: 84px; } }

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

/* Header play buttons (kept last so they win over .btn / .nav-menu a) */
.nav-menu a.btn-play, .nav-menu a.btn-play:hover { color: var(--game-play-text); background: var(--game-play-bg); padding: 12px 18px; border-radius: 12px; }
.site-header .header-play { display: none; }
@media (max-width: 880px) { .site-header .header-play { display: inline-flex; } }
