:root {
  --bg: #090d12;
  --panel: #111821;
  --panel-raised: #17212d;
  --line: #273545;
  --text: #edf5f7;
  --muted: #91a4b5;
  --accent: #5de1c3;
  --accent-strong: #16b896;
  --warning: #ffbd5b;
  --danger: #ff6b78;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 85% -10%, #153c40 0, transparent 35rem), var(--bg); }
button, input, select { font: inherit; }

.hero { max-width: 1480px; margin: 0 auto; padding: 4.5rem 2rem 2.5rem; }
.hero__eyebrow { color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .18em; }
.hero h1 { margin: .35rem 0 .7rem; max-width: 850px; font-size: clamp(2.8rem, 7vw, 6.6rem); line-height: .92; letter-spacing: -.065em; }
.hero p { max-width: 700px; margin: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.6; }

main { max-width: 1480px; margin: 0 auto; padding: 0 2rem 4rem; }
.filters { display: grid; grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(150px, 1fr)); gap: 1rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(17, 24, 33, .9); backdrop-filter: blur(18px); position: sticky; top: .75rem; z-index: 10; box-shadow: 0 20px 60px rgba(0, 0, 0, .22); }
.filters label { display: flex; flex-direction: column; gap: .45rem; color: var(--muted); font-size: .77rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.filters input[type="search"], .filters select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: .78rem .85rem; color: var(--text); background: #0c1219; outline: none; }
.filters input:focus, .filters select:focus { border-color: var(--accent-strong); box-shadow: 0 0 0 3px rgba(93, 225, 195, .12); }
.filters input[type="range"] { accent-color: var(--accent); margin-top: .55rem; }

.catalog-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 5.5rem; color: var(--muted); }
.legend { font-size: .82rem; }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin: 0 .25rem 0 .7rem; }
.dot--present { background: var(--accent); }
.dot--active { background: var(--warning); }

.catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; transition: opacity .2s; }
.catalog[data-loading="true"] { opacity: .55; }
.game-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, var(--panel-raised), var(--panel)); box-shadow: 0 20px 45px rgba(0, 0, 0, .18); }
.cover-wrap { position: relative; height: 235px; overflow: hidden; background: linear-gradient(145deg, #203444, #101820); }
.cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.08); font-size: 6rem; font-weight: 900; letter-spacing: -.08em; }
.rating { position: absolute; right: .8rem; bottom: .8rem; padding: .42rem .65rem; border: 1px solid rgba(255,255,255,.15); border-radius: 99px; background: rgba(5, 10, 14, .82); color: var(--accent); font-size: .8rem; font-weight: 800; backdrop-filter: blur(8px); }
.game-card__body { display: flex; flex-direction: column; gap: .85rem; padding: 1.1rem; }
.title-id { margin: 0 0 .25rem; color: var(--accent); font: 700 .72rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.game-name { margin: 0; font-size: 1.35rem; line-height: 1.13; letter-spacing: -.025em; }
.genres { display: flex; flex-wrap: wrap; gap: .38rem; min-height: 1.5rem; }
.genres span { padding: .28rem .48rem; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: .72rem; }
.summary, .storyline { margin: 0; color: #bdcad5; font-size: .88rem; line-height: 1.55; }
.summary { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.story-details summary { cursor: pointer; color: var(--muted); font-size: .82rem; }
.storyline { margin-top: .6rem; }
.assets { display: flex; flex-direction: column; gap: .55rem; margin-top: auto; padding-top: .3rem; }
.asset-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.asset-copy { display: flex; min-width: 0; flex-direction: column; gap: .15rem; }
.asset-kind { font-size: .78rem; }
.asset-meta { overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.download-button { flex: 0 0 auto; border: 1px solid var(--accent-strong); border-radius: 9px; padding: .58rem .72rem; color: #06120f; background: var(--accent); cursor: pointer; font-size: .74rem; font-weight: 800; }
.download-button:hover:not(:disabled) { transform: translateY(-1px); background: #7debd2; }
.download-button:disabled { cursor: default; opacity: .72; }
.download-button[data-state="present"] { border-color: #297c69; color: var(--accent); background: rgba(93, 225, 195, .1); }
.download-button[data-state="active"] { border-color: #8a672d; color: var(--warning); background: rgba(255, 189, 91, .1); }
.download-button[data-state="partial"] { border-color: #5c6fb5; color: #aebdff; background: rgba(118, 141, 225, .1); }
.download-button[data-state="failed"] { border-color: #943e48; color: var(--danger); background: rgba(255, 107, 120, .1); }
.download-button[data-state="unknown"] { border-color: var(--line); color: var(--muted); background: transparent; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 1.2rem; padding: 2.3rem 0 0; }
.pagination button { border: 1px solid var(--line); border-radius: 10px; padding: .7rem 1rem; color: var(--text); background: var(--panel); cursor: pointer; }
.pagination button:disabled { opacity: .35; cursor: default; }
.pagination span { color: var(--muted); font-size: .85rem; }

@media (max-width: 1050px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); position: static; }
  .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .hero { padding: 3rem 1rem 2rem; }
  main { padding: 0 1rem 3rem; }
  .filters, .catalog { grid-template-columns: 1fr; }
  .catalog-heading { align-items: flex-start; flex-direction: column; justify-content: center; }
  .legend { display: none; }
  .cover-wrap { height: 280px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
