/* WebGames portal: dense arcade shelves, original media, and CSS-only previews. */
:root {
  --bg: #080b18;
  --bg-raised: #0d1225;
  --surface: #141a31;
  --surface-2: #1c2442;
  --border: #2a3458;
  --text: #f7f4ff;
  --text-dim: #b5bdd9;
  --primary: #8da2ff;
  --accent: #ffcc4d;
  --mint: #55e6b2;
  --pink: #ff7aa8;
  --focus: #fff2a8;
  --radius: 18px;
  --radius-sm: 11px;
  --maxw: 1440px;
  --sidebar: 220px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(circle at 78% -10%, rgba(141, 162, 255, 0.16), transparent 30rem),
    radial-gradient(circle at -10% 22%, rgba(255, 122, 168, 0.1), transparent 26rem),
    var(--bg);
  font: 500 16px/1.55 "Aptos", "Trebuchet MS", system-ui, sans-serif;
}

html.portal-pseudo-fullscreen,
body.portal-pseudo-fullscreen {
  overflow: hidden;
  overscroll-behavior: none;
}

h1, h2, h3 { margin: 0; font-family: "Trebuchet MS", system-ui, sans-serif; line-height: 1.08; }
h1 { font-size: clamp(2.15rem, 5vw, 4.6rem); letter-spacing: -0.055em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -0.035em; }
h3 { font-size: 1.08rem; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
[hidden] { display: none !important; }

.container, .header-inner, .portal-layout { width: min(100% - 32px, var(--maxw)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 1000; padding: 10px 16px; color: #080b18; background: var(--focus); border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(181, 189, 217, 0.16);
  background: rgba(8, 11, 24, 0.9);
  backdrop-filter: blur(18px);
}
.header-inner { min-height: 64px; display: grid; grid-template-columns: auto minmax(220px, 420px) auto; gap: 18px; align-items: center; }
.brand { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; color: var(--text); font: 800 1.25rem/1 "Trebuchet MS", sans-serif; letter-spacing: -0.04em; }
.brand:hover { color: var(--text); }
.brand-mark { width: 46px; height: 38px; flex: 0 0 auto; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.28)); }
.brand-copy { display: grid; gap: 1px; }
.brand-family { font-size: 1.08rem; }
.brand-product { color: var(--accent); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; }
.header-search input { width: 100%; min-height: 44px; padding: 9px 15px 9px 40px; color: var(--text); border: 1px solid var(--border); border-radius: 999px; background: var(--surface) radial-gradient(circle at 21px 50%, transparent 5px, var(--text-dim) 6px, transparent 7px); }
.header-search input::placeholder { color: #929bbd; }
.site-nav { display: flex; justify-content: flex-end; gap: 2px; }
.site-nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 10px; color: var(--text-dim); font-weight: 750; border-radius: 10px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.category-topbar { border-top: 1px solid rgba(181, 189, 217, 0.1); }
.category-topnav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding-block: 5px 7px; }
.category-topnav a { min-width: 0; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 10px; color: var(--text-dim); border: 1px solid transparent; border-radius: 11px; font-weight: 800; text-align: center; }
.category-topnav a:hover, .category-topnav a[aria-current="page"] { color: var(--text); background: var(--surface); border-color: var(--border); }
.category-icon { min-width: 26px; color: var(--primary); font-weight: 900; text-align: center; }

.portal-layout { display: grid; gap: clamp(24px, 3vw, 52px); align-items: start; }
.portal-layout.category-layout-top { grid-template-columns: minmax(0, 1fr); }
.portal-layout.category-layout-sidebar { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.portal-main { min-width: 0; padding-block: 18px 48px; }
.browse-page .portal-main { padding-top: 10px; }
.category-sidebar { min-width: 0; position: sticky; top: 88px; padding: 20px 0; }
.sidebar-label, .eyebrow, .card-kicker { color: var(--accent); font-size: 0.7rem; font-weight: 850; letter-spacing: 0.14em; text-transform: uppercase; }
.category-sidebar nav { display: grid; gap: 7px; margin-top: 10px; }
.category-sidebar a { min-height: 44px; display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: center; padding: 7px 10px; color: var(--text-dim); font-weight: 750; border: 1px solid transparent; border-radius: 11px; }
.category-sidebar a span { color: var(--primary); font-weight: 900; text-align: center; }
.category-sidebar a:hover, .category-sidebar a[aria-current="page"] { color: var(--text); background: var(--surface); border-color: var(--border); }

.home-intro { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 4px 0 12px; }
.home-intro h1 { margin-top: 4px; font-size: clamp(1.75rem, 3vw, 2.6rem); letter-spacing: -0.045em; }
.home-intro > p:last-child { max-width: 54ch; color: var(--text-dim); font-size: 0.94rem; text-align: right; }
.page-heading > p:last-child { max-width: 62ch; margin-top: 10px; color: var(--text-dim); font-size: 1rem; }
.catalog-section { padding: 0; }

.block { padding-top: clamp(38px, 6vw, 68px); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-head .eyebrow { margin-bottom: 5px; }
.section-head > a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 800; white-space: nowrap; }
.page-heading { padding: 24px 0 6px; }
.page-heading h1 { margin-top: 7px; }
.browse-page .page-heading { padding: 8px 0 2px; }
.browse-page .page-heading h1 { margin-top: 4px; font-size: clamp(1.75rem, 3vw, 2.6rem); }
.browse-page .crumb { padding-top: 0; }
.browse-catalog { padding-top: 14px; }
.crumb { padding-top: 2px; color: var(--text-dim); font-size: 0.9rem; }
.crumb a { color: var(--text-dim); }

.game-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.game-grid:has(> .game-card:first-child:last-child) { grid-template-columns: minmax(0, 360px); justify-content: start; }
.game-grid:has(> .game-card:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 360px)); justify-content: start; }
.game-grid:has(> .game-card:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 350px)); justify-content: start; }
.game-grid:has(> .game-card:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.game-grid:has(> .game-card:nth-child(5)):not(:has(> .game-card:nth-child(9))) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.game-grid:has(> .game-card:nth-child(9)):not(:has(> .game-card:nth-child(17))) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.game-grid:has(> .game-card:nth-child(17)) { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.portal-layout.category-layout-sidebar .game-grid:has(> .game-card:nth-child(17)) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.card { min-width: 0; overflow: hidden; display: flex; flex-direction: column; color: var(--text); border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 7px 18px rgba(0, 0, 0, 0.16); }
.card-link { height: 100%; min-width: 0; display: flex; flex-direction: column; color: inherit; }
.card-link:hover { color: inherit; }
.game-card:has(.card-link) { transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
.game-card:has(.card-link):hover, .game-card:has(.card-link):focus-within { transform: translateY(-2px); border-color: var(--primary); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24); }
.thumb { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; color: var(--primary); background: var(--surface-2); font-weight: 800; text-align: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.game-preview-video { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; }
.thumb.is-preview-playing .game-preview-video { opacity: 1; }
@media (prefers-reduced-motion: no-preference) { .game-preview-video { transition: opacity 90ms linear; } }
.game-card .body { min-height: 46px; flex: 1; display: flex; align-items: center; padding: 7px 10px 9px; }
.game-card .body h3 { min-width: 0; margin: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--text); font-size: clamp(0.8rem, 1.05vw, 0.98rem); line-height: 1.2; }
.discovery-card .body { min-height: 112px; display: block; padding: 10px 12px 12px; }
.card-description { margin: 7px 0 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; color: var(--text-dim); font-size: 0.78rem; line-height: 1.35; }
.game-grid.discovery-grid:has(> .game-card:first-child:last-child) { grid-template-columns: minmax(0, 420px); }
.game-grid.discovery-grid:has(> .game-card:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 380px)); }
.game-grid.discovery-grid:has(> .game-card:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 350px)); }
.game-grid.discovery-grid:has(> .game-card:nth-child(4):last-child),
.game-grid.discovery-grid:has(> .game-card:nth-child(5)):not(:has(> .game-card:nth-child(9))),
.game-grid.discovery-grid:has(> .game-card:nth-child(9)):not(:has(> .game-card:nth-child(17))),
.game-grid.discovery-grid:has(> .game-card:nth-child(17)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.thumb-fallback-title { padding: 12px; }
.tile-badge { position: absolute; top: 7px; left: 7px; z-index: 2; min-height: 24px; display: inline-flex; align-items: center; padding: 3px 8px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 999px; color: var(--text); background: rgba(8, 11, 24, 0.78); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); font-size: 0.62rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; pointer-events: none; }
.tile-badge.review { color: var(--accent); }
.badge { width: max-content; display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: 0.68rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.badge.review { color: var(--accent); }
.badge.published { color: var(--mint); }

.btn { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 10px 18px; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-weight: 850; cursor: pointer; }
.btn:hover { color: var(--text); filter: brightness(1.08); }
.btn.primary { color: #090c18; border-color: transparent; background: var(--accent); }
.play-wrap { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(240px, 0.7fr); gap: 28px; padding-top: 24px; }
.embed-frame { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #000; box-shadow: var(--shadow); }
.embed-frame.portrait { max-width: 430px; aspect-ratio: 9 / 16; margin-inline: auto; }
.embed-frame iframe { width: 100%; height: 100%; display: block; border: 0; }
.play-page[data-game-page="minesweeper"] .play-wrap { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.play-page[data-game-page="minesweeper"] .play-wrap > aside { min-width: 0; }
.embed-frame[data-game-frame="minesweeper"] { aspect-ratio: auto; height: clamp(760px, 82dvh, 860px); }
.embed-frame[data-game-frame="reckon-rush"] { aspect-ratio: auto; height: clamp(568px, 78dvh, 720px); }
.embed-frame[data-game-frame="hidden-3d"] { aspect-ratio: auto; height: clamp(568px, 78dvh, 720px); }

.embed-frame[data-game-frame="tenthread"] { aspect-ratio: auto; height: clamp(568px, 78dvh, 720px); }

.embed-frame[data-game-frame="signal-scribe"] { aspect-ratio: auto; height: clamp(680px, 78dvh, 720px); }

.embed-frame[data-game-frame="clue-circuit"] { aspect-ratio: auto; height: 820px; }
.play-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
[data-fullscreen] [data-fullscreen-icon] { display: inline-grid; place-items: center; min-width: 1.1em; }
.embed-frame:fullscreen,
.embed-frame:-webkit-full-screen {
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #000;
}
body.portal-pseudo-fullscreen .embed-frame[data-pseudo-fullscreen="true"] {
  position: absolute;
  left: var(--portal-fullscreen-left, 0px);
  top: var(--portal-fullscreen-top, 0px);
  z-index: 1000;
  width: var(--portal-fullscreen-width, 100vw);
  height: var(--portal-fullscreen-height, 100dvh);
  max-width: none;
  margin: 0;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #000;
}
body.portal-pseudo-fullscreen [data-fullscreen][data-fullscreen-active="pseudo"] {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 1002;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  color: #fff;
  background: rgba(8, 11, 24, 0.72);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
}
body.portal-pseudo-fullscreen [data-fullscreen][data-fullscreen-active="pseudo"] [data-fullscreen-icon] {
  font-size: 1.2rem;
}
body.portal-pseudo-fullscreen [data-fullscreen][data-fullscreen-active="pseudo"] [data-fullscreen-label] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.fullscreen-exit {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 4;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  color: #fff;
  background: rgba(8, 11, 24, 0.72);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
}
body.portal-pseudo-fullscreen [data-fullscreen][data-fullscreen-active="pseudo"] { display: none; }
.play-section { margin-top: 26px; }
.play-section h2 { margin-bottom: 9px; font-size: 1.2rem; }
.play-section p, .play-section li { color: var(--text-dim); }
.play-editorial ul { margin: 0; padding-left: 1.25rem; }
.play-editorial li + li { margin-top: 8px; }
.faq-list { display: grid; gap: 16px; }
.faq-item h3 { margin-bottom: 5px; font-size: 1rem; }
.faq-item p { margin: 0; }
.home-publisher { max-width: 920px; }
.catalog-guide { max-width: 920px; margin-top: 14px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.catalog-guide h2 { margin-bottom: 8px; font-size: 1.05rem; }
.catalog-guide p { margin: 6px 0 0; color: var(--text-dim); }
.selection-guidance { max-width: 920px; margin-top: 7px; color: var(--text-dim); }
.home-publisher > p + p { margin-top: 10px; }
.editorial-guides { max-width: 1040px; }
.editorial-guides-intro { max-width: 72ch; color: var(--text-dim); }
.guide-teaser-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.category-guides .guide-teaser-grid { grid-template-columns: minmax(0, 680px); }
.guide-teaser { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.guide-teaser h3 { font-size: 1.15rem; }
.guide-teaser p { margin-top: 8px; color: var(--text-dim); }
.guide-teaser a { display: inline-flex; margin-top: 12px; font-weight: 800; }
.guide-main { width: 100%; }
.guide-article { max-width: 980px; }
.guide-heading > p:not(.eyebrow) { max-width: 76ch; }
.guide-byline { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; color: var(--text-dim); font-size: 0.86rem; }
.guide-scope, .guide-section, .guide-footer { margin-top: 24px; }
.guide-scope { padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.guide-scope h2, .guide-section h2, .guide-footer h2 { margin-bottom: 9px; font-size: 1.25rem; }
.guide-scope p, .guide-section > p, .guide-footer p, .guide-item p { color: var(--text-dim); }
.guide-scope p + p, .guide-footer p + p { margin-top: 9px; }
.guide-question { color: var(--text) !important; font-weight: 750; }
.guide-item-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.guide-item { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.guide-mechanic { margin-bottom: 6px; color: var(--accent) !important; font-size: 0.72rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.guide-item h3 a { color: var(--text); }
.guide-item h3 a:hover { color: var(--accent); }
.guide-item p:last-child { margin-top: 8px; }
.game-grid.related-grid:has(> .game-card) { grid-template-columns: 1fr; justify-content: stretch; }
.ad-slot { padding: 18px; color: var(--text-dim); border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface); text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; padding: 5px 10px; color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 0.78rem; }

.search-box { max-width: 680px; display: block; margin-bottom: 24px; }
.search-box input { width: 100%; min-height: 52px; padding: 12px 16px; color: var(--text); border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font-size: 1rem; }
.empty-state { grid-column: 1 / -1; padding: 34px 0; color: var(--text-dim); }
.legal-page { max-width: 920px; width: 100%; }
.legal-page > .block { padding-top: 30px; }
.contact-launch-note { padding: 8px 0; text-align: left; }

.site-footer { border-top: 1px solid var(--border); background: rgba(8, 11, 24, 0.5); }
.site-footer .container { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--text-dim); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: var(--text-dim); font-weight: 700; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

@media (max-width: 1120px) {
  .header-inner { grid-template-columns: auto minmax(180px, 1fr) auto; gap: 10px; }
  .portal-layout.category-layout-sidebar { grid-template-columns: 1fr; gap: 0; }
  .category-sidebar { position: static; padding: 18px 0 0; }
  .category-sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .site-header { position: static; }
  .category-topbar { position: relative; }
  .category-topbar::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 38px; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(8, 11, 24, 0.96)); }
  .category-topnav { display: flex; gap: 6px; overflow-x: auto; padding: 5px 2px 7px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .category-topnav::-webkit-scrollbar { display: none; }
  .category-topnav a { min-width: 160px; flex: 0 0 auto; scroll-snap-align: start; }
  .site-nav a:nth-child(-n+3) { display: none; }
  .home-intro { align-items: flex-start; }
  .game-grid:has(> .game-card:nth-child(2):last-child),
  .game-grid:has(> .game-card:nth-child(3):last-child),
  .game-grid:has(> .game-card:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; }
  .game-grid:has(> .game-card:nth-child(5)):not(:has(> .game-card:nth-child(9))) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-grid:has(> .game-card:nth-child(9)):not(:has(> .game-card:nth-child(17))),
  .game-grid:has(> .game-card:nth-child(17)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .game-grid.discovery-grid:has(> .game-card:nth-child(5)):not(:has(> .game-card:nth-child(9))),
  .game-grid.discovery-grid:has(> .game-card:nth-child(9)):not(:has(> .game-card:nth-child(17))),
  .game-grid.discovery-grid:has(> .game-card:nth-child(17)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .play-wrap { grid-template-columns: 1fr; }
  .play-page .category-sidebar, .play-page .category-topbar { display: none; }
  .play-page .portal-main { padding-top: 12px; }
  .play-page .play-wrap { padding-top: 12px; }
  .play-page[data-game-page="minesweeper"] .portal-layout,
  .play-page[data-game-page="tenthread"] .portal-layout { width: 100%; }
  .embed-frame[data-game-frame="minesweeper"] { height: clamp(820px, 92dvh, 900px); }
  .embed-frame[data-game-frame="signal-scribe"] { height: clamp(568px, 78dvh, 720px); }
  .embed-frame[data-game-frame="clue-circuit"] { height: 920px; }
}

@media (max-width: 680px) {
  .container, .header-inner, .portal-layout { width: min(100% - 20px, var(--maxw)); }
  .header-inner { min-height: 0; grid-template-columns: 1fr auto; gap: 6px 8px; padding-block: 7px; }
  .brand { min-height: 44px; }
  .brand-mark { width: 42px; height: 36px; }
  .brand-family { font-size: 1rem; }
  .brand-product { font-size: 0.58rem; }
  .header-search { grid-column: 1 / -1; grid-row: 2; }
  .site-nav { grid-column: 1 / -1; grid-row: 3; width: 100%; min-width: 0; justify-content: flex-start; gap: 0; overflow-x: auto; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex: 0 0 auto; padding-inline: 8px; font-size: 0.8rem; }
  .site-nav a:nth-child(-n+3) { display: none; }
  .category-topnav { gap: 5px; padding-block: 4px 6px; }
  .category-topnav a { min-width: 148px; min-height: 44px; padding: 5px 9px; }
  .category-sidebar nav { width: 100%; max-width: 100%; display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
  .category-sidebar a { min-width: 150px; }
  .home-intro { display: grid; gap: 2px; padding: 2px 0 9px; }
  .home-intro h1 { margin-top: 2px; font-size: 1.55rem; }
  .home-intro > p:last-child { display: none; }
  .game-grid { gap: 10px; }
  .game-grid:has(> .game-card:nth-child(2):last-child),
  .game-grid:has(> .game-card:nth-child(3):last-child),
  .game-grid:has(> .game-card:nth-child(4):last-child),
  .game-grid:has(> .game-card:nth-child(5)):not(:has(> .game-card:nth-child(9))),
  .game-grid:has(> .game-card:nth-child(9)):not(:has(> .game-card:nth-child(17))),
  .game-grid:has(> .game-card:nth-child(17)) { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; }
  .game-card .body { min-height: 42px; padding: 6px 8px 8px; }
  .game-card .body h3 { font-size: 0.78rem; }
  .game-grid.discovery-grid:has(> .game-card:nth-child(2):last-child),
  .game-grid.discovery-grid:has(> .game-card:nth-child(3):last-child),
  .game-grid.discovery-grid:has(> .game-card:nth-child(4):last-child),
  .game-grid.discovery-grid:has(> .game-card:nth-child(5)):not(:has(> .game-card:nth-child(9))),
  .game-grid.discovery-grid:has(> .game-card:nth-child(9)):not(:has(> .game-card:nth-child(17))),
  .game-grid.discovery-grid:has(> .game-card:nth-child(17)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .discovery-card .body { min-height: 108px; padding: 8px 9px 10px; }
  .card-description { font-size: 0.76rem; -webkit-line-clamp: 4; }
  .tile-badge { top: 5px; left: 5px; min-height: 22px; padding: 2px 6px; font-size: 0.56rem; }
  .browse-page .page-heading > p:last-child { display: none; }
  .browse-page .page-heading > p.selection-guidance:last-child { display: block; }
  .browse-catalog { padding-top: 10px; }
  .section-head { align-items: flex-start; }
  .section-head > a { display: none; }
  .guide-teaser-grid, .guide-item-grid { grid-template-columns: 1fr; }
  .guide-teaser, .guide-item, .guide-scope { padding: 14px; }
  .guide-byline { display: grid; gap: 3px; }
  .site-footer .container { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 20px; }
}

.play-page .game-grid.related-grid:has(> .game-card) { grid-template-columns: 1fr; justify-content: stretch; }

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