/* Cioco Games - site styles. Mobile first; no inline styles anywhere (strict CSP). */

@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-800.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/assets/fonts/eb-garamond-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --bg: #120b08;
  --bg-2: #1a100c;
  --surface: #211410;
  --surface-2: #2b1a13;
  --surface-3: #36221a;
  --line: rgba(230, 199, 156, 0.14);
  --line-strong: rgba(230, 199, 156, 0.3);
  --text: #f4ecdf;
  --text-2: #d6c8b6;
  --muted: #ab9a8b;
  --copper: #d39a68;
  --champagne: #e6c79c;
  --ink: #1a100c;
  --accent: var(--copper);
  --accent-2: var(--champagne);
  --focus: #ffd9a8;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --wrap: 1240px;
  --gutter: clamp(16px, 4.2vw, 40px);
  --header-h: 64px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.88rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  --step-1: clamp(1.15rem, 1.06rem + 0.45vw, 1.35rem);
  --step-2: clamp(1.4rem, 1.2rem + 0.9vw, 1.9rem);
  --step-3: clamp(1.8rem, 1.4rem + 1.8vw, 2.8rem);
  --step-4: clamp(2.4rem, 1.7rem + 3.4vw, 4.4rem);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: var(--step-0);
  line-height: 1.6; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
picture { display: block; }
a { color: var(--champagne); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text); }
p { margin: 0 0 1em; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 0.5em; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -0.01em; }
ul { padding-left: 1.2em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--champagne); color: var(--ink); padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.eyebrow { display: inline-block; font-size: var(--step--1); font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 0.9rem; }
.lede { font-size: var(--step-1); color: var(--text-2); max-width: 60ch; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
.section { padding: clamp(56px, 8vw, 112px) 0; }
.section--tight { padding: clamp(40px, 6vw, 72px) 0; }
.section-head { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: end; justify-content: space-between; margin-bottom: clamp(24px, 4vw, 40px); }
.section-head h2 { margin: 0; letter-spacing: -0.025em; }
.section-head p { margin: 0; color: var(--text-2); max-width: 54ch; }
.section-head .eyebrow::before { content: ""; display: inline-block; width: 22px; height: 1px; margin-right: 10px; vertical-align: middle; background: var(--copper); }
.rule { height: 1px; background: linear-gradient(90deg, var(--copper), transparent); border: 0; margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 22px;
  border-radius: 999px; font: 600 0.92rem/1 var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn--primary { background: linear-gradient(180deg, #f0cf9e, var(--copper)); color: var(--ink); box-shadow: 0 10px 30px rgba(211, 154, 104, 0.25); }
.btn--primary:hover { color: var(--ink); transform: translateY(-1px); background: linear-gradient(180deg, #f6dcb3, #dca576); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); background: rgba(255, 255, 255, 0.02); }
.btn--ghost:hover { border-color: var(--champagne); color: var(--text); }
.btn svg { width: 18px; height: 18px; flex: none; }
.text-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem; text-decoration: none; color: var(--accent-2); min-height: 44px; }
.text-link:hover { color: var(--text); }
.text-link svg { width: 16px; height: 16px; transition: transform 0.18s ease; }
.text-link:hover svg { transform: translateX(3px); }

/* ---------- header and navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(16, 10, 7, 0.88); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.18);
}
/* a fine copper hairline that fades out toward the edges */
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(211, 154, 104, 0.45) 30%, rgba(211, 154, 104, 0.45) 70%, transparent); pointer-events: none; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; min-height: 44px; border-radius: 8px; }
.brand img { width: 170px; height: auto; }
.primary-nav { display: none; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; }
.nav-list > li { position: relative; }
.nav-link, .nav-button {
  position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 0; background: none;
  color: var(--text-2); font: 600 0.8rem/1 var(--font-sans); letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}
/* underline that grows from the centre on hover; stays for the current page */
.nav-link::after, .nav-button::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--copper);
  transform: scaleX(0); transition: transform 0.22s ease; opacity: 0.9;
}
.nav-button::after { right: 37px; }
.nav-link:hover, .nav-button:hover, .nav-button[aria-expanded="true"] { color: var(--text); background: rgba(230, 199, 156, 0.06); }
.nav-link:hover::after, .nav-button:hover::after { transform: scaleX(0.5); }
.nav-link[aria-current="page"], .nav-button.is-current { color: var(--text); }
.nav-link[aria-current="page"]::after, .nav-button.is-current::after { transform: scaleX(1); }
.nav-button svg { width: 14px; height: 14px; transition: transform 0.2s ease; opacity: 0.8; }
.nav-button[aria-expanded="true"] svg { transform: rotate(180deg); }
.header-row { position: relative; }
.nav-list > li.has-mega { position: static; }
.mega {
  position: absolute; top: calc(100% + 6px); right: 0; width: min(980px, 100%); padding: 24px 24px 18px;
  background: linear-gradient(180deg, #23150f, #170e0a); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 236, 210, 0.05); display: none;
}
.mega::before { content: ""; position: absolute; top: -1px; left: 24px; right: 24px; height: 1px; background: linear-gradient(90deg, transparent, var(--copper), transparent); }
.mega.is-open { display: block; }
/* no-JS fallback: keyboard focus inside the Games item reveals the menu */
.no-js .has-mega:focus-within .mega { display: block; }
/* one column per genre, wrapping if genres are added; a long menu scrolls inside itself instead of running off screen */
.mega-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; }
.mega.is-open, .no-js .has-mega:focus-within .mega { max-height: calc(100vh - var(--header-h) - 24px); overflow-y: auto; overscroll-behavior: contain; }
.mega-grid > div + div { border-left: 1px solid var(--line); padding-left: 18px; }
.mega-label { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--champagne); font-weight: 600; margin: 0 0 10px; padding-left: 8px; }
.mega ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.mega a { display: grid; grid-template-columns: 34px 1fr; gap: 1px 12px; align-items: center; padding: 8px; border-radius: 12px; text-decoration: none; color: var(--text); transition: background-color 0.15s ease; }
.mega a:hover, .mega a:focus-visible { background: rgba(230, 199, 156, 0.08); }
.mega a .app-icon { width: 34px; height: 34px; grid-row: span 2; border-radius: 9px; box-shadow: none; }
.mega a strong { font-weight: 600; font-size: 0.93rem; line-height: 1.25; }
.mega a small { color: var(--muted); font-size: 0.76rem; line-height: 1.3; }
.mega-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.mega-foot p { margin: 0; color: var(--muted); font-size: 0.86rem; }
.mega-foot .text-link { white-space: nowrap; }

.menu-button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: none; color: var(--text); font: 600 0.8rem/1 var(--font-sans); letter-spacing: 0.16em; text-transform: uppercase; cursor: pointer;
}
.menu-button svg { width: 18px; height: 18px; }
.drawer { position: fixed; inset: 0; z-index: 80; display: none; }
.drawer.is-open { display: block; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(8, 5, 3, 0.72); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, #23150f, #140c09); border-left: 1px solid var(--line-strong); padding: 16px var(--gutter) 40px;
}
.drawer-top { display: flex; align-items: center; justify-content: space-between; height: calc(var(--header-h) - 16px); margin-bottom: 12px; }
.drawer-top img { width: 150px; }
.drawer-close { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line-strong); background: none; color: var(--text); cursor: pointer; }
.drawer-close svg { width: 18px; height: 18px; }
.drawer-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.drawer-list > li { border-bottom: 1px solid var(--line); }
.drawer-list a, .drawer-list button.drawer-sub {
  display: flex; width: 100%; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 4px; background: none; border: 0;
  color: var(--text); font: 600 1rem/1.2 var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; cursor: pointer; text-align: left;
}
.drawer-list a[aria-current="page"] { color: var(--champagne); }
.drawer-sub svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.drawer-sub[aria-expanded="true"] svg { transform: rotate(180deg); }
.drawer-games { padding: 4px 0 18px; }
.drawer-games[hidden] { display: none; }
.drawer-label { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin: 14px 4px 4px; font-weight: 600; }
.drawer-games ul { list-style: none; margin: 0; padding: 0; }
.drawer-games a { min-height: 48px; text-transform: none; letter-spacing: 0; font-weight: 600; justify-content: flex-start; gap: 12px; }
.drawer-games a .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--g-accent, var(--copper)); }
.drawer-games .all { color: var(--champagne); }
body.is-locked { overflow: hidden; }

@media (min-width: 1000px) {
  .primary-nav { display: block; }
  .menu-button { display: none; }
  .brand img { width: 196px; }
  :root { --header-h: 82px; }
}

/* ---------- hero (home): studio name and introduction beside real game art, then every game one tap away ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: -30% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px; background: radial-gradient(closest-side, rgba(211, 154, 104, 0.14), transparent 70%); pointer-events: none; }
.hero-grid {
  position: relative; display: grid; gap: 22px; padding: clamp(22px, 4vw, 56px) 0 clamp(32px, 5vw, 56px);
  grid-template-areas: "copy" "show" "actions" "games";
}
.hero-copy { grid-area: copy; }
.hero-show { grid-area: show; }
.hero-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-games { grid-area: games; }
.hero .eyebrow { margin-bottom: 0.6rem; }
/* the header already carries the CIOCO GAMES logo, so the hero headline says what the studio makes */
.hero h1 { font-size: clamp(2.35rem, 1.45rem + 3.7vw, 4.5rem); line-height: 1.04; letter-spacing: -0.032em; margin-bottom: 0.4em; max-width: 13ch; text-wrap: balance; }
.hero .lede { margin: 0; text-wrap: pretty; }
.hero-show { margin: 0; position: relative; container-type: inline-size; }
.hero-show a { display: block; color: var(--text); text-decoration: none; }
.hero-show-art { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid color-mix(in srgb, var(--g-accent) 40%, var(--line)); box-shadow: var(--shadow); background: #0d0806; }
.hero-show-art img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hero-show-phone {
  position: absolute; z-index: 2; right: 5cqw; top: 31cqw; width: 23cqw; max-width: 150px; padding: 5px; border-radius: 20px;
  background: linear-gradient(160deg, #3a281e, #120b08); border: 1px solid var(--line-strong); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}
.hero-show-phone img { border-radius: 15px; width: 100%; }
.hero-show figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 14px 4px 0; }
.hero-show--phone figcaption { padding-right: calc(min(23cqw, 150px) + 7cqw); min-height: calc(min(23cqw, 150px) * 1.78 + 31cqw - 56.25cqw + 10px); }
.hero-show figcaption strong { font-size: var(--step-1); font-weight: 800; letter-spacing: -0.01em; }
.hero-show .card-genre { width: 100%; }
.hero-show-note { color: var(--text-2); font-size: var(--step--1); }
.hero-show a:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.hero-games-label { margin: 0 0 10px; font-size: var(--step--1); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hero-games ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 8px; }
.hero-games a { display: grid; justify-items: center; gap: 6px; padding: 4px 2px; border-radius: 12px; text-decoration: none; color: var(--text-2); text-align: center; font-size: 0.72rem; line-height: 1.25; }
.hero-games a:hover { color: var(--text); }
.hero-games a:hover .app-icon { border-color: var(--g-accent); transform: translateY(-2px); }
.hero-games .app-icon { width: 52px; height: 52px; transition: transform 0.18s ease, border-color 0.18s ease; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); grid-template-areas: "copy show" "actions show" "games show"; gap: 22px 56px; align-items: start; }
  .hero-copy { align-self: end; }
  .hero-show { align-self: center; }
  .hero-games .app-icon { width: 56px; height: 56px; }
}
/* app icons: the games' own launcher icons */
.app-icon { flex: none; border-radius: 22%; border: 1px solid var(--line-strong); background: #0d0806; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.app-icon--hero { width: 64px; height: 64px; }

/* ---------- game cards ---------- */
.card {
  position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #24160f, var(--surface) 40%, #1b110c); box-shadow: inset 0 1px 0 rgba(255, 236, 210, 0.05), 0 8px 24px rgba(0, 0, 0, 0.22);
  overflow: hidden; transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease; isolation: isolate;
}
.card:hover {
  transform: translateY(-3px); border-color: color-mix(in srgb, var(--g-accent, var(--copper)) 50%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 236, 210, 0.06), 0 22px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px color-mix(in srgb, var(--g-accent, var(--copper)) 18%, transparent);
}
/* every card frames its art the same way: a 16:9 window, cover-fitted, with a hairline inner edge and a soft fade into the body */
.card-media { position: relative; aspect-ratio: 16 / 9; background: #0d0806; overflow: hidden; }
.card-media::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 236, 210, 0.06); background: linear-gradient(180deg, transparent 72%, rgba(18, 11, 8, 0.38)); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card-media picture, .feature-art picture { height: 100%; }
.card:hover .card-media img { transform: scale(1.03); }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 22px 20px; flex: 1; }
.card-title { display: flex; align-items: center; gap: 14px; }
.card-title .app-icon { width: 46px; height: 46px; }
.card-title .card-genre { margin-bottom: 3px; }
.card-genre { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--g-accent, var(--copper)); margin: 0; }
.card :is(h3, h4) { margin: 0; font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem); letter-spacing: -0.015em; }
.card :is(h3, h4) a { color: var(--text); text-decoration: none; }
.card :is(h3, h4) a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card p { margin: 0; color: var(--text-2); font-size: 0.97rem; line-height: 1.55; }
.card .text-link { margin-top: auto; padding-top: 2px; position: relative; z-index: 2; color: var(--g-accent, var(--champagne)); }
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--g-accent, var(--copper)), color-mix(in srgb, var(--g-accent, var(--copper)) 25%, transparent)); z-index: 3; }

/* featured: a genuine gameplay screen in a phone frame beside the game's introduction */
.section--featured { padding: clamp(40px, 5vw, 68px) 0 clamp(40px, 5vw, 64px); background: linear-gradient(180deg, rgba(38, 23, 16, 0.6), rgba(18, 11, 8, 0) 85%); border-bottom: 1px solid var(--line); }
.featured { display: grid; gap: 18px; }
@media (min-width: 1100px) { .featured { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); } }
.feature {
  position: relative; display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 18px; align-items: center; padding: 16px 18px 16px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); isolation: isolate;
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--g-accent, var(--copper)) 16%, transparent), transparent 60%), linear-gradient(180deg, #24160f, var(--surface));
  box-shadow: inset 0 1px 0 rgba(255, 236, 210, 0.05), 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.feature:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--g-accent, var(--copper)) 50%, transparent); box-shadow: inset 0 1px 0 rgba(255, 236, 210, 0.06), 0 22px 48px rgba(0, 0, 0, 0.5); }
.feature-phone { padding: 5px; border-radius: 20px; background: linear-gradient(160deg, #3a281e, #120b08); border: 1px solid var(--line-strong); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); }
.feature-phone img { border-radius: 15px; width: 100%; }
.feature-phone--art img { aspect-ratio: 9 / 16; object-fit: cover; }
.feature-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.feature .card-title { gap: 12px; }
.feature .card-title .app-icon { width: 40px; height: 40px; }
.feature h3 { margin: 0; font-size: var(--step-2); }
.feature h3 a { color: var(--text); text-decoration: none; }
.feature h3 a::after { content: ""; position: absolute; inset: 0; z-index: 4; }
.feature p { margin: 0; color: var(--text-2); font-size: 0.95rem; }
.feature .card-genre { margin: 0; }
.feature .text-link { color: var(--g-accent, var(--champagne)); }
@media (min-width: 760px) and (max-width: 1099px) { .feature { grid-template-columns: 200px minmax(0, 1fr); gap: 28px; padding: 18px 28px 18px 18px; } .feature p { font-size: var(--step-0); } }
/* catalogue grids follow the group size so every row is full (data-count is written by the generator) */
.catalog { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 620px) {
  .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* a card left alone on the last row becomes a wide row: its 16:9 image beside its text */
  .catalog > .card:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; }
  .catalog > .card:last-child:nth-child(odd) .card-media { width: 62%; flex: none; aspect-ratio: 16 / 9; }
  .catalog > .card:last-child:nth-child(odd) .card-body { justify-content: center; padding: 26px 30px; }
}
/* the layout depends only on how many cards a genre actually has, so games added later fit without any edits:
   three columns, except exactly two or four cards (two even columns); a lone card on the last row goes wide */
@media (min-width: 1040px) {
  .catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catalog:has(> .card:nth-child(2):last-child), .catalog:has(> .card:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog > .card:last-child:nth-child(odd) { grid-column: auto; flex-direction: column; }
  .catalog > .card:last-child:nth-child(odd) .card-media { width: auto; }
  .catalog > .card:last-child:nth-child(odd) .card-body { justify-content: flex-start; padding: 18px 22px 20px; }
  .catalog > .card:last-child:nth-child(3n + 1):not(:nth-child(4)) { grid-column: 1 / -1; flex-direction: row; }
  .catalog > .card:last-child:nth-child(3n + 1):not(:nth-child(4)) .card-media { width: 62%; flex: none; }
  .catalog > .card:last-child:nth-child(3n + 1):not(:nth-child(4)) .card-body { justify-content: center; padding: 26px 30px; }
}
.catalog .card[hidden] { display: none; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.filter {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-2);
  font: 600 0.82rem/1 var(--font-sans); letter-spacing: 0.08em; cursor: pointer;
}
.filter:hover { color: var(--text); border-color: var(--champagne); }
.filter[aria-pressed="true"] { background: var(--champagne); color: var(--ink); border-color: var(--champagne); }
.filter[aria-pressed="true"] span { color: #5b3f2b; }
.no-js .filters { display: none; }
.result-note { color: var(--muted); font-size: var(--step--1); margin: -8px 0 18px; }

/* genre groups (home catalogue and the Games page): a ruled heading with the family name, a line of description and
   the game count, then that family's cards */
.genre-block + .genre-block { margin-top: clamp(44px, 6vw, 72px); }
.genre-block[hidden] { display: none; }
.genre-head {
  position: relative; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px;
  padding-top: 18px; margin-bottom: 22px; border-top: 1px solid var(--line);
}
.genre-head::before { content: ""; position: absolute; top: -1px; left: 0; width: 64px; height: 2px; background: var(--copper); }
.genre-head h2, .genre-head h3 { font-size: var(--step-2); margin: 0 0 4px; letter-spacing: -0.015em; }
.genre-head p { color: var(--text-2); margin: 0; max-width: 64ch; }
.section--catalogue { padding-top: clamp(40px, 5vw, 64px); }

/* ---------- studio strip ---------- */
.pillars { display: grid; gap: 18px; }
@media (min-width: 820px) { .pillars { grid-template-columns: repeat(3, 1fr); } }
.pillar { padding: 26px; border-radius: var(--radius-lg); background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); }
.pillar h3 { margin-bottom: 8px; }
.pillar p { margin: 0; color: var(--text-2); }
.pillar .num { display: block; font-family: var(--font-serif); font-style: italic; color: var(--copper); font-size: 1.6rem; margin-bottom: 8px; }

/* ---------- breadcrumbs ---------- */
.breadcrumbs { padding-top: 22px; font-size: var(--step--1); color: var(--muted); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.breadcrumbs a { color: var(--text-2); text-decoration: none; display: inline-block; padding: 10px 0; }
.breadcrumbs a:hover { color: var(--text); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--text); padding: 10px 0; display: inline-block; }

/* ---------- page head (inner pages) ---------- */
.page-head { padding: clamp(28px, 5vw, 56px) 0 clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--line); background: radial-gradient(900px 360px at 85% 0%, rgba(211, 154, 104, 0.12), transparent 70%); }
.page-head h1 { margin-bottom: 0.3em; }
.page-head + .section--tight { padding-top: clamp(28px, 4vw, 44px); }
.prose { max-width: 70ch; }
.prose h2 { font-size: var(--step-2); margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose p, .prose li { color: var(--text-2); }
.prose li { margin-bottom: 0.4em; }
.note { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: rgba(230, 199, 156, 0.05); color: var(--text-2); }
.note strong { color: var(--text); }

/* ---------- game page ---------- */
.game-hero { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.game-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(900px 480px at 80% 10%, color-mix(in srgb, var(--g-accent) 22%, transparent), transparent 70%); pointer-events: none; }
.game-hero-grid { position: relative; display: grid; gap: 28px; padding: clamp(12px, 3vw, 28px) 0 clamp(40px, 6vw, 72px); align-items: center; }
@media (min-width: 960px) { .game-hero-grid { grid-template-columns: 0.9fr 1.1fr; gap: 52px; } }
.game-hero h1 { font-size: clamp(2.3rem, 1.5rem + 3.8vw, 4.4rem); letter-spacing: -0.035em; margin-bottom: 0.1em; }
.game-hero .eyebrow { color: var(--g-accent); margin-bottom: 0.4rem; }
.game-title { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
@media (max-width: 420px) { .app-icon--hero { width: 52px; height: 52px; } .game-title { gap: 14px; } }
.game-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 26px 0 0; }
.game-meta div { padding: 14px 16px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line); }
.game-meta dt { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.game-meta dd { margin: 0; font-weight: 600; color: var(--text); }
.poster-frame { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid color-mix(in srgb, var(--g-accent) 35%, var(--line)); box-shadow: var(--shadow); background: #0d0806; }
.poster-frame img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.overview { display: grid; gap: 32px; }
@media (min-width: 960px) { .overview { grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: start; } }
.overview .prose p:first-of-type { font-size: var(--step-1); color: var(--text); }
.highlights { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.highlights li { padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--g-accent); }
.highlights h3 { font-size: 1.05rem; margin: 0 0 4px; letter-spacing: 0; }
.highlights p { margin: 0; color: var(--text-2); font-size: 0.97rem; }

/* first look: a device frame around the genuine first screen */
.first-look { display: grid; gap: 28px; align-items: center; }
@media (min-width: 860px) {
  .first-look { grid-template-columns: minmax(0, 360px) 1fr; gap: 56px; }
  .first-look--landscape, .first-look--pair { grid-template-columns: minmax(0, 640px) 1fr; }
}
.first-look-devices { display: grid; gap: 18px; }
.device-figure { margin: 0; display: grid; gap: 12px; justify-items: center; }
@media (max-width: 859px) { .first-look-text { order: -1; } .first-look-line { margin-bottom: 0; } }
.device-figure figcaption { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.first-look-line { font-family: var(--font-serif); font-style: italic; font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem); line-height: 1.35; color: var(--champagne); max-width: 30ch; }
@media (min-width: 860px) {
  .first-look:not(.first-look--landscape):not(.first-look--pair):not(.first-look--pending) { grid-template-columns: minmax(0, 290px) 1fr; }
  .first-look:not(.first-look--pair) .device:not(.device--landscape) { width: min(100%, 290px); }
}
.first-look--pending { grid-template-columns: auto 1fr; gap: 24px; padding: clamp(20px, 3vw, 28px); border-radius: var(--radius-lg); border: 1px dashed var(--line-strong); background: var(--surface); }
@media (min-width: 860px) { .first-look--pending { grid-template-columns: auto 1fr; } }
.first-look--pending h2 { font-size: var(--step-2); }
.first-look--pending .first-look-text p:last-child { margin-bottom: 0; }
.app-icon--pending { width: 72px; height: 72px; }
.pending-panel { display: flex; align-items: center; gap: 20px; padding: clamp(20px, 3vw, 28px); border-radius: var(--radius-lg); border: 1px dashed var(--line-strong); background: var(--surface); }
.pending-panel p { margin: 0; color: var(--text-2); max-width: 70ch; }
.pending-panel .app-icon { width: 56px; height: 56px; }
.first-look--pair .first-look-devices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.first-look--pair .device { padding: 8px; border-radius: 30px; }
.first-look--pair .device img, .first-look--pair .device .slot { border-radius: 22px; }
.section-title-spaced { font-size: var(--step-2); margin: 48px 0 18px; }
.section-title-first { font-size: var(--step-2); margin: 0 0 18px; }
.faq + .prose { margin-top: 48px; }
.contact-card--solo { max-width: 680px; }
.device { position: relative; margin: 0 auto; width: min(100%, 316px); padding: 12px; border-radius: 38px; background: linear-gradient(160deg, #3a281e, #120b08); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.device--landscape { width: min(100%, 620px); border-radius: 30px; }
.device img, .device .slot { border-radius: 26px; width: 100%; }
.device--landscape img, .device--landscape .slot { border-radius: 20px; }
.first-look figcaption, .first-look-text p { color: var(--text-2); }

/* gameplay rail: one row of genuine screens, scrolled sideways (swipe, trackpad, or Tab through the buttons) */
.rail-wrap { position: relative; margin-inline: calc(-1 * var(--gutter)); }
.rail {
  list-style: none; margin: 0; padding: 4px var(--gutter) 18px; display: grid; grid-auto-flow: column; gap: 16px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.rail--portrait { grid-auto-columns: clamp(176px, 56vw, 236px); }
.rail--landscape { grid-auto-columns: clamp(280px, 80vw, 520px); }
@media (min-width: 700px) { .rail--portrait { grid-auto-columns: clamp(176px, 27vw, 236px); } .rail--landscape { grid-auto-columns: clamp(280px, 44vw, 520px); } }
@media (min-width: 1240px) { .rail-wrap { margin-inline: 0; } .rail { padding-inline: 0; scroll-padding-inline: 0; } }
.rail .shot { scroll-snap-align: start; }
.rail figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }

/* gallery */
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .gallery--portrait { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gallery--landscape { grid-template-columns: 1fr; }
@media (min-width: 700px) { .gallery--landscape { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* no approved screenshots yet: a compact strip of honest frames instead of a wall of empty tiles */
.gallery--pending { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.gallery--pending.gallery--landscape { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery--pending .slot { padding: 10px; border-radius: 14px; }
.gallery--pending .slot p { font-size: 0.74rem; }
.gallery--pending figcaption { font-size: 0.82rem; }
.shot { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shot button {
  padding: 5px; border: 1px solid var(--line-strong); border-radius: 22px; overflow: hidden; cursor: zoom-in; display: block; width: 100%;
  background: linear-gradient(160deg, #33231a, #120b08); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); transition: border-color 0.18s ease, transform 0.18s ease;
}
.shot button:hover { border-color: var(--g-accent); transform: translateY(-2px); }
.shot img { width: 100%; border-radius: 17px; }
.rail--landscape .shot img { border-radius: 14px; }
.shot figcaption { font-size: 0.9rem; color: var(--text-2); line-height: 1.45; }

/* rights-safe placeholder slots (GitHub build): honest frames, not fake screenshots */
.slot {
  position: relative; display: grid; place-items: center; text-align: center; padding: 18px; border-radius: 18px; overflow: hidden;
  background: repeating-linear-gradient(135deg, rgba(230, 199, 156, 0.05) 0 12px, transparent 12px 24px), linear-gradient(180deg, color-mix(in srgb, var(--g-accent) 14%, #1d120d), #120b08);
  border: 1px dashed color-mix(in srgb, var(--g-accent) 45%, var(--line-strong)); color: var(--text-2);
}
.slot--portrait { aspect-ratio: 9 / 16; }
.slot--landscape { aspect-ratio: 16 / 9; }
.slot span { display: block; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--g-accent); font-weight: 600; margin-bottom: 6px; }
.slot p { margin: 0; font-size: 0.86rem; max-width: 22ch; }
.media-note { margin-top: 18px; font-size: var(--step--1); color: var(--muted); }
.rail-wrap + .media-note { margin-top: 4px; }

/* local owner-review copy only (never in the repository build) */
.review-banner { position: relative; z-index: 60; padding: 10px var(--gutter); background: #5c1d12; color: #fff; font-size: 0.9rem; text-align: center; }
.review-tag { display: inline-block; margin: 0 0 14px; padding: 6px 12px; border-radius: 999px; background: #5c1d12; color: #fff; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.card-media .review-tag, .hero-show .review-tag, .poster-frame .review-tag, .feature-art .review-tag { position: absolute; left: 12px; top: 12px; margin: 0; z-index: 2; }
.poster-frame { position: relative; }
.first-look-text .review-tag { display: table; }

/* availability */
.availability { display: grid; gap: 16px; padding: clamp(22px, 4vw, 36px); border-radius: var(--radius-lg); border: 1px solid var(--line-strong); background: linear-gradient(135deg, color-mix(in srgb, var(--g-accent) 10%, var(--surface)), var(--surface)); }
@media (min-width: 820px) { .availability { grid-template-columns: 1fr auto; align-items: center; } }
.availability h2 { font-size: var(--step-2); margin: 0 0 6px; }
.availability p { margin: 0; color: var(--text-2); }
.store-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.store-badge { display: inline-flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 8px 18px; border-radius: 12px; border: 1px solid var(--line-strong); color: var(--text-2); background: rgba(0, 0, 0, 0.25); }
.store-badge small { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.store-badge strong { font-size: 0.98rem; color: var(--text); font-weight: 600; }

.related { display: grid; gap: 18px; }
@media (min-width: 760px) { .related { grid-template-columns: repeat(3, 1fr); } }
.help-strip { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; padding: 22px 0; border-top: 1px solid var(--line); }
.help-strip p { margin: 0; color: var(--text-2); }
.help-strip nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }

/* faq */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 54px 18px 20px; font-weight: 600; position: relative; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--copper); }
.faq details[open] summary::after { content: "\2212"; }
.faq .answer { padding: 0 20px 18px; color: var(--text-2); }
.faq .answer p:last-child { margin-bottom: 0; }

/* contact cards */
.contact-grid { display: grid; gap: 18px; }
@media (min-width: 820px) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }
.contact-card { padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.contact-card h2 { font-size: var(--step-1); margin-bottom: 8px; }
.contact-card p { color: var(--text-2); margin: 0 0 12px; }
.status-pill { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--champagne); border: 1px solid var(--line-strong); }

/* ---------- footer ---------- */
.site-footer { margin-top: clamp(40px, 6vw, 80px); border-top: 1px solid var(--line); background: linear-gradient(180deg, #160e0a, #0e0806); padding: clamp(44px, 6vw, 72px) 0 28px; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer-brand img { width: 176px; margin-bottom: 14px; }
.footer-brand p { color: var(--muted); max-width: 36ch; font-size: 0.95rem; }
.site-footer h2 { font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.site-footer li a { display: inline-block; padding: 7px 0; color: var(--text-2); text-decoration: none; }
.site-footer li a:hover { color: var(--text); text-decoration: underline; }
.footer-base { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.86rem; }
.footer-base p { margin: 0; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 90; display: none; background: rgba(8, 5, 3, 0.97); }
.lightbox.is-open { display: grid; grid-template-rows: auto 1fr auto; }
.lightbox-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px var(--gutter); color: var(--text-2); font-size: 0.9rem; }
.lightbox-stage { display: grid; place-items: center; min-height: 0; padding: 0 var(--gutter); }
.lightbox-stage img { max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px); width: auto; max-width: 100%; border-radius: 14px; box-shadow: var(--shadow); }
.lightbox-caption { padding: 14px var(--gutter) 22px; text-align: center; color: var(--text); max-width: 760px; margin: 0 auto; }
.lb-btn { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(26, 16, 12, 0.85); color: var(--text); cursor: pointer; }
.lb-btn svg { width: 20px; height: 20px; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); }
.lb-prev { left: max(8px, calc(var(--gutter) - 24px)); }
.lb-next { right: max(8px, calc(var(--gutter) - 24px)); }

/* ---------- 404 ---------- */
.notfound { min-height: 56vh; display: grid; align-content: center; gap: 18px; }

/* ---------- per-game accent themes ---------- */
.g-gateblaze { --g-accent: #ff9a4d; }
.g-tile-thief { --g-accent: #f2c14e; }
.g-crownshift { --g-accent: #e8c66a; }
.g-castle-loop-td { --g-accent: #a8d26a; }
.g-time-slice { --g-accent: #e0ad62; }
.g-pocket-puzzle-vault { --g-accent: #dfb877; }
.g-tiny-beltworks { --g-accent: #f6bd2c; }
.g-ghost-elevator { --g-accent: #d9b27a; }
.g-neon-fuse { --g-accent: #4fdcff; }
.g-pocket-traffic { --g-accent: #ffcd45; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .card:hover, .btn--primary:hover { transform: none; }
}
@media (forced-colors: active) {
  .btn--primary { border: 1px solid ButtonText; }
  .slot { border: 1px solid CanvasText; }
}
