:root {
  --bg: #101217;
  --panel: #191d25;
  --muted: #9ca6b7;
  --text: #f2f5fa;
  --line: #2a3040;
  --accent: #66e3a0;
  --blue: #82b8ff;
  --danger: #ff7474;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.topbar { position: sticky; top: 0; z-index: 2; display: flex; gap: 24px; align-items: center; padding: 15px max(24px, calc((100vw - 1120px) / 2)); background: #101217e8; backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; color: var(--text); text-decoration: none; white-space: nowrap; }
.topbar nav { display: flex; gap: 16px; flex: 1; }
.topbar a { color: var(--muted); text-decoration: none; }
.topbar a:hover { color: var(--text); }
.link-button { color: var(--muted); background: none; padding: 0; }
.container { max-width: 920px; margin: 0 auto; padding: 42px 24px 64px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.1; margin-bottom: 10px; }
h2 { font-size: 22px; }
.eyebrow { color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.hero, .page-heading { margin-bottom: 26px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.hero p, .page-heading p { color: var(--muted); }
button, .button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; border: 0; border-radius: 10px; padding: 9px 15px; background: var(--accent); color: #082014; font-weight: 750; font: inherit; text-decoration: none; cursor: pointer; }
.secondary, .filter { background: transparent; border: 1px solid var(--line); color: var(--text); }
.secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 14px; border-radius: 10px; text-decoration: none; font-weight: 650; }
.secondary:hover { border-color: var(--blue); color: var(--blue); }
.danger { background: var(--danger); color: #310d0d; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0; }
.stats a { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); text-decoration: none; }
.stats strong { display: block; font-size: 28px; }
.stats span, .muted { color: var(--muted); font-size: 14px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 16px; }
.section-heading a, .back { color: var(--blue); }
.back { display: inline-block; margin-bottom: 16px; }

.game-list { display: grid; gap: 16px; }
.game-card { display: grid; grid-template-columns: clamp(250px, 42%, 360px) minmax(0, 1fr); min-height: 246px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel); transition: border-color .15s ease, transform .15s ease; }
.game-card:hover { border-color: #47536a; transform: translateY(-1px); }
.game-cover { position: relative; min-width: 0; overflow: hidden; background: #0b0e13; }
.game-cover::before { position: absolute; inset: -18px; filter: blur(18px) brightness(.42) saturate(1.15); content: ""; }
.game-cover.cover-ready::before { background: var(--cover-image) center / cover no-repeat; }
.game-cover img { position: absolute; z-index: 1; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.game-content { min-width: 0; padding: 20px 21px; }
.game-heading { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.game-heading h3 { min-width: 0; font-size: 20px; line-height: 1.25; margin-bottom: 10px; }
.game-heading a { color: var(--text); text-decoration: none; }
.game-heading a:hover { color: var(--accent); }
.game-heading span { flex: 0 0 auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.price { margin: 5px 0; overflow-wrap: anywhere; }
.price.best { color: var(--accent); font-weight: 650; }
.release { color: #ffc96b; margin-bottom: 15px; }
.owned { color: #a5c8ff; margin-top: 12px; }
.game-content .muted { margin: 10px 0 0; }
.card-actions { margin: 15px 0 0; }
.card-untrack { min-height: 32px; padding: 5px 10px; border: 1px solid #784650; border-radius: 8px; background: transparent; color: #ff9da5; font-size: 13px; font-weight: 650; }
.card-untrack:hover { border-color: var(--danger); color: var(--danger); }
.toolbar { display: flex; gap: 8px; margin: 20px 0; }
.filter { padding: 7px 11px; min-height: 36px; border-radius: 8px; text-decoration: none; font-size: 14px; }
.filter.active { border-color: var(--accent); color: var(--accent); }
.spacer { flex: 1; }
.pagination { display: flex; gap: 7px; justify-content: center; margin-top: 28px; }
.pagination a { min-width: 34px; padding: 5px 9px; text-align: center; border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-decoration: none; }
.pagination a.current { background: var(--accent); border-color: var(--accent); color: #082014; }
.panel, .list-panel, .login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.stack { display: grid; gap: 15px; }
.stack label { display: grid; gap: 6px; font-weight: 650; }
.stack input, .stack select, .search-form input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #11151d; color: var(--text); font: inherit; }
.search-form { display: flex; gap: 10px; margin: 22px 0 28px; }
.subscription-search { display: flex; gap: 10px; margin: 20px 0; }
.subscription-search input { min-width: 0; flex: 1; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #11151d; color: var(--text); font: inherit; }
.lazy-sentinel { display: flex; justify-content: center; padding: 18px; color: var(--muted); font-size: 14px; }
.login-card { max-width: 520px; margin: 8vh auto; }
.login-card h1 { font-size: 32px; }
.notice { padding: 12px 14px; border-radius: 10px; background: #202633; border: 1px solid var(--line); }
.notice.success { border-color: #3c875d; }
.notice.error { border-color: #a75353; color: #ffc2c2; }
.empty { text-align: center; padding: 46px 24px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.actions form { margin: 0; }
.profile-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.profile-row:first-of-type { border-top: 0; }
.profile-row span { display: block; color: var(--muted); font-size: 14px; }
.release-timeline { display: grid; gap: 32px; }
.release-period { position: relative; padding-left: 22px; }
.release-period::before { position: absolute; top: 9px; bottom: -32px; left: 0; width: 2px; background: var(--line); content: ""; }
.release-period:last-child::before { bottom: 0; }
.release-period h2 { position: relative; margin-bottom: 14px; font-size: 18px; }
.release-period h2::before { position: absolute; top: 7px; left: -28px; width: 12px; height: 12px; border: 3px solid var(--bg); border-radius: 50%; background: var(--accent); content: ""; }

@media (max-width: 900px) {
  .topbar { gap: 12px; padding: 13px 16px; }
  .topbar nav { gap: 10px; overflow: auto; }
  .topbar nav a { white-space: nowrap; font-size: 14px; }
  .container { padding: 30px 16px; }
  .game-card { grid-template-columns: minmax(190px, 38%) minmax(0, 1fr); min-height: 210px; border-radius: 13px; }
  .game-content { padding: 15px 16px; }
  .game-heading { display: block; }
  .game-heading h3 { font-size: 17px; margin-bottom: 4px; }
  .game-heading span { display: block; margin-bottom: 10px; }
  .price { font-size: 14px; margin: 4px 0; }
  .release { font-size: 14px; margin-bottom: 10px; }
  .game-content .muted, .owned { font-size: 13px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: 1fr; }
  .search-form { flex-direction: column; }
  .subscription-search { flex-direction: column; }
  .toolbar { flex-wrap: wrap; }
  .spacer { display: none; flex-basis: 100%; }
}

@media (max-width: 600px) {
  .topbar { align-items: flex-start; }
  .topbar nav { padding-bottom: 2px; }
  .game-card { grid-template-columns: 1fr; min-height: 0; }
  .game-cover { aspect-ratio: 2.14 / 1; }
  .game-content { padding: 13px; }
  .game-heading h3 { font-size: 16px; }
}
