/* CreesPop — Heroes of the Storm leveling guide (v4), on the v2-light tokens.
   Everything is scoped under .hg / #main.hg-main so it can't leak into the site shell. */
.hg-main {
  position: relative; /* contain .sr-only children so they can't extend the document */
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scroll-padding-top: 72px;
}
.hg {
  --hg-panel: #ffffff;
  --hg-line: #d5ddd7;
  --hg-soft: #eef3ef;
  --hg-muted: #47604f;
  --hg-gold: #8a5a00;
  --hg-radius: 10px;
  color: var(--tx);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.hg h1, .hg h2, .hg h3, .hg p, .hg ul, .hg ol { margin: 0; }
.hg ul, .hg ol { padding: 0; list-style: none; }
.hg a { color: var(--accent); text-underline-offset: 3px; }
.hg a:hover { color: var(--fg); }
.hg [hidden] { display: none !important; }
.hg .sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hg :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.hg h1:focus { outline: none; }
.hg .muted { color: var(--hg-muted); }
.hg .small { font-size: 13.5px; }
.hg .hg-clip { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }

.hg-body { flex: 1 0 auto; width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 28px 28px; }
.hg .loading, .hg .notice { color: var(--hg-muted); padding: 32px 0; }

/* ---------- type ---------- */
.hg .title { font-size: 26px; line-height: 1.15; font-weight: 700; color: var(--fg); letter-spacing: -0.01em; }
.hg .display { font-size: 30px; line-height: 1.1; font-weight: 750; color: var(--fg); letter-spacing: -0.01em; }
.hg .eyebrow { display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; font-weight: 700; color: var(--hg-muted); }
.hg .lede { color: var(--hg-muted); max-width: 64ch; margin-top: 6px; }

/* ---------- controls ---------- */
.hg .panel { background: var(--hg-panel); border: 1px solid var(--hg-line); border-radius: var(--hg-radius); padding: 20px; }
.hg .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 14px; border-radius: 6px;
  border: 1px solid var(--hg-line); background: #fff; color: var(--fg);
  font: 600 14px/1.2 var(--font); text-decoration: none; cursor: pointer;
}
.hg .btn:hover { background: var(--hover); border-color: var(--accent); color: var(--fg); }
.hg .link-btn { background: none; border: 0; color: var(--accent); font: 600 14px/1.2 var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 8px 6px; min-height: 36px; }
.hg .input {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 6px;
  border: 1px solid #b9c6bd; background: #fff; color: var(--fg); font: 400 15px/1.3 var(--font);
}
.hg .input::placeholder { color: #66746b; }
.hg .input:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }

/* ---------- role dot / portrait tile (monogram + glyph, no artwork) ---------- */
.hg .role-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rc, var(--accent)); box-shadow: 0 0 0 1px rgba(20, 32, 24, 0.25); flex: none; display: inline-block; }
.hg .portrait {
  position: relative; flex: none; width: 56px; height: 56px; border-radius: 10px;
  display: grid; place-items: center; overflow: hidden;
  background: color-mix(in srgb, var(--rc, #0b6b3c) 20%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--rc, #0b6b3c) 55%, #ffffff);
}
.hg .portrait-glyph { position: absolute; inset: 0; display: grid; place-items: center; color: color-mix(in srgb, var(--rc, #0b6b3c) 45%, #ffffff); }
.hg .portrait-glyph svg { width: 70%; height: 70%; }
.hg .portrait-mono { position: relative; font-weight: 800; font-size: 19px; letter-spacing: 0.02em; color: var(--fg); }
.hg .portrait-lg { width: 88px; height: 88px; border-radius: 14px; }
.hg .portrait-lg .portrait-mono { font-size: 30px; }

/* ---------- hero grid ---------- */
.hg .grid-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 14px; }
.hg .search-wrap { width: min(340px, 100%); }
.hg .filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.hg .chips, .hg .filters-extra { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hg .chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--hg-line); background: #fff; color: var(--fg);
  font: 600 13.5px/1.2 var(--font); cursor: pointer;
}
.hg .chip:hover { border-color: var(--rc, var(--accent)); background: var(--hover); }
.hg .chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--rc, #0b6b3c) 18%, #ffffff);
  border-color: color-mix(in srgb, var(--rc, #0b6b3c) 70%, #142118);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc, #0b6b3c) 70%, #142118);
}
.hg .chip-glyph { display: inline-grid; width: 16px; height: 16px; color: color-mix(in srgb, var(--rc, #0b6b3c) 75%, #142118); }
.hg .chip-glyph svg { width: 16px; height: 16px; }
.hg .chip-ready[aria-pressed="true"] { background: var(--active); border-color: var(--accent); }
.hg .result-count { margin: 4px 0 12px; font-size: 13.5px; }
.hg .hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 10px; }
.hg .hero-card {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  min-height: 76px; border-radius: var(--hg-radius); border: 1px solid var(--hg-line);
  background: #fff; color: var(--fg); text-decoration: none;
}
.hg .hero-card:hover { border-color: color-mix(in srgb, var(--rc, #0b6b3c) 70%, #142118); background: #fbfdfb; color: var(--fg); }
.hg .hero-card:focus-visible { outline-offset: 1px; }
.hg .hero-meta { display: flex; flex-direction: column; min-width: 0; }
.hg .hero-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg .hero-role { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--hg-muted); }
.hg .hero-card .badge { display: none; } /* every hero is ready; badge is noise in the grid */
.hg .empty { padding: 28px 0; color: var(--hg-muted); }
.hg .badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.hg .badge-ready { background: var(--active); color: var(--accent); }
.hg .badge-soon { background: #f3eee2; color: var(--hg-gold); }

/* ---------- hero page ---------- */
.hg .crumbs { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13.5px; color: var(--hg-muted); margin-bottom: 14px; }
.hg .crumbs [aria-current] { color: var(--fg); font-weight: 600; }
.hg .hero-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.hg .hero-head-text { display: flex; flex-direction: column; gap: 4px; }
.hg .hero-head .badge { align-self: flex-start; }
.hg .tab-panel { outline: none; }
.hg .tab-panel:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 6px; }
.hg .build-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; justify-content: space-between; }
.hg .panel-title { font-size: 19px; line-height: 1.25; color: var(--fg); font-weight: 700; }
.hg .build-summary { margin-top: 10px; max-width: 80ch; }
.hg .build-meta {
  margin-top: 10px; padding: 8px 12px; font-size: 13.5px; color: var(--hg-muted);
  border-left: 3px solid var(--accent); background: var(--hg-soft); border-radius: 0 6px 6px 0; max-width: 90ch;
}
.hg .btn-copy.is-copied { border-color: var(--accent); background: var(--active); }
.hg .btn-copy.is-failed { border-color: #a4262c; color: #a4262c; }
.hg .copy-icon { display: inline-grid; width: 18px; height: 18px; }
.hg .copy-icon svg { width: 18px; height: 18px; }

/* tabs (role builds) */
.hg .tabs-slot { margin: 18px 0 14px; }
.hg .tabs-wrap { overflow-x: auto; scrollbar-width: thin; border-bottom: 1px solid var(--hg-line); }
.hg .tablist { position: relative; display: inline-flex; gap: 2px; min-width: max-content; }
.hg .tab {
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 8px 14px;
  border: 0; background: transparent; color: var(--hg-muted); font: 600 14px/1.2 var(--font);
  cursor: pointer; border-radius: 6px 6px 0 0; white-space: nowrap;
}
.hg .tab:hover { color: var(--fg); background: var(--hover); }
.hg .tab[aria-selected="true"] { color: var(--fg); }
.hg .tab-glider { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); border-radius: 3px 3px 0 0; transition: transform 0.2s ease, width 0.2s ease; }
.hg .tab-icon { font-size: 15px; }

/* level cards */
.hg .level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.hg .level-card {
  display: flex; flex-direction: column; gap: 6px; padding: 12px 14px;
  background: #fff; border: 1px solid var(--hg-line); border-radius: var(--hg-radius);
}
.hg .level-card.is-heroic { border-color: #c9a85a; background: #fffcf3; }
.hg .lc-top { display: flex; align-items: center; gap: 10px; }
.hg .lc-level {
  display: inline-flex; align-items: baseline; gap: 3px; min-width: 52px; padding: 2px 8px; border-radius: 6px;
  background: var(--hg-soft); color: var(--fg); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums;
}
.hg .lc-level small { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--hg-muted); }
.hg .is-heroic .lc-level { background: #f6ecd2; }
.hg .lc-icon { font-size: 22px; line-height: 1; }
.hg .lc-tag { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--hg-soft); color: var(--hg-muted); white-space: nowrap; }
.hg .lc-name { font-size: 16px; line-height: 1.25; color: var(--fg); font-weight: 700; }
.hg .lc-reason { font-size: 14px; color: var(--tx); }
.hg .lc-alt { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; padding-top: 6px; border-top: 1px dashed var(--hg-line); font-size: 13px; color: var(--hg-muted); }
.hg .lc-alt-label { font-weight: 700; }
.hg .lc-alt-name { color: var(--fg); font-weight: 600; }

/* sources (citations) */
.hg .sources { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--hg-line); border-radius: var(--hg-radius); background: var(--hg-soft); font-size: 13.5px; }
.hg .src-line { color: var(--fg); }
.hg .src-note { color: var(--hg-muted); }
.hg .src-list { margin: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.hg .src-list a { font-weight: 600; }

.hg .soon-panel, .hg .notfound { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.hg .soon-icon { font-size: 28px; }

/* ---------- sticky hero bar (back + hero search) ---------- */
.hg-bar { position: sticky; top: 0; z-index: 5; background: rgba(247, 250, 247, 0.96); border-bottom: 1px solid var(--line); }
.hg-bar-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 8px 28px; }
.hg-bar-back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px 0 4px; border-radius: 6px; color: var(--fg); font-weight: 600; text-decoration: none; }
.hg-bar-back:hover { background: var(--hover); color: var(--fg); }
.hg-bar-back svg { width: 20px; height: 20px; }
.hg-bar-hero { font-weight: 700; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hg-bar-search { position: relative; margin-left: auto; width: min(300px, 46%); }
.hg-bar-search .input { padding-right: 34px; }
.hg-kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 600 12px/1 var(--font); color: var(--hg-muted); border: 1px solid var(--hg-line); border-radius: 4px; padding: 3px 6px; background: #fff; }
.hg-bar-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 6; max-height: 320px; overflow-y: auto;
  background: #fff; border: 1px solid var(--hg-line); border-radius: 8px; box-shadow: 0 10px 28px rgba(20, 32, 24, 0.16); padding: 4px;
}
.hg-bar-results .tb-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.hg-bar-results .tb-item[aria-selected="true"] { background: var(--active); }
.hg-bar-results .tb-name { font-weight: 600; color: var(--fg); }
.hg-bar-results .tb-role { margin-left: auto; font-size: 12.5px; color: var(--hg-muted); }
.hg-bar-results .tb-none { padding: 8px 10px; color: var(--hg-muted); }

/* ---------- footer ---------- */
.hg-foot { margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--hg-muted); display: flex; flex-direction: column; gap: 4px; }
.hg-version { font-variant-numeric: tabular-nums; color: var(--fg); }

@media (max-width: 860px) {
  .hg-body { padding: 16px 14px 22px; }
  .hg-bar-inner { padding: 6px 10px; gap: 6px; }
  .hg-bar-back-text { display: none; }
  .hg-bar-hero { flex: 1 1 auto; }
  .hg-bar-search { width: auto; flex: 0 1 170px; }
  .hg-kbd { display: none; }
  .hg .input { font-size: 16px; } /* avoid iOS zoom on focus */
  .hg .grid-head { align-items: stretch; }
  .hg .search-wrap { width: 100%; }
  .hg .hero-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
  .hg .hero-card { min-height: 64px; gap: 10px; padding: 8px 10px; }
  .hg .portrait { width: 44px; height: 44px; }
  .hg .portrait-mono { font-size: 16px; }
  .hg .portrait-lg { width: 64px; height: 64px; }
  .hg .portrait-lg .portrait-mono { font-size: 22px; }
  .hg .display { font-size: 24px; }
  .hg .title { font-size: 22px; }
  .hg .level-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .hg .tab-glider { transition: none; }
}
@media (forced-colors: active) {
  .hg .portrait, .hg .hero-card, .hg .level-card { border-color: CanvasText; }
}
