:root {
  --bg: #07090f;
  --bg-elev: rgba(15, 20, 34, 0.72);
  --bg-card: rgba(14, 19, 32, 0.84);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f7ff;
  --text-soft: #b6c2dc;
  --text-muted: #7c8aa8;

  --aura-1: #eab145;
  --aura-2: #4cc9a0;
  --hero-accent: #eab145;
  --hero-accent-2: #4cc9a0;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;

  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1.2, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Ambient Reactive Canvas & Aura ---------- */
#ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  pointer-events: none;
  opacity: 0.72;
}

.aura-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.aura {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.24;
  transition: background 1.1s var(--ease-out-expo), transform 1.4s var(--ease-out-expo);
  will-change: transform, background;
}

.aura-1 {
  width: min(68vw, 820px);
  height: min(68vw, 820px);
  top: -220px;
  left: -140px;
  background: radial-gradient(circle, var(--aura-1) 0%, transparent 70%);
  animation: auraFloat1 18s ease-in-out infinite alternate;
}

.aura-2 {
  width: min(60vw, 760px);
  height: min(60vw, 760px);
  right: -180px;
  top: 120px;
  background: radial-gradient(circle, var(--aura-2) 0%, transparent 70%);
  animation: auraFloat2 22s ease-in-out infinite alternate;
}

.grid-mesh {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 10%, transparent 80%);
}

@keyframes auraFloat1 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(60px, 40px) scale(1.08); }
}

@keyframes auraFloat2 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-50px, 60px) scale(1.12); }
}

/* ---------- Top Navigation ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  background: rgba(7, 9, 15, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.topbar.scrolled {
  background: rgba(7, 9, 15, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.11);
}

.topbar-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-emblem {
  width: 36px;
  height: 36px;
  display: inline-flex;
  filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.35));
  transition: transform 0.35s var(--ease-spring);
}

.brand:hover .brand-emblem {
  transform: rotate(-5deg) scale(1.06);
}

.brand-text {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #7dd3fc;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #a7f3d0;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
  animation: pulseDot 2.2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
  max-width: 640px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 340px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0 12px 0 14px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.search-box:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(125, 211, 252, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-box input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 9px 10px;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-clear {
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: var(--text);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  margin-right: 4px;
}

.kbd-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

/* ---------- Buttons ---------- */
.btn-ghost,
.btn-secondary,
.btn-icon,
.btn-primary {
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.25s var(--ease-spring), background 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
  white-space: nowrap;
}

.btn-ghost {
  padding: 9px 15px;
  font-size: 0.86rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border);
}

.btn-ghost svg {
  width: 16px;
  height: 16px;
  transition: transform 0.45s var(--ease-spring);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn-ghost:hover svg {
  transform: rotate(22deg) scale(1.08);
}

.btn-ghost.shuffling svg {
  animation: spinDice 0.35s linear infinite;
}

@keyframes spinDice {
  to { transform: rotate(360deg); }
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.btn-icon svg {
  width: 17px;
  height: 17px;
}

.btn-icon:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--border-strong);
}

.btn-icon[aria-pressed="true"] {
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.14);
}

.btn-primary {
  position: relative;
  overflow: hidden;
  padding: 13px 24px;
  font-size: 0.96rem;
  font-weight: 700;
  color: #080b12;
  background: linear-gradient(135deg, var(--hero-accent), color-mix(in srgb, var(--hero-accent) 68%, #ffffff));
  border: 0;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--hero-accent) 36%, transparent);
}

.btn-primary svg {
  width: 17px;
  height: 17px;
}

.btn-primary .ext-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.25s var(--ease-spring);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 38px color-mix(in srgb, var(--hero-accent) 52%, transparent);
}

.btn-primary:hover .ext-arrow {
  transform: translate(2px, -2px);
}

.btn-primary-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.48) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.75s var(--ease-out-expo);
}

.btn-primary:hover .btn-shine {
  transform: translateX(120%);
}

.btn-secondary {
  padding: 12px 20px;
  font-size: 0.92rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
}

.btn-secondary svg {
  width: 17px;
  height: 17px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-2px);
}

/* ---------- Main Container ---------- */
.page-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 22px 24px 72px;
}

/* ---------- Hero Spotlight ---------- */
.hero-section {
  margin-bottom: 28px;
}

.hero-stage {
  position: relative;
  min-height: 490px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: #0b1020;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.62),
    0 0 0 1px color-mix(in srgb, var(--hero-accent) 22%, transparent) inset;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: box-shadow 0.6s ease, border-color 0.6s ease;
}

.hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.04);
  transition: opacity 0.45s ease, transform 7s ease-out;
  will-change: transform, opacity;
}

.hero-stage.is-switching .hero-img {
  opacity: 0.18;
  transform: scale(1.09);
}

.hero-stage.is-active .hero-img {
  transform: scale(1.0);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(95deg, rgba(6, 9, 16, 0.94) 0%, rgba(6, 9, 16, 0.72) 44%, rgba(6, 9, 16, 0.18) 78%, rgba(6, 9, 16, 0.38) 100%),
    linear-gradient(0deg, rgba(6, 9, 16, 0.95) 0%, rgba(6, 9, 16, 0.45) 38%, rgba(6, 9, 16, 0.1) 70%);
}

.hero-scanlines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.014) 0px,
    rgba(255, 255, 255, 0.014) 1px,
    transparent 1px,
    transparent 4px
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  padding: 38px 42px 26px;
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out-expo);
}

.hero-stage.is-switching .hero-content {
  opacity: 0;
  transform: translateY(10px);
}

.hero-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.pill-accent {
  color: #07090f;
  background: var(--hero-accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--hero-accent) 45%, transparent);
}

.pill-glass {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.pill-mono {
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #cbd5e1;
  background: rgba(7, 10, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.4vw, 3.65rem);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.025em;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

.hero-subtitle {
  margin: 10px 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--hero-accent) 75%, #ffffff);
  letter-spacing: 0.01em;
}

.hero-desc {
  margin: 12px 0 0;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 58ch;
}

.hero-specs {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-chip {
  font-size: 0.78rem;
  font-weight: 500;
  color: #dce6f7;
  padding: 5px 11px;
  border-radius: 10px;
  background: rgba(10, 14, 25, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Hero Rail */
.hero-rail {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 20px 18px;
  background: linear-gradient(180deg, transparent, rgba(5, 8, 14, 0.88) 40%);
}

.rail-item {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 7px 9px;
  background: rgba(12, 16, 28, 0.68);
  backdrop-filter: blur(10px);
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  transition: transform 0.25s var(--ease-spring), border-color 0.25s ease, background 0.25s ease, color 0.2s ease;
}

.rail-item:hover {
  transform: translateY(-2px);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(20, 26, 44, 0.85);
}

.rail-item[aria-selected="true"] {
  color: var(--text);
  border-color: color-mix(in srgb, var(--item-accent) 72%, #ffffff);
  background: rgba(22, 28, 46, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
}

.rail-thumb {
  width: 32px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.rail-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2.5px;
  width: 0%;
  background: var(--item-accent);
  box-shadow: 0 0 10px var(--item-accent);
}

.rail-item[aria-selected="true"] .rail-progress {
  animation: railFill 8s linear forwards;
}

.hero-stage.is-paused .rail-item[aria-selected="true"] .rail-progress {
  animation-play-state: paused;
}

@keyframes railFill {
  from { width: 0%; }
  to { width: 100%; }
}

/* ---------- Recently Played ---------- */
.recent-section {
  margin-bottom: 24px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: rgba(14, 19, 32, 0.6);
  border: 1px solid var(--border);
}

.section-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-mini-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-mini-title svg {
  width: 15px;
  height: 15px;
  color: #7dd3fc;
}

.text-btn {
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.text-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.recent-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  transition: transform 0.2s var(--ease-spring), border-color 0.2s ease, background 0.2s ease;
}

.recent-chip:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--chip-accent);
}

.recent-chip img {
  width: 34px;
  height: 24px;
  border-radius: 999px;
  object-fit: cover;
}

/* ---------- Controls / Filter Bar ---------- */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: transform 0.2s var(--ease-spring), background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter-pill:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.filter-pill[aria-selected="true"] {
  color: #07090f;
  background: #f4f7ff;
  border-color: #f4f7ff;
  box-shadow: 0 6px 22px rgba(244, 247, 255, 0.22);
}

.filter-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.72;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sort-select {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  cursor: pointer;
  outline: none;
}

.sort-select:focus {
  border-color: rgba(125, 211, 252, 0.5);
}

.sort-select option {
  background: #0e1320;
  color: var(--text);
}

/* ---------- 3D Holographic Game Cards ---------- */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
  perspective: 1200px;
}

.game-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  transition: transform 0.35s var(--ease-out-expo), border-color 0.3s ease, box-shadow 0.35s ease;
  animation: cardIn 0.55s var(--ease-out-expo) both;
  animation-delay: calc(var(--card-index, 0) * 55ms);
  will-change: transform;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--card-accent) 90%, #ffffff),
    transparent 62%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 4;
}

.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    360px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.11),
    transparent 65%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 3;
}

.game-card:hover::before,
.game-card:hover::after,
.game-card.is-highlighted::before {
  opacity: 1;
}

.game-card:hover,
.game-card.is-highlighted {
  border-color: color-mix(in srgb, var(--card-accent) 62%, transparent);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.58),
    0 0 38px color-mix(in srgb, var(--card-accent) 24%, transparent);
}

.card-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.card-link-overlay:focus-visible {
  outline: 2px solid var(--card-accent);
  outline-offset: 2px;
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 9.4;
  overflow: hidden;
  background: #0c1222;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s var(--ease-out-expo), filter 0.4s ease;
}

.game-card:hover .card-media img {
  transform: scale(1.07);
}

.card-media-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 9, 15, 0.12) 0%, rgba(7, 9, 15, 0.05) 45%, rgba(14, 19, 32, 0.96) 100%);
}

.card-top-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.card-badges {
  display: flex;
  gap: 6px;
}

.card-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  color: #07090f;
  background: var(--card-accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.card-badge-played {
  color: #e2e8f0;
  background: rgba(8, 12, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-info-btn {
  pointer-events: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 12, 22, 0.72);
  backdrop-filter: blur(8px);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--ease-spring), background 0.2s ease, border-color 0.2s ease;
}

.card-info-btn svg {
  width: 15px;
  height: 15px;
}

.card-info-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.2);
  border-color: #ffffff;
}

.card-launch-pill {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -35%) scale(0.92);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #07090f;
  background: linear-gradient(135deg, var(--card-accent), color-mix(in srgb, var(--card-accent) 70%, #ffffff));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: opacity 0.28s ease, transform 0.35s var(--ease-spring);
}

.card-launch-pill svg {
  width: 15px;
  height: 15px;
}

.game-card:hover .card-launch-pill {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.card-body {
  position: relative;
  z-index: 2;
  padding: 14px 20px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  pointer-events: none;
}

.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}

.card-genre {
  font-size: 0.74rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--card-accent) 82%, #ffffff);
  flex-shrink: 0;
}

.card-desc {
  margin: 8px 0 14px;
  font-size: 0.88rem;
  line-height: 1.52;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tag-chip {
  font-size: 0.72rem;
  font-weight: 500;
  color: #cbd5e1;
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.075);
}

.card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-domain {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card-domain-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--card-accent);
  box-shadow: 0 0 8px var(--card-accent);
}

.card-cta-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s ease, transform 0.25s var(--ease-spring);
}

.card-cta-label svg {
  width: 14px;
  height: 14px;
}

.game-card:hover .card-cta-label {
  color: color-mix(in srgb, var(--card-accent) 85%, #ffffff);
  transform: translateX(2px);
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  border-radius: var(--radius-lg);
  background: rgba(14, 19, 32, 0.55);
  border: 1px dashed rgba(255, 255, 255, 0.14);
}

.empty-state h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--text-soft);
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 6, 12, 0.78);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.22s ease;
}

.modal-backdrop[hidden] {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 740px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 24px;
  background: #0d1220;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.72);
  animation: modalRise 0.34s var(--ease-out-expo);
}

@keyframes modalRise {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(7, 9, 15, 0.75);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-media {
  position: relative;
  aspect-ratio: 16 / 6.8;
  max-height: 250px;
  overflow: hidden;
}

.modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-media-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 18, 32, 0.1) 25%, #0d1220 100%);
}

.modal-media-pills {
  position: absolute;
  left: 24px;
  bottom: 16px;
  display: flex;
  gap: 8px;
}

.modal-body {
  padding: 6px 26px 26px;
}

.modal-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.9rem;
  letter-spacing: -0.02em;
}

.modal-subtitle {
  margin: 5px 0 0;
  font-size: 0.94rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--hero-accent) 78%, #ffffff);
}

.modal-desc {
  margin: 14px 0 18px;
  color: var(--text-soft);
  line-height: 1.62;
  font-size: 0.95rem;
}

.modal-grid-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.meta-tile {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.meta-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.modal-section {
  margin-bottom: 16px;
}

.modal-chips {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.modal-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(7, 9, 15, 0.55);
}

.footer-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 20px 24px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.05em;
}

.footer-sep {
  margin: 0 8px;
}

.footer-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-keys kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-soft);
  margin-right: 3px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  background: rgba(13, 18, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  backdrop-filter: blur(12px);
  animation: toastIn 0.28s var(--ease-spring);
}

.toast[hidden] {
  display: none;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 14px) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .hero-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar-inner {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .live-pill {
    display: none;
  }

  .topbar-actions {
    width: 100%;
    max-width: none;
  }

  .page-shell {
    padding: 16px 16px 56px;
  }

  .hero-stage {
    min-height: 440px;
    border-radius: 22px;
  }

  .hero-content {
    padding: 26px 22px 18px;
  }

  .hero-rail {
    display: flex;
    overflow-x: auto;
    padding: 10px 16px 14px;
    scrollbar-width: none;
  }

  .hero-rail::-webkit-scrollbar {
    display: none;
  }

  .rail-item {
    min-width: 155px;
    flex-shrink: 0;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .modal-grid-meta {
    grid-template-columns: 1fr;
  }

  .btn-ghost span,
  .kbd-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
