/* Indie Steam Tracker — Styles */

/* Self-hosted fonts */
@font-face { font-family: 'Exo 2'; font-weight: 400; font-display: swap; src: url(fonts/exo2-400.woff2) format('woff2'); }
@font-face { font-family: 'Exo 2'; font-weight: 600; font-display: swap; src: url(fonts/exo2-600.woff2) format('woff2'); }
@font-face { font-family: 'Exo 2'; font-weight: 700; font-display: swap; src: url(fonts/exo2-700.woff2) format('woff2'); }
@font-face { font-family: 'Exo 2'; font-weight: 800; font-display: swap; src: url(fonts/exo2-800.woff2) format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 300; font-display: swap; src: url(fonts/rajdhani-300.woff2) format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 400; font-display: swap; src: url(fonts/rajdhani-400.woff2) format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 500; font-display: swap; src: url(fonts/rajdhani-500.woff2) format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 600; font-display: swap; src: url(fonts/rajdhani-600.woff2) format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 700; font-display: swap; src: url(fonts/rajdhani-700.woff2) format('woff2'); }
@font-face { font-family: 'Space Mono'; font-weight: 400; font-display: swap; src: url(fonts/spacemono-400.woff2) format('woff2'); }
@font-face { font-family: 'Space Mono'; font-weight: 700; font-display: swap; src: url(fonts/spacemono-700.woff2) format('woff2'); }

:root {
  /* Core palette */
  --facet-dark: #1c1d20;
  --facet-mid: #2c2d32;
  --facet-light: #3e4046;
  --facet-highlight: #62656e;
  --facet-peak: #8a8d96;

  /* Accent */
  --accent-amber: #e8943a;
  --accent-flame: #d4533b;
  --accent-gold: #f2c94c;
  --accent-cyan: #45c8dc;
  --accent-mint: #4dd9a0;

  /* Surface colors */
  --bg-primary: #111113;
  --bg-secondary: #18191c;
  --bg-card: #1c1d20;
  --bg-card-hover: #26272b;
  --bg-elevated: #2a2b30;
  --bg-input: #141416;

  /* Text */
  --text-primary: #e8e8ec;
  --text-secondary: rgba(232, 232, 236, 0.7);
  --text-muted: rgba(232, 232, 236, 0.55);
  --text-on-accent: #111113;

  /* Functional */
  --success: #4dd9a0;
  --warning: #f2c94c;
  --error: #d4533b;
  --info: #45c8dc;

  /* Gradients */
  --gradient-facet: linear-gradient(135deg, var(--facet-dark), var(--facet-mid), var(--facet-light));
  --gradient-cool: linear-gradient(135deg, var(--facet-dark), var(--accent-cyan), var(--accent-mint));

  /* Spacing Scale (8px base) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Typography */
  --font-display: 'Exo 2', 'Segoe UI', sans-serif;
  --font-body: 'Rajdhani', 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', 'Consolas', monospace;

  /* Border / Edge */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-default: rgba(255, 255, 255, 0.14);
  --border-emphasis: rgba(255, 255, 255, 0.22);
  --edge-glow: rgba(69, 200, 220, 0.15);

  /* Shadows */
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.5);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

[data-theme="light"] {
  --facet-dark: #dcdde0;
  --facet-mid: #c4c5ca;
  --facet-light: #a8a9b0;
  --facet-highlight: #8c8e96;
  --facet-peak: #64666e;

  --accent-cyan: #1a9ab0;
  --accent-mint: #28a870;
  --accent-amber: #c47820;
  --accent-flame: #b83828;
  --accent-gold: #b89418;

  --bg-primary: #f2f2f4;
  --bg-secondary: #e8e8ec;
  --bg-card: #ffffff;
  --bg-card-hover: #f4f4f6;
  --bg-elevated: #ebebee;
  --bg-input: #ffffff;

  --text-primary: #1c1d20;
  --text-secondary: rgba(28, 29, 32, 0.7);
  --text-muted: rgba(28, 29, 32, 0.65);
  --text-on-accent: #ffffff;

  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-default: rgba(0, 0, 0, 0.12);
  --border-emphasis: rgba(0, 0, 0, 0.2);
  --edge-glow: rgba(26, 154, 176, 0.15);

  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.02;
  background: url(noise.png);
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.skip-to-content {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-cyan);
  color: var(--text-on-accent);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-to-content:focus {
  top: var(--space-sm);
}

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


/* Container */
.container {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}


.site-header {
  position: relative;
  z-index: 10;
  background: var(--bg-secondary);
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--edge-glow);
}


.site-header .container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: 10px;
  padding-bottom: 10px;
  gap: var(--space-lg);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  flex-shrink: 0;
  justify-self: start;
}

.site-logo:hover {
  text-decoration: none;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  position: relative;
}

.logo-icon svg {
  position: relative;
  z-index: 1;
}

.logo-icon span {
  position: relative;
  z-index: 1;
  font-size: 16px;
  font-family: var(--font-display);
  font-weight: 800;
  background: var(--gradient-cool);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.site-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.site-nav a {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
  padding: 10px 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover {
  color: var(--text-primary);
}

.site-nav a:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}

.site-nav a.active {
  color: var(--accent-cyan);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  width: 16px;
  height: 16px;
}

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }


.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 220px;
  position: relative;
  justify-self: end;
}

.search-bar input {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  padding: 8px 16px;
  width: 100%;
  outline: none;
  transition: var(--transition-fast);
  border-radius: var(--radius-md);
}

.search-clear {
  position: absolute;
  right: 78px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  font-size: 0.9rem;
  width: 32px;
  height: 32px;
  padding: 0;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear.visible {
  display: flex;
}

.search-clear:hover,
.search-clear:focus-visible {
  color: var(--text-primary);
}

.search-bar input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--edge-glow);
}

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


.page-hero {
  text-align: center;
  padding: var(--space-3xl) 0 var(--space-2xl);
  position: relative;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.page-hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}


.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.section-link {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

section {
  margin-bottom: var(--space-3xl);
}


.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
}

.game-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.game-card-link:focus-visible {
  outline: none;
}

.card-badges {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  pointer-events: none;
}

.peak-badge {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}


.sale-tag {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(77, 217, 160, 0.15);
  color: var(--accent-mint);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.price-low {
  font-size: 0.7rem;
  color: var(--text-muted);
}


.embed-panel {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.embed-options {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.embed-options label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
}

.embed-preview {
  margin-bottom: var(--space-md);
}

.embed-code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  word-break: break-all;
  user-select: all;
}

.game-card-desc {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  aspect-ratio: 460 / 215;
  display: flex;
  align-items: flex-end;
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.5) 35%, rgba(0, 0, 0, 0.92) 100%);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.72rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
  overflow: hidden;
}

.game-card:hover .game-card-desc,
.game-card:focus-within .game-card-desc {
  opacity: 1;
}

.game-card:hover,
.game-card:focus-within {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-default);
  text-decoration: none;
}

.game-card-image {
  width: 100%;
  height: auto;
  aspect-ratio: 460 / 215;
  object-fit: cover;
  display: block;
  background: var(--gradient-facet);
  transition: filter var(--transition-base);
}

.game-card:hover .game-card-image,
.game-card:focus-within .game-card-image {
  filter: brightness(0.5);
}

.game-card-body {
  padding: var(--space-md) var(--space-lg);
}

.game-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-sm);
}

.game-tag {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  background: rgba(69, 200, 220, 0.1);
  color: var(--accent-cyan);
  border-radius: var(--radius-sm);
}

.game-card-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.stat-players {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-mint);
}

.stat-players .dot {
  width: 6px;
  height: 6px;
  background: var(--accent-mint);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.stat-reviews {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.peak-badge.price {
  background: rgba(14, 17, 24, 0.85);
  color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0;
  text-transform: none;
}

.peak-badge.price .price-discount {
  color: var(--accent-mint);
}


.upcoming-badge {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 3px 10px;
  background: rgba(232, 148, 58, 0.15);
  color: var(--accent-amber);
  border-radius: var(--radius-sm);
}

.release-date-text {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted);
}




.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-3xl);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: var(--space-sm) var(--space-lg);
  text-align: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: var(--transition-base);
}

.stat-card:hover,
.stat-card:focus-visible {
  border-color: var(--border-default);
  text-decoration: none;
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--accent-cyan);
  line-height: 1.2;
}

.stat-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}


.game-detail-header {
  display: grid;
  grid-template-columns: clamp(280px, 40vw, 460px) 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
  align-items: start;
}

.game-hero-image {
  width: 100%;
  border-radius: var(--radius-md);
  display: block;
}

.game-info h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.game-info .game-card-tags {
  margin-bottom: var(--space-lg);
}

.game-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.meta-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: var(--space-md);
  border-radius: var(--radius-md);
}

.meta-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.meta-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-primary);
}

.meta-value.players {
  color: var(--accent-mint);
}

.meta-value.score {
  color: var(--accent-gold);
}

.game-description {
  color: var(--text-secondary);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  line-height: 1.75;
  letter-spacing: 0.01em;
  margin-bottom: var(--space-lg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
  text-decoration: none;
  padding: 12px 28px;
  border-radius: var(--radius-md);
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-cyan);
  color: var(--text-on-accent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  filter: brightness(1.15);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--bg-card-hover);
  color: var(--accent-cyan);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: rgba(69, 200, 220, 0.1);
}

/* Chart container */
.chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: var(--space-xl);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3xl);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.chart-header h2 {
  font-size: 1.2rem;
}

.chart-range-btns {
  display: flex;
  gap: var(--space-xs);
}

.chart-range-btns button {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.chart-range-btns button:hover,
.chart-range-btns button:focus-visible,
.chart-range-btns button.active {
  background: rgba(69, 200, 220, 0.15);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.chart-container {
  position: relative;
  height: 350px;
}


.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}


.tag-dropdown {
  position: relative;
}

.tag-dropdown-btn {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  padding: 11px 32px 11px 12px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%238193c4' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.tag-dropdown-btn:hover,
.tag-dropdown-btn:focus-visible {
  border-color: var(--accent-cyan);
  outline: none;
}

.tag-dropdown-btn.has-selection {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2345c8dc' stroke-width='2'/%3E%3C/svg%3E");
}

.tag-dropdown-btn.open {
  border-color: var(--accent-cyan);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 6L6 1L11 6' stroke='%2345c8dc' stroke-width='2'/%3E%3C/svg%3E");
}

.tag-dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 100;
  overflow: hidden;
}

.tag-dropdown-panel.open {
  display: block;
}

.tag-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.tag-dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.tag-dropdown-item:has(.tag-dropdown-cb:checked) {
  color: var(--accent-cyan);
}

.tag-dropdown-item.dimmed {
  opacity: 0.4;
}

.tag-dropdown-cb {
  accent-color: var(--accent-cyan);
  cursor: pointer;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tag-dropdown-count {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Custom single-select dropdown (replaces native <select> on sort/price) */
.custom-select {
  position: relative;
}

.custom-select-btn {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  padding: 11px 32px 11px 12px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  text-align: left;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%238193c4' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.custom-select-btn:hover,
.custom-select-btn:focus-visible {
  border-color: var(--accent-cyan);
  outline: none;
}

.custom-select-btn.open {
  border-color: var(--accent-cyan);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 6L6 1L11 6' stroke='%2345c8dc' stroke-width='2'/%3E%3C/svg%3E");
}

.custom-select-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 100;
  overflow: hidden;
}

.custom-select-panel.open {
  display: block;
}

.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  cursor: pointer;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  text-align: left;
  transition: var(--transition-fast);
}

.custom-select-option:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.custom-select-option.selected {
  color: var(--accent-cyan);
}

.custom-select-option.selected::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  flex-shrink: 0;
}

.clear-tags {
  display: none;
}

.clear-tags.visible {
  display: flex;
}

.clear-tags:hover,
.clear-tags:focus-visible {
  border-color: var(--accent-flame);
  color: var(--accent-flame);
}

.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-sm);
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-primary);
  padding: var(--space-md) 0;
  margin-top: calc(-1 * var(--space-md));
}

.sort-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.02;
  pointer-events: none;
  background: url(noise.png);
}

.sort-bar .result-count {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sort-bar select {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  padding: 11px 32px 11px 12px;
  min-height: 44px;
  outline: none;
  border-radius: var(--radius-sm);
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%238193c4' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sort-bar select:focus-visible {
  border-color: var(--accent-cyan);
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl) 0;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--space-md);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-state p {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: var(--space-4xl) 0;
  color: var(--text-muted);
}

.scroll-sentinel {
  height: 1px;
}

.scroll-loading {
  text-align: center;
  padding: var(--space-lg) 0;
}

.scroll-loading::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.back-to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--accent-cyan);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-base);
  z-index: 100;
  box-shadow: var(--shadow-card);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  color: var(--accent-mint);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}


.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  margin-top: 4px;
  z-index: 100;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: var(--shadow-card-hover);
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.search-dropdown-item:hover,
.search-dropdown-item.active {
  background: var(--bg-card-hover);
  text-decoration: none;
}

.search-dropdown-item:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: -2px;
  background: var(--bg-card-hover);
  text-decoration: none;
}

.search-dropdown-item img {
  width: 60px;
  height: 28px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.search-dropdown-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
}

.search-dropdown-players {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-mint);
}

.search-dropdown-empty {
  padding: var(--space-md);
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.85rem;
}


.meta-link {
  color: var(--accent-cyan);
  text-decoration: none;
}

.meta-link:hover {
  text-decoration: underline;
}

.game-media {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}

.screenshot-thumb {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.screenshot-thumb:hover,
.screenshot-thumb:focus-visible {
  border-color: var(--accent-cyan);
}

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

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-md);
  object-fit: contain;
  user-select: none;
}

.lightbox-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-lg);
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: var(--transition-fast);
  z-index: 1;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  opacity: 1;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 2.5rem;
  width: 48px;
  height: 64px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: var(--transition-fast);
}

.lightbox-prev:hover,
.lightbox-prev:focus-visible,
.lightbox-next:hover,
.lightbox-next:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
  left: var(--space-md);
}

.lightbox-next {
  right: var(--space-md);
}

.lightbox-counter {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.similar-section {
  margin-top: var(--space-3xl);
}

.empty-state p {
  font-family: var(--font-body);
  font-size: 1rem;
}


.site-footer {
  text-align: center;
  padding: var(--space-lg) 0 var(--space-xl);
}

.site-footer p {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.made-by {
  font-size: 0.7rem;
  opacity: 0.5;
  margin-top: var(--space-xs);
}

.data-freshness {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.favs-on-sale-section {
  margin-bottom: var(--space-3xl);
  padding-bottom: var(--space-3xl);
  border-bottom: 1px solid var(--border-subtle);
}


@media (max-width: 1024px) {
  .game-detail-header {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }

  .stats-row {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (max-width: 768px) {
  .container {
    padding: var(--space-lg) var(--space-md);
  }

  .site-header .container {
    display: flex;
    flex-wrap: wrap;
  }


  .search-bar {
    flex: 1 1 100%;
    order: 3;
  }

  .site-nav {
    order: 4;
    flex: 1 1 100%;
    justify-content: center;
    gap: 16px;
  }

  .site-nav a {
    font-size: 0.75rem;
    padding: 8px 4px;
  }

  .page-hero h1 {
    font-size: 1.3rem;
  }

  h2 {
    font-size: 1.3rem;
  }

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

  .game-detail-header {
    grid-template-columns: 1fr;
  }


  .stats-row {
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-sm);
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .sort-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .sort-bar select {
    width: 100%;
  }

  .tag-dropdown,
  .tag-dropdown-btn,
  .custom-select,
  .custom-select-btn {
    width: 100%;
  }

  .theme-toggle {
    order: 2;
  }

  .embed-panel {
    padding: var(--space-md);
  }

  .embed-options {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .chart-container {
    height: 250px;
  }

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

  .game-hero-image {
    max-height: 200px;
  }

  .screenshot-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lightbox-prev,
  .lightbox-next {
    width: 36px;
    height: 48px;
    font-size: 1.8rem;
  }

  .similar-section .game-grid {
    grid-template-columns: 1fr;
  }

  .dev-header h1 {
    font-size: 1.5rem;
  }

  .dev-stats {
    gap: var(--space-sm);
  }
}


/* Favorites button on cards */
.game-card > .fav-btn {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  z-index: 3;
}

.fav-btn {
  background: rgba(14, 17, 24, 0.7);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  transition: var(--transition-fast);
  opacity: 0;
  padding: 0;
}

.fav-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.game-card:hover .fav-btn,
.game-card:focus-within .fav-btn,
.fav-btn.favorited {
  opacity: 1;
}

.fav-btn.favorited {
  color: var(--accent-flame);
}

.fav-btn.favorited svg {
  fill: var(--accent-flame);
  stroke: var(--accent-flame);
}

.fav-btn:hover {
  color: var(--accent-flame);
  transform: scale(1.15);
}

.favs-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}

.favs-link:hover {
  color: var(--accent-flame);
  text-decoration: none;
}

.favs-link:focus-visible {
  outline: 2px solid var(--accent-flame);
  outline-offset: 3px;
  color: var(--accent-flame);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.favs-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* Favorites filter toggle on browse */
.favs-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  min-height: 44px;
}

.favs-toggle:hover {
  border-color: var(--accent-flame);
  color: var(--accent-flame);
}

.favs-toggle:focus-visible {
  outline: 2px solid var(--accent-flame);
  outline-offset: 3px;
  border-color: var(--accent-flame);
  color: var(--accent-flame);
}

.favs-toggle.active {
  background: rgba(212, 83, 59, 0.15);
  border-color: var(--accent-flame);
  color: var(--accent-flame);
}

.favs-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.favs-toggle.active svg {
  fill: var(--accent-flame);
}



/* Community votes */
.vote-section {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.vote-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  min-height: 44px;
}

.vote-btn:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.vote-btn.voted {
  background: rgba(232, 148, 58, 0.15);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  cursor: default;
}

.vote-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.vote-btn.voted svg {
  fill: var(--accent-amber);
}

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


/* Developer/Publisher page */
.dev-header {
  margin-bottom: var(--space-3xl);
}

.dev-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.dev-role {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
  margin-bottom: var(--space-lg);
}

.dev-stats {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.dev-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
}

.dev-stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--accent-cyan);
}

.dev-stat-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

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

@media (hover: none), (pointer: coarse) {
  .fav-btn {
    opacity: 1;
  }
}
