*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg-base: #0d1117;
  --bg-surface: #161b22;
  --bg-card: #1c2330;
  --bg-card-hover: #212938;
  --bg-input: #0d1117;
  --border: #30363d;
  --accent-blue: #1f6feb;
  --accent-cyan: #39d5f5;
  --accent-glow: rgba(31, 111, 235, 0.25);
  --accent-steam: #66c0f4;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --tag-bg: #21262d;
  --tag-border: #30363d;
  --tag-active-bg: rgba(31, 111, 235, 0.15);
  --tag-active-border: #1f6feb;
  --positive: #3fb950;
  --mixed: #e3b341;
  --negative: #f85149;
  --slider-track: #21262d;
  --font-display: 'Rajdhani', sans-serif;
  --font-body: 'Exo 2', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-card: 8px;
  --transition: 0.2s ease;
}



html, body { height: 100%; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}


body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

#root {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 52px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

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



.nav-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-steam);
}

.nav-logo span {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 1px;
  margin-left: 10px;
}

.nav-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color var(--transition);
}

.repo-link:hover {
  color: var(--accent-steam);
}

.repo-link svg {
  width: 14px;
  height: 14px;
}

.repo-icon {
  width: 14px;
  height: 14px;
  display: block;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 40px 24px;
  animation: fadeUp 0.5s ease both;
}

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

.hero-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 700;
  letter-spacing: 6px;
  text-transform: uppercase;
  line-height: 1;
  color: var(--text-primary);
}

/* .hero-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent-blue);
  margin: 14px auto 0;
  border-radius: 2px;
  box-shadow: 0 0 12px var(--accent-glow);
} */

.hero-sub {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 300;
  margin-top: 0px;
  text-align: center;
}
.hero-sub-sub {
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 300;
  margin-top: 0px;
  text-align: center;
}

.search-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 560px;
}

.mode-toggle {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.mode-btn {
  padding: 8px 22px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.mode-btn.active {
  background: var(--accent-blue);
  color: #fff;
}

.mode-btn:not(.active):hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.search-row {
  display: flex;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-row:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-input {
  flex: 1;
  background: var(--bg-input);
  border: none;
  outline: none;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-primary);
  letter-spacing: 1px;
}
.search-input::placeholder {
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0;
  font-family: var(--font-body);
}

.search-btn {
  padding: 14px 26px;
  background: var(--accent-blue);
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  transition: background var(--transition), box-shadow var(--transition);
}

.search-btn:hover:not(:disabled) {
  background: #388bfd;
  box-shadow: 0 0 16px rgba(56, 139, 253, 0.4);
}

.search-btn:disabled,
.mode-btn:disabled,
.back-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}


.results-layout {
  flex: 1;
  display: flex;
  min-height: 0;
  animation: fadeUp 0.35s ease both;
}

.panel-left {
  flex: 3;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--border);
}

.panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.panel-header-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.panel-header-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-steam);
  background: rgba(102, 192, 244, 0.08);
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid rgba(102, 192, 244, 0.2);
}

.panel-header-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.cards-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cards-scroll::-webkit-scrollbar,
.panel-right::-webkit-scrollbar {
  width: 6px;
}

.cards-scroll::-webkit-scrollbar-thumb,
.panel-right::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.game-card {
  display: flex;
  align-items: stretch;
  gap: 26px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), transform 0.15s ease, opacity 0.3s ease;
  position: relative;
  overflow: hidden;
}

.game-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-blue);
  opacity: 0;
  transition: opacity var(--transition);
}

.game-card:hover {
  background: var(--bg-card-hover);
  border-color: #3d444d;
  transform: translateX(2px);
}

.game-card:hover::before {
  opacity: 1;
}

.rank-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.card-img,
.card-img-placeholder {
  width: 450px;
  min-height: 180px;
  height: auto;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.card-img {
  object-fit: cover;
  object-position: center;
}

.card-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 22px;
}

.card-body {
  flex: 1;
  min-width: 0;
  padding-right: 52px;
}

.card-name {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0px;
}
.card-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
  margin-top: 0px;
}
.card-studio {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 5px;
}

.studio-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.studio-label {
  flex: 0 0 62px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.studio-value {
  min-width: 0;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.meta-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-pill {
  font-size: 14px;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid;
  width: fit-content;
}

.meta-pill.positive { color: var(--positive); border-color: rgba(63, 185, 80, 0.3); background: rgba(63, 185, 80, 0.08); }
.meta-pill.mixed { color: var(--mixed); border-color: rgba(227, 179, 65, 0.3); background: rgba(227, 179, 65, 0.08); }
.meta-pill.negative { color: var(--negative); border-color: rgba(248, 81, 73, 0.3); background: rgba(248, 81, 73, 0.08); }

.meta-reviews {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.score-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  /* margin-top: 5px; */
  min-width: 84px;
  /* border: 0.5px solid var(--accent-cyan); */
}

.score-chip-label {
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  line-height: 1;
}
  
.score-chip-value {
  font-size: 20px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  line-height: 1;
}

.steam-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent-steam);
  text-decoration: none;
  padding: 7px 12px;
  border: 1px solid rgba(102, 192, 244, 0.3);
  border-radius: 5px;
  background: rgba(102, 192, 244, 0.05);
  transition: all var(--transition);
}

.steam-link:hover {
  background: rgba(102, 192, 244, 0.15);
  border-color: var(--accent-steam);
}

.steam-link-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.card-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--tag-bg);
}

.panel-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.weights-section,
.tags-section {
  padding: 14px 16px;
}

.weights-section {
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.section-copy {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: -6px;
  margin-bottom: 14px;
}

.slider-item {
  margin-bottom: 14px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.slider-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.slider-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-cyan);
}

.slider-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.slider-scale-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 10px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    var(--accent-blue) 0%,
    var(--accent-blue) var(--pct, 50%),
    var(--slider-track) var(--pct, 50%),
    var(--slider-track) 100%
  );
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent-blue);
  box-shadow: 0 0 6px var(--accent-glow);
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.tags-section {
  flex: 1;
}

.tags-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}



.filter-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.filter-tag:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.filter-tag.active {
  background: var(--tag-active-bg);
  border-color: var(--tag-active-border);
  color: var(--accent-steam);
}

.filter-tag .count {
  margin-left: 4px;
  opacity: 0.6;
  font-size: 9px;
}


.reset-btn,
.back-btn {
  font-family: var(--font-display);
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.reset-btn {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 3px;
}

.reset-btn:hover,
.back-btn:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.loading-wrap,
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text,
.empty-state {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-align: center;
}

.status-message {
  width: 100%;
  max-width: 560px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}
.status-message-sub {
  width: 100%;
  max-width: 560px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: -15px;
}

.error-message {
  color: #ff9b9b;
}

.back-btn {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 5px 12px;
}

.divider {
  width: 1px;
  height: 16px;
  background: var(--border);
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  #root {
    height: auto;
    min-height: 100vh;
  }

  .results-layout {
    flex-direction: column;
  }

  .panel-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 720px) {
  .nav {
    padding: 0 16px;
  }

  .nav-right {
    gap: 8px;
  }

  .repo-link {
    font-size: 10px;
  }

  .search-row,
  .panel-header,
  .card-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .search-btn,
  .back-btn {
    width: 100%;
  }

  .game-card {
    flex-direction: column;
  }

  .card-img,
  .card-img-placeholder {
    width: 100%;
    min-height: 180px;
  }

  .card-body {
    padding-right: 0;
  }
}

.suggestions-panel {
  width: 100%;
  max-width: 560px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(12, 17, 23, 0.96);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.suggestions-status {
  padding: 14px 16px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.suggestion-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid rgba(48, 54, 61, 0.75);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}
.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: rgba(31, 111, 235, 0.12);
}

.suggestion-image {
  width: 92px;
  height: 43px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}


.suggestion-name {
  font-family: var(--font-body);
  font-size: 14px;
}
