/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Base ── */
body {
  background: #1a1a2e;
  color: #f0e6d3;
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

/* ── Login ── */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-container h1 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: #b8a9c9;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 320px;
}

.login-form label {
  font-size: 0.85rem;
  color: #b8a9c9;
}

.login-form input {
  padding: 0.6rem 0.75rem;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #12121f;
  color: #f0e6d3;
  font-size: 0.95rem;
}

.login-form input:focus {
  outline: none;
  border-color: #b8a9c9;
}

/* Password visibility toggle */
.pw-toggle-wrap {
  position: relative;
}
.pw-toggle-wrap input {
  padding-right: 2.5rem;
  width: 100%;
}
.pw-toggle-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #b8a9c9;
  cursor: pointer;
  padding: 0.2rem;
  opacity: 0.5;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.pw-toggle-btn:hover { opacity: 0.9; }

.login-form button {
  margin-top: 0.5rem;
  padding: 0.6rem;
  border: none;
  border-radius: 6px;
  background: #b8a9c9;
  color: #1a1a2e;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.login-form button:hover {
  background: #c9bada;
}

.error {
  color: #e57373;
  font-size: 0.85rem;
  text-align: center;
}

/* ── Header ── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #2a2a4a;
}

.header h1 {
  font-size: 1.2rem;
  color: #b8a9c9;
}

.logout-form button {
  padding: 0.4rem 1rem;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: transparent;
  color: #b8a9c9;
  font-size: 0.8rem;
  cursor: pointer;
}

.logout-form button:hover {
  border-color: #b8a9c9;
}

/* ── Dashboard ── */
.dashboard {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ── Cards ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  background: #12121f;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}

.card-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #f0e6d3;
}

.card-label {
  font-size: 0.8rem;
  color: #b8a9c9;
  margin-top: 0.25rem;
}

/* ── Live indicator ── */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #4caf50;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

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

.card-live {
  border-color: #3a3a5a;
}

.card-live .card-value {
  color: #b8a9c9;
}

/* ── Per-game cards ── */
.cards-games {
  margin-top: -0.5rem;
}

.card-game {
  border-left: 3px solid #8a8a9a;
}

.color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 2px;
}

/* ── Version info ── */
.version-info {
  margin-bottom: 1.5rem;
}

.version-info h2 {
  font-size: 1rem;
  color: #b8a9c9;
  margin-bottom: 0.75rem;
}

.version-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.version-pill {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border: 1px solid #2a2a4a;
  border-radius: 12px;
  background: #12121f;
  color: #f0e6d3;
  font-size: 0.8rem;
  font-family: monospace;
}

.version-loading {
  font-size: 0.8rem;
  color: #8a8a9a;
}

/* ── Live chart ── */
.live-chart-container {
  background: #12121f;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 0.5rem;
  overflow: hidden;
}

.live-chart-container canvas {
  display: block;
  width: 100%;
}

/* ── Chart legend ── */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 0.25rem 0;
}

.legend-item {
  font-size: 0.8rem;
  color: #b8a9c9;
}

/* ── Records tab ── */
.records-section h2 {
  font-size: 1rem;
  color: #b8a9c9;
  margin-bottom: 0.75rem;
}

.records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.record-card {
  background: #12121f;
  border: 1px solid #2a2a4a;
  border-left: 3px solid #b8a9c9;
  border-radius: 8px;
  padding: 1rem;
}

.record-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #f0e6d3;
}

.record-label {
  font-size: 0.8rem;
  color: #b8a9c9;
  margin-top: 0.25rem;
}

.record-date {
  font-size: 0.7rem;
  color: #8a8a9a;
  margin-top: 0.25rem;
}

/* ── Controls ── */
.controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.controls label {
  font-size: 0.85rem;
  color: #b8a9c9;
}

.controls select,
.controls input[type="text"] {
  padding: 0.4rem 0.6rem;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #12121f;
  color: #f0e6d3;
  font-size: 0.85rem;
}

.controls select:focus,
.controls input:focus {
  outline: none;
  border-color: #b8a9c9;
}

.controls button {
  padding: 0.4rem 1rem;
  border: none;
  border-radius: 6px;
  background: #b8a9c9;
  color: #1a1a2e;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.controls button:hover {
  background: #c9bada;
}

/* ── Bar chart ── */
.chart-section {
  margin-bottom: 1.5rem;
}

.chart-section h2 {
  font-size: 1rem;
  color: #b8a9c9;
  margin-bottom: 0.75rem;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 140px;
  background: #12121f;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 0.75rem;
}

.bar {
  flex: 1;
  min-width: 4px;
  background: #b8a9c9;
  border-radius: 2px 2px 0 0;
  position: relative;
  transition: background 0.2s;
}

.bar:hover {
  background: #c9bada;
}

.bar[title]::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a4a;
  color: #f0e6d3;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  display: none;
}

.bar:hover::after {
  display: block;
}

/* ── Table ── */
.table-section h2 {
  font-size: 1rem;
  color: #b8a9c9;
  margin-bottom: 0.75rem;
}

.events-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: #12121f;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  overflow: hidden;
}

.events-table th,
.events-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #2a2a4a;
}

.events-table th {
  background: #0f0f1a;
  color: #b8a9c9;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.events-table td {
  color: #f0e6d3;
}

.events-table td:last-child {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: #8a8a9a;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.events-table tbody tr:hover {
  background: #1e1e35;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.pagination button {
  padding: 0.35rem 0.75rem;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: transparent;
  color: #b8a9c9;
  font-size: 0.8rem;
  cursor: pointer;
}

.pagination button:hover:not(:disabled) {
  border-color: #b8a9c9;
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: default;
}

#page-info {
  font-size: 0.8rem;
  color: #8a8a9a;
}

/* ── Empty state ── */
.empty {
  text-align: center;
  color: #8a8a9a;
  padding: 2rem;
  font-size: 0.9rem;
}

/* ── Nav menu ── */
.nav-menu {
  display: flex;
  align-items: center;
  flex: 1;
  margin: 0 1rem;
  position: relative;
}

.nav-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.nav-item {
  padding: 0.3rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #8a8a9a;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.nav-item:hover {
  color: #f0e6d3;
  background: rgba(255,255,255,0.04);
}

.nav-item.active {
  color: #b8a9c9;
  background: rgba(184,169,201,0.12);
  border-color: rgba(184,169,201,0.25);
}

.hamburger {
  display: none;
  background: none;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  color: #b8a9c9;
  font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  line-height: 1;
}

.hamburger:hover {
  border-color: #b8a9c9;
}

.tab-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 9px;
  background: #e57373;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ── Errors tab ── */
.errors-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.errors-controls label {
  font-size: 0.85rem;
  color: #b8a9c9;
}

.errors-controls select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #12121f;
  color: #f0e6d3;
  font-size: 0.85rem;
}

.errors-controls select:focus {
  outline: none;
  border-color: #b8a9c9;
}

.errors-controls button {
  padding: 0.4rem 1rem;
  border: none;
  border-radius: 6px;
  background: #b8a9c9;
  color: #1a1a2e;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.errors-controls button:hover {
  background: #c9bada;
}

.errors-table tbody tr {
  cursor: pointer;
}

.errors-table tbody tr:hover {
  background: #1e1e35;
}

.errors-table td:first-child,
.errors-table td:nth-child(2) {
  font-weight: 700;
  text-align: center;
}

.error-detail {
  margin-top: 1.5rem;
  background: #12121f;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 1.25rem;
}

.error-detail h2 {
  font-size: 1rem;
  color: #b8a9c9;
  margin-bottom: 0.75rem;
}

.error-field {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  word-break: break-word;
}

.error-label {
  color: #b8a9c9;
  font-weight: 600;
}

.error-stack {
  background: #0a0a14;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  padding: 0.75rem;
  font-size: 0.75rem;
  color: #e57373;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
}

/* ── Accounts tab ── */
.accounts-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.accounts-controls input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #12121f;
  color: #f0e6d3;
  font-size: 0.85rem;
}

.accounts-controls input:focus {
  outline: none;
  border-color: #b8a9c9;
}

.accounts-count {
  font-size: 0.8rem;
  color: #8a8a9a;
}

.accounts-table tbody tr:hover {
  background: #1e1e35;
}

/* Tier pills */
.tier-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 9px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.tier-explorer {
  background: rgba(138,138,154,0.15);
  color: #8a8a9a;
}

.tier-believer {
  background: rgba(126,200,227,0.15);
  color: #7ec8e3;
}

.tier-firestarter {
  background: rgba(229,162,50,0.15);
  color: #e5a232;
}

.tier-faithful {
  background: rgba(200,130,200,0.15);
  color: #c882c8;
}

.tier-starseed {
  background: rgba(78,204,163,0.15);
  color: #4ecca3;
}

.tier-wizard {
  background: rgba(184,169,201,0.15);
  color: #b8a9c9;
}

/* Account detail panel */
.account-detail {
  margin-top: 1.5rem;
  background: #12121f;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 1.25rem;
}

.account-detail h2 {
  font-size: 1rem;
  color: #b8a9c9;
  margin-bottom: 0.75rem;
}

.account-detail select {
  padding: 0.3rem 0.5rem;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #12121f;
  color: #f0e6d3;
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.account-detail select:focus {
  outline: none;
  border-color: #b8a9c9;
}

.tier-save-btn {
  padding: 0.25rem 0.75rem;
  border: none;
  border-radius: 6px;
  background: #b8a9c9;
  color: #1a1a2e;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: 0.5rem;
}

.tier-save-btn:hover {
  background: #c9bada;
}

.tier-save-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Clickable user links in event tables */
.user-link {
  color: #7ec8e3;
  cursor: pointer;
  text-decoration: none;
  font-family: monospace;
  font-size: 0.8rem;
}

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

/* ── Game stats table ── */
.game-stats-section {
  margin-bottom: 1.5rem;
}

.game-stats-table .num-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.game-stats-table thead .num-col {
  text-align: right;
}

/* Hide all-zero columns dynamically */
.game-stats-table.hide-levels .gs-col-levels,
.game-stats-table.hide-maxlevel .gs-col-maxlevel,
.game-stats-table.hide-maxscore .gs-col-maxscore,
.game-stats-table.hide-peak .gs-col-peak {
  display: none;
}

/* ── Game peaks grid ── */
.game-peaks-section {
  margin-bottom: 1.5rem;
}

.game-peaks-section h2 {
  font-size: 1rem;
  color: #b8a9c9;
  margin-bottom: 0.75rem;
}

/* Tier count cards */
.tier-counts { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }

/* ── Range toggle ── */
.range-toggle {
  display: flex;
  gap: 0;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.range-btn {
  padding: 0.25rem 0.65rem;
  border: none;
  background: transparent;
  color: #8a8a9a;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.range-btn:not(:last-child) {
  border-right: 1px solid #2a2a4a;
}
.range-btn:hover { color: #f0e6d3; }
.range-btn.active { background: #b8a9c9; color: #1a1a2e; }

/* ── Refresh timer bar ── */
.refresh-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.refresh-bar {
  flex: 1;
  height: 3px;
  background: #2a2a4a;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.refresh-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: #b8a9c9;
  border-radius: 2px;
  width: var(--progress, 0%);
  transition: width 1s linear;
}

.refresh-bar.polling::after {
  background: #4caf50;
  width: 100%;
  transition: none;
  animation: pulse-bar 0.6s ease-in-out;
}

@keyframes pulse-bar {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.refresh-label {
  font-size: 0.7rem;
  color: #8a8a9a;
  min-width: 2rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Campfire settings ── */
.campfire-settings {
  margin-bottom: 1.5rem;
  background: #12121f;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 1.25rem;
}
.campfire-settings h2 {
  font-size: 0.95rem;
  color: #b8a9c9;
  margin-bottom: 0.75rem;
}
.lifetime-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.lifetime-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.lifetime-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.lifetime-input-wrap input[type="number"] {
  width: 80px;
  padding: 0.3rem 0.5rem;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #1a1a2e;
  color: #f0e6d3;
  font-size: 0.85rem;
}
.lifetime-input-wrap input[type="number"]:focus {
  outline: none;
  border-color: #b8a9c9;
}
.lt-unit { font-size: 0.75rem; color: #8a8a9a; }
.lt-perm-label { font-size: 0.8rem; color: #f0e6d3; }
.lt-unit-sel {
  padding: 0.3rem 0.5rem;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #1a1a2e;
  color: #f0e6d3;
  font-size: 0.8rem;
}
.lt-unit-sel:focus { outline: none; border-color: #b8a9c9; }

/* ── Game tags ── */
.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.game-tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.tag-popular { background: rgba(76,175,80,0.15); color: #4caf50; }
.tag-nobody { background: rgba(229,115,115,0.15); color: #e57373; }
.tag-trending { background: rgba(0,188,212,0.15); color: #00bcd4; }
.tag-declining { background: rgba(255,152,0,0.15); color: #ff9800; }
.tag-new { background: rgba(66,165,245,0.15); color: #42a5f5; }

/* ── Impact bars ── */
.impact-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 80px;
}
.impact-bar {
  flex: 1;
  height: 6px;
  background: #2a2a4a;
  border-radius: 3px;
  overflow: hidden;
}
.impact-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.impact-score {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  min-width: 1.8rem;
  text-align: right;
}

/* Hide impact column when all N/A */
.game-stats-table.hide-impact .gs-col-impact { display: none; }

/* ── Game config section ── */
.game-config-section {
  margin-bottom: 1.5rem;
  background: #12121f;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 1.25rem;
}
.game-config-section h2 {
  font-size: 0.95rem;
  color: #b8a9c9;
  margin-bottom: 0.75rem;
}
.game-config-global {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.game-config-global label {
  font-size: 0.85rem;
  color: #b8a9c9;
}
.game-config-global input[type="number"] {
  width: 70px;
  padding: 0.3rem 0.5rem;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #1a1a2e;
  color: #f0e6d3;
  font-size: 0.85rem;
}
.game-config-global input[type="number"]:focus {
  outline: none;
  border-color: #b8a9c9;
}
.game-config-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.game-config-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #1e1e35;
}
.game-config-row:last-child { border-bottom: none; }
.game-config-row-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.game-config-name {
  min-width: 120px;
  font-size: 0.85rem;
  color: #f0e6d3;
}
.game-config-row select {
  padding: 0.3rem 0.5rem;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #1a1a2e;
  color: #f0e6d3;
  font-size: 0.8rem;
}
.game-config-row select:focus { outline: none; border-color: #b8a9c9; }
.game-config-row input[type="number"] {
  width: 60px;
  padding: 0.3rem 0.5rem;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #1a1a2e;
  color: #f0e6d3;
  font-size: 0.8rem;
}
.game-config-row input[type="number"]:focus { outline: none; border-color: #b8a9c9; }
.game-config-threshold-label {
  font-size: 0.75rem;
  color: #8a8a9a;
}

/* ── Game selector (Access tab) ── */
.gc-game-selector-wrap {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem;
}
.gc-game-selector-wrap label { font-size: 0.85rem; color: #b8a9c9; }
#gc-game-select {
  flex: 1; max-width: 280px; padding: 0.4rem 0.6rem;
  border: 1px solid #2a2a4a; border-radius: 6px;
  background: #1a1a2e; color: #f0e6d3; font-size: 0.85rem;
}
#gc-game-select:focus { outline: none; border-color: #b8a9c9; }
.gc-tier-hint {
  font-size: 0.65rem; color: #8a8a9a; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Threshold groups (everyone / faithful+) ── */
.gc-threshold-group {
  margin-top: 0.5rem;
  padding: 0.5rem 0.5rem 0.4rem;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.04);
}
.gc-threshold-group-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a8a9a;
  margin-bottom: 0.35rem;
}
.gc-metric-label {
  font-style: italic;
}

/* ── Per-tier threshold inputs ── */
.gc-thresholds {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-left: 0.25rem;
}
.gc-threshold-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
}
.gc-tier-progress {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
}

/* ── Game config community stats ── */
.gc-community-stats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #b8a9c9;
  margin-bottom: 0.75rem;
}
.gc-community-stats strong {
  color: #f0e6d3;
}

/* ── Game config unlock progress ── */
.gc-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-left: 0.25rem;
}
.gc-progress-bar {
  flex: 1;
  height: 6px;
  background: #2a2a4a;
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}
.gc-progress-fill {
  height: 100%;
  background: #7ec8e3;
  border-radius: 3px;
  transition: width 0.3s;
}
.gc-progress-label {
  font-size: 0.75rem;
  color: #8a8a9a;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Community score badge in access tab ── */
.gc-current-score {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(212,165,116,0.12);
  color: #d4a574;
  margin-left: auto;
  white-space: nowrap;
}

/* ── Feedback tab ── */
.feedback-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.feedback-controls label {
  font-size: 0.85rem;
  color: #b8a9c9;
}
.feedback-controls select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  background: #12121f;
  color: #f0e6d3;
  font-size: 0.85rem;
}
.feedback-controls select:focus {
  outline: none;
  border-color: #b8a9c9;
}
/* ── Emotion summary cards ── */
.fb-emotion-card {
  background: #12121f;
  border: 1px solid #2a2a4a;
  border-left: 3px solid #8a8a9a;
  border-radius: 8px;
  padding: 1rem;
}
.fb-emotion-card-header {
  font-size: 0.85rem;
  color: #f0e6d3;
  margin-bottom: 0.5rem;
}
.fb-emotion-dominant {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  text-transform: capitalize;
}
.fb-emotion-bars {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.fb-emotion-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0.7;
}
.fb-emotion-row-dominant {
  opacity: 1;
}
.fb-emotion-emoji {
  font-size: 0.85rem;
  width: 1.2rem;
  text-align: center;
  flex-shrink: 0;
}
.fb-emotion-bar-track {
  flex: 1;
  height: 6px;
  background: #2a2a4a;
  border-radius: 3px;
  overflow: hidden;
}
.fb-emotion-bar {
  height: 100%;
  border-radius: 3px;
  min-width: 0;
  transition: width 0.3s;
}
.fb-emotion-count {
  font-size: 0.7rem;
  color: #8a8a9a;
  min-width: 1.2rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Emotion pill in feedback table ── */
.fb-emotion-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

/* ── Clickable feedback rows ── */
.fb-clickable-row {
  cursor: pointer;
}
.fb-clickable-row:hover {
  background: #1e1e35;
}
.fb-comment-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Feedback detail panel ── */
.fb-detail-row td {
  background: #0f0f1a;
  padding: 0 !important;
  border-bottom: 1px solid #2a2a4a;
}
.fb-detail-content {
  padding: 1rem 1.25rem;
}
.fb-detail-section {
  margin-bottom: 0.75rem;
}
.fb-detail-section:last-of-type {
  margin-bottom: 0.5rem;
}
.fb-detail-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a8a9a;
  margin-bottom: 0.25rem;
}
.fb-detail-value {
  font-size: 0.85rem;
  color: #f0e6d3;
  word-break: break-word;
}

/* ── Context timeline ── */
.fb-context-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.fb-context-event {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding-left: 0.5rem;
  border-left: 2px solid #2a2a4a;
}
.fb-ctx-name {
  color: #b8a9c9;
  font-weight: 600;
  white-space: nowrap;
}
.fb-ctx-data {
  color: #8a8a9a;
  font-family: monospace;
  font-size: 0.7rem;
}
.fb-ctx-time {
  color: #666;
  font-size: 0.7rem;
  white-space: nowrap;
  margin-left: auto;
}

/* ── Feedback detail actions ── */
.fb-detail-actions {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid #2a2a4a;
}
.fb-delete-btn {
  background: none;
  border: 1px solid rgba(229,115,115,0.3);
  color: #e57373;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.fb-delete-btn:hover {
  background: rgba(229,115,115,0.1);
}
.feedback-table tbody tr:hover {
  background: #1e1e35;
}

/* Monospace truncated IDs */
.monospace {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: #8a8a9a;
}

/* ── Mobile layout ── */
@media (max-width: 600px) {
  /* Nav menu mobile */
  .hamburger {
    display: block;
  }

  .nav-items {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #12121f;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 0.5rem;
    z-index: 100;
    margin-top: 0.35rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  }

  .nav-menu.nav-open .nav-items {
    display: flex;
  }

  .nav-item {
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    text-align: left;
  }

  /* Reduce dashboard padding */
  .dashboard {
    padding: 0.75rem;
  }
  .header {
    padding: 0.75rem 1rem;
  }
  .header h1 {
    font-size: 1rem;
  }

  /* Card sizes */
  .card {
    padding: 0.75rem;
  }
  .card-value {
    font-size: 1.5rem;
  }

  /* Tier counts grid: auto-fit wrapping */
  .tier-counts {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }

  /* Table scroll wrappers */
  .table-section,
  .game-stats-section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .events-table {
    font-size: 0.75rem;
  }
  .events-table th {
    font-size: 0.65rem;
  }
  .events-table td:last-child {
    max-width: 120px;
  }

  /* Account detail & error detail */
  .account-detail,
  .error-detail {
    padding: 0.75rem;
    overflow-x: auto;
  }

  /* Range toggle mobile */
  .range-btn { padding: 0.2rem 0.5rem; font-size: 0.7rem; }

  /* Campfire settings mobile */
  .lifetime-grid { grid-template-columns: 1fr; }
}
