/* ── Team Builder ─────────────────────────────────────────────────── */
.tb-root {
  --tb-bg-1: #131314;
  --tb-bg-2: #1b1b1d;
  --tb-bg-3: #25252a;
  --tb-line: #2a2a30;
  --tb-line-strong: #3a3a44;
  --tb-text: #e8e8ec;
  --tb-muted: #9a9aa3;
  --tb-good: #4ade80;
  --tb-warn: #fbbf24;
  --tb-bad: #f87171;
  --tb-stab: #4ade80;
  --tb-threat-bg: rgba(239, 68, 68, 0.20);
  --tb-resist-bg: rgba(34, 197, 94, 0.20);
  font-size: 14px;
  line-height: 1.45;
  color: var(--tb-text);
}
.tb-root * { box-sizing: border-box; }

/* ── Page header (tightened - saves ~20px for taller layout below) ── */
.tb-head { padding: 12px 0 10px; border-bottom: 1px solid var(--tb-line); margin-bottom: 12px; }
.tb-head h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.tb-head .tb-sub { color: var(--tb-muted); font-size: 12px; }
.tb-hack-pill-wrap { position: relative; display: inline-block; vertical-align: middle; }
.tb-hack-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  background: var(--tb-bg-3);
  border: 1px solid var(--tb-line-strong);
  border-radius: 999px;
  font-size: 12px; margin-left: 8px;
  color: var(--tb-text); cursor: pointer; text-decoration: none;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  vertical-align: middle;
}
.tb-hack-pill:hover { background: var(--tb-line-strong); border-color: var(--tb-text); }
.tb-hack-pill::after { content: "\25BE"; font-size: 9px; opacity: 0.7; margin-left: 4px; }

.tb-hack-pill-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 8px;
  min-width: 220px;
  background: var(--tb-bg-3);
  border: 1px solid var(--tb-line-strong);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  padding: 6px;
  z-index: 1000;
  max-height: 70vh;
  overflow-y: auto;
}
.tb-hack-pill-menu.hidden { display: none; }
.tb-hack-pill-item {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--tb-text);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.1s;
}
.tb-hack-pill-item:hover { background: var(--tb-line); }
.tb-hack-pill-item.active {
  background: var(--tb-line-strong);
  font-weight: 700;
  cursor: default;
}
.tb-hack-pill-item.all-hacks {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--tb-line);
  color: var(--tb-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
@media (max-width: 480px) {
  .tb-hack-pill-menu { left: auto; right: 0; min-width: 200px; }
}

.tb-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.tb-btn {
  background: var(--tb-bg-2); color: var(--tb-text);
  border: 1px solid var(--tb-line-strong);
  padding: 7px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: background 0.15s;
}
.tb-btn:hover:not(:disabled) { background: var(--tb-bg-3); }
.tb-btn.primary { background: #fff; color: #000; border-color: #fff; }
.tb-btn.primary:hover:not(:disabled) { background: #e8e8e8; }
.tb-btn.ghost { background: transparent; }
.tb-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Layout ──────────────────────────────────────────────────────
   Independent column heights:
   - Team column (.tb-col-left) takes its natural height, no scroll
   - Threats column (.tb-col-right) is sticky and viewport-bounded with
     internal scroll, so it stays visible while the page scrolls past
     a tall team column.
   Page scrolls naturally to reveal SEO content below. */
.tb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.tb-col-left {
  min-width: 0;             /* lets grid child shrink so contents don't overflow */
}
.tb-col-right {
  position: sticky;
  top: 70px;                /* clears the global sticky nav */
  max-height: calc(100vh - 84px);
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  padding-right: 6px;
}
/* Themed scrollbars on the right column only (left column has no scroll) */
.tb-col-right::-webkit-scrollbar { width: 8px; }
.tb-col-right::-webkit-scrollbar-track {
  background: var(--tb-bg-1);
  border-radius: 4px;
}
.tb-col-right::-webkit-scrollbar-thumb {
  background: var(--tb-line-strong);
  border-radius: 4px;
  border: 1px solid var(--tb-bg-1);
}
.tb-col-right::-webkit-scrollbar-thumb:hover {
  background: var(--tb-muted);
}
.tb-col-right {
  scrollbar-width: thin;
  scrollbar-color: var(--tb-line-strong) var(--tb-bg-1);
}
@media (max-width: 980px) {
  .tb-layout { grid-template-columns: 1fr; gap: 16px; }
  .tb-col-right {
    position: static;
    max-height: none;
    overflow-y: visible;
    overflow-x: visible;
  }
}

/* ── Team grid ── */
.tb-team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .tb-team-grid { grid-template-columns: 1fr; } }

.tb-slot {
  background: var(--tb-bg-1);
  border: 1px solid var(--tb-line);
  border-radius: 10px;
  padding: 12px;
  min-height: 200px;
  min-width: 0;        /* allow shrinking inside grid track */
  position: relative;
}
.tb-slot.empty {
  border-style: dashed; border-color: var(--tb-line-strong);
  color: var(--tb-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-direction: column; gap: 8px; opacity: 0.85;
}
.tb-slot.empty:hover { opacity: 1; border-color: var(--tb-text); }
.tb-slot.empty .tb-plus {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--tb-bg-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--tb-text); line-height: 1;
  border: 1px solid var(--tb-line-strong);
}
.tb-slot-num {
  position: absolute; top: 8px; left: 10px;
  font-size: 10px; color: var(--tb-muted); font-weight: 600; opacity: 0.5;
}
.tb-slot-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding-left: 14px; min-width: 0; }
.tb-slot-head > div { min-width: 0; flex: 1; }
.tb-sprite {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  flex-shrink: 0;
  background: var(--tb-bg-3); color: var(--tb-text);
  border: 1px solid var(--tb-line-strong);
  overflow: hidden;
}
.tb-sprite img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.tb-sprite.sm { width: 32px; height: 32px; font-size: 12px; }
.tb-slot-name { font-weight: 600; font-size: 14px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-slot-types { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.tb-slot-remove {
  margin-left: auto; color: var(--tb-muted);
  background: transparent; border: none; cursor: pointer;
  font-size: 16px; padding: 2px 6px; border-radius: 4px;
}
.tb-slot-remove:hover { color: var(--tb-bad); background: rgba(248,113,113,0.1); }

/* ── Type badges ── */
.tb-type {
  display: inline-block; width: 70px; text-align: center;
  padding: 2px 0; border-radius: 4px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.15); line-height: 1.3;
}
.tb-type.sm { width: 56px; font-size: 9px; padding: 1px 0; letter-spacing: 0.4px; }
.tb-type-Normal{background-color:#A8A878;} .tb-type-Fire{background-color:#F08030;}
.tb-type-Water{background-color:#6890F0;} .tb-type-Electric{background-color:#F8D030;}
.tb-type-Grass{background-color:#78C850;} .tb-type-Ice{background-color:#98D8D8;}
.tb-type-Fighting{background-color:#C03028;} .tb-type-Poison{background-color:#A040A0;}
.tb-type-Ground{background-color:#E0C068;} .tb-type-Flying{background-color:#A890F0;}
.tb-type-Psychic{background-color:#F85888;} .tb-type-Bug{background-color:#A8B820;}
.tb-type-Rock{background-color:#B8A038;} .tb-type-Ghost{background-color:#705898;}
.tb-type-Dragon{background-color:#7038F8;} .tb-type-Dark{background-color:#705848;}
.tb-type-Steel{background-color:#B8B8D0;} .tb-type-Fairy{background-color:#EE99AC;}

/* ── Abilities ── */
.tb-abilities { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 10px; }
.tb-ability {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 5px;
  background: rgba(58,58,68,0.55);
  font-size: 11px; font-weight: 500;
  color: var(--tb-text);
  cursor: help; position: relative;
  border: 1px solid rgba(255,255,255,0.06);
  line-height: 1.4;
  transition: background 0.15s, border-color 0.15s;
}
.tb-ability:hover, .tb-ability:focus { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.20); outline: none; }
.tb-ability.hidden { font-style: italic; color: var(--tb-muted); }
.tb-ability.hidden::after { content: " (H)"; font-size: 9px; font-style: normal; }
.tb-ability-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--tb-bg-3);
  border: 1px solid var(--tb-line-strong);
  border-radius: 6px;
  padding: 7px 11px;
  font-size: 11px; font-style: normal; color: var(--tb-text);
  white-space: normal;
  width: max-content;
  max-width: 240px;
  display: none;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  pointer-events: none;
  text-align: center;
}
.tb-ability:hover .tb-ability-tip, .tb-ability:focus .tb-ability-tip { display: block; }
.tb-ability.hidden .tb-ability-tip { font-style: normal; color: var(--tb-text); }

/* ── Move slots ── */
.tb-moves { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 0; }
.tb-move {
  background: var(--tb-bg-2);
  border: 1px solid var(--tb-line);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; min-height: 32px;
  transition: border-color 0.15s, background 0.15s;
}
.tb-move:hover { border-color: var(--tb-line-strong); }
.tb-move.empty {
  color: var(--tb-muted); justify-content: center;
  font-style: italic;
  border-style: dashed;
}
.tb-move.empty:hover { color: var(--tb-text); border-color: var(--tb-text); }
.tb-move .tb-move-name { font-weight: 600; flex: 1; line-height: 1.1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-move .tb-move-power { color: var(--tb-muted); font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; flex-shrink: 0; }

.tb-move.stab-move {
  border-left: 3px solid var(--tb-stab);
  padding-left: 6px;
  background: linear-gradient(90deg, rgba(74,222,128,0.07) 0%, var(--tb-bg-2) 30%);
}
.tb-threat-move.stab-move {
  border-left: 3px solid var(--tb-stab);
  padding-left: 8px;
  background: linear-gradient(90deg, rgba(74,222,128,0.07) 0%, var(--tb-bg-1) 30%);
}

/* ── Move-search-active ── */
.tb-move.searching {
  grid-column: span 2;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  background: var(--tb-bg-2);
  border: 1px solid var(--tb-line-strong);
  cursor: default;
  overflow: visible;
  min-height: 0;
}
.tb-move-search-input {
  background: transparent;
  border: none;
  color: var(--tb-text);
  font-size: 12px;
  padding: 8px 10px;
  outline: none;
  font-family: inherit;
  border-bottom: 1px solid var(--tb-line);
  width: 100%;
}
.tb-move-search-input::placeholder { color: var(--tb-muted); }
.tb-move-results { max-height: 220px; overflow-y: auto; }
.tb-move-result {
  padding: 6px 10px;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 11px;
  border-bottom: 1px solid var(--tb-line);
}
.tb-move-result:last-child { border-bottom: none; }
.tb-move-result:hover, .tb-move-result.selected { background: var(--tb-bg-3); }
.tb-move-result .tb-result-name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-move-result .tb-result-power { color: var(--tb-muted); font-size: 10px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.tb-move-results-empty { padding: 12px; text-align: center; color: var(--tb-muted); font-size: 11px; }

/* ── Pokémon picker ── */
.tb-slot.picking {
  border-style: solid;
  border-color: var(--tb-line-strong);
  background: var(--tb-bg-1);
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  cursor: default;
  opacity: 1;
  overflow: visible;
}
.tb-picker-search-input {
  background: transparent;
  border: none;
  color: var(--tb-text);
  font-size: 13px;
  padding: 12px 14px;
  outline: none;
  font-family: inherit;
  border-bottom: 1px solid var(--tb-line);
  width: 100%;
}
.tb-picker-search-input::placeholder { color: var(--tb-muted); }
.tb-picker-results { flex: 1; overflow-y: auto; max-height: 260px; }
.tb-picker-result {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--tb-line);
}
.tb-picker-result:last-child { border-bottom: none; }
.tb-picker-result:hover, .tb-picker-result.selected { background: var(--tb-bg-3); }
.tb-picker-result .tb-result-name { flex: 1; font-weight: 600; font-size: 13px; }
.tb-picker-result .tb-result-types { display: flex; gap: 3px; }
.tb-picker-cancel {
  display: block; padding: 8px 12px; text-align: center;
  font-size: 11px; color: var(--tb-muted); cursor: pointer;
  border-top: 1px solid var(--tb-line); background: var(--tb-bg-2);
}
.tb-picker-cancel:hover { color: var(--tb-text); }

/* ── Category icons ── */
.tb-cat-icon { flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* ── Right column panels ── */
.tb-panel { background: var(--tb-bg-1); border: 1px solid var(--tb-line); border-radius: 10px; padding: 16px; margin-bottom: 18px; }
.tb-panel h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: var(--tb-muted); margin: 0 0 12px; }
.tb-type-empty { color: var(--tb-muted); font-size: 12px; font-style: italic; }

/* ── Type Coverage grid (Option D - single panel, dual badges per cell) ── */
.tb-cd-legend { display: flex; gap: 12px; font-size: 10px; color: var(--tb-muted); margin-bottom: 10px; align-items: center; flex-wrap: wrap; }
.tb-cd-legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; vertical-align: middle; margin-right: 4px; }
.tb-cd-legend-dot.weak   { background: rgba(239,68,68,0.75); }
.tb-cd-legend-dot.resist { background: rgba(74,222,128,0.7); }
.tb-cd-legend-dot.immune { background: rgba(59,130,246,0.78); }

.tb-cd-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
@media (max-width: 540px) { .tb-cd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.tb-cd-cell {
  background: var(--tb-bg-2);
  border: 1px solid var(--tb-line);
  border-radius: 6px;
  padding: 6px 4px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 0;
}
.tb-cd-cell.has-weak                                { background: rgba(239,68,68,0.18);  border-color: rgba(239,68,68,0.45); }
.tb-cd-cell.has-immune:not(.has-weak)               { background: rgba(59,130,246,0.16); border-color: rgba(59,130,246,0.45); }
.tb-cd-cell.has-resist:not(.has-weak):not(.has-immune) { background: rgba(74,222,128,0.16); border-color: rgba(74,222,128,0.45); }
.tb-cd-cell.neutral { opacity: 0.4; }
.tb-cd-cell .tb-type {
  width: 100%; padding: 2px 0;
  font-size: 9px; letter-spacing: 0.4px;
}

.tb-cd-counts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; min-height: 14px; }
.tb-cd-count {
  font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1;
}
.tb-cd-count.weak   { color: #f87171; }
.tb-cd-count.resist { color: #4ade80; }
.tb-cd-count.immune { color: #60a5fa; }
.tb-cd-count.zero   { color: #5a5a64; font-weight: 500; }
.tb-cd-sign { font-size: 9px; opacity: 0.7; margin-right: 1px; }

/* ── Threat list ── */
.tb-threat-list { display: flex; flex-direction: column; gap: 12px; }
.tb-threat {
  background: var(--tb-bg-2); border: 1px solid var(--tb-line);
  border-radius: 10px; padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s;
  position: relative;
  min-width: 0;
}
.tb-threat:hover, .tb-threat:focus { border-color: var(--tb-line-strong); outline: none; }
.tb-threat.handled { opacity: 0.55; }
.tb-threat.handled:hover, .tb-threat.handled:focus { opacity: 1; }
.tb-threat-head {
  display: grid;
  grid-template-columns: 22px 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
}
.tb-threat-rank { color: var(--tb-muted); font-size: 12px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.tb-threat-info { min-width: 0; }
.tb-threat-name { font-weight: 600; font-size: 15px; line-height: 1.2; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) {
  /* Drop tag onto its own row below the head so the name has the full width
     to wrap without ellipsis-truncation, and the tag never collides with
     the sprite or types row. */
  .tb-threat { padding: 12px; }
  .tb-threat-head {
    grid-template-columns: 18px 40px minmax(0, 1fr);
    grid-template-areas:
      "rank sprite info"
      "tag  tag    tag";
    gap: 8px 8px;
    row-gap: 10px;
  }
  .tb-threat-rank { grid-area: rank; }
  /* Sprite is wrapped by pokemonLink() into an <a> with no class, so target
     the second direct child explicitly rather than relying on auto-placement. */
  .tb-threat-head > a:nth-child(2) { grid-area: sprite; }
  .tb-threat-head > .tb-threat-info { grid-area: info; }
  .tb-threat-head > .tb-tag { grid-area: tag; justify-self: start; }
  .tb-threat-name { white-space: normal; line-height: 1.25; }
}
.tb-threat-types { display: flex; gap: 4px; margin-bottom: 5px; flex-wrap: wrap; }
.tb-threat .tb-abilities { margin: 0; }

.tb-threat-moves { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (max-width: 480px) { .tb-threat-moves { grid-template-columns: 1fr; } }
.tb-threat-move {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: var(--tb-bg-1);
  border: 1px solid var(--tb-line);
  border-radius: 6px; font-size: 11px; min-width: 0;
}
.tb-threat-move .tb-tm-name { font-weight: 600; color: var(--tb-text); line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.tb-threat-move .tb-tm-bp { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--tb-text); font-size: 12px; flex-shrink: 0; }

.tb-tag { font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.tb-tag.wiped   { background: rgba(74,222,128,0.20);  color: #86f5a8; border: 1px solid rgba(74,222,128,0.55); }
.tb-tag.dealt   { background: rgba(251,191,36,0.18);  color: #fcd34d; border: 1px solid rgba(251,191,36,0.55); }
.tb-tag.problem { background: rgba(249,115,22,0.20);  color: #fb923c; border: 1px solid rgba(249,115,22,0.55); }
.tb-tag.threat  { background: rgba(239,68,68,0.22);   color: #f87171; border: 1px solid rgba(239,68,68,0.60); }

/* ── Stats popover ── */
/* Positioned relative to viewport - JS sets top/left from cursor on mousemove
   so the popover follows the pointer, even if it overlaps the subject. */
.tb-stats-pop {
  position: fixed;
  top: 0; left: 0;
  background: var(--tb-bg-3);
  border: 1px solid var(--tb-line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  width: 230px; font-size: 11px;
  z-index: 1000;
  display: none;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  pointer-events: none;
}
.tb-threat:hover > .tb-stats-pop, .tb-threat:focus-within > .tb-stats-pop,
.tb-slot:hover > .tb-stats-pop, .tb-slot:focus-within > .tb-stats-pop { display: block; }
.tb-stats-pop-title { margin-bottom: 6px; font-weight: 700; font-size: 12px; }
.tb-stats-grid { display: grid; grid-template-columns: 36px 1fr 32px; gap: 4px 8px; align-items: center; }
.tb-stat-label { color: var(--tb-muted); font-weight: 500; }
.tb-stat-bar { height: 8px; background: var(--tb-bg-1); border-radius: 999px; overflow: hidden; }
.tb-stat-bar > span { display: block; height: 100%; border-radius: 999px; }
.tb-stat-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.tb-stats-pop-total { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--tb-line); display: flex; justify-content: space-between; font-size: 11px; }
.tb-stats-pop-total .tb-lbl { color: var(--tb-muted); }
.tb-stats-pop-total .tb-val { font-weight: 700; font-variant-numeric: tabular-nums; }

@media (hover: none) {
  .tb-ability-tip { display: none !important; }
  .tb-ability:focus .tb-ability-tip { display: block !important; }
}

.tb-toggle-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 12px; color: var(--tb-muted); }
.tb-toggle-row input { accent-color: #fff; }

.tb-loading {
  text-align: center; padding: 40px;
  color: var(--tb-muted); font-size: 13px;
}

/* ── Empty results ── */
.tb-empty-results {
  background: var(--tb-bg-1);
  border: 1px solid var(--tb-line);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  color: var(--tb-muted);
}
.tb-empty-results .tb-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  border: 1px solid var(--tb-line-strong);
}
.tb-empty-results h2 { font-size: 16px; font-weight: 700; color: var(--tb-text); margin: 0 0 8px; }
.tb-empty-results p { font-size: 13px; line-height: 1.55; margin: 0 auto; max-width: 380px; }

/* ── Ad slot styling for the Team Builder ── */
/* AdSense sizes its own ad units once loaded; we only constrain max width
   and add vertical breathing room. Empty containers (verification phase,
   ad blocker, unfilled inventory) collapse naturally because the inner
   adsbygoogle <ins> tag self-collapses when no ad serves. */
.tb-root .ad-container.tb-ad { margin: 24px auto; max-width: 728px; }

/* ── SEO content sections (visible to crawlers; readable in-page) ── */
.tb-seo { margin: 32px 0; max-width: 900px; }
.tb-seo-section { background: var(--tb-bg-1); border: 1px solid var(--tb-line); border-radius: 10px; padding: 20px 24px; margin-bottom: 16px; }
.tb-seo-section h2 { font-size: 16px; font-weight: 700; color: var(--tb-text); margin: 0 0 10px; text-transform: none; letter-spacing: 0; }
.tb-seo-section h3 { font-size: 14px; font-weight: 700; color: var(--tb-text); margin: 16px 0 6px; }
.tb-seo-section p { font-size: 13px; color: var(--tb-muted); line-height: 1.6; margin: 0 0 10px; }
.tb-seo-section ul, .tb-seo-section ol { font-size: 13px; color: var(--tb-muted); line-height: 1.7; margin: 0 0 10px; padding-left: 22px; }
.tb-seo-section li { margin-bottom: 4px; }
.tb-seo-section strong { color: var(--tb-text); }
.tb-seo-section em { color: var(--tb-text); font-style: normal; font-weight: 600; }
.tb-seo-section a { color: #93c5fd; text-decoration: none; }
.tb-seo-section a:hover { color: #bfdbfe; text-decoration: underline; }
.tb-seo-link-list { list-style: none; padding: 0; }
.tb-seo-link-list li { padding: 6px 0; border-bottom: 1px solid var(--tb-line); }
.tb-seo-link-list li:last-child { border-bottom: none; }

/* ── Landing page (all hacks) ── */
.tb-landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.tb-landing-card {
  display: block;
  background: var(--tb-bg-1);
  border: 1px solid var(--tb-line);
  border-radius: 10px;
  padding: 18px;
  text-decoration: none;
  color: var(--tb-text);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.tb-landing-card:hover { background: var(--tb-bg-2); border-color: var(--tb-line-strong); transform: translateY(-2px); }
.tb-landing-card .tb-landing-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.tb-landing-card .tb-landing-base { color: var(--tb-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; }

/* ── Auto-hide nav on teambuilder page (issue #2, desktop only) ── */
/* Gated behind hover/pointer media query so touch devices keep the nav
   visible - they can't bring it back without a mouse. */
@media (hover: hover) and (pointer: fine) {
  body.tb-page-active header.sticky {
    transform: translateY(-100%);
    transition: transform 0.25s ease-out;
  }
  body.tb-page-active.tb-nav-show header.sticky {
    transform: translateY(0);
  }
}

/* ── Move-area popover suppression (issue #5) ── */
/* When the user is hovering the moves grid, don't show the stats popover. */
.tb-slot:hover:has(.tb-moves:hover) > .tb-stats-pop,
.tb-threat:hover:has(.tb-threat-moves:hover) > .tb-stats-pop {
  display: none;
}

/* ── Minimize toggle on Type Coverage panel (issue #3) ── */
.tb-panel-collapsible { position: relative; }
.tb-min-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--tb-text);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  animation: tb-min-pulse 1.6s ease-in-out infinite;
  z-index: 5;
}
.tb-min-toggle:hover { background: rgba(255,255,255,0.14); }
@keyframes tb-min-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0), inset 0 0 0 1px rgba(255,255,255,0.15); }
  50%      { box-shadow: 0 0 10px 1px rgba(255,255,255,0.35), inset 0 0 0 1px rgba(255,255,255,0.5); }
}
/* Respect OS-level reduced-motion preference (accessibility) */
@media (prefers-reduced-motion: reduce) {
  .tb-min-toggle { animation: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4); }
  body.tb-page-active header.sticky { transition: none; }
}
.tb-panel.minimized .tb-cd-legend,
.tb-panel.minimized .tb-cd-grid { display: none; }
.tb-panel.minimized { padding: 10px 16px; margin-bottom: 10px; }
.tb-panel.minimized h2 { margin-bottom: 0; }
