/* ── GLOBAL SCROLLBAR FIX ── */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(139,92,246,0.25) transparent;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,0.4); }

/* ── SEARCH BAR ── */
.glossary-search {
  max-width: 520px; margin: 0 auto 1.5rem;
  position: relative;
}
.glossary-search input {
  width: 100%; padding: 0.85rem 1.25rem 0.85rem 2.75rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #f1f1f4; font-size: 0.95rem; font-family: inherit;
  outline: none; transition: border-color 0.3s;
}
.glossary-search input::placeholder { color: #6b7280; }
.glossary-search input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,0.1); }
.glossary-search-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: #6b7280; font-size: 1rem; pointer-events: none;
}

/* ── FILTER BAR ── */
.glossary-filters {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.filter-btn {
  padding: 0.35rem 0.8rem; border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #9ca3af; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  text-transform: uppercase; letter-spacing: 0.04em;
  font-family: inherit;
}
.filter-btn:hover {
  background: rgba(139,92,246,0.1);
  border-color: rgba(139,92,246,0.25);
  color: #a78bfa;
}
.filter-btn.active {
  background: rgba(139,92,246,0.15);
  border-color: rgba(139,92,246,0.35);
  color: #a78bfa;
}

/* ── SORT BAR ── */
.glossary-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem;
}
.glossary-count {
  font-size: 0.78rem; color: #6b7280; font-weight: 500;
}
.sort-controls {
  display: flex; align-items: center; gap: 0.5rem;
}
.sort-label {
  font-size: 0.72rem; color: #6b7280; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.sort-btn {
  padding: 0.3rem 0.65rem; border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #9ca3af; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  font-family: inherit;
}
.sort-btn:hover, .sort-btn.active {
  background: rgba(139,92,246,0.1);
  border-color: rgba(139,92,246,0.25);
  color: #a78bfa;
}

/* ── CARD GRID ── */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* ── GLOSSARY CARD ── */
.g-card {
  background: #12121e;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  transition: all 0.3s;
  display: flex; flex-direction: column;
}
.g-card:hover {
  border-color: rgba(139,92,246,0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.g-card-header {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.g-card-term {
  font-size: 1.05rem; font-weight: 700; color: #f1f1f4;
  font-family: 'Playfair Display', serif;
}
.g-card-badge {
  font-size: 0.58rem; font-weight: 700;
  padding: 0.15rem 0.45rem; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.04em;
  flex-shrink: 0;
}
.badge-financial { background: rgba(16,185,129,0.12); color: #34d399; }
.badge-financing { background: rgba(59,130,246,0.12); color: #60a5fa; }
.badge-property  { background: rgba(245,158,11,0.12); color: #fbbf24; }
.badge-market    { background: rgba(239,68,68,0.12); color: #f87171; }
.badge-deal      { background: rgba(139,92,246,0.12); color: #a78bfa; }
.badge-strategy  { background: rgba(168,85,247,0.12); color: #c084fc; }
.badge-gameplay  { background: rgba(6,182,212,0.12); color: #22d3ee; }

.g-card-simple {
  font-size: 0.72rem; font-weight: 600; color: #6b7280;
  margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.03em;
}

.g-card-def {
  font-size: 0.88rem; color: #9ca3af; line-height: 1.55;
  flex: 1;
}

.g-card-insight {
  margin-top: 0.65rem; padding-top: 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 0.78rem; color: #a78bfa; font-style: italic;
  line-height: 1.45;
}

.g-card-aliases {
  margin-top: 0.4rem;
  font-size: 0.7rem; color: #4b5563;
}

.g-card-letter {
  display: none; /* hidden, used for sort grouping */
}

/* ── LETTER DIVIDER (for A-Z sort) ── */
.letter-divider {
  grid-column: 1 / -1;
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; font-weight: 800;
  color: rgba(139,92,246,0.5);
  padding: 1.5rem 0 0.25rem;
  border-bottom: 1px solid rgba(139,92,246,0.12);
  margin-bottom: -0.25rem;
}
.letter-divider:first-child { padding-top: 0; }

/* ── EMPTY STATE ── */
.glossary-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 3rem 1rem;
  color: #6b7280; font-size: 0.95rem;
}
.glossary-empty strong { color: #9ca3af; }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .glossary-grid {
    grid-template-columns: 1fr;
  }
}
