:root {
  color-scheme: dark;
  --ink: #060a11;
  --panel: #0b1420;
  --text: #edf5ff;
  --muted: #afc1d4;
  --gold: #ffdd9b;
  --cyan: #9cecff;
  --edge: #354751;
  --rail: linear-gradient(90deg, transparent, #ad8551 14%, #ffe0a1 34%, #69cee2 64%, #5755a2 84%, transparent);
  --frame: linear-gradient(137deg, #ad8859 0%, #494335 21%, #243747 49%, #62453c 80%, #936741);
  --tile-size: 650px auto;
  scrollbar-gutter: stable;
  background: var(--ink);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background-image: radial-gradient(ellipse at 45% 0%, #10283d8a, transparent 38rem),
    linear-gradient(#060a11ac, #070b1366 360px), url("/gameverse/catalog-circuit.svg");
  background-size: auto, auto, var(--tile-size);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.directory-icon { flex: none; width: 21px; height: 21px; overflow: visible; }
.directory-shell {
  max-width: 1304px;
  margin-inline: auto;
  padding: clamp(18px, 4vw, 54px) clamp(14px, 4vw, 36px) calc(116px + env(safe-area-inset-bottom));
}

.directory-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(20px, 4.4vw, 42px);
  border: 1px solid transparent;
  border-radius: 24px;
  background: radial-gradient(ellipse at 100% 0%, #163d5187, transparent 66%) padding-box,
    radial-gradient(ellipse at 0 0, #4e352575, transparent 70%) padding-box,
    linear-gradient(148deg, #121825, #070e19 78%) padding-box, var(--frame) border-box;
  box-shadow: inset 0 1px #ffedb926, 0 22px 66px #0008;
}
.directory-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 40%;
  background: url("/gameverse/catalog-circuit.svg") right -83px top -50px / 540px auto repeat;
  mask-image: linear-gradient(268deg,#000b,transparent);
  opacity: .7;
  content: "";
}
.directory-hero::after {
  position: absolute;
  inset: 0;
  background: var(--rail) center top / 82% 1px no-repeat, var(--rail) center bottom / 65% 1px no-repeat;
  pointer-events: none;
  content: "";
}
.directory-intro { max-width: 690px; margin: 15px 0 20px; color: var(--muted); line-height: 1.55; }

.directory-languages {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  max-width: 750px;
  border: 1px solid #4a5661;
  border-radius: 13px;
  background: linear-gradient(180deg, #323942, #1b222c 55%, #111721);
  box-shadow: inset 0 1px #c5d9ed22, inset 0 -1px #000a, 0 9px 24px #04060b68;
}
.directory-languages a {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 46px;
  padding: 5px 3px;
  color: #d8e4ee;
  font-size: .86rem;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
}
.directory-languages a:first-child { border-start-start-radius: 12px; border-end-start-radius: 12px; }
.directory-languages a:last-child { border-start-end-radius: 12px; border-end-end-radius: 12px; }
.directory-languages a + a { border-inline-start: 1px solid #65728061; }
.directory-languages a:hover { color: var(--cyan); background: #a2e2ff10; }
.directory-languages a[aria-current="page"] {
  color: #fff0ce;
  background: linear-gradient(180deg,#8c673845,#a98a4d16 60%,#a27b2f31);
  box-shadow: inset 0 1px #eff1ae43;
}
.directory-languages a[aria-current="page"]::after {
  position: absolute;
  inset-inline: 16%;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffe4a6, transparent);
  box-shadow: 0 0 10px #edbf6cd9;
  content: "";
}
.directory-language-code { display: none; letter-spacing: .05em; }

.directory-pagination a,
.directory-page-jump button, .directory-page-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(150deg,#1b2939,#0a1421 74%) padding-box, var(--frame) border-box;
  box-shadow: inset 0 1px #f6dba530, 0 6px 19px #0006;
  color: var(--gold);
  font-size: .9rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.directory-pagination .directory-icon { width: 17px; height: 17px; }
.directory-pagination a:hover, .directory-page-jump button:hover {
  background: linear-gradient(150deg,#244156,#0c1723 74%) padding-box, #e2ad61 border-box;
  color: #fff1ce;
  box-shadow: inset 0 1px #f6dba568, 0 0 18px #ddbd7440;
}
[dir="rtl"] .directory-pagination .directory-icon { transform: scaleX(-1); }

.directory-controls {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 24px 0 0;
  padding: 4px;
  border: 1px solid #476571;
  border-radius: 15px;
  background: linear-gradient(160deg,#182a37,#08131e 60%,#111622);
  box-shadow: inset 0 1px #a5e9f92b, 0 12px 32px #0008;
  overflow-anchor: none;
  user-select: none;
}
.directory-controls::after {
  position: absolute;
  inset-inline: 14%;
  bottom: 0;
  height: 1px;
  background: var(--rail);
  content: "";
  pointer-events: none;
}
.directory-search {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid #526574;
  border-radius: 11px;
  background: #08121d;
  box-shadow: inset 0 0 13px #080d14;
}
.directory-search:focus-within { border-color: var(--cyan); box-shadow: inset 0 0 16px #61ceec14; }
.directory-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
}
.directory-field input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  border: 0;
  padding: 6px 48px 6px 15px;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: start;
  outline-offset: -3px;
  user-select: text;
}
[dir="rtl"] .directory-field input { padding-left: 48px; padding-right: 15px; }
.directory-field input::placeholder { color: #9eb1c5; opacity: 1; }
.directory-field input::-webkit-search-cancel-button { display: none; }
.directory-clear {
  position: absolute;
  inset-inline-end: 4px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-inline-start: 1px solid #53657363;
  border-radius: 0;
  background: transparent;
  color: #c8e0ec;
  cursor: pointer;
}
.directory-clear .directory-icon { width: 15px; height: 15px; }
.directory-clear:hover { color: var(--cyan); background: #7ccee826; }
.directory-field input:placeholder-shown + .directory-clear { visibility: hidden; }
.directory-search button[type="submit"] {
  flex: none;
  min-height: 44px;
  padding: 6px clamp(12px, 3vw, 28px);
  border: 0;
  border-inline-start: 1px solid #b38f53;
  border-start-end-radius: 10px;
  border-end-end-radius: 10px;
  background: linear-gradient(155deg,#423341,#1c2030 44%,#101622 74%,#49343b);
  box-shadow: inset 0 1px #ffe8b86b, inset 0 -1px #bf8c4e40;
  color: #ffebbb;
  font-weight: 800;
  cursor: pointer;
}
.directory-search button[type="submit"]:hover { background: linear-gradient(155deg,#62424c,#212334 60%,#44313b); }

.directory-count {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 14px 0 9px;
  color: #c5d8e9;
  font-size: .83rem;
  font-weight: 700;
}
.directory-count::after, .directory-count::before {
  content: "";
  flex: 1 1 12px;
  height: 1px;
  background: var(--rail);
}
.directory-count span[aria-hidden] { color: var(--gold); font-size: .78rem; }
.directory-count strong { color: var(--gold); font-variant-numeric: tabular-nums; }
.directory-feedback { margin: 6px 0 15px; color: var(--muted); font-size: .88rem; }
.directory-feedback a:hover { text-decoration: underline; }

.directory-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  align-items: stretch;
  gap: clamp(15px, 1.8vw, 23px);
  padding: 0;
  margin: 6px 0 0;
  list-style: none;
}
.directory-card {
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #d8b06a;
  border-radius: 19px;
  background: linear-gradient(180deg,#0b101b,#151222 69%,#0b0e19);
  box-shadow: inset 0 0 0 1px #1d1522, inset 0 0 0 4px #d9ac5224, 0 12px 27px #0008;
  scroll-margin-top: 77px;
}
.directory-card:hover, .directory-card:focus-within, .directory-card-match {
  border-color: #ffdc96;
  box-shadow: inset 0 0 0 1px #1d1522, inset 0 0 0 4px #d9ac5236, 0 10px 30px #0009, 0 0 20px #57bed52c;
}
.directory-card-match { border-color: #ffd48e; }
.directory-card-link {
  display: grid;
  justify-items: center;
  align-self: center;
  gap: 6px;
  margin: 4px 12px 12px;
  color: #fff1cb;
  text-decoration: none;
  cursor: pointer;
}
.directory-card-link::after { position: absolute; z-index: 1; inset: 0; content: ""; }
.directory-card-link > span { position: relative; z-index: 2; }
.directory-play-glyph svg { display: block; width: clamp(58px, 9vw, 80px); height: auto; pointer-events: none; filter: drop-shadow(0 4px 10px #000b); transition: transform .17s ease, filter .17s ease; }
.directory-poster {
  position: relative;
  flex: none;
  z-index: -1;
  width: calc(100% - 8px);
  margin: clamp(13px, 3vw, 36px) 4px -11px;
  aspect-ratio: 16 / 10;
  mask-image: linear-gradient(180deg,transparent,#000 10%,#000 48%,#000d 61%,#0007 77%,#0002 92%,transparent 100%);
}
.directory-poster::after {
  position: absolute;
  inset: 0;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg,#080b1638,transparent 22%,transparent 50%,#080b1642 76%,transparent);
  pointer-events: none;
  content: "";
}
.directory-poster img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; border-radius: 14px 14px 0 0; }
.directory-game-badges {
  margin: 10px 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  direction: ltr;
  gap: 7px;
  pointer-events: none;
}
.directory-game-badge {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: calc(50% - 3px);
  min-height: 34px;
  padding: 4px 7px 4px 5px;
  border: 1px solid #e1b873;
  border-radius: 13px 4px 13px 4px;
  background: linear-gradient(145deg,#4b3549,#222238 26%,#101622 57%,#10111b 78%,#493039);
  box-shadow: inset 0 0 0 2px #10121e, inset 0 1px #fff1c29c, inset 0 -2px #8f62374d, 0 3px 9px #0009;
  color: #ffe9b5;
  font-size: clamp(.56rem, 1.3vw, .69rem);
  font-weight: 850;
  letter-spacing: .035em;
  line-height: 1.15;
  text-shadow: 0 1px 3px #000;
}
.directory-game-badge::before { position: absolute; inset: 3px; pointer-events: none; border: 1px solid #e8c47b40; border-radius: 9px 2px 9px 2px; content: ""; }
.directory-game-badge::after { position: absolute; inset: 0 14% auto; height: 1px; pointer-events: none; background: linear-gradient(90deg,transparent,#fff2c5,transparent); content: ""; }
.directory-game-badge svg { flex: none; display: block; width: 26px; height: 26px; }
.directory-game-badge span { min-width: 0; overflow-wrap: anywhere; }
.directory-game-badges .directory-game-badge span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
[dir="rtl"] .directory-game-badge[data-gameverse-category] { direction: rtl; }
.directory-brand { display: flex; width: fit-content; max-width: 100%; margin: 0 auto 0 0; padding: 6px clamp(9px, 2vw, 17px) 6px 7px; gap: clamp(5px, 1.5vw, 11px); font-size: clamp(.7rem, 2vw, .95rem); }
.directory-brand svg { width: 31px; height: 31px; }
.directory-brand-star { color: #f4cf86; text-shadow: 0 0 10px #ffdb97a8; }
.directory-brand-label { color: #ffe6ac; }
.directory-card h2 { display: grid; place-items: center; block-size: 3.69em; flex: none; margin: 0 12px 4px; color: #fff3cf; text-align: center; font-size: clamp(1rem, 2vw, 1.28rem); font-weight: 850; line-height: 1.23; letter-spacing: .02em; text-shadow: 0 3px 8px #000; }
.directory-card h2 bdi { display: block; max-inline-size: min(100%, 29ch); text-wrap: balance; overflow-wrap: anywhere; }
.directory-card h2 mark { border-radius: 4px; padding-inline: 2px; background: #f3d488; color: #111827; }
.directory-gold-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 5px 13px;
  border: 1px solid #d8b06a;
  border-radius: 10px 4px 10px 4px;
  background: linear-gradient(160deg,#4d3548,#211d31 34%,#10131e 72%,#38292d);
  box-shadow: inset 0 0 0 2px #0b0d16, inset 0 1px #ffdd9c8c, 0 2px 5px #0006;
  color: #fff0c5;
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
}
.directory-card-link .directory-gold-button { min-width: 112px; transition: color .16s ease, border-color .16s ease, box-shadow .16s ease; }
.directory-gold-button:hover { background: linear-gradient(155deg,#633f49,#262038 60%,#39282e); }
.directory-card-link:focus-visible { border-radius: 12px; outline-color: #ffe6a4; }
.directory-card-link:focus-visible .directory-gold-button { border-color: #fff1bc; color: #fff8e4; }
.directory-card-link:has(> :active) > span { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) {
  .directory-card-link:has(> :hover) .directory-play-glyph svg { transform: scale(1.055); filter: drop-shadow(0 0 9px #ffc56b83); }
  .directory-card-link:has(> :hover) .directory-gold-button { border-color: #fff1bc; color: #fff8e4; box-shadow: inset 0 0 0 2px #15121c, inset 0 1px 0 #fff0c9, 0 0 10px #e0a74b40; }
}
@media (prefers-reduced-motion: reduce) {
  .directory-play-glyph svg, .directory-card-link .directory-gold-button { transition: none; }
  .directory-card-link:has(> :hover) .directory-play-glyph svg, .directory-card-link:has(> :active) > span { transform: none; }
}
.directory-card-footer { display: grid; justify-items: center; align-content: center; gap: 5px; margin: 0 10px; color: #ffe0a1; text-align: center; }
.directory-review-trigger { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 6px; max-width: 100%; min-height: 38px; padding: 5px 10px; border: 1px solid #ad804b; border-radius: 10px; background: #101321e0; color: #ffe0a1; font-size: .78rem; text-decoration: none; text-shadow: 0 2px 5px #000; }
.directory-review-trigger [data-rating-label] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.directory-review-trigger:hover { border-color: #f5c982; background: #252134; }
.directory-stars { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.directory-stars > svg { display: block; flex: none; width: 20px; height: 20px; }
.directory-tagline { font-size: .73rem; line-height: 1.3; color: #efd9a4; }
.directory-card-copy { position: relative; margin: 13px 0 0; padding: 14px clamp(14px, 2vw, 20px) 16px; background: linear-gradient(180deg,#2d203025,transparent 60%); color: #e3cda7; font-size: .87rem; line-height: 1.6; }
.directory-card-copy::before { position: absolute; inset: 0 12px auto; height: 1px; background: var(--rail); box-shadow: 0 0 8px #e9b56a45; content: ""; }
.directory-card-description { position: relative; z-index: 2; block-size: 8em; padding-inline-end: 8px; overflow-y: auto; overflow-wrap: anywhere; scrollbar-width: thin; scrollbar-color: #b38a55 #101322; scrollbar-gutter: stable; }
.directory-card-description p { margin: 0; }

.directory-reviews { box-sizing: border-box; width: min(720px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: clamp(16px, 4vw, 26px); overflow: auto; overscroll-behavior: contain; border: 1px solid #e5bc7a; border-radius: 20px; background: radial-gradient(ellipse at 50% -20%,#513448,#171725 50%,#0c0e19); box-shadow: inset 0 0 0 3px #15111f, inset 0 0 0 4px #cda65a32, 0 18px 60px #000a; color: #fff0cf; }
html[data-directory-selecting], html:has(.directory-reviews[open]) { overflow: hidden; }
.directory-reviews::backdrop { background: #070910cf; }
.directory-reviews > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid #d3a66072; }
.directory-reviews > header p { margin: 0 0 4px; color: #f6ce8a; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.directory-reviews > header h2 { margin: 0; color: #fff1cb; font-size: clamp(1.1rem, 4vw, 1.6rem); overflow-wrap: anywhere; }
.directory-reviews > header button { padding-inline: 7px; }
.directory-reviews > header button .directory-icon { width: 18px; height: 18px; }
.directory-reviews > footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.directory-reviews [hidden] { display: none; }
.directory-reviews [data-review-status]:empty { display: none; }
.directory-reviews [data-review-items] { display: grid; max-height: 55dvh; gap: 7px; margin: 10px 0; padding: 0; list-style: none; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #ab8754 transparent; }
.directory-reviews li { padding: 9px 11px; border: 1px solid #71583e; border-radius: 10px; background: #10121de5; overflow-wrap: anywhere; }
.directory-reviews li header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; font-size: .82rem; color: #e4c18b; }
.directory-reviews li header time { margin-inline-start: auto; color: var(--muted); }
.directory-reviews li p { margin: 5px 0 0; white-space: pre-wrap; line-height: 1.48; color: #f3e3c0; }

.directory-pagination {
  position: fixed;
  z-index: 6;
  inset-inline: 0;
  bottom: max(8px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: min(550px, calc(100% - 22px));
  padding: 8px;
  margin-inline: auto;
  border: 1px solid #6d6459;
  border-radius: 15px;
  background: linear-gradient(145deg,#232c38,#0a1421 65%,#191a24);
  box-shadow: inset 0 1px #ffdd9b2b,0 10px 35px #000a;
}
.directory-pagination::before {
  position: absolute;
  inset-inline: 9%;
  top: 0;
  height: 1px;
  background: var(--rail);
  content: "";
  pointer-events: none;
}
.directory-page-disabled { color: #96a9bb; border-color: #3d4a58; box-shadow: none; cursor: default; }
.directory-page-jump { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-variant-numeric: tabular-nums; }
.directory-page-jump input {
  display: block;
  width: 3.1em;
  min-height: 44px;
  padding: 4px;
  appearance: textfield;
  border: 1px solid #4e6677;
  border-radius: 8px;
  background: #08131f;
  color: var(--text);
  text-align: center;
}
.directory-page-jump input::-webkit-inner-spin-button, .directory-page-jump input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.directory-page-jump button { padding-inline: 5px; }
.directory-page-jump button .directory-icon { width: 16px; height: 16px; }
.directory-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 900px) {
  :root { --tile-size: 480px auto; }
  .directory-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .directory-hero::before { background-size: 425px auto; }
}
@media (max-width: 620px) {
  :root { --tile-size: 306px auto; }
  .directory-shell { padding-inline: 12px; }
  .directory-language-name { display: none; }
  .directory-language-code { display: inline; }
  .directory-hero::before { inset-inline-start: 25%; background-size: 315px auto; }
  .directory-pagination { gap: 6px; }
}
@media (max-width: 520px) {
  .directory-grid { grid-template-columns: minmax(0,1fr); }
  .directory-hero { border-radius: 18px; }
  .directory-search button[type="submit"] { padding-inline: 11px; }
  .directory-controls { margin-top: 15px; }
  .directory-card-description { block-size: 6.4em; }
  .directory-pagination a, .directory-page-disabled { padding-inline: 6px; font-size: .78rem; }
  .directory-page-jump { gap: 4px; font-size: .81rem; }
  .directory-page-jump input { width: 2.65em; }
}
@media (max-width: 360px) {
  .directory-game-badges { margin-inline: 7px; }
  .directory-game-badges .directory-game-badge svg { width: 22px; height: 22px; }
  .directory-pagination .directory-pagination-title { display: none; }
  .directory-page-jump button { min-width: 35px; }
}
