*, *::before, *::after { box-sizing: border-box; }
:root {
  color-scheme: light;
  --heading: "Trebuchet MS", "Segoe UI", sans-serif;
  --body: "Segoe UI", system-ui, sans-serif;
  --width: 1280px;
  --radius: 16px;
  --space: clamp(36px, 5.4vw, 82px);
}
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.55 var(--body); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--selection, var(--accent)); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--focus, var(--accent)); outline-offset: 4px; }
h1, h2, h3, p, figure, ul, ol { margin: 0; }
h1, h2, h3 { font-family: var(--heading); line-height: 1.04; letter-spacing: -.04em; }
h1 { font-size: clamp(2.5rem, 5.2vw, 5rem); overflow-wrap: anywhere; }
h2 { font-size: clamp(1.52rem, 2.85vw, 2.7rem); }
.shell { width: min(var(--width), calc(100% - clamp(28px, 7.2vw, 112px))); margin-inline: auto; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; top: .5rem; left: .5rem; z-index: 3; background: var(--panel); padding: .65rem 1rem; border: 1px solid var(--line); }

.header { border-bottom: 1px solid var(--line); background: var(--head, var(--bg)); }
.header-inner { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-block; flex: 0 1 252px; min-width: 0; }
.brand img { width: 252px; }
.category-nav { display: flex; align-items: center; gap: clamp(3px, .6vw, 10px); }
.category-nav a { white-space: nowrap; padding: .48rem .52rem; border-radius: 7px; font-size: .9rem; font-weight: 650; text-decoration: none; }
.category-nav a:hover, .category-nav a[aria-current], .popup-nav a:hover, .popup-nav a[aria-current] { background: var(--wash); color: var(--accent-text); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.head-button, .close { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); border-radius: 9px; min-height: 44px; min-width: 44px; padding: .36rem .58rem; font-weight: 700; }
.head-button:hover, .close:hover { background: var(--wash); }
.head-button span { font-size: 1.32rem; line-height: 1; }
.search-button span { width: 14px; height: 14px; font-size: 0; border: 2px solid currentColor; border-radius: 50%; position: relative; margin: -2px 3px 0 0; }
.search-button span::after { content: ""; position: absolute; width: 7px; height: 2px; background: currentColor; transform: rotate(46deg); transform-origin: left; top: 9px; left: 9px; }
.mobile-category { display: none; }
dialog { width: min(520px, calc(100% - 28px)); max-height: min(85vh, 730px); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 5vw, 32px); background: var(--panel); color: var(--ink); box-shadow: 0 25px 80px #12121b48; }
dialog::backdrop { background: #151825a8; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.dialog-top h2 { font-size: clamp(1.5rem, 5vw, 2.18rem); }
.close { font-size: 1.45rem; }
.popup-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.popup-nav a, #search-results a { display: block; border: 1px solid var(--line); border-radius: 8px; padding: .7rem; font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
#game-query { width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: .75rem; }
#game-query::placeholder { color: var(--muted); }
#search-status { margin: .75rem 0; color: var(--muted); }
#search-results { display: grid; gap: 5px; list-style: none; padding: 0; }
#search-results a:hover { background: var(--wash); }

#main { padding-block: clamp(22px, 3.8vw, 54px) var(--space); min-height: 55vh; }
#main:has(> .ad-placement:first-child) { display: flow-root; padding-block-start: 0; }
.hero-copy { min-width: 0; }
.eyebrow { color: var(--accent-text); text-transform: uppercase; font-size: .76rem; font-weight: 800; letter-spacing: .17em; }
.hero-copy h1 { margin-block: .16em .28em; }
.hero-copy > p:not(.eyebrow) { font-size: clamp(1rem, 1.42vw, 1.16rem); max-width: 52ch; }
.feature-card { min-width: 0; display: block; position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); text-decoration: none; }
.feature-card > img { width: 100%; aspect-ratio: 3/2; height: auto; object-fit: cover; border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.feature-copy { display: flex; flex-direction: column; align-items: flex-start; padding: clamp(.9rem, 2vw, 1.5rem); min-width: 0; }
.feature-copy > span:first-child { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: .71rem; font-weight: 750; }
.feature-copy > strong { font-family: var(--heading); font-size: clamp(1.4rem, 2.7vw, 2.45rem); letter-spacing: -.04em; line-height: 1.08; margin-block: .23em; }
.feature-copy > small { font-size: .94rem; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; max-width: 100%; width: fit-content; min-height: 44px; border: 1px solid transparent; border-radius: 999px; background: var(--accent); color: var(--accent-ink); text-decoration: none; padding: .54rem 1rem; font-weight: 780; }
.feature-copy .button { margin-top: .8rem; }
.feature-card:hover .button, a.button:hover { filter: brightness(.90); }
.hero-side h2 { font-size: clamp(1.23rem, 1.8vw, 1.55rem); margin-bottom: .74rem; }

.shelf { margin-top: var(--space); min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px 20px; margin-bottom: clamp(13px, 2vw, 24px); }
.section-head p { margin-top: .5em; max-width: 63ch; color: var(--muted); }
.more { display: inline-flex; align-items: center; width: fit-content; gap: .35rem; font-size: .88rem; min-height: 40px; font-weight: 750; color: var(--accent-text); text-decoration: none; white-space: nowrap; }
.more:hover { text-decoration: underline; text-underline-offset: .2em; }
.grid { --card-gap: clamp(8px, 1.35vw, 18px); display: flex; flex-wrap: wrap; gap: var(--card-gap); padding: 0; list-style: none; }
.grid > li { min-width: 0; flex: 1 1 calc((100% + var(--card-gap)) / var(--columns) - var(--card-gap) - .1px); }
.grid-tile { --columns: 6; }
.grid-brief, .grid-line { --columns: 3; }
.grid-small { --columns: 4; }
.hero-side .grid-line { --columns: 1; --card-gap: .55rem; }
.game-card { display: grid; width: 100%; height: 100%; min-width: 0; position: relative; align-items: start; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); text-decoration: none; }
.game-card:hover { border-color: var(--accent-text); }
.game-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-top-left-radius: calc(var(--radius) - 1px); border-top-right-radius: calc(var(--radius) - 1px); }
.card-tile img, .card-small img { max-height: clamp(112px, 17vw, 202px); }
.card-copy { min-width: 0; padding: .61rem .7rem; overflow-wrap: anywhere; }
.card-copy strong { display: block; font-size: .96rem; line-height: 1.28; }
.card-copy small { display: block; margin-top: .32rem; color: var(--muted); font-size: .84rem; line-height: 1.38; }
.card-arrow { color: var(--accent-text); line-height: 1; font-weight: 700; }
.card-tile .card-arrow, .card-small .card-arrow { display: none; }
.card-small .card-copy strong { font-size: .875rem; }
.card-line, .card-brief { grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: .15rem; padding: .45rem .55rem; }
.card-brief { grid-template-columns: 78px minmax(0, 1fr) auto; align-items: center; }
.card-line img, .card-brief img { aspect-ratio: 1; border-radius: min(8px, calc(var(--radius) - 1px)); }
.catalog { margin-top: var(--space); }
.catalog-intro { border-bottom: 1px solid var(--line); padding-bottom: 1.1rem; }
.catalog-intro p { margin-top: .55rem; max-width: 72ch; color: var(--muted); }
.category-shelves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 4vw, 56px); margin-top: 1.5rem; }
.category-shelves .shelf { margin: 0; }
.category-shelves .section-head h2 { font-size: clamp(1.35rem, 2.2vw, 1.95rem); }
.category-shelves .section-head p { font-size: .9rem; }
.ad-placement { display: flex; justify-content: safe center; margin-block: 50px; }
.ad-placement + .shelf { margin-top: 0; }

.breadcrumbs { margin-bottom: 1.15rem; color: var(--muted); font-size: .875rem; }
.breadcrumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 5px 9px; }
.breadcrumbs li:not(:first-child)::before { content: "/"; margin-right: 9px; opacity: .75; }
.breadcrumbs a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.category-hero { padding: clamp(22px, 4vw, 53px); border: 1px solid var(--line); background: var(--wash); border-radius: var(--radius); display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.category-hero p { margin-top: .65rem; max-width: 64ch; }
.category-hero h1 { font-size: clamp(2.3rem, 4.9vw, 4.3rem); }
.count { white-space: nowrap; font-size: .82rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); padding: .35rem .75rem; font-weight: 750; }
.all-games { margin-top: 1.4rem; }
.detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: clamp(12px, 2vw, 26px); align-items: stretch; }
.detail-lead, .detail-aside { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 3.2vw, 42px); min-width: 0; }
.detail-lead { display: grid; grid-template-columns: minmax(106px, 174px) minmax(0, 1fr); gap: clamp(14px, 2.8vw, 36px); align-items: center; }
.detail-lead figure { width: 100%; max-width: 174px; }
.detail-lead img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: min(var(--radius), 16px); }
.detail-summary > h1 { font-size: clamp(1.9rem, 4.1vw, 3.8rem); margin-block: .15em .31em; }
.detail-summary > p:not(.eyebrow), .detail-aside p { color: var(--muted); }
.detail-aside h2 { font-size: clamp(1.38rem, 2.2vw, 1.85rem); }
.detail-aside p { margin-top: .72rem; }
.play-button { margin-top: 1.05rem; }
.game-guide > h2 { margin-bottom: clamp(14px, 2.2vw, 24px); }
.guide-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2vw, 24px); }
.guide-card { padding: clamp(15px, 2.6vw, 30px); background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent-text); border-radius: var(--radius); }
.guide-card h3 { font-size: clamp(1.16rem, 2vw, 1.6rem); }
.guide-card p { margin-top: .6rem; color: var(--muted); }
.player-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 1rem; }
.player-head h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
.player-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.25rem; }
.player-frame { display: flex; flex-direction: column; background: #13141a; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.player-toolbar { display: flex; justify-content: flex-end; padding: 6px 10px; color: var(--ink); background: var(--panel); }
.player-frame iframe { display: block; border: 0; width: 100%; height: clamp(320px, 72svh, 780px); }
.player-frame:fullscreen, .player-frame.is-expanded { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
.player-frame.is-expanded { position: fixed; inset: 0; z-index: 20; }
.player-frame:fullscreen iframe, .player-frame.is-expanded iframe { flex: 1; height: auto; min-height: 0; }
body:has(.player-frame.is-expanded) { overflow: hidden; }
.player-note { margin-top: 1rem; color: var(--muted); }
.info { max-width: 880px; margin-inline: auto; padding: clamp(18px, 5vw, 56px); border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.info > header { padding-bottom: clamp(20px, 3vw, 35px); border-bottom: 1px solid var(--line); }
.info h1 { font-size: clamp(2.25rem, 5vw, 4.4rem); }
.info header p { margin-top: .65rem; color: var(--muted); }
.info section, .info > p { margin-top: 1.6rem; }
.info h2 { font-size: clamp(1.32rem, 2.6vw, 1.85rem); }
.info section p, .info ul { margin-top: .65rem; }
.info ul { padding-left: 1.35rem; }
.info li + li { margin-top: .45rem; }
.info a:not(.button), .player-note a { color: var(--accent-text); text-underline-offset: .18em; overflow-wrap: anywhere; }
.footer { background: var(--head, var(--bg)); border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 22px; min-height: 104px; padding-block: 20px; }
.footer .brand { flex-basis: 218px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 7px 18px; }
.footer nav a { text-underline-offset: 3px; font-size: .875rem; }
.footer-credit { display: grid; gap: .16rem; color: var(--muted); }
.footer-affiliation { font-size: .875rem; }

@media (max-width: 1000px) {
  .category-nav { display: none; }
  .mobile-category { display: inline-flex; }
  .grid-tile { --columns: 4; }
}
@media (max-width: 740px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { min-height: 63px; }
  .brand { flex-basis: 220px; }
  .category-shelves { grid-template-columns: 1fr; }
  .grid-tile { --columns: 3; }
  .grid-brief, .grid-line { --columns: 2; }
  .detail { grid-template-columns: 1fr; }
  .detail-lead { grid-template-columns: minmax(86px, 122px) minmax(0, 1fr); }
  .guide-cards { grid-template-columns: 1fr; }
  .footer-inner { justify-content: flex-start; }
  .footer-credit { flex-basis: 100%; }
}
@media (max-width: 480px) {
  .header-inner, .header-actions { gap: 5px; }
  .head-button { font-size: .78rem; padding-inline: .4rem; }
  .search-button { min-width: 42px; }
  .category-hero { display: grid; justify-items: start; }
  .grid-tile, .grid-small { --columns: 2; }
  .grid-brief { --columns: 1; }
  .ad-placement { margin-inline: -14px; overflow-x: auto; }
  .card-line { grid-template-columns: 37px minmax(0, 1fr) auto; padding: .4rem; gap: .2rem; }
  .card-line .card-copy { padding: .31rem; }
  .card-line .card-copy strong { font-size: .81rem; }
  .card-line .card-arrow { font-size: .82rem; }
  .shelf .section-head { align-items: flex-start; }
  .section-head .more { align-self: flex-start; line-height: 1.2; min-height: 0; padding-top: .23rem; }
  .detail-lead figure { align-self: start; }
}
@media (max-width: 356px) {
  .grid-line { --columns: 1; }
}
