@import url('/assets/game-cover.css');
:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-subtle: #11171f;
  --surface: #141d26;
  --surface-card: #18232e;
  --surface-hover: #1f2d3b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.15);
  --accent-green: #34d399;

  /* Platforms */
  --platform-steam: #66c0f4;
  --platform-steam-bg: rgba(102, 192, 244, 0.12);
  --platform-ps: #60a5fa;
  --platform-ps-bg: rgba(96, 165, 250, 0.12);
  --platform-xbox: #34d399;
  --platform-xbox-bg: rgba(52, 211, 153, 0.12);
  --platform-switch: #fb7185;
  --platform-switch-bg: rgba(251, 113, 133, 0.12);
  --platform-gog: #c084fc;
  --platform-gog-bg: rgba(192, 132, 252, 0.12);

  /* Statuses */
  --status-playing: #34d399;
  --status-backlog: #fbbf24;
  --status-completed: #38bdf8;
  --status-hiatus: #a78bfa;
  --status-dropped: #f87171;
  --status-wishlist: #f472b6;

  font: 16px/1.6 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.06) 0%, transparent 640px),
              radial-gradient(circle at 100% 40%, rgba(99, 102, 241, 0.03) 0%, transparent 500px),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent); }

button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }

button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 16px;
  background: var(--surface);
  min-height: 44px;
  transition: all 0.2s ease;
}
button:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}
button:disabled { opacity: .45; cursor: not-allowed; }
button[aria-pressed="true"], .primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border-color: #38bdf8;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}
button[aria-pressed="true"]:hover, .primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  border-color: #7dd3fc;
}

input, select, textarea {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  min-width: 0;
  min-height: 44px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }

h1, h2, h3, p { margin-top: 0; }
h1 {
  font-size: clamp(32px, 4.5vw, 54px);
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 18px;
  font-weight: 800;
}
h2 {
  font-size: 26px;
  letter-spacing: -0.6px;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 10px;
}
h3 { font-size: 19px; line-height: 1.35; font-weight: 700; }
p { max-width: 76ch; }

/* Top Navigation Bar */
.topbar {
  height: 80px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 max(24px, calc((100vw - 1280px) / 2));
  gap: 40px;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.brand span { color: var(--accent); }
.topbar .brand,.topbar nav a,.subnav a,.game-card h3 a { min-height: 44px; display: inline-flex; align-items: center; }
nav { display: flex; gap: 24px; align-items: center; }
nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 0;
  position: relative;
}
nav a:hover, nav a.active { color: var(--text); }
nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.topbar button { margin-left: auto; }
.quiet { background: transparent; border-color: var(--line); }

main {
  max-width: 1280px;
  margin: auto;
  padding: 40px 24px 80px;
  min-height: 75vh;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 12px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.muted, .meta { color: var(--muted); font-size: 14px; }
.intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 28px;
}
.intro p { margin-bottom: 0; }

.subnav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 24px;
}
.subnav a {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  transition: all 0.2s ease;
}
.subnav a:hover { color: var(--text); background: var(--surface); }
.subnav .active {
  color: var(--accent);
  background: var(--surface-card);
  border: 1px solid var(--line-strong);
}

.search-line {
  position: relative;
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.search-line input {
  flex: 1;
  font-size: 16px;
  padding: 14px 18px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.suggestions {
  position: absolute;
  top: 62px;
  left: 0;
  right: 0;
  background: var(--surface-card);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 16px;
  z-index: 20;
  box-shadow: 0 20px 40px rgba(0,0,0,0.7);
}
.suggestions a { display: block; padding: 7px 10px; border-radius: 6px; }
.suggestions a:hover { background: var(--surface-hover); }
.suggestions strong { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; display: block; margin: 6px 0 3px; }

.filter-row, .toolbar, .actions, .pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-row { margin-bottom: 16px; }
.filter-row select { max-width: 240px; min-height: 44px; }

.filters {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 20px;
}
.filters[open] summary { margin-bottom: 16px; }
summary { cursor: pointer; min-height: 30px; font-weight: 600; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.toolbar {
  justify-content: space-between;
  margin: 24px 0 20px;
}
.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
}
.view-toggle button {
  min-height: 44px;
  padding: 4px 12px;
  font-size: 13px;
  border: none;
  border-radius: 6px;
  background: transparent;
}
.view-toggle button[aria-pressed="true"] {
  background: var(--surface-card);
  color: var(--accent);
  box-shadow: none;
  border: 1px solid var(--line);
}

/* Game Catalog Grid & Cards */
.results-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.game-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.game-card .art-link {
  display: block;
  padding: 20px 24px;
  background: radial-gradient(circle at 50% 10%, rgba(255,255,255,0.03) 0%, transparent 80%), var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 20px -4px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}
.game-card .art-link:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -6px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.1);
}
.game-card h3 { margin: 0 0 6px; font-size: 18px; }
.game-card .meta { font-size: 13px; margin-bottom: 5px; }
.game-card .price { font-size: 15px; font-weight: 750; color: var(--accent); margin-top: 8px; }
.game-card .description { font-size: 14px; color: var(--text-secondary); }

.results-list { display: grid; gap: 14px; }
.results-list .game-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 22px;
  padding: 20px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.results-list .art-link { margin: 0; padding: 12px; }
.results-list .game-card details { grid-column: 2; }
.row-details { margin-top: 14px; }

/* Platform and Status Badges */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  transition: all 0.15s ease;
}
.tag:hover {
  border-color: var(--accent);
  color: var(--text);
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.platform-badge[data-platform="steam"] { color: var(--platform-steam); background: var(--platform-steam-bg); border: 1px solid rgba(102, 192, 244, 0.25); }
.platform-badge[data-platform="playstation"] { color: var(--platform-ps); background: var(--platform-ps-bg); border: 1px solid rgba(96, 165, 250, 0.25); }
.platform-badge[data-platform="xbox"] { color: var(--platform-xbox); background: var(--platform-xbox-bg); border: 1px solid rgba(52, 211, 153, 0.25); }
.platform-badge[data-platform="nintendo"] { color: var(--platform-switch); background: var(--platform-switch-bg); border: 1px solid rgba(251, 113, 133, 0.25); }
.platform-badge[data-platform="gog"] { color: var(--platform-gog); background: var(--platform-gog-bg); border: 1px solid rgba(192, 132, 252, 0.25); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-badge.playing { color: var(--status-playing); background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.3); }
.status-badge.backlog { color: var(--status-backlog); background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.3); }
.status-badge.completed { color: var(--status-completed); background: rgba(56, 189, 248, 0.12); border: 1px solid rgba(56, 189, 248, 0.3); }
.status-badge.hiatus { color: var(--status-hiatus); background: rgba(167, 139, 250, 0.12); border: 1px solid rgba(167, 139, 250, 0.3); }
.status-badge.dropped { color: var(--status-dropped); background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.3); }
.status-badge.wishlist { color: var(--status-wishlist); background: rgba(244, 114, 182, 0.12); border: 1px solid rgba(244, 114, 182, 0.3); }

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  display: inline-block;
  animation: pulseLive 2s infinite ease-in-out;
}
@keyframes pulseLive {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 18px;
  align-items: center;
  margin-top: 40px;
}
.empty {
  border: 1px dashed var(--line-strong);
  padding: 36px;
  color: var(--muted);
  border-radius: 12px;
  text-align: center;
  background: rgba(255,255,255,0.01);
}

/* Game Page Hero */
.hero {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 56px;
  align-items: start;
  margin: 24px 0 45px;
}
.hero .cover-wrap {
  padding: 16px;
  background: radial-gradient(circle at 50% 20%, rgba(255,255,255,0.04) 0%, transparent 80%), var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 40px -10px rgba(0,0,0,0.8);
}
.hero .lead {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.hero .pills { margin: 16px 0; }
.hero label { margin-top: 20px; }

/* Sticky Section Navigation */
.section-nav {
  position: sticky;
  top: 80px;
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  z-index: 30;
  font-size: 14px;
}
.section-nav a {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 600;
  transition: all 0.15s ease;
}
.section-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

/* Game Card 4-Tab Navigation & Accessible Panels */
.game-tabs {
  position: sticky;
  top: 80px;
  background: var(--bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  z-index: 30;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.game-tabs::-webkit-scrollbar {
  display: none;
}

.game-tab-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.game-tab-btn:hover {
  color: var(--text);
  border-color: rgba(102, 192, 244, 0.4);
  background: var(--surface-hover);
}
.game-tab-btn.active, .game-tab-btn[aria-selected="true"] {
  color: var(--text);
  background: rgba(102, 192, 244, 0.15);
  border-color: var(--platform-steam);
  box-shadow: 0 0 16px rgba(102, 192, 244, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.game-tab-btn .tab-icon {
  font-size: 16px;
  line-height: 1;
}

.game-tab-panel {
  display: block;
  padding-top: 20px;
  animation: tabFadeIn 0.2s ease-in-out;
}
.game-tab-panel[hidden] {
  display: none !important;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 3-Tier Progressive Hints Styling */
.hints-container {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hint-tier-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: var(--surface-card);
  transition: border-color 0.2s ease;
}
.hint-tier-card.tier-1 {
  border-left: 4px solid var(--accent);
}
.hint-tier-card.tier-2 {
  border-left: 4px solid #f59e0b;
}
.hint-tier-card.tier-3 {
  border-left: 4px solid #fb7185;
}
.hint-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.hint-badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.hint-tier-card.tier-1 .hint-badge { color: var(--accent); border-color: rgba(56, 189, 248, 0.3); }
.hint-tier-card.tier-2 .hint-badge { color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); }
.hint-tier-card.tier-3 .hint-badge { color: #fb7185; border-color: rgba(251, 113, 133, 0.3); }
.hint-reveal-btn {
  margin-top: 10px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Pre-composed Companion Chips */
.companion-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.companion-chips::-webkit-scrollbar {
  display: none;
}
.companion-chip {
  white-space: nowrap;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}
.companion-chip:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--text);
}

/* Quick Hours Stepper Buttons */
.hours-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.hours-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--surface-hover);
}

/* Unified Component States: Loading, Empty, Error, Private */
.state-container {
  padding: 36px 24px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  margin: 16px 0;
}
.state-container.state-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
}
.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.state-container.state-error {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.05);
  color: #fca5a5;
}
.state-container.state-empty {
  color: var(--muted);
}
.state-container.state-private {
  border-color: rgba(102, 192, 244, 0.25);
  background: rgba(23, 29, 37, 0.7);
  text-align: left;
}

.content-section {
  padding: 44px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 140px;
}
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

/* Panels & Entity Cards */
.panel {
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 12px;
  background: var(--surface-card);
  box-shadow: 0 4px 20px -4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
}
.panel h3 { margin-bottom: 12px; }
.panel ul { padding-left: 20px; }

.entity-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.entity-card {
  display: block;
  border: 1px solid var(--line);
  padding: 22px;
  border-radius: 12px;
  background: var(--surface-card);
  box-shadow: 0 4px 16px -4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: all 0.2s ease;
}
.entity-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(0,0,0,0.6);
}
.entity-card p { margin: 0; }

.source {
  font-size: 13px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.source:hover { text-decoration: underline; }

.metrics {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.metric {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
}
.metric strong { display: block; font-size: 24px; font-weight: 800; color: #fff; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.media-grid img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* MODERN CHART COMPONENT & AXIS SYSTEM */
.chart-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-top: 16px;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}
.chart-metrics {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.chart-metric-chip {
  display: flex;
  flex-direction: column;
}
.chart-metric-chip span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chart-metric-chip strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.chart-view-switch {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}
.chart-view-switch button {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chart-view-switch button.active {
  background: var(--surface-card);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.chart-viewport {
  position: relative;
  width: 100%;
  height: 180px;
  display: flex;
}
.chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-right: 12px;
  font-size: 11px;
  color: var(--muted);
  min-width: 60px;
  text-align: right;
  user-select: none;
}
.chart-stage {
  position: relative;
  flex: 1;
  height: 100%;
  overflow: visible;
}
.chart-grid-lines {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.chart-grid-line {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
}
.chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.chart-svg path.chart-area {
  fill: url(#chartGradient);
  opacity: 0.28;
}
.chart-svg path.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart-svg circle.chart-point {
  fill: var(--accent);
  stroke: var(--bg);
  stroke-width: 2;
  cursor: pointer;
  transition: r 0.15s ease, fill 0.15s ease;
}
.chart-svg circle.chart-point:hover {
  r: 6;
  fill: #fff;
}
.chart-bars-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding-bottom: 2px;
}
.chart-bar-col {
  flex: 1;
  min-width: 4px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  position: relative;
  cursor: pointer;
}
.chart-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(56, 189, 248, 0.25) 100%);
  border-radius: 3px 3px 0 0;
  transition: all 0.15s ease;
  min-height: 2px;
}
.chart-bar-col:hover .chart-bar-fill {
  background: #fff;
  box-shadow: 0 0 10px var(--accent);
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(11, 15, 20, 0.95);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -130%);
  white-space: nowrap;
  z-index: 30;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.chart-tooltip.visible {
  opacity: 1;
}
.chart-x-axis {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  margin-left: 60px;
  font-size: 11px;
  color: var(--muted);
}

/* Activity bars backward compatibility fallback */
.activity-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
  overflow: auto;
  padding: 12px 0;
}
.activity-bars > div {
  flex: 1;
  min-width: 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.activity-bars span {
  display: block;
  background: var(--accent, #38bdf8);
  width: 80%;
  min-height: 2px;
  border-radius: 3px;
}
.activity-bars small {
  font-size: 10px;
  color: #adb9af;
  margin-top: 6px;
}

/* Price chart backward compatibility */
.price-chart {
  width: 100%;
  max-width: 600px;
  height: 150px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.price-chart circle { fill: var(--accent); }
.price-chart text { fill: var(--muted); font: 11px system-ui; }
.price-chart path { stroke: var(--line); fill: none; }

/* Editions & Offers Section */
.editions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 18px 0;
}
.edition-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.edition-card.selected, .edition-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.edition-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.edition-title {
  font-weight: 700;
  font-size: 16px;
}
.edition-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: auto;
}
.edition-price-current {
  font-size: 22px;
  font-weight: 850;
  color: var(--accent);
}
.edition-discount-badge {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
}
.edition-atl-badge {
  font-size: 11px;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 4px;
}

.offer {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: var(--surface-card);
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
}
.offer small { display: block; color: var(--muted); }

/* Playthrough & Companion Box */
.playthrough-container {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.04) 0%, rgba(20, 29, 38, 0.7) 100%);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 8px 30px -4px rgba(0,0,0,0.5);
  margin-top: 12px;
}
.hours-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hours-btn {
  min-height: 34px;
  padding: 4px 12px;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.hours-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Player Profile & "Mine" Space */
.gamer-profile-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  background: linear-gradient(180deg, rgba(24, 35, 46, 0.8) 0%, rgba(14, 20, 27, 0.95) 100%);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: 0 12px 36px -8px rgba(0,0,0,0.6);
}
.gamer-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  color: #0b0f14;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.35);
}
.gamer-info h2 { margin: 0 0 6px 0; font-size: 26px; }
.gamer-rank {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 9999px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.gamer-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-box {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 16px -4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
}
.stat-box .label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-box .val {
  font-size: 26px;
  font-weight: 850;
  color: var(--text);
}
.stat-box .sub {
  font-size: 11px;
  color: var(--muted);
}

.library-filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.library-filter-tab {
  min-height: 38px;
  padding: 6px 16px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.library-filter-tab.active, .library-filter-tab:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--accent);
}

.library-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.lib-game-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px -4px rgba(0,0,0,0.4);
}
.lib-game-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 30px -6px rgba(0,0,0,0.6);
}
.lib-cover-area {
  height: 140px;
  overflow: hidden;
  background: #121922;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.lib-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}
.lib-body h3 { margin: 0; font-size: 17px; }
.lib-note-text {
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 2px solid var(--accent);
  margin-top: auto;
  white-space: pre-wrap;
}

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 600; }
.table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.columns { margin-bottom: 15px; }
.columns label { display: inline-flex; align-items: center; margin-right: 15px; }
.columns input { min-height: 0; }

.login-prompt {
  padding: 24px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.private-form { display: grid; gap: 14px; max-width: 720px; }
.private-form textarea { min-height: 100px; }

.connection {
  margin: 14px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-card);
}
.connection form { display: flex; gap: 8px; margin-top: 14px; }
.connection input { flex: 1; }

.chat-output {
  white-space: pre-wrap;
  padding: 18px 20px;
  border: 1px solid var(--line);
  margin: 16px 0;
  border-radius: 10px;
  min-height: 70px;
  background: rgba(0, 0, 0, 0.25);
  line-height: 1.6;
}

dialog {
  background: var(--surface-card);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  width: min(440px, 95vw);
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.8);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); }
dialog label { margin: 16px 0; }
dialog .close { position: absolute; right: 16px; top: 16px; min-height: 32px; padding: 4px 10px; }

#auth-error { color: #ffb9ab; font-size: 14px; }
#notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 400px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border-radius: 10px;
  padding: 0;
  z-index: 50;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  font-weight: 600;
}
#notice:not(:empty) { padding: 14px 22px; }

footer {
  max-width: 1280px;
  padding: 30px 24px;
  margin: auto;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.skip { position: absolute; left: 12px; top: -100px; }
.skip:focus { top: 10px; background: var(--surface); padding: 15px; z-index: 99; }
[hidden] { display: none !important; }

/* Responsive adjustments */
@media(max-width: 1000px) {
  .results-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar { gap: 20px; }
  .hero { gap: 32px; grid-template-columns: 240px 1fr; }
  .gamer-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media(max-width: 700px) {
  .topbar { height: auto; min-height: 76px; padding: 14px 16px; gap: 10px; flex-wrap: wrap; }
  .brand { font-size: 14px; }
  .topbar nav { order: 3; width: 100%; gap: 20px; font-size: 14px; }
  .topbar button { padding: 6px 12px; }
  main { padding: 24px 16px 60px; }
  .intro { display: block; }
  .intro .meta { margin-top: 15px; }
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .game-card .art-link { padding: 14px 16px; }
  .game-card h3 { font-size: 16px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-row select { max-width: 100%; flex: 1; }
  .toolbar { align-items: flex-start; }
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .hero .cover-wrap { width: 230px; margin: auto; }
  .hero h1 { font-size: 32px; }
  .content-grid, .entity-list, .media-grid { grid-template-columns: 1fr; }
  .results-list .game-card { grid-template-columns: 75px 1fr; padding: 14px; gap: 14px; }
  .content-section { padding: 30px 0; }
  .connection form { flex-wrap: wrap; }
  .connection input { width: 100%; }
  .view-toggle button { padding: 8px 10px; font-size: 13px; }
  .gamer-profile-hero { grid-template-columns: 1fr; text-align: center; }
  .gamer-avatar { margin: auto; }
  .gamer-stats-grid { grid-template-columns: 1fr; }
  footer { display: block; }
  footer span { display: block; margin-top: 10px; }
}

@media(prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}


/* Mobile Bottom Navigation Dock (Stage 3) */
.mobile-dock {
  display: none;
}
@media(max-width: 768px) {
  .mobile-dock {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(11, 15, 20, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 6px 12px max(10px, env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
  }
  .dock-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 44px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease, transform 0.15s ease;
  }
  .dock-tab:hover, .dock-tab.active {
    color: var(--accent);
  }
  .dock-icon {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 2px;
  }
  main {
    padding-bottom: 84px !important;
  }
}
.semantic-feature{padding:14px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}
.semantic-feature blockquote{margin:10px 0;padding-left:12px;border-left:2px solid var(--line);white-space:pre-wrap;overflow-wrap:anywhere}
#semantic-passport .source,#semantic-passport summary{display:inline-flex;align-items:center;min-height:44px;padding:8px 0}
.review-sample{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,145px),1fr));gap:12px;margin:16px 0}
.review-sample dt{font-size:.85em;opacity:.75}
.review-sample dd{margin:4px 0 0;overflow-wrap:anywhere}
#player-review-overview blockquote{margin:12px 0;padding-left:12px;border-left:2px solid var(--line);overflow-wrap:anywhere}
#player-review-overview summary{cursor:pointer;display:flex;align-items:center;min-height:44px}
