/* MLBB glossary on /glossary/. Same family as the nickname generator: journal tokens (--j-*), a settings card on top,
   a list that scrolls inside its own frame, and the two next-step cards under it. */
.glossary-page .gl, .glossary-page .gl-faq { width: min(100%, 1200px); margin-inline: auto; }
.gl { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; padding-block: 4px 8px; }
.gl *, .gl *::before, .gl *::after { box-sizing: border-box; }
.gl [hidden] { display: none !important; }
.gl :focus-visible { outline: 2px solid var(--j-accent); outline-offset: 2px; }
.gl-main { min-width: 0; }

/* search and topics */
.gl-controls { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--j-line); border-radius: 16px; background: var(--j-panel); }
.gl-search { position: relative; display: flex; align-items: center; }
.gl-search > svg { position: absolute; left: 16px; color: var(--j-faint); pointer-events: none; }
.gl-search input { width: 100%; height: 52px; padding: 0 48px 0 46px; border: 1px solid var(--j-line-strong); border-radius: 12px; background: #0b1b2c; color: var(--j-ink); font: inherit; font-size: 1.0625rem; -webkit-appearance: none; appearance: none; }
.gl-search input::-webkit-search-cancel-button { display: none; }
.gl-search input::placeholder { color: var(--j-faint); }
.gl-search input:focus { border-color: var(--j-accent); outline: 0; }
.gl-search__clear { position: absolute; right: 6px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--j-muted); cursor: pointer; }
.gl-search__clear:hover { background: #17314a; color: var(--j-ink); }
.gl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gl-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--j-line-strong); border-radius: 20px; background: transparent; color: var(--j-text); font: inherit; font-size: .9375rem; cursor: pointer; white-space: nowrap; transition: border-color .15s, background-color .15s; }
.gl-chip small { color: var(--j-faint); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.gl-chip:hover { border-color: #4a6a88; color: var(--j-ink); }
.gl-chip[aria-pressed="true"] { border-color: var(--j-accent); background: rgba(0, 255, 157, .12); color: var(--j-ink); font-weight: 600; }
.gl-chip[aria-pressed="true"] small { color: var(--j-accent); }
.gl-status { min-height: 1.5em; margin: 14px 2px 10px; color: var(--j-muted); font-size: .9375rem; }
.gl-status:empty { min-height: 0; margin: 12px 0 0; }

/* the list scrolls inside its frame; cards flow in two columns on wide screens */
.gl-scroll { max-height: min(72vh, 780px); padding: 12px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--j-line); border-radius: 16px; background: #0b1b2c; scrollbar-width: thin; scrollbar-color: #34506b transparent; scroll-behavior: smooth; }
.gl-scroll:focus-visible { outline-offset: -2px; }
.gl-list { columns: 2 330px; column-gap: 12px; }
.gl-card { position: relative; display: block; margin: 0 0 12px; padding: 16px; border: 1px solid var(--j-line); border-radius: 14px; background: var(--j-panel); break-inside: avoid; scroll-margin-top: 12px; transition: border-color .15s, background-color .15s; }
.gl-card:hover { border-color: var(--j-line-strong); }
.gl-card.is-current { border-color: var(--j-accent); background: #0f2a2c; }
.gl-card__head { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.gl-card__icon { display: grid; place-items: center; width: 40px; height: 40px; overflow: hidden; border-radius: 10px; background: #0b1b2c; }
.gl-card__icon img { width: 40px; height: 40px; object-fit: contain; }
.gl-card__icon--letter span { color: var(--j-accent); font-size: 1.125rem; font-weight: 650; }
.gl-card__name { display: grid; gap: 2px; min-width: 0; }
.gl-card h3 { margin: 0; color: var(--j-ink); font-size: 1.125rem; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.gl-card__cat { color: var(--j-faint); font-size: .8125rem; line-height: 1.3; }
.gl-card__anchor { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--j-faint); opacity: 0; transition: opacity .15s, color .15s, background-color .15s; }
.gl-card:hover .gl-card__anchor, .gl-card__anchor:focus-visible, .gl-card.is-current .gl-card__anchor { opacity: 1; }
.gl-card__anchor:hover { background: #17314a; color: var(--j-accent); }
.gl-card__alt { margin: 10px 0 0; color: var(--j-faint); font-size: .875rem; line-height: 1.45; }
.gl-card__def { margin: 8px 0 0; color: var(--j-text); font-size: .96875rem; line-height: 1.55; }
.gl-card__ex { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: #06121f; color: #ffd66b; font-size: .875rem; line-height: 1.45; overflow-wrap: anywhere; }
.gl-card__ex span { color: #62b5ff; }
.gl-card__link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--j-accent); font-size: .875rem; font-weight: 600; text-decoration: none; }
.gl-card__link:hover { text-decoration: underline; text-underline-offset: 3px; }
.gl-card mark { padding: 0 1px; border-radius: 3px; background: rgba(0, 255, 157, .24); color: inherit; }
.gl-empty { margin: 8px 4px; color: var(--j-muted); font-size: .9375rem; line-height: 1.55; }
.gl-empty a { color: var(--j-accent); }

/* most searched */
.gl-side { position: sticky; top: 88px; padding: 18px; border: 1px solid var(--j-line); border-radius: 16px; background: var(--j-panel); }
.gl-side h2 { margin: 0 0 12px; color: var(--j-ink); font-size: 1rem; font-weight: 650; }
.gl-popular { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.gl-popular a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--j-line-strong); border-radius: 18px; color: var(--j-text); font-size: .9375rem; text-decoration: none; }
.gl-popular a:hover { border-color: var(--j-accent); color: var(--j-ink); }
.gl-toast { position: fixed; left: 50%; bottom: 24px; z-index: 10001; padding: 12px 18px; border: 1px solid rgba(0, 255, 157, .4); border-radius: 12px; background: #0f2a2c; color: var(--j-ink); font-weight: 600; transform: translateX(-50%); box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.gl-faq { margin-top: clamp(28px, 5vw, 48px); }

@media (hover: none) { .gl-card__anchor { opacity: .7; } }
@media (max-width: 980px) {
  .gl { grid-template-columns: minmax(0, 1fr); }
  .gl-side { position: static; }
}
@media (max-width: 620px) {
  .gl-controls { padding: 14px; gap: 12px; }
  /* topics in one row that scrolls sideways: the list stays close to the search */
  .gl-chips { flex-wrap: nowrap; margin: 0 -14px; padding: 0 14px 2px; overflow-x: auto; scrollbar-width: none; }
  .gl-chips::-webkit-scrollbar { display: none; }
  .gl-chip { min-height: 40px; padding: 0 12px; }
  .gl-scroll { max-height: 68vh; padding: 8px; border-radius: 14px; }
  .gl-card { padding: 14px; margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .gl-scroll { scroll-behavior: auto; } .gl-card, .gl-chip, .gl-card__anchor { transition: none; } }
