*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f1012;
  --surface:   #17191e;
  --surface2:  #1e2128;
  --border:    #252830;
  --gold:      #d4a017;
  --gold-dim:  #8a6810;
  --gold-glow: rgba(212,160,23,0.15);
  --text:      #e0e4ef;
  --muted:     #666a80;
  --green:     #22c55e;
  --red:       #ef4444;
  --row-hover: #1e2230;
  --sidebar-w: 200px;
  --filter-w:  260px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 20;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 24px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  font-size: 28px;
  color: var(--gold);
  line-height: 1;
}

.logo-text {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--text);
  line-height: 1.1;
  text-transform: uppercase;
}

.logo-sub {
  display: block;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.25em;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-left: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nav-item:hover {
  color: var(--text);
  background: var(--gold-glow);
}

.nav-item.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: var(--gold-glow);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-version {
  margin-top: 2px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  opacity: 0.8;
}

/* ── Account stats (sidebar footer) ──────────────────────────────────────── */
.acct-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.acct-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
}

.acct-stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.acct-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.badge.live    { background: rgba(34,197,94,0.15); color: var(--green); }
.badge.offline { background: rgba(239,68,68,0.15); color: var(--red); }

/* ── Main wrap ───────────────────────────────────────────────────────────── */
.main-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.content-section {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.content-section.hidden { display: none !important; }

/* ── Filter panel ────────────────────────────────────────────────────────── */
.filter-panel {
  width: var(--filter-w);
  min-width: var(--filter-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: min-width 0.2s, width 0.2s;
}

.filter-panel.collapsed {
  width: 36px;
  min-width: 36px;
  overflow: hidden;
}

.filter-panel.collapsed .filter-body { display: none; }

.filter-toggle-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.filter-panel.collapsed .filter-toggle-btn {
  writing-mode: vertical-lr;
  text-orientation: mixed;
  padding: 14px 10px;
}

.filter-body {
  padding: 0 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 10px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.radio-group input[type="radio"] {
  accent-color: var(--gold);
  width: 14px;
  height: 14px;
}

/* Multi-select dropdown (checkbox list) — compact alternative to a native <select multiple>. */
.msdd { position: relative; }
.msdd-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.msdd-toggle:hover, .msdd.open .msdd-toggle { border-color: var(--gold); }
.msdd-toggle-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msdd-caret { color: var(--muted); font-size: 10px; flex-shrink: 0; }
.msdd-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  box-shadow: 0 8px 20px rgba(0,0,0,.5);
}
.msdd-panel.hidden { display: none; }
.msdd-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.msdd-option:hover { background: var(--surface); }
.msdd-option input[type="checkbox"] { accent-color: var(--gold); width: 14px; height: 14px; flex-shrink: 0; }

.filter-body input[type="text"],
.filter-body select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  width: 100%;
  cursor: pointer;
}

.filter-body input[type="text"]:focus,
.filter-body select:focus {
  outline: none;
  border-color: var(--gold);
}

.filter-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0 2px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.toggle-label input[type="checkbox"] {
  accent-color: var(--gold);
  width: 14px;
  height: 14px;
}

.reset-btn {
  margin-top: 12px;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s;
}

.reset-btn:hover { background: #b88a12; }

/* ── Champion content area ───────────────────────────────────────────────── */
.champ-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.no-account {
  color: var(--muted);
  font-size: 16px;
  text-align: center;
  padding: 80px 20px;
}

.champ-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.champ-count {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--text);
  text-transform: uppercase;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.toolbar-right select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}

.toolbar-right select:focus { outline: none; border-color: var(--gold); }

/* ── Champion card grid ──────────────────────────────────────────────────── */
.champ-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.champ-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.1s;
}

.champ-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-1px);
}

/* Rarity border tints */
.champ-card[data-rarity="6"] { border-color: rgba(220,38,38,0.5); }
.champ-card[data-rarity="5"] { border-color: rgba(251,191,36,0.4); }
.champ-card[data-rarity="4"] { border-color: rgba(167,139,250,0.35); }
.champ-card[data-rarity="3"] { border-color: rgba(96,165,250,0.3); }
.champ-card[data-rarity="2"] { border-color: rgba(52,211,153,0.25); }

.portrait-wrap {
  position: relative;
  width: 112px;
  height: 146px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface2);
}

.portrait-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.grade-badge {
  position: absolute;
  bottom: 3px;
  left: 3px;
  font-size: 12px;
  letter-spacing: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  line-height: 1;
}

.stars-awakened { color: #ef4444; }
.stars-ascended { color: #f472b6; }
.stars-grade    { color: #fbbf24; }

.level-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.75);
  color: var(--text);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 700;
}

.empower-badge {
  position: absolute;
  bottom: 3px;
  right: 4px;
  background: rgba(212,160,23,0.85);
  color: #000;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 9px;
  font-weight: 700;
}


.champ-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.champ-name {
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.champ-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.champ-rarity {
  font-size: 11px;
  font-weight: 600;
}

.champ-flags {
  display: flex;
  gap: 6px;
  margin-top: auto;
  flex-wrap: wrap;
}

.flag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.flag-locked    { background: rgba(239,68,68,0.15);  color: #ef4444; }
.flag-storage   { background: rgba(107,112,144,0.2); color: var(--muted); }
.flag-bathhouse { background: rgba(34,197,94,0.12);  color: var(--green); }

/* Champion status strip: masteries / skills / gear */
.champ-status {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.s-item {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
}
.s-item.s-full    { color: var(--gold); }
.s-item.s-partial { color: #f59e0b; }

/* Rarity colours */
.r-Common    { color: #9ca3af; }
.r-Uncommon  { color: #34d399; }
.r-Rare      { color: #60a5fa; }
.r-Epic      { color: #a78bfa; }
.r-Legendary { color: #fbbf24; }
.r-Mythical  { color: #dc2626; }

/* ── Artifact / Relic sections ───────────────────────────────────────────── */
.section-inner {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
thead th:hover { color: var(--gold); }
thead th.sort-asc::after  { content: ' \2191'; color: var(--gold); }
thead th.sort-desc::after { content: ' \2193'; color: var(--gold); }

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--row-hover); }
tbody td { padding: 9px 14px; }

.grade-stars { color: #fbbf24; letter-spacing: 1px; }
.bool-yes { color: var(--green); }
.bool-no  { color: var(--muted); }
.rarity-Common    { color: #9ca3af; }
.rarity-Uncommon  { color: #34d399; }
.rarity-Rare      { color: #60a5fa; }
.rarity-Epic      { color: #a78bfa; }
.rarity-Legendary { color: #fbbf24; }
.rarity-Mythical  { color: #dc2626; }

/* ── Form controls (sidebar footer) ─────────────────────────────────────── */
select {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  width: 100%;
}
select:focus { outline: none; border-color: var(--gold); }

/* ── Account section ─────────────────────────────────────────────────────── */
.acct-profile-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
}

.acct-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.acct-avatar-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  object-fit: cover;
  border: 2px solid #2dd4bf; /* fallback when no in-game frame is equipped — matches the game's default teal border */
}

.acct-avatar-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* When an in-game frame is equipped, the portrait needs to span the frame's whole
   canvas (not just its inner window) so the frame's ornate border overlaps and hides
   the portrait's raw square edge instead of leaving it visible inside the window. */
.acct-avatar-wrap.has-frame {
  width: 120px;
  height: 120px;
}

.acct-avatar-wrap.has-frame .acct-avatar-img {
  border: none;
  /* The frame artwork's ornamental corners don't reach the literal square corners of its
     canvas (they're feather/wing tips, not a solid border) — rounding the portrait keeps
     its own corners from poking out past the frame's silhouette in that gap. */
  border-radius: 22%;
}

.acct-avatar-wrap.has-frame .acct-avatar-frame {
  width: 100%;
  height: 100%;
}

.acct-level-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--gold-glow);
  border: 2px solid var(--gold-dim);
  border-radius: 12px;
  min-width: 90px;
  padding: 12px 16px;
  gap: 2px;
  flex-shrink: 0;
}

.acct-level-badge span:first-child {
  font-size: 40px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}

.acct-level-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold-dim);
  text-transform: uppercase;
}

.acct-identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.acct-display-name {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
}

.acct-social-name {
  font-size: 14px;
  color: var(--muted);
}

.acct-xp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acct-xp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.acct-xp-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.acct-xp-pct {
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
}

.acct-xp-track {
  height: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.acct-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 99px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.acct-xp-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.acct-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.acct-stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.acct-tile-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.acct-tile-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ── Account Resources & Shards ─────────────────────────────────────────── */
.acct-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 24px 0 12px;
}

.res-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.res-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 160px;
  min-width: 140px;
}

.res-tile--energy {
  flex: 2 1 260px;
}

.res-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.res-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.res-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-left: auto;
}

.res-energy-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.res-energy-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.res-energy-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  width: 0;
  transition: width 0.4s ease;
}

.shard-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.sub-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sub-rows .shard-card {
  flex: 0 1 100px;
}

.shard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1 1 100px;
  min-width: 90px;
  text-align: center;
}

.shard-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.shard-count {
  font-size: 20px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.shard-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ── Great Hall ──────────────────────────────────────────────────────────── */
.section-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

.gh-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 24px 0;
}

.gh-magic  { color: #5ba3e0; }
.gh-force  { color: #e06060; }
.gh-spirit { color: #52c87a; }
.gh-void   { color: #a07adb; }

/* ── Affinity Bonuses: badge grid + detail panel ─────────────────────────── */
.gh-affinity-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.gh-badge-grid-wrap { flex: 1; min-width: 0; }

.gh-badge-grid {
  display: grid;
  grid-template-columns: 90px repeat(6, 64px);
  gap: 8px;
  align-items: center;
}

.gh-grid-corner { width: 90px; }

.gh-col-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: center;
}

.gh-row-label {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* Shield badge: heater-shield silhouette via clip-path, tier-based gradient fill. No CSS border
   or box-shadow — neither follows a clip-path (that's what made the earlier version look broken);
   the "rim" is a lighter top gradient stop, and selection/max glows use filter: drop-shadow. */
.gh-badge {
  width: 60px;
  height: 66px;
  border: none;
  cursor: pointer;
  padding: 0;
  clip-path: polygon(0% 0%, 100% 0%, 100% 62%, 50% 100%, 0% 62%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: var(--surface2);
  transition: transform 0.1s, filter 0.15s;
}
.gh-badge:hover { transform: translateY(-2px); }

.gh-badge-val { font-size: 15px; font-weight: 800; line-height: 1; }
.gh-badge-lvl { font-size: 10px; font-weight: 600; opacity: 0.8; line-height: 1; }

/* Bronze (levels 0-3) */
.gh-badge-bronze {
  background: linear-gradient(180deg, #d69a5c 0%, #a9713a 45%, #6e4420 100%);
  color: #2a1a0c;
}
/* Blue (levels 4-6) — matches the in-game screenshot's mid-tier blue */
.gh-badge-blue {
  background: linear-gradient(180deg, #7fc0f5 0%, #3d84c4 45%, #1d4a6e 100%);
  color: #08243a;
}
/* Gold (levels 7-10) */
.gh-badge-gold {
  background: linear-gradient(180deg, #f7e2a0 0%, #e2b83c 45%, #a9800f 100%);
  color: #2a1f04;
  filter: drop-shadow(0 0 5px var(--gold-glow));
}

.gh-badge-selected {
  filter: drop-shadow(0 0 5px var(--green)) drop-shadow(0 0 2px var(--green));
  transform: translateY(-2px);
}
.gh-badge-gold.gh-badge-selected {
  filter: drop-shadow(0 0 5px var(--green)) drop-shadow(0 0 2px var(--green));
}

.gh-detail-panel {
  width: 300px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  position: sticky;
  top: 0;
  max-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gh-detail-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
}

.gh-detail-header { display: flex; align-items: center; gap: 12px; }

.gh-detail-icon-badge {
  width: 52px;
  height: 58px;
  flex-shrink: 0;
  clip-path: polygon(0% 0%, 100% 0%, 100% 62%, 50% 100%, 0% 62%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.gh-detail-icon-badge .gh-badge-val { font-size: 15px; font-weight: 800; line-height: 1; }
.gh-detail-icon-badge .gh-badge-lvl { font-size: 10px; font-weight: 600; opacity: 0.8; line-height: 1; }

.gh-detail-stat { font-size: 16px; font-weight: 800; color: var(--text); }
.gh-detail-elem { font-size: 12px; }
.gh-detail-elem.gh-magic  { color: #5ba3e0; }
.gh-detail-elem.gh-force  { color: #e06060; }
.gh-detail-elem.gh-spirit { color: #52c87a; }
.gh-detail-elem.gh-void   { color: #a07adb; }

.gh-detail-levels {
  overflow-y: auto;
  max-height: 260px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
}

.gh-detail-level-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--muted);
  border-radius: 4px;
}
.gh-detail-level-row.reached { color: var(--text); }
.gh-detail-level-row.current { background: var(--gold-glow); color: var(--gold); font-weight: 700; }

.gh-detail-next-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.gh-detail-next-note { color: var(--muted); font-size: 13px; }
.gh-detail-maxed { color: var(--gold); font-weight: 700; }

.gh-cost-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.gh-cost-icon { width: 20px; height: 20px; object-fit: contain; }
.gh-cost-icon-generic { width: 20px; height: 20px; border-radius: 50%; background: var(--border); display: inline-block; }
.gh-cost-amount { font-weight: 700; color: var(--text); }
.gh-cost-label { color: var(--muted); flex: 1; }
.gh-cost-balance { font-size: 11px; color: var(--muted); }
.gh-cost-row.insufficient .gh-cost-amount,
.gh-cost-row.insufficient .gh-cost-balance { color: var(--red); }

.gh-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 28px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #1a1d24 0%, #1e1a2e 100%);
  border: 1px solid #3a3060;
  border-radius: 10px;
  max-width: 700px;
}

.gh-cta-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gh-cta-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.gh-cta-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.gh-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--gold);
  color: #0f1012;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.gh-cta-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* ── Inbox section ───────────────────────────────────────────────────────── */
.inbox-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inbox-toolbar select {
  width: auto;
  min-width: 160px;
}

.inbox-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.inbox-count-warn {
  color: #f59e0b;
  font-weight: 700;
  cursor: help;
}

.inbox-expiry-critical { color: #ef4444; font-weight: 700; }
.inbox-expiry-warn     { color: #f59e0b; }
.inbox-expiry-ok       { color: var(--muted); }
.inbox-read-yes        { color: var(--muted); font-size: 12px; }
.inbox-read-no         { color: var(--gold);  font-size: 12px; font-weight: 700; }
.inbox-src-cell        { display: flex; align-items: center; gap: 8px; }
.inbox-src-icon        { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.inbox-src-name        { line-height: 1.2; }
.inbox-prize-cell      { text-align: center; }
.inbox-prize-icon      { width: 48px; height: 48px; object-fit: contain; }
.inbox-hero-icon       { border-radius: 50%; object-fit: cover; }
.inbox-prize-unknown   { color: var(--muted); font-size: 18px; }
.inbox-prize-label     { color: var(--muted); font-size: 10px; display: block; margin-top: 2px; }
.inbox-prize-unmapped  { color: var(--gold); font-size: 11px; font-family: monospace; cursor: help; border-bottom: 1px dashed var(--gold); }

/* Mailbox-overflow artifact/accessory icons in the Prize column (real item icon, not the
   generic "artifact" placeholder). Stats shown via the shared #floatTooltip on hover. */
.inbox-art-icons { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.inbox-art-icon-wrap { display: inline-block; cursor: help; }
.inbox-art-icon { width: 40px; height: 40px; object-fit: contain; }

/* Shared floating tooltip — JS-positioned (showFloatTooltip), used for anything inside a
   scrolling ancestor (e.g. .table-wrap) where a CSS :hover tooltip would get clipped. */
.float-tooltip {
  position: fixed;
  z-index: 200;
  width: 220px;
  background: var(--surface2);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 8px 22px rgba(0,0,0,.6);
  pointer-events: none;
  text-align: left;
}
.art-tip-name { font-weight: 700; font-size: 13px; color: var(--gold); margin-bottom: 2px; }
.art-tip-meta { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.art-tip-star.gold { color: #fbbf24; }
.art-tip-star.asc  { color: #c084fc; }
.art-tip-grade { margin-left: 4px; font-weight: 700; padding: 1px 5px; border-radius: 999px; border: 1px solid currentColor; font-size: 10px; }
.art-tip-grade.grade-junk    { color: #dc2626; }
.art-tip-grade.grade-low     { color: #f97316; }
.art-tip-grade.grade-medium  { color: #fbbf24; }
.art-tip-grade.grade-high    { color: #84cc16; }
.art-tip-grade.grade-ultra   { color: #4ade80; }
.art-tip-grade.grade-godlike { color: #22d3ee; }
.art-tip-primary { font-size: 12px; color: var(--text); margin-bottom: 2px; }
.art-tip-primary b { color: var(--gold); }
.art-tip-ascend { font-size: 11px; color: #c084fc; font-weight: 600; margin-bottom: 2px; }

/* Live-update toasts — fired from the WebSocket-diff logic in app.js (showToast) when a tracked
   resource/level/roster value changes. Stack bottom-right, newest on top, auto-dismiss. */
.toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  width: 400px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  pointer-events: none;
  scrollbar-width: none;
}
.toast-container::-webkit-scrollbar { display: none; }
.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface2);
  border: 1px solid var(--gold-dim);
  border-left: 5px solid var(--gold-dim);
  border-radius: 10px;
  padding: 14px 16px 18px;
  box-shadow: 0 8px 22px rgba(0,0,0,.6);
  pointer-events: auto;
  flex-shrink: 0;
  overflow: hidden;
  animation: toast-in .25s ease-out;
}
.toast.toast-leaving { animation: toast-out .2s ease-in forwards; }
.toast.toast-gain    { border-left-color: #4ade80; }
.toast.toast-loss    { border-left-color: #f97316; }
.toast.toast-new     { border-left-color: #22d3ee; }
.toast.toast-levelup { border-left-color: #c084fc; }
.toast-icon  { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.toast-body  { flex: 1; min-width: 0; }
.toast-title { font-weight: 700; font-size: 15px; color: var(--text); }
.toast-msg   { font-size: 14px; color: var(--muted); margin-top: 3px; }
.toast-close { cursor: pointer; color: var(--muted); font-size: 18px; padding: 0 2px; flex-shrink: 0; }
.toast-close:hover { color: var(--text); }

/* Countdown bar along the bottom edge — width animates 100%→0% over the toast's lifetime
   (duration set inline per-toast from TOAST_DURATION_MS) and pauses while the mouse is over it,
   so the toast doesn't disappear mid-read. */
.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--gold-dim);
  animation: toast-countdown linear forwards;
  animation-play-state: running;
}
.toast:hover .toast-progress { animation-play-state: paused; }
.toast.toast-gain    .toast-progress { background: #4ade80; }
.toast.toast-loss    .toast-progress { background: #f97316; }
.toast.toast-new     .toast-progress { background: #22d3ee; }
.toast.toast-levelup .toast-progress { background: #c084fc; }
@keyframes toast-countdown { from { width: 100%; } to { width: 0%; } }
@keyframes toast-in  { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateX(24px); } }
.art-tip-subs { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.art-tip-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.art-tip-sub span:last-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.art-tip-roll { color: #4ade80; font-weight: 700; }

/* ── Great Hall tabs ─────────────────────────────────────────────────────── */
.gh-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.gh-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.03em;
}

.gh-tab:hover { color: var(--text); }
.gh-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── Observatory area bonuses ─────────────────────────────────────────────── */
.obs-grade-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 12px 0 6px;
}

.obs-table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 24px;
}

.obs-table th,
.obs-table td {
  padding: 9px 12px;
  text-align: center;
  font-size: 12px;
}

.obs-table thead th {
  color: var(--muted);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.obs-table tbody tr { border-bottom: 1px solid var(--border); }
.obs-table tbody tr:last-child { border-bottom: none; }
.obs-table tbody tr:hover { background: var(--row-hover); }

.obs-area-cell {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  min-width: 160px;
}

.obs-grade-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  min-width: 24px;
}

.obs-g1 { background: rgba(52,211,153,0.15); color: #34d399; }
.obs-g2 { background: rgba(96,165,250,0.15); color: #60a5fa; }
.obs-g3 { background: rgba(212,160,23,0.15);  color: var(--gold); }

.obs-cell { vertical-align: middle; }

.obs-bar-wrap {
  width: 50px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 3px;
  overflow: hidden;
}

.obs-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--gold-dim);
  transition: width 0.3s ease;
}

.obs-lvl {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.obs-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 24px 0;
}

/* ── Chimera ─────────────────────────────────────────────────────────────── */
.chimera-stats-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.chimera-stat-tile {
  flex: 1;
  min-width: 100px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chimera-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
}

.chimera-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.chimera-last-fight {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.chimera-fight-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.chimera-fight-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.chimera-fight-diff {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-glow);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 2px 8px;
}

.chimera-fight-heroes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chimera-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 72px;
}

.chimera-hero-portrait {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.chimera-hero-name {
  font-size: 10px;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 72px;
}

/* ── Boss Battles (Clan Boss / Hydra / Chimera) ──────────────────────────── */
.boss-battles {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.boss-group-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
}

.boss-diff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.boss-diff-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.boss-diff-card.empty {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.boss-diff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.boss-diff-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.boss-diff-date {
  font-size: 11px;
  color: var(--muted);
}

.boss-diff-affinity {
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

.boss-diff-note {
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
}

.boss-diff-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

.boss-diff-stats b {
  color: var(--text);
  font-weight: 700;
}

.boss-diff-heroes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Dungeon Teams ────────────────────────────────────────────────────────── */
.dteam-tabs {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.dteam-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.dteam-tab:hover { color: var(--text); }
.dteam-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.dungeon-teams {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dteam-pane.hidden { display: none; }

.dteam-banner {
  position: relative;
  height: 180px;
  border-radius: 10px;
  background-size: cover;
  background-position: center 30%;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-end;
}

.dteam-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.15) 60%, transparent 100%);
}

.dteam-banner-name {
  position: relative;
  z-index: 1;
  padding: 14px 20px;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  text-shadow: 0 2px 6px rgba(0,0,0,.8);
  letter-spacing: 0.02em;
}

.dteam-header-plain {
  font-size: 20px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 16px;
}

.dteam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.dteam-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 8px;
}
/* Rarity border tints — same palette/values as .champ-card[data-rarity] on the Champions grid. */
.dteam-hero-card[data-rarity="6"] { border-color: rgba(220,38,38,0.5); }
.dteam-hero-card[data-rarity="5"] { border-color: rgba(251,191,36,0.4); }
.dteam-hero-card[data-rarity="4"] { border-color: rgba(167,139,250,0.35); }
.dteam-hero-card[data-rarity="3"] { border-color: rgba(96,165,250,0.3); }
.dteam-hero-card[data-rarity="2"] { border-color: rgba(52,211,153,0.25); }

.dteam-hero-portrait-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 2px solid var(--border);
  overflow: hidden;
}
/* Portrait frame follows the card's rarity (data-rarity lives on .dteam-hero-card) — same
   palette as the card border tint, just fully opaque since this is a thin 2px frame rather
   than a translucent card outline. Affinity is still shown via the portrait's title tooltip. */
.dteam-hero-card[data-rarity="6"] .dteam-hero-portrait-wrap { border-color: #dc2626; }
.dteam-hero-card[data-rarity="5"] .dteam-hero-portrait-wrap { border-color: #fbbf24; }
.dteam-hero-card[data-rarity="4"] .dteam-hero-portrait-wrap { border-color: #a78bfa; }
.dteam-hero-card[data-rarity="3"] .dteam-hero-portrait-wrap { border-color: #60a5fa; }
.dteam-hero-card[data-rarity="2"] .dteam-hero-portrait-wrap { border-color: #34d399; }

.dteam-hero-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dteam-hero-level {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0,0,0,.75);
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px 0 0 0;
}

.dteam-hero-stars {
  font-size: 11px;
  color: #fbbf24;
  letter-spacing: -1px;
  line-height: 1;
}

.dteam-hero-stars .stars-awakened { color: #c084fc; }

.dteam-hero-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  margin-bottom: 16px;
}

/* Compact mastery view — see compactMasteryGrid() in app.js. A champion only ever has masteries
   in 2 of the 3 trees, so this packs selected nodes left-to-right by row-depth (3 per line,
   wrapping if a depth has more) rather than reserving a column per tree. */
.dteam-mastery-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  margin-bottom: 16px;
}

.dteam-mastery-grid-row {
  display: flex;
  gap: 4px;
}

/* 3×3 grid matching the in-game gear layout (see GEAR_SLOT_ORDER in app.js). Gap is wider than a
   typical icon row so the level/star badges on .mini-art-icon have room without overlapping. */
.dteam-gear-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  justify-content: center;
  justify-items: center;
  margin-bottom: 16px;
}

/* Compact artifact icon — rarity border, level badge, rank/ascend stars, hover tooltip via the
   shared #floatTooltip (see buildMiniArtifactIcon in app.js). Shares the same rarity colour scale
   as .cd-art-slot (Champion Detail gear grid) so gear reads consistently across pages. */
.mini-art-icon {
  position: relative;
  display: block;
  width: 60px;
  height: 60px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: default;
}
.mini-art-icon.empty { opacity: 0.35; border-style: dashed; }
.mini-art-icon[data-rarity="6"] { border-color: rgba(220,38,38,0.9); }
.mini-art-icon[data-rarity="5"] { border-color: rgba(251,191,36,0.85); }
.mini-art-icon[data-rarity="4"] { border-color: rgba(167,139,250,0.8); }
.mini-art-icon[data-rarity="3"] { border-color: rgba(96,165,250,0.75); }
.mini-art-icon[data-rarity="2"] { border-color: rgba(52,211,153,0.7); }
.mini-art-icon-img { width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }
.mini-art-lvl {
  position: absolute; bottom: -4px; left: -4px;
  background: rgba(0,0,0,.8); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 4px; padding: 0 4px;
}
.mini-art-stars {
  position: absolute; top: -7px; left: 0; right: 0; text-align: center;
  font-size: 10px; line-height: 1; letter-spacing: -1px; white-space: nowrap; text-shadow: 0 1px 2px #000;
}
.mini-art-star.gold { color: #fbbf24; }
.mini-art-star.asc  { color: #c084fc; }

.dteam-mastery-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 50%;
}

/* Tree-coloured glow (red/green/blue) so provenance stays visible without a fixed column per
   tree — same colours as .cd-mastery-tree on the Champion Detail page. */
.dteam-mastery-icon.t1 { filter: drop-shadow(0 0 3px rgba(239,68,68,.8)); }
.dteam-mastery-icon.t2 { filter: drop-shadow(0 0 3px rgba(34,197,94,.8)); }
.dteam-mastery-icon.t3 { filter: drop-shadow(0 0 3px rgba(59,130,246,.8)); }

.dteam-stage-section {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.dteam-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.dteam-stage-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 8px;
}

.dteam-stage-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 14px;
}

.dteam-stage-summary-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}

.dteam-stage-summary-tier {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
}

.dteam-stage-summary-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dteam-stage-summary-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dteam-stage-summary-stat span {
  font-size: 11px;
  color: var(--muted);
}

.dteam-stage-summary-stat b {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.dteam-stage-details {
  margin-top: 4px;
}

.dteam-stage-details summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  user-select: none;
}

.dteam-stage-details summary::-webkit-details-marker { display: none; }

.dteam-stage-details summary::before {
  content: '▸ ';
}

.dteam-stage-details[open] summary::before {
  content: '▾ ';
}

.dteam-stage-details summary:hover { color: var(--text); }

.dteam-stage-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.dteam-stage-tier {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.dteam-stage-tier-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.dteam-stage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.dteam-stage-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 3px 6px;
  border-bottom: 1px solid var(--border);
}

.dteam-stage-table td {
  padding: 3px 6px;
  color: var(--text);
}

.dteam-stage-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }

/* ── Champion Detail page ─────────────────────────────────────────────────── */
.cd-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 0 0 32px;
}
.cd-header {
  padding: 16px 24px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cd-back-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: color .15s, border-color .15s;
}
.cd-back-btn:hover { color: var(--text); border-color: var(--muted); }

.cd-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 24px;
  align-items: start;
}
@media (max-width: 700px) {
  .cd-body { grid-template-columns: 1fr; }
}

/* Portrait column */
.cd-portrait-col { display: flex; flex-direction: column; gap: 12px; }
.cd-portrait-wrap {
  position: relative;
  width: 200px;
  height: 260px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface2);
}
.cd-portrait-wrap img { width: 100%; height: 100%; object-fit: cover; }
.cd-portrait-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}
.cd-portrait-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cd-meta-pill {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text);
}
.cd-lvl-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cd-lvl-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text);
}
.cd-lvl-badge span { color: var(--gold); font-weight: 600; }

/* Scrolls row */
.cd-scrolls-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cd-scroll-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
}
.cd-scroll-badge .sc-count { font-weight: 700; }
.sc-bronze { color: #cd7f32; }
.sc-silver { color: #aaaaaa; }
.sc-gold   { color: var(--gold); }

/* Right column */
.cd-right-col { display: flex; flex-direction: column; gap: 20px; }

/* Section headings inside detail */
.cd-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

/* Artifact / gear slots — detailed cards (icon, level, stars, primary, ascended, substats) */
.cd-art-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* 3×3, in-game gear order */
  gap: 8px;
}
.cd-art-slot {
  position: relative;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cd-art-slot.empty { opacity: .45; }
/* Rarity tints: darker/bolder border + a faint colour wash over the surface so rarity reads
   at a glance, not just from the border alone. */
.cd-art-slot[data-rarity="6"] { border-color: rgba(220,38,38,0.9);   background-image: linear-gradient(rgba(220,38,38,0.12), rgba(220,38,38,0.12)); }
.cd-art-slot[data-rarity="5"] { border-color: rgba(251,191,36,0.85); background-image: linear-gradient(rgba(251,191,36,0.12), rgba(251,191,36,0.12)); }
.cd-art-slot[data-rarity="4"] { border-color: rgba(167,139,250,0.8); background-image: linear-gradient(rgba(167,139,250,0.11), rgba(167,139,250,0.11)); }
.cd-art-slot[data-rarity="3"] { border-color: rgba(96,165,250,0.75); background-image: linear-gradient(rgba(96,165,250,0.10), rgba(96,165,250,0.10)); }
.cd-art-slot[data-rarity="2"] { border-color: rgba(52,211,153,0.7);  background-image: linear-gradient(rgba(52,211,153,0.09), rgba(52,211,153,0.09)); }

/* Keep/sell grade badge (computeGearGrade) — top-right corner, six colour bands low→high. */
.cd-art-grade {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: #111318;
  border: 1px solid currentColor;
  cursor: help;
  z-index: 1;
}
.cd-art-grade.grade-junk    { color: #dc2626; }
.cd-art-grade.grade-low     { color: #f97316; }
.cd-art-grade.grade-medium  { color: #fbbf24; }
.cd-art-grade.grade-high    { color: #84cc16; }
.cd-art-grade.grade-ultra   { color: #4ade80; }
.cd-art-grade.grade-godlike { color: #22d3ee; box-shadow: 0 0 6px rgba(34,211,238,.6); }

.cd-art-top { display: flex; gap: 8px; }
.cd-art-icon {
  position: relative;
  width: 52px; height: 52px;
  flex-shrink: 0;
  background: rgba(0,0,0,.25);
  border-radius: 6px;
}
.cd-art-icon-img { width: 100%; height: 100%; object-fit: contain; }
.cd-art-lvl {
  position: absolute; bottom: -3px; left: -3px;
  background: rgba(0,0,0,.8); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 4px; padding: 0 4px;
}
.cd-art-stars { position: absolute; top: -6px; left: 0; right: 0; text-align: center; font-size: 9px; line-height: 1; letter-spacing: -1px; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.cd-art-star.gold { color: #fbbf24; }
.cd-art-star.asc  { color: #c084fc; }

.cd-art-meta { min-width: 0; flex: 1; }
.cd-art-slotlabel { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.cd-art-setname { font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-art-empty { color: var(--muted); font-size: 11px; }
.cd-art-primary { color: var(--text); font-size: 12px; margin-top: 2px; }
.cd-art-primary b { color: var(--gold); }
.cd-art-ascend { color: #c084fc; font-size: 11px; font-weight: 600; }

.cd-art-subs { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border); padding-top: 5px; }
.cd-art-sub { display: flex; justify-content: space-between; font-size: 11px; gap: 8px; }
.cd-art-sub-k { color: var(--muted); }
.cd-art-sub-v { color: var(--text); font-weight: 600; white-space: nowrap; }
.cd-art-roll { color: #4ade80; font-weight: 700; }
.cd-art-cnt  { color: var(--muted); font-weight: 400; font-size: 10px; margin-left: 1px; }
.r-Legendary { }  /* set-name colour reuses existing .r-* rarity classes */

/* Standalone Artifacts page: responsive grid instead of the champion page's fixed 3×3 */
.artifact-page-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

/* "Equipped: {champion}" line on artifact cards (Artifacts page only) */
.cd-art-equipped {
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 5px;
  margin-top: -1px;
}
.cd-art-equipped.is-link { color: var(--gold); cursor: pointer; }
.cd-art-equipped.is-link:hover { text-decoration: underline; }

/* Skills */
.cd-skill-list { display: flex; flex-direction: column; gap: 8px; }
.cd-skill-form-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gold);
  margin-top: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--gold-dim);
}
.cd-skill-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
}
.cd-skill-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}
.cd-skill-info { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.cd-skill-name { font-size: 13px; color: var(--text); font-weight: 600; }
.cd-skill-level-row { display: flex; align-items: center; gap: 8px; }
.cd-skill-lvl { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cd-skill-label { font-size: 12px; color: var(--muted); min-width: 56px; }
.cd-skill-pips  { display: flex; gap: 4px; flex: 1; }
.cd-pip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--border);
}
.cd-pip.pip-filled { background: var(--gold); }
.cd-pip.pip-max    { background: #22c55e; }
.cd-skill-booked {
  font-size: 11px;
  font-weight: 700;
  color: #22c55e;
  white-space: nowrap;
}
.cd-skill-row { align-items: flex-start; }
.cd-skill-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}
.cd-skill-cd {
  margin-left: 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .03em;
}
.cd-skill-kind {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.cd-skill-icon-passive {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface, #1a1c22);
  border: 1px solid var(--gold-dim, #6b5a1e);
  color: var(--gold);
  font-size: 20px;
}

/* Mastery tree grid */
.cd-mastery-trees {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
/* Per-tree tinted panel: Offense=red, Defense=green, Support=blue (matches in-game) */
.cd-mastery-tree {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  padding: 8px 6px;
  border: 1px solid var(--border);
}
.cd-mastery-tree.t1 { background: linear-gradient(180deg, rgba(239,68,68,.10), rgba(239,68,68,.02)); border-color: rgba(239,68,68,.25); }
.cd-mastery-tree.t2 { background: linear-gradient(180deg, rgba(34,197,94,.10), rgba(34,197,94,.02)); border-color: rgba(34,197,94,.25); }
.cd-mastery-tree.t3 { background: linear-gradient(180deg, rgba(59,130,246,.10), rgba(59,130,246,.02)); border-color: rgba(59,130,246,.25); }
.cd-mastery-tree-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 8px;
}
.cd-mastery-tree-name.t1 { color: #ef4444; }
.cd-mastery-tree-name.t2 { color: #22c55e; }
.cd-mastery-tree-name.t3 { color: #3b82f6; }
.cd-mastery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  justify-items: center;
}
.cd-mastery-cell {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Frame background behind the icon — highlighted (glowing) for selected below */
  background-image: url('ui_icons/marketing/masteries_bg.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.cd-mastery-cell.empty { visibility: hidden; background: none; }
.cd-mastery-cell.has-tip { cursor: help; }
/* Icon sits slightly inset on the frame, like in-game */
.cd-mastery-img { width: 62%; height: 62%; object-fit: contain; }
/* Selected masteries use the glowing frame + full-colour icon; unselected are dimmed */
.cd-mastery-cell.sel { background-image: url('ui_icons/marketing/masteries_highlighted_frame_bg.png'); }
.cd-mastery-cell.dim .cd-mastery-img { filter: grayscale(1) brightness(.55); opacity: .55; }
.cd-mastery-cell.dim { opacity: .8; }
.cd-mastery-cell.sel .cd-mastery-img { filter: none; opacity: 1; }
.cd-mastery-tree.t1 .cd-mastery-cell.sel .cd-mastery-img { filter: drop-shadow(0 0 2px rgba(239,68,68,.8)); }
.cd-mastery-tree.t2 .cd-mastery-cell.sel .cd-mastery-img { filter: drop-shadow(0 0 2px rgba(34,197,94,.8)); }
.cd-mastery-tree.t3 .cd-mastery-cell.sel .cd-mastery-img { filter: drop-shadow(0 0 2px rgba(59,130,246,.8)); }

/* Mastery hover tooltip */
.cd-mastery-tip {
  display: none;
  position: absolute;
  bottom: 118%;
  left: 50%;
  transform: translateX(-50%);
  width: 210px;
  background: var(--surface2);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.55);
  z-index: 60;
  text-align: left;
  white-space: normal;
  pointer-events: none;
}
.cd-mastery-cell.has-tip:hover .cd-mastery-tip { display: block; }
.mt-name { display: block; color: var(--gold); font-weight: 700; font-size: 12px; margin-bottom: 3px; }
.mt-desc { display: block; color: var(--text); font-size: 11px; line-height: 1.4; }

/* ── Relic cards ─────────────────────────────────────────────────────────── */
.relic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}

.relic-card {
  display: grid;
  grid-template-columns: 116px 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  /* overflow visible so socket hover tooltips can escape the card bounds */
  overflow: visible;
}
.relic-card[data-rarity="6"] { border-color: rgba(220,38,38,0.5); }
.relic-card[data-rarity="5"] { border-color: rgba(251,191,36,0.4); }
.relic-card[data-rarity="4"] { border-color: rgba(167,139,250,0.35); }

.relic-portrait-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
}
.relic-portrait-wrap {
  position: relative;
  width: 116px;
  min-height: 150px;
  background: radial-gradient(ellipse at center, var(--surface2), var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px 0 0 0;   /* top-left matches card; sockets sit below */
  overflow: hidden;
}
.relic-portrait { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.relic-rank {
  position: absolute; bottom: 4px; left: 0; right: 0;
  text-align: center; color: #fbbf24; font-size: 12px; letter-spacing: 1px;
  text-shadow: 0 1px 2px #000;
}
.relic-level {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,.72); color: #fff; border-radius: 4px;
  padding: 1px 6px; font-size: 12px; font-weight: 700;
}

.relic-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.relic-name { color: var(--gold); font-weight: 700; font-size: 15px; line-height: 1.2; }
.relic-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.relic-pill {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 7px; font-size: 11px; color: var(--muted);
}
.relic-pill.relic-equipped { color: var(--text); }
.relic-pill.relic-equipped.is-link { color: var(--gold); cursor: pointer; border-color: var(--gold-dim); }
.relic-pill.relic-equipped.is-link:hover { background: var(--gold-glow); }

/* Equipped-relic card mounted on the champion detail page */
.cd-relic-mount .relic-card { max-width: 440px; }

.relic-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.relic-stat { display: flex; gap: 6px; font-size: 12px; min-width: 88px; }
.relic-stat-k { color: var(--muted); }
.relic-stat-v { color: var(--text); font-weight: 600; }
.relic-stat-locked .relic-stat-k,
.relic-stat-locked .relic-stat-v { color: var(--muted); opacity: .6; }

.relic-sockets { display: flex; align-items: center; justify-content: center; gap: 5px; }
.relic-socket-slot {
  position: relative;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
}
.relic-socket-slot.has-tip { cursor: help; }
.relic-stone-img { width: 30px; height: 30px; object-fit: contain; }
.relic-socket-glyph { font-size: 20px; line-height: 1; color: var(--border); }
.relic-socket-glyph.filled { color: var(--gold); text-shadow: 0 0 4px var(--gold-glow); }

/* Socketed-stone hover tooltip */
.relic-stone-tip {
  display: none;
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  background: var(--surface2);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.55);
  z-index: 50;
  text-align: left;
  white-space: normal;
  pointer-events: none;
}
.relic-socket-slot.has-tip:hover .relic-stone-tip { display: block; }
.relic-stone-tip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--gold-dim);
}
.rst-name { display: block; color: var(--gold); font-weight: 700; font-size: 13px; }
.rst-name.r-Legendary { color: #fbbf24; }
.rst-name.r-Mythical  { color: #dc2626; }
.rst-name.r-Epic      { color: #a78bfa; }
.rst-name.r-Rare      { color: #60a5fa; }
.rst-meta { display: block; color: var(--muted); font-size: 11px; margin: 1px 0 5px; }
.rst-desc { display: block; color: var(--text); font-size: 11px; line-height: 1.4; }

.relic-desc {
  font-size: 12px; color: var(--text); line-height: 1.4;
  border-top: 1px solid var(--border); padding-top: 6px; margin-top: 1px;
}

/* Rarity name colours (relic pills reuse these) */
.relic-pill.r-Legendary { color: #fbbf24; border-color: rgba(251,191,36,0.4); }
.relic-pill.r-Mythical  { color: #dc2626; border-color: rgba(220,38,38,0.5); }
.relic-pill.r-Epic      { color: #a78bfa; border-color: rgba(167,139,250,0.4); }

/* ── Scrollbar styling ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Auth overlay ────────────────────────────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(circle at 50% 30%, #1a1c22 0%, var(--bg) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.auth-brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  color: var(--text);
}
.auth-brand span { color: var(--gold); }
.auth-tag {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.auth-view h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}
.auth-view input {
  display: block;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 14px;
  margin-bottom: 12px;
}
.auth-view input:focus { outline: none; border-color: var(--gold-dim); }
.auth-text { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 16px; }
.auth-loading { color: var(--muted); text-align: center; padding: 20px 0; }
.auth-btn {
  width: 100%;
  background: var(--gold);
  color: #1a1400;
  border: none;
  border-radius: 6px;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.auth-btn:hover { background: #e6b528; }
.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
}
.auth-links a { color: var(--muted); font-size: 12px; text-decoration: none; }
.auth-links a:hover { color: var(--gold); }
.auth-msg {
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 16px;
}
.auth-msg--ok  { background: rgba(34,197,94,0.12);  color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.auth-msg--err { background: rgba(239,68,68,0.12);  color: var(--red);   border: 1px solid rgba(239,68,68,0.3); }

/* ── Sidebar user chip ───────────────────────────────────────────────────── */
.user-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.user-chip-email {
  font-size: 11px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip-logout {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.user-chip-logout:hover { color: var(--gold); }

/* ── Devices & pairing ───────────────────────────────────────────────────── */
.pair-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 24px;
  max-width: 560px;
}
.pair-help { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.pair-form { display: flex; gap: 10px; }
.pair-form input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.pair-form input:focus { outline: none; border-color: var(--gold-dim); }
.pair-form .auth-btn { width: auto; padding: 10px 18px; }
.devices-list { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
}
.device-row--revoked { opacity: 0.5; }
.device-main { display: flex; flex-direction: column; gap: 3px; }
.device-name { font-size: 14px; color: var(--text); }
.device-meta { font-size: 11.5px; color: var(--muted); }
.device-revoke {
  background: none;
  border: 1px solid var(--border);
  color: var(--red);
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.device-revoke:hover:not(:disabled) { border-color: var(--red); }
.device-revoke:disabled { color: var(--muted); cursor: default; }
.muted { color: var(--muted); font-size: 13px; }

/* ── Admin console ───────────────────────────────────────────────────────── */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.admin-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
}
.admin-tab.active { color: var(--gold); border-color: var(--gold-dim); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.admin-table th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; }
.admin-table td { color: var(--text); }
.admin-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 6px;
}
.admin-btn:hover { border-color: var(--gold-dim); }
.admin-btn--bad { color: var(--red); }
.admin-btn--bad:hover { border-color: var(--red); }
.tag-ok  { color: var(--green); }
.tag-bad { color: var(--red); }
