:root {
  --bg-0:        #070b16;
  --bg-1:        #0d1326;
  --panel:       #131c35;
  --panel-2:     #1a2544;
  --line:        #2b3760;
  --text:        #e7ecff;
  --muted:       #aab8dd;
  --brand:       #54d6ff;
  --up:          #3ddc97;
  --down:        #ff5d7a;
  --warn:        #ffb454;
  --gold:        #f7d154;
  --ps-color:    #0072ce;
  --steam-color: #1a9fff;
  --xbox-color:  #4ade80;
}

* { box-sizing: border-box; }

html {
  background-color: var(--bg-0);
  color-scheme: dark;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background-color: var(--bg-0);
  background: linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/*  Navigation  */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  height: 54px;
  background: rgba(7, 11, 22, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  margin-right: 8px;
}
.nav-brand:hover { color: var(--brand); text-decoration: none; }
.nav-brand-icon { font-size: 1.25rem; }

.nav-links {
  display: flex;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
  gap: 2px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.14s, background 0.14s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.nav-link.active              { color: var(--brand);        background: rgba(84, 214, 255, 0.10); }
.nav-link.active.nav-steam    { color: var(--steam-color);  background: rgba(26, 159, 255, 0.10); }
.nav-link.active.nav-ps       { color: var(--ps-color);     background: rgba(0, 114, 206, 0.10); }
.nav-link.active.nav-xbox     { color: var(--xbox-color);   background: rgba(74, 222, 128, 0.10); }

.nav-disabled {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  font-size: 0.88rem;
  color: #3e4a61;
  cursor: default;
  border-radius: 8px;
  white-space: nowrap;
}
.nav-disabled::after { content: " (soon)"; font-size: 0.72rem; opacity: 0.7; }

.nav-x-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-left: 12px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #000;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.nav-x-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: 0 0 auto;
}

.nav-x-link:hover {
  background: #111;
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  text-decoration: none;
}

.nav-x-link:active {
  transform: scale(0.97);
}

.nav-auth {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
  white-space: nowrap;
}

.nav-auth-text {
  color: var(--muted);
  font-size: 0.84rem;
}
.nav-auth-text strong { color: var(--text); }

.nav-auth-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(84, 214, 255, 0.2);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  background: rgba(84, 214, 255, 0.08);
}
.nav-auth-link:hover {
  color: #d8f3ff;
  border-color: rgba(84, 214, 255, 0.45);
  background: rgba(84, 214, 255, 0.14);
  text-decoration: none;
}

.nav-auth-logout {
  color: #ffd5de;
  border-color: rgba(255, 93, 122, 0.25);
  background: rgba(255, 93, 122, 0.12);
}
.nav-auth-logout:hover {
  color: #ffe8ee;
  border-color: rgba(255, 93, 122, 0.5);
  background: rgba(255, 93, 122, 0.2);
}

/*  Content area  */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 16px;
}

h1 {
  margin: 0 0 8px 0;
  font-size: clamp(1.5rem, 2.2vw, 2.2rem);
  letter-spacing: 0.03em;
}

h2 { margin: 0 0 12px; font-size: 1.18rem; color: #dce6ff; }

.subtitle { margin: 0 0 16px; color: var(--muted); font-size: 0.93rem; }
.generated-at {
  margin-top: 14px;
  margin-bottom: 0;
  font-size: 0.82rem;
  opacity: 0.92;
}

a { color: #c3e8ff; text-decoration: none; }
a:hover { color: #fff; text-decoration: underline; }

/* Table controls */
.table-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.table-controls label { color: var(--muted); font-size: 0.9rem; }

.filter-group { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.filter-group label { display: inline-flex; align-items: center; gap: 6px; }
.filter-group input[type="checkbox"] { accent-color: var(--brand); }

.search-group { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }

.table-controls input[type="search"] {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  background: rgba(8, 14, 30, 0.7);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  outline: none;
}
.table-controls input[type="search"]::placeholder { color: #8fa1d4; }
.table-controls input[type="search"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(84, 214, 255, 0.16);
}

/*  Data table  */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: 10px 11px; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.94rem; }
th {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.84rem;
}
tbody tr:hover { background: rgba(84, 214, 255, 0.07); }

/*  State/indicator classes  */
.change-up   { color: var(--up);   font-weight: 700; }
.change-down { color: var(--down); font-weight: 700; }
.new-entry   { color: #c0c6d8;    font-weight: 700; }
.estimated   { color: var(--warn); font-weight: 700; }

.center-col   { text-align: center; }
.rank-col     { white-space: nowrap; width:90px;}
.rank-indicator { margin-left: 6px; font-size: 0.78rem; font-weight: 700; }
.release-date { white-space: nowrap; }
.momentum     { white-space: nowrap; font-weight: 700; }
.momentum-very-high { color: #5eead4; }
.momentum-high      { color: #7dd3fc; }
.momentum-moderate  { color: #a7f3d0; }
.momentum-none      { color: #94a3b8; }

.sortable { cursor: pointer; user-select: none; }
.sortable.sorted-asc::after  { content: " ▲"; font-size: 0.72rem; }
.sortable.sorted-desc::after { content: " ▼"; font-size: 0.72rem; }

.star-col { width: 40px; }
.star-toggle {
  border: none;
  background: transparent;
  color: #7c8eb8;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.star-toggle:hover { color: var(--gold); }
.star-toggle.is-starred { color: var(--gold); }

.table-game-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.table-game-link > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-game-thumb {
  width: 96px;
  height: 44px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: rgba(8, 14, 30, 0.75);
  flex-shrink: 0;
  display: inline-block;
}

.table-game-thumb-empty {
  background: rgba(160, 176, 210, 0.14);
}

/* Google Fonts (game detail typography) */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=IBM+Plex+Mono:wght@300;400;500&family=Barlow:wght@300;400;500;600&display=swap');

/* Game hero / detail  */
.crumb {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.02em;
}
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--text); text-decoration: none; }

.game-hero {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  padding: 18px 18px 14px;
  margin-bottom: 14px;
}

.game-subtitle {
  margin: 4px 0 10px;
  color: rgba(200, 215, 255, 0.6);
  font-family: 'Barlow', sans-serif;
  font-style: italic;
  font-size: 1rem;
}

/* Cinematic hero banner  */
.detail-hero {
  position: relative;
  min-height: 320px;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-bottom: 18px;
  border: 1px solid var(--line);
}

/* PS-only: no background image — use a rich gradient */
.detail-hero-ps {
  background:
    radial-gradient(ellipse 70% 60% at 10% 0%, rgba(71, 132, 222, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse 50% 80% at 90% 100%, rgba(30, 60, 120, 0.25) 0%, transparent 55%),
    linear-gradient(160deg, #08101e 0%, #0a1628 60%, #0d1f3c 100%);
}

/* Steam / mapped: full background image with cinematic overlays */
.detail-hero-with-art {
  --hero-grad-1: rgba(7,11,22,0.35);
  --hero-grad-2: rgba(7,11,22,0.15);
  --hero-grad-3: rgba(7,11,22,0.15);
  background-image:
    linear-gradient(to top,    #070b16 0%, #070b16 6%, rgba(7,11,22,0.72) 42%, rgba(7,11,22,0.18) 100%),
    linear-gradient(to right,  rgba(7,11,22,0.75) 0%, transparent 38%),
    linear-gradient(to left,   rgba(7,11,22,0.45) 0%, transparent 28%),
    var(--hero-image);
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  border-color: rgba(140, 173, 245, 0.22);
}
.detail-hero-with-art::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(120deg, var(--hero-grad-1) 0%, var(--hero-grad-2) 48%, var(--hero-grad-3) 100%);
  transition: background 0.8s ease, opacity 0.8s ease;
  opacity: 0.74;
}

/* Cover art portrait (right side) */
.detail-hero-media {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 140px;
  height: 220px;
  border-radius: 10px;
  border: 1px solid rgba(196, 213, 255, 0.15);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.06);
  background: linear-gradient(180deg, #1a2b43, #0f1f34);
  z-index: 3;
  flex-shrink: 0;
}
.detail-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Content sits above overlays */
.detail-hero-inner {
  position: relative;
  z-index: 2;
  padding: 28px 28px 24px;
}
.detail-hero-has-media .detail-hero-inner {
  padding-right: 172px;
}

/* Source attribution badge */
.detail-hero-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  margin-bottom: 10px;
}

.detail-hero-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.detail-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  border: 1px solid rgba(188, 206, 250, 0.2);
  background: rgba(10, 20, 40, 0.55);
  backdrop-filter: blur(4px);
  color: #dbe7ff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
}

/* Game title in hero */
.detail-hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 0.93;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  margin: 0 0 8px;
  word-break: break-word;
}

.detail-hero .game-subtitle {
  margin: 4px 0 14px;
  color: rgba(200, 215, 255, 0.55);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.detail-actions .store-link { margin-top: 0; }

.meta-inline {
  margin: 10px 0 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  color: rgba(200,215,255,0.45);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.meta-inline strong { color: rgba(200,215,255,0.65); font-weight: 500; }

/* Stats row */
.detail-stats {
  margin: 0 0 18px;
}

.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}

.detail-stat {
  background: rgba(9, 16, 32, 0.85);
  padding: 16px 14px;
  transition: background 0.15s;
}
.detail-stat:hover { background: rgba(14, 24, 48, 0.9); }

.detail-stat-label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--muted);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.detail-stat-value {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  margin-top: 8px;
  color: #f0f5ff;
  font-size: 1.18rem;
  font-weight: 500;
  line-height: 1.1;
}

.detail-stat-sub {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  margin-top: 5px;
  color: #6b7a9c;
  font-size: 0.68rem;
}

/* Chart + info sidebar layout */
.detail-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: start;
}

.detail-chart-stack {
  display: grid;
  gap: 16px;
}

.detail-info-stack {
  display: grid;
  gap: 16px;
}

/* Info sidebar card */
.detail-info-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 16, 32, 0.85);
  overflow: hidden;
}

.detail-info-title {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: var(--text);
}

.detail-info-row {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.detail-info-row:last-child { border-bottom: none; }

.detail-info-label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--muted);
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.detail-info-value {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  margin-top: 4px;
  color: #e8efff;
  font-size: 0.84rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.detail-platform-links a.ps-platform-chip {
  text-decoration: none;
}

.detail-platform-links a.ps-platform-chip:hover {
  color: #ffffff;
  text-decoration: none;
  filter: brightness(1.08);
}

.estimated-note {
  margin: 0;
  color: #ffd9a0;
  font-weight: 700;
  line-height: 1.4;
}
.estimated-note a {
  color: #ffe7c2;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.estimated-note a:hover {
  color: #fff1da;
}

/* Chart panel */
.chart-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 16, 32, 0.85);
  padding: 18px 18px 14px;
}
.chart-panel h2 {
  margin: 0 0 4px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.chart-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}
.chart-panel .subtitle {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--muted);
  margin: 0 0 14px;
}
.chart-panel-header .subtitle {
  margin-bottom: 0;
}
.chart-view-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.chart-view-button {
  appearance: none;
  border: 1px solid rgba(132, 154, 202, 0.34);
  background: rgba(255, 255, 255, 0.04);
  color: #d8e4ff;
  border-radius: 999px;
  padding: 7px 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s, opacity 0.14s;
}
.chart-view-button:hover:not(:disabled) {
  border-color: rgba(111, 209, 255, 0.58);
  background: rgba(84, 214, 255, 0.08);
  color: #f5fbff;
}
.chart-view-button.is-active {
  border-color: rgba(84, 214, 255, 0.74);
  background: rgba(84, 214, 255, 0.18);
  color: #ffffff;
}
.chart-view-button:disabled {
  opacity: 0.45;
  cursor: default;
}
.chart-canvas-wrap { position: relative; width: 100%; height: 340px; }
#historyChart, #rankChart,
#topSellersHistoryChart, #wishlistHistoryChart, #ccuHistoryChart {
  display: block; width: 100% !important; height: 100% !important;
}
.chart-panel.chart-panel-empty { padding: 16px 18px; }

/* Store filter buttons (PS game page) */
.store-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.store-filters label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: transparent;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.store-filters label:hover { border-color: var(--brand); background: rgba(84,214,255,0.05); }
.store-filters input[type="checkbox"] { accent-color: var(--brand); }

/* Platform chips  */
.ps-platform-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ps-platform-chip {
  border: 1px solid #37507a;
  color: #d6e4ff;
  background: #1b2a42;
  border-radius: 999px;
  font-size: 0.74rem;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ps-platform-chip.ps5 { border-color: #2759ae; background: #16346b; }
.ps-platform-chip.ps4 { border-color: #4f46e5; background: #2a246f; }
.ps-platform-chip.steam { border-color: #1b6fb8; background: #0f375a; }
.ps-platform-chip.pc { border-color: #1d7a73; background: #103f3b; }
.ps-platform-chip.xboxone { border-color: #2e7d32; background: #18461c; }
.ps-platform-chip.xboxseries { border-color: #58a65c; background: #215f25; }
.ps-platform-chip.xcloud { border-color: #3b82f6; background: #183b72; }
.ps-platform-chip.handheld { border-color: #b7791f; background: #5f3b12; }

.price-stack { display: inline-flex; flex-direction: column; line-height: 1.05; gap: 3px; white-space: nowrap; }
.price-old     { font-size: 0.76rem; color: #93a5bf; text-decoration: line-through; }
.price-current { font-size: 1.02rem; font-weight: 700; color: #ebf2ff; }
.price-current-discount { color: #4ade80; font-weight: 700; }
.price-paren { color: #9fb0d3; }

.flag-yes { font-weight: 700; }
.flag-no  { font-weight: 700; }

.store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(84, 214, 255, 0.38);
  text-decoration: none;
  background: linear-gradient(180deg, rgba(34, 90, 154, 0.72), rgba(27, 70, 122, 0.92));
  color: #e5f5ff;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}
.store-link:hover {
  border-color: rgba(132, 227, 255, 0.75);
  background: linear-gradient(180deg, rgba(41, 109, 184, 0.78), rgba(31, 82, 143, 0.95));
  color: #ffffff;
  text-decoration: none;
}
.store-link.store-link-steam {
  border-color: rgba(92, 186, 255, 0.62);
  background: linear-gradient(180deg, rgba(41, 121, 201, 0.86), rgba(28, 88, 160, 0.98));
}
.store-link.store-link-steam:hover {
  border-color: rgba(145, 220, 255, 0.82);
  background: linear-gradient(180deg, rgba(49, 139, 228, 0.92), rgba(32, 103, 188, 1));
}
.store-link.store-link-ps {
  border-color: rgba(112, 132, 255, 0.6);
  background: linear-gradient(180deg, rgba(72, 87, 193, 0.86), rgba(55, 67, 158, 0.98));
}
.store-link.store-link-ps:hover {
  border-color: rgba(156, 171, 255, 0.84);
  background: linear-gradient(180deg, rgba(85, 104, 218, 0.92), rgba(63, 78, 186, 1));
}
.store-link.store-link-alt {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #d6e4ff;
}
.store-link.store-link-alt:hover {
  border-color: rgba(168, 187, 228, 0.68);
  background: rgba(255, 255, 255, 0.09);
  color: #f2f6ff;
}
.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.store-links .store-link {
  margin-top: 0;
}
.chart-panel.chart-panel-empty {
  padding-top: 16px;
  padding-bottom: 16px;
}

/* Rating badge */
.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(247, 209, 84, 0.12);
  border: 1px solid rgba(247, 209, 84, 0.35);
  border-radius: 10px;
  padding: 8px 14px;
  margin-top: 10px;
}
.rating-stars { color: var(--gold); font-size: 1.1rem; letter-spacing: 1px; }
.rating-score { font-weight: 700; font-size: 1.05rem; }
.rating-count  { color: var(--muted); font-size: 0.85rem; }

/* ── Portal / index page ────────────────────────────────────────────────── */
.portal-hero {
  text-align: center;
  padding: 48px 16px 36px;
}
.portal-hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0 0 12px;
  background: linear-gradient(135deg, var(--brand) 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.portal-hero p {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.5;
}

.stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.store-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 20px 20px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
  text-decoration: none;
  color: var(--text);
}
.store-card:hover { text-decoration: none; }
a.store-card:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 28px rgba(84, 214, 255, 0.14);
  transform: translateY(-2px);
}
.store-card-disabled {
  opacity: 0.45;
  cursor: default;
}

.store-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -1px;
}
.store-card-steam .store-icon { background: rgba(26, 159, 255, 0.15); color: var(--steam-color); }
.store-card-ps    .store-icon { background: rgba(0, 114, 206, 0.15);  color: var(--ps-color); }
.store-card-xbox  .store-icon { background: rgba(16, 124, 16, 0.15);  color: #4ade80; }
.store-card-epic  .store-icon { background: rgba(80, 80, 80, 0.2);    color: #94a3b8; }

.store-card h2 { margin: 0; font-size: 1.2rem; }
.store-card p  { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.45; flex: 1; }

.store-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand);
}
.store-card-soon {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4a5568;
  background: rgba(255,255,255,0.04);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  width: fit-content;
}

.section-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 32px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.top10-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

@media (min-width: 2200px) {
  .top10-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.home-topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(280px, 420px);
  gap: 14px;
  margin-bottom: 14px;
  align-items: center;
}

.home-topbar-title .subtitle {
  margin: 2px 0 0;
}

.home-stat-badges {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-stat-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 14, 30, 0.45);
  color: #a8b8de;
  font-size: 0.78rem;
  line-height: 1;
  padding: 7px 12px;
  white-space: nowrap;
}

.home-top-search {
  min-width: 0;
}

.home-top-search .search-wrap {
  position: relative;
}

.home-top-search .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #7d8eb7;
  font-size: 0.95rem;
  line-height: 1;
  pointer-events: none;
}

.home-top-search input[type="search"] {
  width: 100%;
  border: 1px solid #344067;
  background: rgba(8, 14, 30, 0.7);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px 10px 32px;
  outline: none;
  font-size: 0.9rem;
}

.home-top-search input[type="search"]::placeholder {
  color: var(--text);
}

.home-top-search input[type="search"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(84, 214, 255, 0.16);
}

.home-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a1024;
  overflow: hidden;
}

.home-search-results:empty {
  display: none;
}

.home-search-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.home-search-item:last-child {
  border-bottom: none;
}

.home-search-item:hover {
  background: var(--panel-2);
  text-decoration: none;
}

.home-search-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 600;
}

.top10-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.top10-card-link {
  cursor: pointer;
}

.top10-meta {
  margin: 0;
  padding: 8px 14px 6px;
  font-size: 0.75rem;
  color: #c2cee9;
  border-bottom: 1px solid var(--line);
}

.ch {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  background: linear-gradient(180deg, #283146, #181c2d)
}

.stag {
  font-size: 0.67rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.t-steam {
  color: #edf8ff;
  border-color: rgba(116, 192, 255, 0.72);
  background: rgba(5, 81, 113, 0.9)
}

.t-ps {
  color: #f4f8ff;
  border-color: rgba(157, 194, 255, 0.76);
  background: rgba(25, 92, 206, 0.9)
}

.t-xbox {
  color: #f0fff5;
  border-color: rgba(118, 234, 164, 0.76);
  background: rgba(24, 108, 58, 0.9)
}

.gr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.gr:hover {
  background: var(--panel-2);
  text-decoration: none;
}

.gr:last-of-type {
  border-bottom: none;
}

.rk,
.up-rank-num {
  width: 18px;
  text-align: right;
  color: #bcc8e4;
  font-weight: 700;
  flex-shrink: 0;
}

.gr-thumb-wrap {
  width: 110px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(8, 14, 30, 0.75);
  flex-shrink: 0;
}

.gr-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gr-thumb-empty {
  background: rgba(160, 176, 210, 0.14);
}

.gi {
  flex: 1 1 auto;
  min-width: 0;
}

.gr-meta {
  margin-left: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  min-width: 58px;
  flex-shrink: 0;
}

.gr-price {
  width: auto;
  text-align: right;
  font-size: 0.74rem;
  color: #d3ddf7;
  white-space: normal;
  flex-shrink: 0;
}

.gr-price-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  line-height: 1.05;
}

.gr-price-current {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ebf2ff;
}

.gr-price-current-discount {
  color: #4ade80;
}

.gr-price-old {
  font-size: 0.64rem;
  color: #b6c5de;
  text-decoration: line-through;
}

.gn {
  font-size: 0.86rem;
  font-weight: 600;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gp {
  margin-top: 2px;
  font-size: 0.72rem;
  color: #bec9e5;
}

.info-sections .chart-panel + .chart-panel {
  margin-top: 10px;
}

.ch2 {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.ch2.up {
  color: var(--up);
  background: rgba(0, 201, 167, 0.14);
}

.ch2.dn {
  color: var(--down);
  background: rgba(255, 95, 95, 0.14);
}

.ch2.eq {
  color: #dde6fb;
  background: rgba(255, 255, 255, 0.1);
}

.ch2.nw {
  color: #f3eeff;
  background: rgba(108, 99, 255, 0.36);
}

.more {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}

.more a {
  color: #9fe8ff;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.more a:hover {
  color: #e9fbff;
  text-decoration: underline;
}

.top10-empty {
  padding: 10px 14px 14px;
  color: #c3cde8;
  font-size: 0.84rem;
}

.upcoming-card {
  margin-bottom: 0;
}

.up-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 14px 8px 10px;
  border-bottom: 1px solid var(--line);
}

.up-row:hover {
  background: var(--panel-2);
}

.up-row:last-of-type {
  border-bottom: none;
}

.up-rank {
  width: 42px;
  flex: 42px 0 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  text-align: center;
  padding-top: 1px;
}

.up-rank-num { font-size: 0.82rem; }

.up-delta {
  min-width: 32px;
  font-size: 0.67rem;
  font-weight: 700;
  text-align: center;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #dde6fb;
}

.up-delta.up {
  color: var(--up);
  background: rgba(0, 201, 167, 0.14);
}

.up-delta.dn {
  color: var(--down);
  background: rgba(255, 95, 95, 0.14);
}

.up-delta.nw {
  color: #8df0b1;
  background: rgba(61, 220, 151, 0.18);
}

.up-thumb {
  width: 110px;
  min-width: 110px;
  height: 50px;
  display: block;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(8, 14, 30, 0.75);
}

.up-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.up-thumb-empty {
  background: rgba(160, 176, 210, 0.14);
}

.ps-top10-card .gr-thumb-wrap {
  width: 50px;
  height: 50px;
}

.up-main {
  min-width: 0;
  flex: 1;
}

.up-title {
  margin: 0 0 3px;
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.25;
}

.up-title a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.up-title a:hover {
  text-decoration: underline;
}

.up-release {
  color: #c6d2ee;
}

.up-gain {
  font-size: 0.8rem;
  color: #c4cee8;
  margin-bottom: 7px;
}

.up-gain strong {
  color: #8df0b1;
}

.up-gain-note {
  color: #bfcae5;
}

.up-spark {
  height: 28px;
}

.up-spark-bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  width: 100%;
  max-width: 180px;
  height: 28px;
}

.up-spark-col {
  position: relative;
  flex: 1 1 0;
  height: 100%;
}

.up-spark-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 1px 1px 0 0;
}

.up-spark-bar.up {
  background: linear-gradient(180deg, #0cdb6c, #0b6236);
}

.up-spark-bar.eq {
  bottom: 0;
  height: 2px;
  background: rgba(160, 176, 210, 0.74);
  border-radius: 0;
}

/* ── Auth pages ─────────────────────────────────────────────────────────── */
.auth-page {
  max-width: 760px;
}

.auth-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
  padding: 18px;
}

.auth-card h2 {
  margin-top: 20px;
}

.auth-card-wide {
  max-width: 740px;
}

.auth-form {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.auth-form label {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 5px;
}

.auth-form input:not([type="checkbox"]) {
  border: 1px solid var(--line);
  background: rgba(8, 14, 30, 0.7);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 8px;
  outline: none;
}
.auth-form input:not([type="checkbox"]):focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.14);
}

/* Keep browser autofill from painting bright yellow fields on dark auth forms. */
.auth-form input:not([type="checkbox"]):-webkit-autofill,
.auth-form input:not([type="checkbox"]):-webkit-autofill:hover,
.auth-form input:not([type="checkbox"]):-webkit-autofill:focus,
.auth-form input:not([type="checkbox"]):-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  border: 1px solid var(--line);
  -webkit-box-shadow: 0 0 0 1000px rgba(8, 14, 30, 0.7) inset;
  box-shadow: 0 0 0 1000px rgba(8, 14, 30, 0.7) inset;
  transition: background-color 9999s ease-out 0s;
}

.auth-form input:not([type="checkbox"]):-webkit-autofill:focus {
  border-color: var(--brand);
  -webkit-box-shadow: 0 0 0 1000px rgba(8, 14, 30, 0.7) inset, 0 0 0 2px rgba(108, 99, 255, 0.14);
  box-shadow: 0 0 0 1000px rgba(8, 14, 30, 0.7) inset, 0 0 0 2px rgba(108, 99, 255, 0.14);
}

.auth-form input:not([type="checkbox"]):-moz-autofill {
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 0 0 1000px rgba(8, 14, 30, 0.7) inset;
}

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand);
}

.auth-form button {
  margin-top: 10px;
  border: 1px solid rgba(156, 162, 191, 0.4);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #eef1ff;
  background: linear-gradient(180deg, rgba(108, 99, 255, 0.92), rgba(90, 82, 226, 0.95));
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.auth-form button:hover {
  background: linear-gradient(180deg, rgba(117, 108, 255, 0.95), rgba(94, 86, 236, 0.98));
  border-color: rgba(173, 178, 210, 0.55);
}
.auth-form button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.18);
}

.auth-alt {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-message {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.88rem;
}
.auth-message-error {
  color: #ffd7df;
  background: rgba(255, 93, 122, 0.14);
  border-color: rgba(255, 93, 122, 0.4);
}
.auth-message-success {
  color: #ceffe7;
  background: rgba(61, 220, 151, 0.14);
  border-color: rgba(61, 220, 151, 0.35);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 840px) {
  .search-group { margin-left: 0; width: 100%; }
  .table-controls input[type="search"] { width: 100%; }
  .home-topbar,
  .topbar.home-topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
  }
  .home-topbar-title,
  .home-stat-badges,
  .home-top-search {
    min-width: 0;
  }
  .home-stat-badges { display: none; }
  .home-stat-badge { white-space: normal; }
  .home-top-search .search-wrap { width: 100%; }
  .up-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
  }
  .up-thumb {
    width: 110px;
    min-width: 110px;
    height: 50px;
  }
  .chart-canvas-wrap { height: 320px; }
  .nav-disabled { display: none; }
  .meta-grid { grid-template-columns: 1fr; }
  .site-nav {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 12px;
    gap: 10px;
  }
  .nav-links {
    margin-left: 0;
    order: 2;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 3px;
  }
  .nav-x-link {
    order: 3;
    margin-left: auto;
    margin-right: 0;
    padding: 8px 14px;
    font-size: 0.81rem;
  }
  .nav-auth {
    margin-left: auto;
  }
  .nav-auth-text {
    display: none;
  }
  .detail-hero-has-media .detail-hero-inner {
    padding-right: 24px;
  }
  .detail-hero-media {
    display: none;
  }
  .detail-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1400px) {
  .top10-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .top10-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .top10-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------------- */
/* Layout v3 visual refresh (non-breaking: keeps existing HTML/JS hooks)  */
/* ---------------------------------------------------------------------- */
:root {
  --bg-0: #0d0f14;
  --bg-1: #121522;
  --panel: #161920;
  --panel-2: #1e2230;
  --line: #2a2f3d;
  --text: #e8eaf0;
  --muted: #8e95ab;
  --brand: #6c63ff;
  --accent2: #00c9a7;
  --gold: #f5c518;
  --up: #00c9a7;
  --down: #ff5f5f;
  --ps-color: #7aadff;
  --steam-color: #4a90d9;
}

body {
  display: grid;
  grid-template-columns: 174px minmax(0, 1fr);
  min-height: 100vh;
  background: radial-gradient(1200px 700px at 90% -10%, rgba(108, 99, 255, 0.18), transparent 45%), var(--bg-0);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

.site-nav {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 0 20px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  border-bottom: none;
  backdrop-filter: none;
}

.nav-toggle,
.nav-overlay {
  display: none;
}

.nav-brand {
  margin: 0 12px 6px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
  gap: 0;
  font-weight: 800;
  font-size: 1.03rem;
  display: block;
  max-width: calc(100% - 24px);
  overflow: hidden;
}

.nav-brand-icon {
  font-size: 1rem;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(108, 99, 255, 0.2);
  color: #c8c3ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-links {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-links li {
  list-style: none;
}

.nav-x-link {
  margin: auto 12px 0;
  padding: 9px 12px;
  min-height: 40px;
}

.nav-section-label {
  padding: 10px 12px 5px;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #79839a;
  font-weight: 700;
  margin-top: 6px;
  margin-bottom: 2px;
  border-top: 1px solid rgba(122, 131, 154, 0.22);
}

.nav-links > .nav-section-label:first-child {
  margin-top: 2px;
  border-top: none;
}

.nav-link {
  width: 100%;
  padding: 8px 12px;
  border-radius: 0;
  border-left: 2px solid transparent;
  font-weight: 600;
  color: var(--muted);
}

.nav-link:hover {
  color: var(--text);
  background: var(--panel-2);
}

.nav-link.active {
  color: var(--text);
  background: rgba(108, 99, 255, 0.12);
  border-left-color: var(--brand);
}

.nav-link.active.nav-steam {
  border-left-color: var(--steam-color);
  background: rgba(74, 144, 217, 0.14);
  color: #b8daff;
}

.nav-link.active.nav-ps {
  border-left-color: var(--ps-color);
  background: rgba(122, 173, 255, 0.14);
  color: #cde2ff;
}

.nav-link.active.nav-xbox {
  border-left-color: var(--xbox-color);
  background: rgba(74, 222, 128, 0.14);
  color: #dffbe8;
}

.nav-disabled {
  width: 100%;
  padding: 8px 12px;
  color: #62697c;
}

.page {
  max-width: none;
  margin: 0;
  padding: 22px 24px 34px;
}

h1 {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.subtitle {
  margin-bottom: 12px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.topbar .subtitle {
  margin-bottom: 0;
}

@media (min-width: 841px) {
  .topbar.home-topbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto minmax(280px, 420px);
    align-items: center;
  }
}

.title-accent {
  color: var(--brand);
}

.badges {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.b-steam {
  color: #9fd2ff;
  border-color: rgba(74, 144, 217, 0.55);
  background: rgba(74, 144, 217, 0.16);
}

.b-ps {
  color: #cfe3ff;
  border-color: rgba(122, 173, 255, 0.55);
  background: rgba(122, 173, 255, 0.16);
}

.b-xbox {
  color: #dffbe8;
  border-color: rgba(74, 222, 128, 0.55);
  background: rgba(74, 222, 128, 0.16);
}

.b-dim {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.b-dim::before {
  opacity: 0.45;
}

.table-controls {
  padding: 10px 14px;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  background: var(--panel);
}

.filter-group label {
  color: #a9afc1;
  font-size: 0.86rem;
}

.table-controls input[type="search"] {
  background: var(--panel-2);
  border-color: var(--line);
  border-radius: 6px;
  padding: 7px 10px;
}

.table-wrap {
  border-radius: 0 0 12px 12px;
  background: var(--panel);
  box-shadow: none;
}

table {
  min-width: 920px;
}

th,
td {
  border-bottom-color: var(--line);
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  background: var(--panel-2);
}

tbody tr:hover {
  background: #1b1f2b;
}

.star-toggle {
  color: #7f879d;
}

.star-toggle:hover,
.star-toggle.is-starred {
  color: var(--gold);
}

.game-hero,
.chart-panel,
.store-filters label,
.meta-chip,
.rating-badge,
.store-link {
  border-radius: 10px;
}

.game-hero,
.chart-panel,
.meta-chip,
.store-filters label {
  background: var(--panel);
  border-color: var(--line);
}

.portal-hero {
  text-align: left;
  padding: 10px 0 18px;
}

.portal-hero h1 {
  -webkit-text-fill-color: initial;
  background: none;
  color: var(--text);
}

.stores-grid {
  gap: 14px;
}

.store-card {
  border-radius: 12px;
  background: var(--panel);
  padding: 18px 16px;
}

.store-card:hover {
  border-color: #3a4053;
  box-shadow: none;
  transform: none;
}

@media (max-width: 980px) {
  body {
    display: block;
  }

  .nav-toggle {
    display: inline-flex;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 320;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(14, 18, 28, 0.94);
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-direction: column;
    cursor: pointer;
  }

  .nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #d6ddf2;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  body.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  body.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }
  body.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    z-index: 305;
    background: rgba(4, 7, 12, 0.68);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.nav-open .nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 310;
    width: min(84vw, 300px);
    max-width: 300px;
    height: 100vh;
    padding: 16px 0 20px;
    border-right: 1px solid var(--line);
    border-bottom: none;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    overflow-y: auto;
  }

  body.nav-open .site-nav {
    transform: translateX(0);
  }

  .nav-brand {
    margin: 0 12px 6px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--line);
    max-width: calc(100% - 24px);
  }

  .nav-links {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 2px;
    margin-top: 0;
  }

  .nav-x-link {
    margin: auto 12px 0;
    width: calc(100% - 24px);
  }

  .nav-section-label {
    display: block;
  }

  .nav-link {
    width: 100%;
    border-left: 2px solid transparent;
    border-radius: 0;
    padding: 8px 12px;
  }

  .nav-disabled {
    width: 100%;
    padding: 8px 12px;
  }

  .page {
    padding: 64px 12px 24px;
  }
}

@media (max-width: 840px) {
  #steamTopSellersTable,
  #steamWishlistTable {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  #steamTopSellersTable .star-col,
  #steamWishlistTable .star-col { width: 24px; max-width: 24px; min-width: 24px; }
  #steamTopSellersTable .rank-col,
  #steamWishlistTable .rank-col { width: 44px; max-width: 44px; min-width: 44px; }

  #steamTopSellersTable td:nth-child(1),
  #steamTopSellersTable th:nth-child(1),
  #steamWishlistTable td:nth-child(1),
  #steamWishlistTable th:nth-child(1) {
    width: 24px;
    max-width: 24px;
    min-width: 24px;
    padding-left: 2px;
    padding-right: 2px;
  }
  #steamTopSellersTable td:nth-child(2),
  #steamTopSellersTable th:nth-child(2),
  #steamWishlistTable td:nth-child(2),
  #steamWishlistTable th:nth-child(2) {
    width: 44px;
    max-width: 44px;
    min-width: 44px;
    padding-left: 3px;
    padding-right: 3px;
  }

  #steamTopSellersTable .table-game-link > span:last-child,
  #steamWishlistTable .table-game-link > span:last-child { display: none; }

  /* Steam top sellers mobile columns */
  #steamTopSellersTable td:nth-child(3),
  #steamTopSellersTable th:nth-child(3) { width: 102px; max-width: 102px; min-width: 102px; }

  #steamTopSellersTable td:nth-child(4),
  #steamTopSellersTable th:nth-child(4) { display: none; }

  #steamTopSellersTable td:nth-child(5),
  #steamTopSellersTable th:nth-child(5) { width: auto; font-size: 0.78rem; }

  /* Steam wishlists mobile columns */
  #steamWishlistTable td:nth-child(3),
  #steamWishlistTable th:nth-child(3) { width: 102px; max-width: 102px; min-width: 102px; }

  /* Hide: trend, followers, follower change, pred week 1 sales, release date */
  #steamWishlistTable td:nth-child(4),
  #steamWishlistTable th:nth-child(4),
  #steamWishlistTable td:nth-child(5),
  #steamWishlistTable th:nth-child(5),
  #steamWishlistTable td:nth-child(6),
  #steamWishlistTable th:nth-child(6),
  #steamWishlistTable td:nth-child(8),
  #steamWishlistTable th:nth-child(8),
  #steamWishlistTable td:nth-child(9),
  #steamWishlistTable th:nth-child(9) { display: none; }

  #steamWishlistTable td:nth-child(7),
  #steamWishlistTable th:nth-child(7) { width: auto; font-size: 0.78rem; }

  th, td { padding: 8px 5px; font-size: 0.82rem; }

  .search-group { width: 100%; }
  .table-controls input[type="search"] { width: 100%; }

}

@media (max-width: 600px) {
  #psTable {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  /* Hide platform, release date, rating */
  #psTable td:nth-child(5),
  #psTable th:nth-child(5) { display: none; }

  #psTable td:nth-child(6),
  #psTable th:nth-child(6) { display: none; }

  #psTable td:nth-child(8),
  #psTable th:nth-child(8) { display: none; }

  /* Fixed columns */
  #psTable td:nth-child(1),
  #psTable th:nth-child(1) { width: 32px; } /* Star */

  #psTable td:nth-child(2),
  #psTable th:nth-child(2) { width: 52px; } /* Rank */

  #psTable td:nth-child(3),
  #psTable th:nth-child(3) { width: 58px; } /* Image */

  #psTable td:nth-child(4),
  #psTable th:nth-child(4) { width: auto; } /* Name — takes remaining space */

  #psTable td:nth-child(7),
  #psTable th:nth-child(7) { width: 60px; font-size: 0.78rem; } /* Price */

  #psTable td:nth-child(9),
  #psTable th:nth-child(9) { width: 72px; font-size: 0.78rem; } /* Est. Owners */

  #psTable th, #psTable td { padding: 8px 5px; font-size: 0.82rem; }

  #xboxTable {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  /* Hide platforms, release date, 24h change, rating */
  #xboxTable td:nth-child(4),
  #xboxTable th:nth-child(4) { display: none; }

  #xboxTable td:nth-child(5),
  #xboxTable th:nth-child(5) { display: none; }

  #xboxTable td:nth-child(6),
  #xboxTable th:nth-child(6) { display: none; }

  #xboxTable td:nth-child(8),
  #xboxTable th:nth-child(8) { display: none; }

  /* Fixed columns */
  #xboxTable td:nth-child(1),
  #xboxTable th:nth-child(1) { width: 52px; } /* Rank */

  #xboxTable td:nth-child(2),
  #xboxTable th:nth-child(2) { width: 58px; } /* Image */

  #xboxTable td:nth-child(3),
  #xboxTable th:nth-child(3) { width: auto; } /* Name */

  #xboxTable td:nth-child(7),
  #xboxTable th:nth-child(7) { width: 60px; font-size: 0.78rem; } /* Price */

  #xboxTable td:nth-child(9),
  #xboxTable th:nth-child(9) { width: 72px; font-size: 0.78rem; } /* Est. Owners */

  #xboxTable th, #xboxTable td { padding: 8px 5px; font-size: 0.82rem; }
}
