:root {
  color-scheme: dark;
  --bg: #08040d;
  --bg-elevated: #110919;
  --panel: rgba(24, 13, 34, .78);
  --panel-solid: #180d22;
  --panel-hover: #21112e;
  --input: #160b20;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 71, 155, .38);
  --text: #f8f3fb;
  --muted: #a99cb4;
  --pink: #ff479b;
  --pink-soft: rgba(255, 71, 155, .14);
  --purple: #c084fc;
  --blue: #38bdf8;
  --green: #34d399;
  --danger: #fb7185;
  --shadow: 0 22px 70px rgba(0, 0, 0, .35);
  --radius: 16px;
  --radius-sm: 10px;
  --shell: 1860px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, rgba(192, 132, 252, .14), transparent 30rem),
    radial-gradient(circle at 85% -10%, rgba(255, 71, 155, .12), transparent 34rem),
    var(--bg);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.shell { width: min(var(--shell), calc(100% - 28px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: 12px; transform: translateY(-160%); z-index: 999; padding: 8px 12px; border-radius: 8px; background: var(--pink); color: white; text-decoration: none; }
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 4, 13, .86);
  backdrop-filter: blur(18px) saturate(145%);
}
.topbar__row { min-height: 68px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; }
.brand { min-width: 210px; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__logo { width: 42px; height: 42px; border-radius: 11px; object-fit: cover; border: 1px solid rgba(255,71,155,.65); box-shadow: 0 0 0 3px rgba(255,71,155,.08); }
.brand__copy { display: flex; flex-direction: column; min-width: 0; }
.brand__copy strong { font-size: 19px; line-height: 1.15; background: linear-gradient(100deg, #ff73b6, #cf9cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand__copy small { color: var(--muted); font-size: 11px; white-space: nowrap; }

.topbar__stats { justify-self: center; display: flex; align-items: center; gap: 4px; min-width: 0; }
.stat-pill { width: 85px; flex: 0 0 85px; padding: 7px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text); text-align: center; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.stat-pill:hover { background: rgba(255,255,255,.035); border-color: var(--border); transform: translateY(-1px); }
.stat-pill strong { display: block; color: var(--pink); font-size: 19px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-pill span { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .055em; white-space: nowrap; }
.stat-pill--watch strong { color: var(--green); }

.topbar__actions { display: flex; justify-content: flex-end; align-items: center; gap: 7px; }
.icon-btn, .primary-btn, .secondary-btn, .chip, .control {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255,255,255,.035);
  transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.icon-btn:hover, .secondary-btn:hover, .chip:hover, .control:hover { border-color: rgba(255,71,155,.48); background: rgba(255,71,155,.07); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; padding: 0; }
.icon-btn svg, .primary-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn--small { width: 34px; height: 34px; border-radius: 9px; font-size: 18px; }
.icon-btn.is-active { color: var(--pink); background: var(--pink-soft); border-color: var(--border-strong); }
.primary-btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 10px; padding: 8px 13px; color: white; font-weight: 700; background: linear-gradient(105deg, #ff479b, #c065f2); box-shadow: 0 8px 24px rgba(255,71,155,.18); }
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(255,71,155,.28); }
.secondary-btn { min-height: 40px; border-radius: 10px; padding: 8px 14px; font-weight: 650; }

.search-popover { padding-bottom: 10px; }
.search-field { display: flex; align-items: center; gap: 9px; width: min(600px, 100%); margin-left: auto; padding: 0 12px; background: var(--input); border: 1px solid var(--border-strong); border-radius: 11px; box-shadow: var(--shadow); }
.search-field svg { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search-field input { flex: 1; min-width: 0; height: 42px; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-field input::placeholder { color: #81758b; }
kbd { padding: 2px 6px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); background: rgba(255,255,255,.03); font: 11px/1.4 ui-monospace, monospace; }

.filters-wrap { border-top: 1px solid rgba(255,255,255,.045); }
.filters { min-height: 52px; display: flex; align-items: center; gap: 7px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; padding-block: 8px; }
.platforms { display: flex; align-items: center; gap: 5px; flex: none; }
.chip { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; border-radius: 9px; padding: 6px 10px; white-space: nowrap; font-size: 12px; }
.chip svg { width: 15px; height: 15px; }
.chip.is-active { background: var(--pink); border-color: var(--pink); color: white; box-shadow: 0 5px 18px rgba(255,71,155,.2); }
.chip--platform.is-active { background: rgba(255,71,155,.17); border-color: rgba(255,71,155,.48); }
.chip--reset { color: var(--muted); }
.control { min-height: 34px; max-width: 160px; border-radius: 9px; padding: 6px 28px 6px 9px; background-color: var(--input); color: var(--text); white-space: nowrap; }
.control--month { width: 115px; }
.control--year { width: 78px; }
.period-control { display: flex; align-items: center; gap: 4px; flex: none; }

.main { padding-block: 20px 42px; }
.hero-strip { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 13px; }
.eyebrow { margin: 0 0 3px; color: var(--pink); font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.hero-strip h1 { margin: 0; font-size: clamp(18px, 2.4vw, 27px); line-height: 1.2; letter-spacing: -.02em; }
.muted { margin: 5px 0 0; color: var(--muted); }
.view-toggle { display: flex; gap: 4px; }

.month-rail { display: flex; gap: 7px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; padding: 2px 1px 13px; margin-bottom: 4px; }
.month-tile { min-width: 130px; scroll-snap-align: start; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.025); color: var(--text); }
.month-tile:hover { border-color: var(--border-strong); background: rgba(255,71,155,.06); }
.month-tile.is-active { border-color: rgba(255,71,155,.58); background: rgba(255,71,155,.11); }
.month-tile span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.month-tile strong { color: var(--pink); font-size: 15px; font-variant-numeric: tabular-nums; }

.games-grid, .skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 13px; }
.games-grid[data-view="compact"] { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 9px; }
.game-card { position: relative; min-width: 0; min-height: 100%; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(155deg, rgba(255,255,255,.035), rgba(255,255,255,.015)); box-shadow: 0 10px 32px rgba(0,0,0,.14); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.game-card:hover { transform: translateY(-3px); border-color: rgba(255,71,155,.43); box-shadow: 0 16px 40px rgba(0,0,0,.26); }
.game-card__button { width: 100%; height: 100%; display: flex; flex-direction: column; padding: 0; text-align: left; color: inherit; border: 0; background: transparent; }
.game-card__cover { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: linear-gradient(135deg, #1b1025, #251130); }
.game-card__cover img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .35s ease; }
.game-card:hover .game-card__cover img { transform: scale(1.025); }
.game-card__gradient { position: absolute; inset: 34% 0 0; background: linear-gradient(transparent, rgba(8,4,13,.94)); pointer-events: none; }
.card-badges { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px; pointer-events: none; }
.badge { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 7px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(7,4,11,.72); backdrop-filter: blur(8px); color: #e9dff0; font-size: 9px; font-weight: 700; letter-spacing: .02em; }
.badge--soon { border-color: rgba(52,211,153,.35); color: #b7f7dc; }
.badge--released { color: #c9bdcf; }
.game-card__body { flex: 1; display: flex; flex-direction: column; gap: 7px; padding: 10px 11px 11px; }
.game-card__title { margin: 0; min-height: 2.5em; color: var(--text); font-size: 13px; line-height: 1.25; font-weight: 750; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.game-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--muted); font-size: 10px; }
.game-card__date { color: #d9cce1; white-space: nowrap; }
.rating { display: inline-flex; align-items: center; gap: 3px; color: #facc15; white-space: nowrap; }
.card-platforms { display: flex; gap: 4px; flex-wrap: wrap; min-height: 21px; }
.platform-tag { padding: 2px 6px; border: 1px solid rgba(192,132,252,.22); border-radius: 999px; color: #d8b4fe; background: rgba(192,132,252,.07); font-size: 9px; white-space: nowrap; }
.game-card__actions { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-top: auto; padding-top: 2px; }
.card-action { min-height: 31px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255,255,255,.03); color: var(--muted); font-size: 10px; text-decoration: none; }
.card-action:hover { color: var(--text); border-color: var(--border-strong); background: var(--pink-soft); }
.watch-btn { width: 31px; padding: 0; color: var(--muted); }
.watch-btn.is-active { color: var(--green); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }

.games-grid[data-view="compact"] .game-card__body { padding: 8px; gap: 5px; }
.games-grid[data-view="compact"] .game-card__title { font-size: 11px; min-height: 2.4em; }
.games-grid[data-view="compact"] .game-card__meta { font-size: 9px; }
.games-grid[data-view="compact"] .game-card__actions { display: none; }
.games-grid[data-view="compact"] .card-platforms { display: none; }

.skeleton-grid { min-height: max(430px, calc(100vh - 180px)); }
.skeleton-card { overflow: hidden; aspect-ratio: 3 / 5.75; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(100deg, rgba(255,255,255,.025) 20%, rgba(255,255,255,.07) 40%, rgba(255,255,255,.025) 60%); background-size: 220% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position-x: -220%; } }

.load-more-wrap { display: flex; justify-content: center; padding: 22px 0 0; }
.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty-state__icon { font-size: 42px; filter: grayscale(.2); }
.empty-state h2 { margin: 10px 0 4px; color: var(--text); }
.empty-state p { margin: 0 0 16px; }
.badge--online { background: rgba(74, 222, 128, .16); color: #86efac; border-color: rgba(74, 222, 128, .32); }

.game-dialog, .trailer-dialog, .calendar-dialog { padding: 0; border: 1px solid var(--border); border-radius: 18px; color: var(--text); background: #110919; box-shadow: var(--shadow); }
.game-dialog { width: min(920px, calc(100% - 24px)); max-height: min(90vh, 850px); overflow: auto; }
.trailer-dialog { width: min(980px, calc(100% - 24px)); }
.game-dialog::backdrop, .trailer-dialog::backdrop, .calendar-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(6px); }
.dialog-close { position: sticky; float: right; top: 10px; margin: 10px 10px -48px 0; z-index: 4; background: rgba(8,4,13,.82); font-size: 24px; }
.calendar-dialog { width: min(620px, calc(100% - 24px)); }
.calendar-dialog__content { padding: 30px; }
.calendar-dialog__content h2 { margin: 2px 0 7px; font-size: 25px; }
.calendar-feed-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 22px 0; }
.calendar-feed-choice { min-height: 92px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: rgba(255,255,255,.025); text-align: left; }
.calendar-feed-choice strong, .calendar-feed-choice span { display: block; }
.calendar-feed-choice span { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.calendar-feed-choice.is-active { border-color: var(--pink); background: var(--pink-soft); box-shadow: 0 0 0 1px rgba(244,63,145,.18); }
.calendar-subscribe-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.calendar-subscribe-actions a { text-decoration: none; }
.calendar-download-row { display: flex; justify-content: space-between; gap: 14px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.calendar-download-row .text-btn { padding: 0; border: 0; color: var(--pink); background: transparent; font: inherit; font-weight: 700; }
.detail-hero { display: grid; grid-template-columns: minmax(220px, 31%) 1fr; min-height: 420px; }
.detail-cover { min-height: 420px; background: #1a0e24; }
.detail-cover img { width: 100%; height: 100%; display: block; object-fit: cover; }
.detail-main { padding: 32px; }
.detail-kicker { margin: 0 0 6px; color: var(--pink); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .09em; }
.detail-main h2 { margin: 0; font-size: clamp(24px, 5vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0; }
.detail-meta .badge { background: rgba(255,255,255,.04); }
.detail-summary { color: #c7bacf; line-height: 1.65; }
.detail-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 18px 0; }
.fact { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.022); }
.fact span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.fact strong { display: block; margin-top: 3px; font-size: 12px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.detail-actions a, .detail-actions button { text-decoration: none; }
.detail-links { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 7px; }
.store-link { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: rgba(255,255,255,.025); color: #d9cce1; text-decoration: none; }
.store-link:hover { border-color: var(--border-strong); color: white; }
.video-frame { aspect-ratio: 16/9; background: #000; }
.video-frame iframe { width: 100%; height: 100%; display: block; border: 0; }

.toast-region { position: fixed; right: 14px; bottom: 14px; z-index: 100; display: grid; gap: 7px; pointer-events: none; }
.toast { max-width: min(360px, calc(100vw - 28px)); padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: rgba(24,13,34,.95); box-shadow: var(--shadow); animation: toast-in .18s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
.noscript { margin: 30px; padding: 15px; border: 1px solid var(--danger); border-radius: 10px; color: #fecdd3; }

@media (max-width: 1180px) {
  .topbar__row { grid-template-columns: auto 1fr auto; }
  .stat-pill { min-width: 72px; padding-inline: 6px; }
  .brand__copy small { display: none; }
  .topbar__actions .primary-btn span { display: none; }
  .topbar__actions .primary-btn { width: 40px; padding: 0; }
}
@media (max-width: 820px) {
  .shell { width: min(100% - 18px, var(--shell)); }
  .topbar__row { min-height: 60px; gap: 8px; }
  .brand { min-width: 0; }
  .brand__logo { width: 36px; height: 36px; }
  .brand__copy strong { font-size: 16px; }
  .topbar__stats { justify-self: end; gap: 0; overflow-x: auto; }
  .stat-pill { min-width: 58px; padding: 5px 4px; }
  .stat-pill strong { font-size: 15px; }
  .stat-pill span { font-size: 7px; }
  .topbar__actions { grid-column: 1/-1; justify-content: flex-end; padding-bottom: 7px; }
  .filters { padding-block: 7px; }
  .main { padding-top: 14px; }
  .games-grid, .skeleton-grid { grid-template-columns: repeat(auto-fill,minmax(155px,1fr)); gap: 9px; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-cover { max-height: 360px; min-height: 0; aspect-ratio: 16/10; }
  .detail-main { padding: 22px; }
}
@media (max-width: 560px) {
  .topbar__row { grid-template-columns: 1fr auto; }
  .topbar__stats { grid-column: 1/-1; grid-row: 2; justify-self: stretch; justify-content: space-between; }
  .topbar__actions { grid-column: 1/-1; grid-row: 3; justify-content: flex-end; padding: 0; }
  .hero-strip { align-items: center; }
  .hero-strip h1 { font-size: 19px; }
  .games-grid, .skeleton-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .game-card__title { font-size: 11px; }
  .game-card__meta { align-items: flex-start; flex-direction: column; gap: 3px; }
  .card-platforms { display: none; }
  .game-card__actions { grid-template-columns: 1fr 31px; }
  .detail-facts { grid-template-columns: 1fr; }
  .calendar-dialog__content { padding: 24px 17px; }
  .calendar-feed-choices { grid-template-columns: 1fr; }
  .calendar-subscribe-actions > * { width: 100%; justify-content: center; }
  .calendar-download-row { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
