:root {
  --bg: #0A1112;
  --panel: #111A1C;
  --panel-2: #182325;
  --border: #253336;
  --border-soft: #1C2729;
  --text: #E4EAEA;
  --muted: #A9B7B8;
  --muted-2: #7A8A8C;
  --accent: #DFA24B;
  --accent-dim: #B5822F;
  --danger: #D96A6A;
  --ok: #4FA987;
  --info: #5B93CC;
  --cyan: #5AA9E6;
  --cyan-dim: #3F7BB0;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  padding: 32px 20px 80px;
}

h1, h2 {
  font-family: "Bricolage Grotesque", "IBM Plex Sans", sans-serif;
}

.wrap { max-width: 1100px; margin: 0 auto; }

h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: 0.02em; font-weight: 700; }
.subtitle { color: var(--muted); font-size: 13px; margin: 0 0 28px; }

.stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.stat-box {
  flex: 1;
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--cyan);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-label { font-size: 12px; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.03em; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--cyan); }
.stat-sublabel { font-size: 11px; color: var(--muted); }

.console-breakdown {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 16px 20px;
  margin-bottom: 28px;
}
.console-breakdown h2 { font-size: 14px; margin: 0 0 12px; color: var(--muted); }
.console-list { display: flex; flex-wrap: wrap; gap: 10px; }
.console-pill {
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text);
}
.console-pill span { color: var(--accent); font-weight: 700; margin-left: 4px; }

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
}
thead th:first-child, tbody td:first-child { width: 34%; }
thead th:nth-child(2), tbody td:nth-child(2) { width: 12%; }
tbody td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
tbody tr:hover { background: var(--panel-2); }
.spacer-row:hover { background: transparent !important; }
.clickable-row { cursor: pointer; }

/* Page détail */
.back-link { color: var(--cyan); text-decoration: none; font-size: 13px; display: inline-block; margin-bottom: 20px; }
.back-link:hover { text-decoration: underline; }

.game-header { display: flex; gap: 24px; margin-bottom: 24px; align-items: flex-start; }
.game-cover-placeholder {
  width: 140px;
  height: 140px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 10px;
}
.game-header-info h1 { margin-bottom: 4px; }
.external-link { color: var(--cyan); font-size: 13px; text-decoration: none; }
.external-link:hover { text-decoration: underline; }

.chart-container {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 24px;
}

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 16px 20px;
}
.detail-panel h2 { font-size: 14px; margin: 0 0 12px; color: var(--muted); }
.detail-panel h3 { font-size: 12px; color: var(--cyan); margin: 14px 0 6px; }

.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.detail-table td { padding: 6px 4px; border-bottom: 1px solid var(--border-soft); }

.delta-up { color: var(--ok); text-align: right; }
.delta-down { color: var(--danger); text-align: right; }
.sale-link { color: var(--ok); text-decoration: none; }
.sale-link:hover { text-decoration: underline; }
.sale-title-cell { color: var(--text); max-width: 500px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.info-grid > div { display: flex; flex-direction: column; gap: 2px; }
.info-label { font-size: 11px; color: var(--muted); text-transform: uppercase; }

.tabs {
  display: flex;
  gap: 2px;
  padding: 12px 12px 0;
}
.tab-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 110px;
}
.tab-btn.active {
  background: var(--panel);
  border-color: var(--cyan-dim);
  position: relative;
  z-index: 1;
}
.tab-btn:hover:not(.active) { color: var(--text); }
.tab-condition { font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.tab-btn.active .tab-condition { color: var(--cyan); }
.tab-price { font-size: 18px; font-weight: 700; color: var(--text); }
.tab-btn.active .tab-price { color: var(--cyan); }
.tab-meta { display: flex; gap: 8px; font-size: 11px; align-items: baseline; }
.tab-volume { color: var(--muted-2); white-space: nowrap; }

.tab-panel {
  display: none;
  border-top: 1px solid var(--cyan-dim);
  padding: 16px 20px 20px;
}
.tab-panel.active { display: block; }
.detail-panel.no-pad { padding: 0; }
.panel-title { font-size: 14px; color: var(--muted); padding: 16px 20px 0; }

@media (max-width: 700px) {
  .detail-grid { grid-template-columns: 1fr; }
  .game-header { flex-direction: column; }
}
.price-cell { color: var(--ok); text-align: right; font-weight: 600; }
.price-missing { color: var(--muted-2); text-align: right; }
.console-cell { color: var(--muted); font-size: 12px; }
