/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
#sidebar {
  flex: 0 0 20%;
  /* Don't let the column get crushed at intermediate widths (≈960–1300px, when
     the house column is still shown): below this the skill rows wrap illegibly.
     game-col (flex 1 1 50%, shrinkable) gives back the space. */
  min-width: 240px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.sb-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.sb-head {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Shop buttons */
.shop-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  margin-bottom: 6px;
  background: #0c0c22;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: var(--text);
  font-family: inherit;
}
.shop-btn:last-child { margin-bottom: 0; }
.shop-btn:hover:not(:disabled) { border-color: var(--accent); background: #14143a; }
.shop-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.shop-btn:active:not(:disabled) { transform: scale(0.98); }

.si-icon { font-size: 20px; flex-shrink: 0; }
.si-info { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.si-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.si-desc { font-size: 11px; color: var(--muted); line-height: 1.3; }
.si-cost { font-size: 13px; font-weight: 700; color: var(--gold); white-space: nowrap; flex-shrink: 0; }
.si-cost.broke { color: var(--muted); }

/* Stats */
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid #1e1e40;
}
.stat-row:last-child { border-bottom: none; }
.stat-row .sr-k { color: var(--muted); }
.stat-row .sr-v { font-weight: 600; }

/* ── Stats modal (📊) — chrome comes from modal.css ───────────────────────────── */
#stats-list.modal-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-content: start;
}

.stats-section .stats-h {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 9px;
}

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

/* Overall content-coverage bar */
.overall-bar {
  height: 9px;
  background: #0f0f2a;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 12px;
}
.overall-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 5px;
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.6);
}

/* Per-domain/grammar-type coverage rows */
.cat-prog-list { display: flex; flex-direction: column; gap: 8px; }
.domain-group-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 10px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
}
.domain-group-header:first-child { margin-top: 0; }
.cat-prog {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px auto;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.cat-prog.cat-locked { opacity: 0.55; }
.cp-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-bar {
  height: 7px;
  background: #0f0f2a;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.cp-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.cp-val { font-size: 11px; color: var(--muted); font-weight: 700; white-space: nowrap; }

/* ── Achievements modal (🏆) — chrome comes from modal.css ────────────────────── */
#ach-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.ach-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.3;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.ach-icon { font-size: 20px; flex-shrink: 0; }
.ach-text { display: flex; flex-direction: column; gap: 2px; }
.ach-name { font-weight: 700; }
.ach-desc { font-size: 11px; color: var(--muted); }
.ach-earned { color: var(--text); }
.ach-earned { border-color: var(--gold); }
.ach-locked { color: var(--muted); }
.ach-locked .ach-icon { filter: grayscale(1) opacity(0.35); }

/* ── Achievement toast ───────────────────────────────────────────────────────── */
#ach-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gold);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 24px rgba(251,191,36,0.2);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
#ach-toast.toast-in  { opacity: 1; transform: translateX(-50%) translateY(0); }
#ach-toast.toast-out { opacity: 0; transform: translateX(-50%) translateY(10px); }
