/* ==========================================================================
   Desi Games — main stylesheet
   Night-cabinet palette, cut-corner "cartridge" tiles.
   ========================================================================== */

:root {
	--bg: #120e2b;
	--s0: #0c0920;
	--s1: #1c1740;
	--s2: #272052;
	--s3: #322a66;
	--line: #3a3175;
	--tx: #edebff;
	--mut: #a49ed1;
	--pink: #ff3d8b;
	--pink-d: #b8195c;
	--cyan: #29d9ff;
	--gold: #ffc93c;
	--ok: #5fffc4;

	--f-display: "Chakra Petch", "Trebuchet MS", system-ui, sans-serif;
	--f-body: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--top: 64px;
	--rail: 232px;
	--gap: 14px;
	--cut: 14px;
	--pad: clamp(14px, 2.4vw, 28px);
	--radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 12px); }
body {
	margin: 0;
	background: var(--bg);
	color: var(--tx);
	font: 400 16px/1.55 var(--f-body);
	-webkit-font-smoothing: antialiased;
}
img, svg, iframe { display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
[hidden] { display: none !important; }

.icon { width: 20px; height: 20px; flex: none; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link {
	position: absolute; left: 12px; top: -60px; z-index: 2000;
	background: var(--pink); color: #fff; padding: 10px 16px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* --------------------------------------------------------------------------
   Buttons and chips
   -------------------------------------------------------------------------- */

.btn {
	--c: var(--pink);
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 10px 20px;
	background: var(--c); color: #fff;
	font: 700 16px/1 var(--f-display); letter-spacing: .02em;
	border: 0; cursor: pointer; text-decoration: none !important;
	clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
	transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }
.btn-ghost { --c: var(--s2); color: var(--tx); }
.btn-ghost:hover { --c: var(--s3); }
.btn-play .icon { width: 20px; height: 20px; }
.btn-xl { min-height: 56px; padding: 14px 34px; font-size: 20px; }

.icon-btn {
	display: inline-grid; place-items: center; width: 40px; height: 40px;
	background: var(--s1); border: 1px solid var(--line); border-radius: 8px;
	color: var(--tx); cursor: pointer;
}
.icon-btn:hover { background: var(--s2); }

.chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 11px; border-radius: 999px;
	background: var(--s2); color: var(--tx); font-size: 14px; font-weight: 500;
	border: 1px solid var(--line);
}
a.chip:hover { background: var(--s3); text-decoration: none; }
.chip .icon { width: 16px; height: 16px; }
.chip-gold { color: var(--gold); }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
	position: sticky; top: 0; z-index: 100;
	height: var(--top);
	display: flex; align-items: center; gap: 14px;
	padding: 0 var(--pad) 0 16px;
	background: rgba(18, 14, 43, .92);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--line);
}
.topbar .rail-toggle { display: none; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--tx); text-decoration: none !important; flex: none; }
.brand-mark { width: 38px; height: 38px; }
.brand-text {
	font: 700 18px/1.05 var(--f-display); letter-spacing: .01em;
	max-width: 11ch;
}
.custom-logo-link img { max-height: 44px; width: auto; }

.search { position: relative; flex: 1; max-width: 560px; margin: 0 auto; }
.search input {
	width: 100%; height: 44px; padding: 0 44px 0 44px;
	background: var(--s1); color: var(--tx);
	border: 1px solid var(--line); border-radius: 22px;
	font: 400 15px var(--f-body);
}
.search input::placeholder { color: var(--mut); }
.search input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(41, 217, 255, .2); }
.search-icon { position: absolute; left: 14px; top: 12px; color: var(--mut); pointer-events: none; }
.search-kbd {
	position: absolute; right: 12px; top: 11px;
	font: 600 12px/20px var(--f-body); color: var(--mut);
	border: 1px solid var(--line); border-radius: 5px; padding: 0 7px;
}
.search input:focus ~ .search-kbd { display: none; }
.search-results {
	position: absolute; left: 0; right: 0; top: calc(100% + 6px);
	background: var(--s1); border: 1px solid var(--line); border-radius: 12px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
	padding: 6px; max-height: 70vh; overflow: auto;
}
.sr-item {
	display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 8px;
	color: var(--tx); text-decoration: none !important;
}
.sr-item img { width: 56px; height: 42px; object-fit: cover; border-radius: 5px; background: var(--s2); }
.sr-item b { font-weight: 500; display: block; }
.sr-item small { color: var(--mut); }
.sr-item:hover, .sr-item[aria-selected="true"] { background: var(--s2); }
.sr-all { display: block; padding: 10px 8px 6px; font-size: 14px; }
.sr-empty { padding: 12px; color: var(--mut); margin: 0; }

.top-actions { display: flex; gap: 6px; flex: none; }
.top-btn {
	position: relative;
	display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
	color: var(--tx); border-radius: 22px; font-weight: 500; font-size: 15px;
}
.top-btn:hover { background: var(--s1); text-decoration: none; }
.fav-count {
	position: absolute; top: 4px; left: 26px;
	min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
	background: var(--pink); color: #fff; font: 700 11px/18px var(--f-body); text-align: center;
}

/* --------------------------------------------------------------------------
   Shell: rail + main
   -------------------------------------------------------------------------- */

.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }

.rail {
	position: sticky; top: var(--top);
	height: calc(100vh - var(--top)); height: calc(100dvh - var(--top));
	overflow-y: auto; overscroll-behavior: contain;
	padding: 14px 10px 40px;
	border-right: 1px solid var(--line);
	background: var(--bg);
	scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.rail-list { list-style: none; margin: 0 0 8px; padding: 0; }
.rail-list a {
	display: flex; align-items: center; gap: 12px;
	padding: 9px 12px; border-radius: 8px;
	color: var(--tx); font-weight: 500; font-size: 15px;
	text-decoration: none !important;
}
.rail-list a .icon { color: var(--mut); }
.rail-list a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-list a small { color: var(--mut); font-size: 12px; font-variant-numeric: tabular-nums; }
.rail-list a:hover { background: var(--s1); }
.rail-list a:hover .icon { color: var(--cyan); }
.rail-list a[aria-current], .rail-list .current-menu-item > a {
	background: var(--s2);
	box-shadow: inset 3px 0 0 var(--pink);
}
.rail-list a[aria-current] .icon { color: var(--pink); }
.rail-heading {
	margin: 18px 12px 6px; font: 600 13px var(--f-body); color: var(--mut); letter-spacing: .02em;
}
.rail-scrim { display: none; }

.main { min-width: 0; padding: var(--pad); padding-bottom: 0; outline: none; }

/* --------------------------------------------------------------------------
   Spotlight marquee (the one loud element)
   -------------------------------------------------------------------------- */

.spotlight {
	display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: var(--gap); margin-bottom: 34px;
}
.marquee {
	position: relative; isolation: isolate; overflow: hidden;
	min-height: clamp(280px, 34vw, 440px);
	display: flex; align-items: flex-end;
	color: #fff; text-decoration: none !important;
	background: var(--s1);
	clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
}
.marquee-bg {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
	transition: transform .6s ease;
}
.marquee:hover .marquee-bg { transform: scale(1.03); }
.marquee::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background:
		linear-gradient(90deg, rgba(12, 9, 32, .95) 0%, rgba(12, 9, 32, .72) 42%, rgba(12, 9, 32, .05) 78%),
		linear-gradient(0deg, rgba(12, 9, 32, .85) 0%, transparent 55%);
}
.marquee-scan {
	position: absolute; inset: 0; z-index: -1; pointer-events: none; mix-blend-mode: overlay; opacity: .35;
	background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .14) 0 1px, transparent 1px 3px);
}
.marquee-body { display: grid; gap: 12px; padding: clamp(20px, 3.4vw, 40px); max-width: 560px; }
.marquee-label {
	justify-self: start;
	font: 600 14px var(--f-display); color: #1a1200; background: var(--gold);
	padding: 3px 10px;
	clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
	padding-right: 16px;
}
.marquee-title {
	font: 700 clamp(32px, 4.6vw, 60px)/.98 var(--f-display);
	letter-spacing: -.005em; text-wrap: balance;
	text-shadow: 0 2px 24px rgba(0, 0, 0, .5);
}
.marquee-text { color: #d6d2f5; font-size: 16px; max-width: 46ch; }
.marquee-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.marquee-foot .chip { background: rgba(28, 23, 64, .7); backdrop-filter: blur(4px); }

.spot-side { display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: var(--gap); min-width: 0; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card { min-width: 0; }
.card-link { display: block; color: var(--tx); text-decoration: none !important; border-radius: 4px; }
.card-media {
	position: relative; display: block; overflow: hidden;
	aspect-ratio: 4 / 3; background: var(--s2);
	clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.card-play {
	position: absolute; inset: 0; display: grid; place-items: center;
	background: linear-gradient(0deg, rgba(12, 9, 32, .55), rgba(12, 9, 32, .1));
	opacity: 0; transition: opacity .18s;
}
.card-play .icon {
	width: 52px; height: 52px; padding: 13px 11px 13px 15px; border-radius: 50%;
	background: var(--pink); color: #fff; box-shadow: 0 0 0 6px rgba(255, 61, 139, .25);
}
.card-link:hover .card-media img, .card-link:focus-visible .card-media img { transform: scale(1.06); }
.card-link:hover .card-play, .card-link:focus-visible .card-play { opacity: 1; }
.card-link:hover .card-title { color: var(--cyan); }

.badge {
	position: absolute; left: 0; top: 10px;
	font: 700 12px/1 var(--f-display); padding: 5px 12px 5px 8px; color: #fff;
	clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.badge-new { background: var(--pink); }
.badge-original { background: var(--gold); color: #1a1200; }

.card-body { display: block; padding: 8px 2px 2px; }
.card-title {
	display: block; font-weight: 500; font-size: 14.5px; line-height: 1.3;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-meta { display: flex; gap: 12px; margin-top: 3px; font-size: 12.5px; color: var(--mut); min-height: 1.3em; }
.card-meta > span, .meta-plays, .meta-rating { display: inline-flex; align-items: center; gap: 4px; }
.card-meta .icon { width: 14px; height: 14px; }
.meta-plays .icon { color: var(--gold); }
.meta-rating .icon { color: var(--ok); }

/* Wide card (spotlight side): title over the image */
.card-wide, .card-wide .card-link { height: 100%; }
.card-wide .card-link { position: relative; }
.card-wide .card-media { height: 100%; aspect-ratio: auto; min-height: 140px; }
.card-wide .card-body {
	position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 12px;
	background: linear-gradient(0deg, rgba(12, 9, 32, .92), transparent);
	pointer-events: none;
}
.card-wide .card-title { font: 700 20px/1.15 var(--f-display); white-space: normal; }

/* Mini card (sidebar) */
.card-mini .card-title { font-size: 13.5px; }
.card-mini .card-meta { display: none; }

/* --------------------------------------------------------------------------
   Shelves
   -------------------------------------------------------------------------- */

.shelf { margin-bottom: 36px; }
.shelf-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.shelf-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 22px; flex: 1; min-width: 0; }
.shelf-head h2 .icon { color: var(--pink); width: 22px; height: 22px; }
.shelf-link { font-weight: 500; font-size: 15px; white-space: nowrap; }
.shelf-nav { display: flex; gap: 6px; }
.shelf-nav .icon-btn { width: 34px; height: 34px; }

.grid {
	display: grid; gap: 18px var(--gap);
	grid-template-columns: repeat(auto-fill, minmax(min(176px, 44vw), 1fr));
}
.rail-scroll {
	display: grid; grid-auto-flow: column; grid-auto-columns: clamp(150px, 17vw, 220px);
	gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory;
	padding-bottom: 8px; margin-bottom: -8px;
	scrollbar-width: none; overscroll-behavior-x: contain;
}
.rail-scroll::-webkit-scrollbar { display: none; }
.rail-scroll > * { scroll-snap-align: start; }

.load-more-wrap { display: flex; justify-content: center; margin: 28px 0 40px; }
.load-more { min-width: 220px; }
.load-more[aria-busy="true"] { opacity: .6; pointer-events: none; }

/* --------------------------------------------------------------------------
   Page heads, sort tabs, empty states
   -------------------------------------------------------------------------- */

.page-head { margin: 4px 0 24px; display: grid; gap: 4px; }
.page-head h1 { font-size: clamp(28px, 3.4vw, 40px); margin: 0; }
.page-head p { color: var(--mut); margin: 0; max-width: 70ch; }
.page-icon {
	display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 6px;
	background: var(--s2); color: var(--pink);
	clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.page-icon .icon { width: 28px; height: 28px; }

.sort-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.sort-tabs a {
	padding: 8px 16px; border-radius: 999px; font-weight: 500; font-size: 15px;
	color: var(--tx); background: var(--s1); border: 1px solid var(--line);
	text-decoration: none !important;
}
.sort-tabs a:hover { background: var(--s2); }
.sort-tabs a[aria-current] { background: var(--tx); color: var(--bg); border-color: var(--tx); }

.empty-state {
	text-align: center; padding: clamp(32px, 6vw, 72px) 20px;
	background: var(--s1); border: 1px dashed var(--line); border-radius: var(--radius);
	margin-bottom: 36px; display: grid; justify-items: center; gap: 4px;
}
.empty-state h1, .empty-state h2 { font-size: clamp(22px, 3vw, 32px); }
.empty-state p { color: var(--mut); max-width: 52ch; }
.empty-state .big-code {
	font: 700 clamp(80px, 16vw, 160px)/1 var(--f-display); margin: 0;
	color: transparent; -webkit-text-stroke: 2px var(--pink);
	text-shadow: 4px 4px 0 rgba(41, 217, 255, .5);
}
.inline-search { display: flex; gap: 8px; width: min(100%, 440px); margin: 8px auto 16px; }
.inline-search input {
	flex: 1; min-width: 0; height: 44px; padding: 0 14px;
	background: var(--bg); color: var(--tx); border: 1px solid var(--line); border-radius: 8px; font: inherit;
}

.about {
	margin: 10px 0 40px; padding: clamp(20px, 3vw, 32px);
	background: var(--s1); border-radius: var(--radius);
	border-left: 4px solid var(--pink);
}
.about h1 { font-size: 24px; }
.about p { color: var(--mut); max-width: 72ch; }
.cat-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }

/* All-categories page */
.cat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); margin-bottom: 40px; }
.cat-tile {
	display: grid; gap: 6px; padding: 12px; background: var(--s1);
	border: 1px solid var(--line); border-radius: var(--radius); color: var(--tx);
	text-decoration: none !important;
}
.cat-tile:hover { border-color: var(--pink); }
.cat-covers { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; }
.cat-covers img { width: 100%; height: 100%; object-fit: cover; }
.cat-covers img:first-child { grid-row: span 2; }
.cat-name { display: flex; align-items: center; gap: 8px; font: 700 19px var(--f-display); }
.cat-name .icon { color: var(--pink); }
.cat-tile small { color: var(--mut); }

/* --------------------------------------------------------------------------
   Game page
   -------------------------------------------------------------------------- */

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.theater .game-layout { grid-template-columns: minmax(0, 1fr); }
.theater .game-side .side-grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--mut); margin-bottom: 12px; }
.crumbs a { color: var(--mut); }
.crumbs a:hover { color: var(--cyan); }
.crumbs [aria-current] { color: var(--tx); }

.player { position: relative; background: var(--s0); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.player-stage {
	position: relative; margin: 0 auto;
	aspect-ratio: var(--arn, 1.7778);
	width: min(100%, calc((100vh - var(--top) - 190px) * var(--arn, 1.7778)));
	width: min(100%, calc((100dvh - var(--top) - 190px) * var(--arn, 1.7778)));
	min-height: 320px; max-height: calc(100dvh - var(--top) - 40px);
}
.player-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-poster { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.poster-bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); max-width: none; object-fit: cover; filter: blur(28px) saturate(1.3) brightness(.45); }
.poster-card { position: relative; display: grid; justify-items: center; gap: 14px; text-align: center; padding: 20px; }
.poster-card img {
	width: clamp(140px, 22vw, 220px); aspect-ratio: 4 / 3; height: auto; object-fit: cover;
	clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
	box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.poster-title { font: 700 clamp(20px, 2.6vw, 30px)/1.1 var(--f-display); margin: 0; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.player.is-playing .player-poster { display: none; }
.player.is-loading .player-stage::after {
	content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px;
	border: 4px solid var(--s3); border-top-color: var(--pink); border-radius: 50%;
	animation: spin .8s linear infinite; z-index: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.player.is-fs, .player:fullscreen {
	position: fixed; inset: 0; z-index: 1000; border-radius: 0; background: #000;
	display: flex; align-items: center; justify-content: center;
}
.player.is-fs .player-stage, .player:fullscreen .player-stage {
	width: min(100vw, calc(100dvh * var(--arn, 1.7778))); max-height: 100dvh; min-height: 0;
}
.player-exit { position: absolute; top: 10px; right: 10px; z-index: 5; background: rgba(12, 9, 32, .8); }
.no-scroll { overflow: hidden; }

.player-bar {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
	padding: 12px 14px; background: var(--s1);
	border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius);
	margin-bottom: 22px;
}
.pb-title { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 260px; }
.pb-title img { width: 56px; height: 42px; object-fit: cover; border-radius: 5px; flex: none; }
.pb-title h1 { font-size: 22px; margin: 0; overflow-wrap: anywhere; }
.pb-title p { margin: 2px 0 0; display: flex; gap: 14px; font-size: 14px; color: var(--mut); }
.pb-title .icon { width: 15px; height: 15px; }
.pb-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vote { display: flex; }
.vote .pb-btn:first-child { border-radius: 8px 0 0 8px; }
.vote .pb-btn:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.pb-btn {
	display: inline-flex; align-items: center; gap: 7px; height: 40px; min-width: 40px; padding: 0 11px;
	justify-content: center;
	background: var(--s2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
	font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.pb-btn:hover { background: var(--s3); }
.pb-btn[aria-pressed="true"] { background: var(--tx); color: var(--bg); border-color: var(--tx); }
.pb-btn[data-fav][aria-pressed="true"] { background: var(--pink); border-color: var(--pink); color: #fff; }
.pb-btn[data-fav][aria-pressed="true"] .icon { fill: currentColor; }

.game-info {
	display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 8px 32px;
	padding: 22px 24px; background: var(--s1); border-radius: var(--radius); margin-bottom: 36px;
}
.game-info h2 { font-size: 19px; }
.game-info .prose, .gi-how p { color: #cfcaef; }
.gi-how { border-left: 1px solid var(--line); padding-left: 24px; }
.game-info .tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; }

.game-side { position: sticky; top: calc(var(--top) + 16px); display: grid; gap: 16px; }
.side-title { font-size: 18px; margin: 4px 0 0; }
.side-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }

.report-dialog {
	width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 14px;
	background: var(--s1); color: var(--tx);
}
.report-dialog::backdrop { background: rgba(6, 4, 18, .7); backdrop-filter: blur(3px); }
.report-form { display: grid; gap: 10px; padding: 22px; }
.report-form h2 { font-size: 22px; margin: 0; }
.report-form p { color: var(--mut); margin: 0 0 4px; }
.radio { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--s2); cursor: pointer; }
.radio input { accent-color: var(--pink); width: 18px; height: 18px; }
.report-form textarea { background: var(--bg); color: var(--tx); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: inherit; resize: vertical; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* --------------------------------------------------------------------------
   Prose (articles, pages, game descriptions)
   -------------------------------------------------------------------------- */

.prose-wrap { max-width: 760px; margin-bottom: 40px; }
.prose { line-height: 1.7; }
.prose > *:last-child { margin-bottom: 0; }
.prose h2 { font-size: 24px; margin-top: 1.4em; }
.prose img { height: auto; border-radius: 8px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { margin: 1em 0; padding-left: 16px; border-left: 3px solid var(--pink); color: var(--mut); }
.prose-hero img { width: 100%; height: auto; border-radius: var(--radius); margin-bottom: 20px; }

/* Comments */
.comments-area { max-width: 760px; margin-bottom: 40px; }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 14px 16px; background: var(--s1); border-radius: 8px; margin-bottom: 10px; }
.comment-form input:not([type=submit]):not([type=checkbox]), .comment-form textarea {
	width: 100%; background: var(--bg); color: var(--tx); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: inherit;
}
.comment-form .submit { background: var(--pink); color: #fff; border: 0; padding: 12px 20px; border-radius: 8px; font-weight: 700; cursor: pointer; }

/* Pagination (no-JS fallback) */
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 24px 0; }
.page-numbers { padding: 8px 14px; background: var(--s1); border-radius: 8px; color: var(--tx); }
.page-numbers.current { background: var(--pink); }

/* --------------------------------------------------------------------------
   Ads
   -------------------------------------------------------------------------- */

.ad { display: grid; justify-items: center; gap: 4px; margin: 0 auto 28px; max-width: 100%; overflow: hidden; }
.ad-label { font-size: 11px; color: var(--mut); }
.ad-game_side { margin: 0; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
	display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px;
	margin: 40px calc(var(--pad) * -1) 0; padding: 36px var(--pad) 28px;
	background: var(--s0); border-top: 1px solid var(--line);
}
.site-footer h2 { font-size: 16px; color: var(--mut); font-family: var(--f-body); font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer ul a { color: var(--tx); }
.footer-brand p { color: var(--mut); margin-top: 12px; max-width: 40ch; }
.social { display: flex !important; flex-wrap: wrap; gap: 8px 14px !important; }
.footer-widgets { grid-column: 1 / -1; }
.copyright { grid-column: 1 / -1; margin: 10px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--mut); }

/* Mobile dock */
.dock { display: none; }

/* Toast */
.toast {
	position: fixed; left: 50%; bottom: 24px; z-index: 1200; transform: translateX(-50%);
	padding: 12px 18px; border-radius: 10px; background: var(--tx); color: var(--bg); font-weight: 500;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1280px) {
	.game-layout { grid-template-columns: minmax(0, 1fr); }
	.game-side { position: static; }
	.side-grid { grid-template-columns: repeat(auto-fill, minmax(min(176px, 44vw), 1fr)); }
	.ad-game_side { display: none; }
}

@media (max-width: 1100px) {
	:root { --rail: 72px; }
	.rail { padding: 12px 8px; }
	.rail-list a { flex-direction: column; gap: 4px; padding: 10px 4px; font-size: 11px; text-align: center; }
	.rail-list a span { width: 100%; white-space: normal; line-height: 1.2; }
	.rail-list a small, .rail-heading, .rail-pages { display: none; }
	.rail-list a[aria-current] { box-shadow: inset 0 -3px 0 var(--pink); }
	.top-btn span { display: none; }
	.top-btn { padding: 0 12px; }
	.spotlight { grid-template-columns: minmax(0, 1fr); }
	.spot-side { grid-template-rows: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.card-wide .card-media { aspect-ratio: 16 / 9; height: auto; }
}

@media (max-width: 767px) {
	:root { --top: 58px; --gap: 12px; }
	body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
	.shell { display: block; }
	.topbar { gap: 10px; padding: 0 12px; }
	.topbar .rail-toggle { display: inline-grid; }
	.brand-text, .search-kbd, .top-actions { display: none; }
	.brand-mark { width: 34px; height: 34px; }
	.search input { height: 40px; }
	.search-icon { top: 10px; }

	.rail {
		position: fixed; top: 0; left: 0; bottom: 0; z-index: 1100; height: 100dvh;
		width: min(300px, 84vw); padding: 18px 12px 80px;
		transform: translateX(-102%); transition: transform .22s ease;
		box-shadow: 20px 0 40px rgba(0, 0, 0, .4);
	}
	.rail.is-open { transform: none; }
	.rail-list a { flex-direction: row; gap: 12px; font-size: 15px; padding: 11px 12px; text-align: left; }
	.rail-list a span { white-space: nowrap; }
	.rail-list a small, .rail-heading, .rail-pages { display: revert; }
	.rail-list a[aria-current] { box-shadow: inset 3px 0 0 var(--pink); }
	.rail-scrim { display: block; position: fixed; inset: 0; z-index: 1090; background: rgba(6, 4, 18, .6); }

	.marquee { min-height: 300px; }
	.marquee-text { display: none; }
	.spot-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.card-wide .card-title { font-size: 15px; }
	.card-wide .card-body { padding: 30px 10px 8px; }
	.shelf-head h2 { font-size: 19px; }
	.shelf-nav { display: none; }
	.rail-scroll { grid-auto-columns: 42vw; margin-right: calc(var(--pad) * -1); padding-right: var(--pad); }

	.player { margin: 0 calc(var(--pad) * -1); border-radius: 0; }
	.player-stage { width: 100%; min-height: 0; }
	.player-bar { margin-left: calc(var(--pad) * -1); margin-right: calc(var(--pad) * -1); border-radius: 0; border-left: 0; border-right: 0; }
	.pb-btn span:not([data-likes]):not([data-dislikes]) { display: none; }
	.hide-sm { display: none; }
	.game-info { grid-template-columns: minmax(0, 1fr); padding: 18px; }
	.gi-how { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }

	.site-footer { grid-template-columns: 1fr 1fr; }
	.footer-brand { grid-column: 1 / -1; }

	.dock {
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
		display: grid; grid-template-columns: repeat(5, 1fr);
		padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
		background: rgba(18, 14, 43, .96); backdrop-filter: blur(12px);
		border-top: 1px solid var(--line);
	}
	.dock a, .dock button {
		display: grid; justify-items: center; gap: 2px; padding: 4px 0;
		background: none; border: 0; color: var(--mut); font-size: 11px; font-weight: 500; cursor: pointer;
		text-decoration: none !important;
	}
	.dock [aria-current] { color: var(--tx); }
	.dock [aria-current] .icon { color: var(--pink); }
	.dock-main .icon { color: var(--gold); }
	.toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
	body.is-game .dock { display: none; }
	body.is-game { padding-bottom: 0; }
}

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

@media print {
	.topbar, .rail, .dock, .ad, .player { display: none; }
	.shell { display: block; }
}

/* Widgets */
.game-side, .game-main { min-width: 0; }
.widget { min-width: 0; overflow-wrap: anywhere; background: var(--s1); border-radius: var(--radius); padding: 16px; }
.widget-title, .widget h2, .widget .wp-block-heading { font-size: 17px; margin: 0 0 10px; }
.widget ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.widget a { color: var(--tx); }
.widget a:hover { color: var(--cyan); }
.widget .wp-block-search__inside-wrapper, .widget .search-form { display: flex; gap: 6px; }
.widget input[type="search"], .widget .wp-block-search__input {
	flex: 1; min-width: 0; height: 40px; padding: 0 12px; background: var(--bg); color: var(--tx);
	border: 1px solid var(--line); border-radius: 8px; font: inherit;
}
.widget .wp-block-search__button, .widget button {
	height: 40px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--pink); color: #fff; font-weight: 600; cursor: pointer; margin: 0;
}
.widget .wp-block-search__label { display: block; font: 700 17px var(--f-display); margin-bottom: 10px; }
.site-footer .widget { background: none; padding: 0; }
@media (max-width: 767px) {
	.pb-actions { gap: 4px; }
	.pb-btn { padding: 0 9px; min-width: 38px; }
}
@media (max-width: 767px), (max-height: 500px) {
	/* On phones, full screen means the whole screen: HTML5 games resize themselves. */
	.player.is-fs .player-stage, .player:fullscreen .player-stage { width: 100vw; height: 100dvh; max-height: none; aspect-ratio: auto; }
}

/* "Plays here": games confirmed to work on this site */
.works {
	position: absolute; left: 8px; bottom: 8px;
	display: inline-flex; align-items: center; gap: 4px;
	padding: 3px 8px 3px 6px; border-radius: 999px;
	background: rgba(12, 9, 32, .82); color: var(--ok);
	font: 600 12px/1.2 var(--f-body);
	backdrop-filter: blur(4px);
	border: 1px solid rgba(95, 255, 196, .45);
}
.works .icon { width: 13px; height: 13px; stroke-width: 2.6; }
.card-wide .works { top: 10px; bottom: auto; left: auto; right: 22px; }
.card-mini .works { padding: 2px 6px 2px 4px; font-size: 11px; }
.works-inline, .engine-note { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.works-inline { color: var(--ok); font-weight: 600; }
.works-inline .icon { stroke-width: 2.6; }
.engine-note { color: var(--mut); }
.pb-title p { flex-wrap: wrap; row-gap: 2px; }
.player-help {
	margin: -12px 0 22px; padding: 10px 14px; border-radius: 8px;
	background: var(--s1); border: 1px solid var(--line); color: var(--mut); font-size: 14px;
}
.linkish { background: none; border: 0; padding: 0; color: var(--cyan); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.sort-tabs .filter-works { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.sort-tabs .filter-works .icon { width: 16px; height: 16px; color: var(--ok); stroke-width: 2.6; }
.sort-tabs .filter-works[aria-current] { background: var(--ok); border-color: var(--ok); color: #03281b; }
.sort-tabs .filter-works[aria-current] .icon { color: #03281b; }
@media (max-width: 767px) { .sort-tabs .filter-works { margin-left: 0; } }
