/* Character detail lives in the right sidebar (#detail-sidebar) */
#char-detail:empty::before {
  content: 'Select a hero'; color: #ccc;
  display: block; text-align: center; padding: 3rem 0;
}
.detail-empty { text-align: center; color: #ccc; padding: 3rem 0; }

/* === Header: portrait + name === */
.detail-head {
  display: flex; gap: 0.75rem; align-items: center;
  padding-bottom: 0.7rem; border-bottom: 1px solid #333844;
  margin-bottom: 0.7rem;
}
.detail-head-portrait { flex-shrink: 0; }
.detail-title h2 {
  margin: 0; font-size: 1.15rem; color: #ffd700;
  display: flex; align-items: center; gap: 0.4rem;
}
.detail-sub {
  font-size: 0.78rem; color: #ccc; margin-top: 0.2rem;
  display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap;
}
.detail-sub svg { vertical-align: middle; }

/* === Stats block === */
.detail-stats {
  font-size: 0.82rem; margin-bottom: 0.7rem;
  background: #2b303a; border-radius: 6px; padding: 0.6rem 0.7rem;
}
.detail-stats > div { margin: 0.2rem 0; }
.detail-stats .k { color: #ccc; margin-right: 0.4rem; font-size: 0.72rem;
                   text-transform: uppercase; letter-spacing: 0.5px; }
.detail-stats-row {
  display: flex; gap: 0.8rem; flex-wrap: wrap;
  font-size: 0.78rem; color: #ccc;
  padding-top: 0.3rem; margin-top: 0.3rem;
  border-top: 1px solid #333844;
}
.detail-dps { color: #ffd700; font-weight: bold; font-size: 0.95rem; }
.detail-position { font-size: 0.72rem; color: #ccc; margin-top: 0.4rem; }

.xp-bar-outer {
  height: 6px; background: #3a3f47; border-radius: 2px; overflow: hidden; margin: 0.2rem 0;
}
.xp-bar-inner {
  height: 100%; background: linear-gradient(90deg, #55c, #77e); transition: width 100ms linear;
}
.xp-text { font-size: 0.7rem; color: #ccc; }

/* === Gear tabs === */
.gear-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem; margin-bottom: 0.55rem;
  background: #1e2128; border-radius: 6px; padding: 0.25rem;
}
.gear-tab {
  padding: 0.55rem 0.3rem;
  background: transparent; border: none; border-radius: 4px;
  color: #ccc; font-family: inherit; font-size: 0.78rem;
  cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  transition: background 80ms, color 80ms;
  position: relative;
}
.gear-tab:hover { background: #2b303a; color: #ddd; }
.gear-tab.active {
  background: #2a3241; color: #ffd700; font-weight: bold;
  box-shadow: 0 0 0 1px #4a5a70 inset;
}

/* Per-tab upgrade dot — same colour scale as cell upgrade badge */
.gear-tab-upgrade {
  position: absolute; top: 4px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  pointer-events: none;
}
.gear-tab-upgrade.step-1  { background: #888; }
.gear-tab-upgrade.step-5  { background: #d4a017; }
.gear-tab-upgrade.step-10 { background: #d47017; }
.gear-tab-upgrade.step-50 {
  background: #e83ee8;
  box-shadow: 0 0 6px rgba(232, 62, 232, 0.7);
  animation: upgrade-pulse 1.6s ease-in-out infinite;
}
.gear-tab-icon { font-size: 1rem; line-height: 1; }
.gear-tab-badge {
  font-size: 0.62rem; color: #ccc; font-weight: normal;
  margin-top: 0.05rem;
}
.gear-tab.active .gear-tab-badge { color: #ffd700; }

/* === Gear section (single visible tab) === */
.gear-section { margin-bottom: 0.7rem; }
.section-sub { font-size: 0.72rem; color: #ccc; margin: 0.5rem 0 0.35rem; text-transform: uppercase; letter-spacing: 0.5px; }

.equipped-empty {
  padding: 0.8rem; text-align: center; background: #1e2128; border-radius: 6px;
  color: #ccc; font-size: 0.82rem;
}

.weapon-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem; align-items: center;
  padding: 0.45rem 0.6rem; background: #1e2128; border-radius: 6px;
  margin-bottom: 0.3rem;
}
.weapon-row.equipped {
  background: #2a3241; border: 1px solid #4a5a70;
  grid-template-columns: auto 1fr;
}
.weapon-info { min-width: 0; }
.weapon-name { font-weight: bold; font-size: 0.85rem; color: #eee; }
.weapon-stats { font-size: 0.72rem; color: #ccc; margin-top: 0.1rem; }
.weapon-row > button {
  padding: 0.35rem 0.6rem;
  background: #333844; color: #eee;
  border: 1px solid #555; border-radius: 4px; cursor: pointer;
  font-family: inherit; font-size: 0.75rem; white-space: nowrap;
}
.weapon-row > button:hover:not(:disabled) { background: #444a58; }
.weapon-row > button:disabled { opacity: 0.4; cursor: not-allowed; }

.weapon-mat-have {
  font-size: 0.75rem; color: #ccc;
  margin: 0.45rem 0 0.3rem 0.15rem;
}

.weapon-level-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
}
.weapon-level-btn {
  padding: 0.35rem 0.2rem;
  background: #3a4a2a; color: #cf8;
  border: 1px solid #6a8a4a; border-radius: 4px; cursor: pointer;
  font-family: inherit;
  display: flex; flex-direction: column; align-items: center;
  gap: 0.1rem; min-width: 0;
}
.weapon-level-btn:hover:not(:disabled) { background: #4a5a3a; }
.weapon-level-btn:disabled {
  background: #2a2e35; color: #ccc; border-color: #444; cursor: not-allowed;
}
.weapon-level-btn .btn-label { font-weight: bold; font-size: 0.82rem; }
.weapon-level-btn .btn-cost { font-size: 0.6rem; text-align: center; line-height: 1.15; }

.weapon-others { margin-top: 0.65rem; max-height: 250px; overflow-y: auto; }

/* === Action buttons (Awaken, Lead) — anchored at bottom === */
.detail-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
  padding-top: 0.7rem;
  border-top: 1px solid #333844;
  margin-top: 0.5rem;
}
.detail-actions button {
  padding: 0.55rem; background: #333844; color: #eee;
  border: 1px solid #555; border-radius: 4px; cursor: pointer;
  font-size: 0.8rem; font-family: inherit;
}
.detail-actions button:hover:not(:disabled) { background: #444a58; }
.detail-actions button:disabled { opacity: 0.4; cursor: not-allowed; }
.awaken-btn:not(:disabled) {
  background: #6a4a1a; border-color: #ffd700; color: #ffd700; font-weight: bold;
}
.awaken-btn:not(:disabled):hover { background: #8a5a2a; }

/* ═══════════════════════════════════════════════════════════
   HEROES VIEW — full-page character-management surface.
   Multi-column card grid; cards expand inline on click.
   ═══════════════════════════════════════════════════════════ */

.heroes-view {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.heroes-view-header {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--panel-bg);
  border: var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
}

/* Card grid — 3 columns by default, dense packing so expanded rows fill
   the full width without leaving gaps. */
.heroes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  align-items: start;
}
@media (min-width: 1400px) { .heroes-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px)  { .heroes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .heroes-grid { grid-template-columns: 1fr; } }

.hero-card {
  background: var(--surface-2);
  border: 1px solid var(--border-hair);
  border-radius: 10px;
  padding: var(--sp-3);
  cursor: pointer;
  color: var(--text-1);
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.hero-card:hover:not(.is-locked):not(.is-expanded) {
  background: var(--surface-3);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.hero-card.is-fielded {
  border-top: 2px solid var(--accent-positive);
}
.hero-card.is-locked {
  opacity: 0.5;
  cursor: default;
}
.hero-card.is-expanded {
  background: linear-gradient(180deg, var(--surface-3) 0%, var(--surface-2) 100%);
  border-color: var(--accent-gold);
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.15), inset 0 1px 0 rgba(255,255,255,0.05);
  cursor: default;
}

/* Collapsed body — horizontal: portrait | ident | swap | chevron */
.hero-card-collapsed {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.hero-card-ident {
  flex: 1;
  min-width: 0;
}
.hero-card-name {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-1);
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-card-awake {
  color: #a8b8ff;
  font-weight: var(--weight-bold);
  letter-spacing: 0.3px;
  font-size: var(--text-md);
}
.hero-card-sub {
  margin-top: 2px;
  font-size: var(--text-xs);
}
.hero-card-class {
  font-weight: var(--weight-bold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.hero-card-meta {
  margin-top: 4px;
  font-size: var(--text-sm);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.hero-card-lock { color: var(--text-2); }
.hero-card-swap {
  flex-shrink: 0;
}
.hero-card-chevron {
  flex-shrink: 0;
  color: var(--text-2);
  font-size: 10px;
  padding: 0 4px;
  opacity: 0.6;
  transition: color var(--dur-fast), opacity var(--dur-fast);
}
.hero-card:hover .hero-card-chevron { color: var(--accent-gold); opacity: 1; }
.hero-card.is-expanded .hero-card-chevron { color: var(--accent-gold); opacity: 1; }

/* Expanded body — everything about this hero */
.hero-card-expanded {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-hair);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.hero-expanded-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  flex: 1;
}
.hero-chip-stars.tier-1 { color: var(--tier-bronze); }
.hero-chip-stars.tier-2 { color: var(--tier-silver); }
.hero-chip-stars.tier-3 { color: var(--tier-gold); }
.hero-story-btn {
  padding: 4px 12px;
  background: var(--surface-3);
  color: var(--text-1);
  border: 1px solid var(--border-hair);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.hero-story-btn:hover {
  background: var(--surface-4);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* Level + XP row */
.hero-level-row { }
.hero-level-line {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.hero-level-num {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--accent-gold);
}
.hero-level-max {
  color: var(--text-2);
  font-size: var(--text-sm);
}
.hero-level-xp {
  margin-left: auto;
  color: var(--text-2);
  font-size: var(--text-xs);
}
.hero-xp-bar {
  height: 6px;
  background: var(--surface-1);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
}
.hero-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-xp) 0%, #a8b8ff 100%);
  transition: width 200ms linear;
}

/* Gear grid — 3 slots side by side, no tabs */
.hero-gear-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}
@media (max-width: 900px)  { .hero-gear-grid { grid-template-columns: 1fr; } }
.hero-gear-slot {
  background: var(--surface-1);
  border: 1px solid var(--border-hair);
  border-radius: 8px;
  padding: var(--sp-3);
}
.hero-gear-slot-header {
  color: var(--accent-gold);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border-hair);
  margin-bottom: var(--sp-3);
  text-align: center;
}

/* Actions row (awaken button) */
.hero-actions {
  display: flex;
  justify-content: center;
  padding-top: var(--sp-2);
}
.hero-awaken-btn {
  padding: var(--sp-3) var(--sp-5);
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border-hair);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 240px;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast), color var(--dur-fast);
}
.hero-awaken-btn:disabled { cursor: not-allowed; opacity: 0.7; }
.hero-awaken-btn.is-ready {
  background: linear-gradient(180deg, #b8860b 0%, #7a5a08 100%);
  border-color: var(--accent-gold);
  color: #14161a;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  cursor: pointer;
  opacity: 1;
}
.hero-awaken-btn.is-ready:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.25); }
.hero-awaken-label {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  letter-spacing: 1px;
}
.hero-awaken-cost {
  font-size: var(--text-xs);
  opacity: 0.85;
}

/* Compact gear rendering — 3-across inside hero card column. Trimmed down
   from the old verbose card: no repeated rarity name, cost lives in tooltip,
   buttons show just "+N". Room comes from stripping visual noise. */
.gear-compact {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.gear-compact-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px dashed var(--border-hair);
  cursor: help;
}
.gear-compact-info {
  flex: 1;
  min-width: 0;
}
.gear-compact-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gear-compact-level,
.gear-compact-stat {
  font-size: var(--text-xs);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.gear-compact-stat { color: var(--text-1); }
.gear-compact-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}
.gear-lvl-btn {
  padding: 6px 0;
  background: linear-gradient(180deg, #3a2f14 0%, #241d0c 100%);
  color: var(--accent-gold);
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.3px;
  transition: background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.gear-lvl-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #5a4820 0%, #322708 100%);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.gear-lvl-btn:disabled {
  background: var(--surface-3);
  color: var(--text-2);
  border-color: var(--border-hair);
  box-shadow: none;
  opacity: 0.4;
  cursor: not-allowed;
}
.gear-rarity-btn {
  padding: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
  border: 1px solid;   /* color set inline based on next rarity */
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.5px;
  transition: background var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 0 10px currentColor;
  filter: brightness(1);
}
.gear-rarity-btn:not(:disabled) {
  /* currentColor drives the glow to the next-rarity color */
  animation: rarity-affordable-pulse 2.2s ease-in-out infinite;
}
.gear-rarity-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}
.gear-rarity-btn:disabled {
  background: var(--surface-3);
  border-color: var(--border-hair) !important;
  color: var(--text-2) !important;
  box-shadow: none;
  opacity: 0.35;
  cursor: not-allowed;
  animation: none;
}
@keyframes rarity-affordable-pulse {
  0%, 100% { box-shadow: 0 0 6px currentColor; }
  50%      { box-shadow: 0 0 14px currentColor; }
}
.tier-upgrade-max {
  padding: 6px;
  text-align: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.5px;
}

/* Slot header inside hero card gear grid — smaller than the takeover
   header so it doesn't dominate the compact layout */
.hero-gear-slot { padding: var(--sp-2); }
.hero-gear-slot .hero-gear-slot-header {
  font-size: 10px;
  padding-bottom: var(--sp-1);
  margin-bottom: var(--sp-2);
  letter-spacing: 1px;
}
.hero-gear-grid { gap: var(--sp-2); }

/* Placeholder view (Stats / Achievements) */
.view-placeholder {
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
  color: var(--text-2);
}
.placeholder-icon {
  font-size: 64px;
  margin-bottom: var(--sp-3);
  opacity: 0.5;
}
.view-placeholder h3 {
  color: var(--accent-gold);
  font-size: var(--text-xl);
  margin: 0 0 var(--sp-2);
}
.view-placeholder p {
  font-size: var(--text-md);
  max-width: 400px;
  margin: 0 auto;
}
.sidebar-tabs {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  margin-bottom: 0.7rem;
  background: #1e2128;
  border-radius: 6px;
  padding: 0.25rem;
}
.sidebar-tabs .sidebar-tab {
  flex: 1;
  min-width: 0;   /* let the flex items shrink instead of forcing wrap */
}
.sidebar-expand-btn {
  flex-shrink: 0;
  background: transparent;
  color: var(--text-2);
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.sidebar-expand-btn:hover {
  background: var(--surface-3);
  color: var(--accent-gold);
  border-color: var(--border-strong);
}

/* === Character strip on the Equipment tab (horizontal scroll of small
   portraits — click to swap which champion's gear you're editing) === */
.eq-strip {
  padding: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.eq-strip-scroll {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 6px;
  scrollbar-width: thin;
}
.eq-strip-item {
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: 3px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast);
}
.eq-strip-item:hover { transform: translateY(-2px); }
.eq-strip-item.is-selected .portrait {
  box-shadow: 0 0 0 3px var(--accent-gold), 0 0 12px rgba(255, 215, 0, 0.6);
}
.eq-strip-item.is-fielded::after {
  content: '';
  display: block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-positive);
  margin: 3px auto 0;
  box-shadow: 0 0 4px rgba(74, 222, 128, 0.7);
}
.eq-strip-empty {
  color: var(--text-2);
  font-size: var(--text-sm);
  padding: var(--sp-2);
}

/* === Roster grid: 2 columns for bigger, more legible tiles === */
.champion-grid {
  grid-template-columns: repeat(2, 1fr);
  --tile-h: 138px;   /* slightly taller to breathe with the bigger portrait */
  max-height: calc(var(--tile-h) * var(--rows-visible) + var(--sp-2) * (var(--rows-visible) - 1));
}
.champion-tile { height: 138px; }

/* === Expanded-sidebar overrides — larger typography and layouts when
   the sidebar takes the full page === */
body.sidebar-expanded .champion-grid {
  grid-template-columns: repeat(6, 1fr);
  --tile-h: 168px;
  --rows-visible: 5;
  max-height: calc(var(--tile-h) * var(--rows-visible) + var(--sp-2) * (var(--rows-visible) - 1));
}
body.sidebar-expanded .champion-tile { height: 168px; }
body.sidebar-expanded .tile-name { font-size: var(--text-lg); }
body.sidebar-expanded .tile-meta { font-size: var(--text-sm); }

/* Expanded mode: 3-up gear panel so all slots are visible at once */
.eq-gear-all {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}
.eq-gear-slot-header {
  color: var(--accent-gold);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border-hair);
  margin-bottom: var(--sp-3);
  text-align: center;
}
/* Small screens can't fit 3 columns comfortably even when expanded */
@media (max-width: 1000px) {
  .eq-gear-all { grid-template-columns: 1fr; }
}

body.sidebar-expanded .eq-hero-top { gap: var(--sp-4); }
body.sidebar-expanded .eq-name { font-size: var(--text-2xl); }
body.sidebar-expanded .eq-bio { font-size: var(--text-md); }
body.sidebar-expanded .eq-stats {
  grid-template-columns: repeat(4, 1fr);
}
body.sidebar-expanded .eq-strip-scroll {
  gap: var(--sp-3);
}

/* Materials tab: give rows more room in expanded mode */
body.sidebar-expanded .material-row {
  padding: 0.7rem 0.9rem;
  font-size: var(--text-md);
}
.sidebar-tab {
  padding: 0.55rem 0.3rem;
  background: transparent; border: none; border-radius: 4px;
  color: #ccc; font-family: inherit; font-size: 0.82rem;
  cursor: pointer;
  transition: background 80ms, color 80ms;
}
.sidebar-tab:hover { background: #2b303a; color: #ddd; }
.sidebar-tab.active {
  background: #2a3241; color: #ffd700; font-weight: bold;
  box-shadow: 0 0 0 1px #4a5a70 inset;
}

/* Tab stubs (Crafting, Inventory — coming soon) */
.tab-stub {
  padding: 1.5rem 0.8rem;
  text-align: center;
}
.tab-stub h3 {
  color: #ffd700; margin: 0 0 0.6rem;
  font-size: 1.05rem;
}
.tab-stub p {
  color: #ccc; font-size: 0.85rem;
  margin: 0.3rem 0;
}
.tab-stub-hint {
  margin-top: 1rem;
  padding: 0.6rem;
  background: #2b303a;
  border-radius: 6px;
  color: #ccc;
  font-size: 0.78rem;
}

/* === Tier upgrade button (crafting) === */
.tier-upgrade-btn {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.55rem 0.6rem;
  background: linear-gradient(135deg, #3a2a5a, #4a3a6a);
  color: #ffd700;
  border: 1px solid #6a5a8a;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}
.tier-upgrade-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #4a3a6a, #5a4a7a);
}
.tier-upgrade-btn:disabled {
  background: #2a2e35; color: #ccc; border-color: #444;
  cursor: not-allowed;
}
.tier-upgrade-btn .btn-label {
  font-weight: bold; font-size: 0.88rem;
  margin-bottom: 0.15rem;
}
.tier-upgrade-btn .btn-cost {
  font-size: 0.72rem;
}
.tier-upgrade-max {
  margin-top: 0.5rem;
  padding: 0.4rem;
  background: #2a3241;
  border-radius: 6px;
  color: #ffd700;
  text-align: center;
  font-size: 0.8rem;
  font-weight: bold;
}

/* === Characters tab: class filter chips + roster grid === */
/* char-detail is the tab content host inside the sidebar. Fallback scroll
   for tabs that don't manage their own overflow (equipment/inventory).
   The characters tab has its own grid-scoped scroll, so this rarely fires
   for that tab. */
#char-detail {
  overflow-y: auto;
  min-height: 0;
}

/* === Characters tab (roster) — natural document flow. The tile grid caps
   itself and scrolls internally when full; nothing else needs special
   layout. === */
.characters-panel {
  min-height: 0;
}

.roster-header {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-hair);
  margin-bottom: var(--sp-3);
}
.roster-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}
.roster-row-label {
  font-size: var(--text-xs);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: var(--weight-medium);
  padding-top: 6px;
  min-width: 36px;
  flex-shrink: 0;
}
.roster-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

/* Class filter chips arranged as a grid: "All" spans the full row,
   then 9 class chips fill a 3×3 layout beneath. Consistent widths make
   scanning fast. */
.roster-chips-filter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.roster-chips-filter .roster-chip-all {
  grid-column: 1 / -1;
}

.roster-chip {
  padding: 4px 8px;
  background: var(--surface-2);
  color: var(--text-1);
  border: 1px solid var(--border-hair);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.3px;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}
.roster-chip-class .roster-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-chip-stars {
  font-size: 10px;
  font-weight: var(--weight-bold);
  letter-spacing: 0;
  flex-shrink: 0;
}
.roster-chip-stars.tier-1 { color: var(--tier-bronze); text-shadow: 0 0 3px rgba(212, 145, 77, 0.5); }
.roster-chip-stars.tier-2 { color: var(--tier-silver); text-shadow: 0 0 4px rgba(220, 235, 255, 0.55); }
.roster-chip-stars.tier-3 { color: var(--tier-gold);   text-shadow: 0 0 5px rgba(255, 215, 0, 0.7); }

.roster-chip:hover:not(.is-active) {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
.roster-chip.is-active {
  background: linear-gradient(180deg, #b8860b 0%, #8a6608 100%);
  border-color: var(--accent-gold);
  color: #14161a;
  font-weight: var(--weight-bold);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
.roster-chip.is-active .roster-chip-stars { color: #14161a; text-shadow: none; }

.roster-chip-sort.is-active {
  /* Sort chips use a cooler accent so they don't compete visually with the
     class filter chips — same "active" concept, different color language. */
  background: linear-gradient(180deg, #4a63c8 0%, #354a9c 100%);
  border-color: var(--accent-xp);
  color: #fff;
  box-shadow: 0 0 8px rgba(123, 156, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}

.roster-meta {
  display: flex;
  justify-content: flex-end;
  font-size: var(--text-xs);
  color: var(--text-2);
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}

.champion-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2);
  /* Show exactly 4 rows of tiles, then scroll. Tile height is set on
     .champion-tile — change both together to shift how many rows fit. */
  --rows-visible: 4;
  --tile-h: 138px;
  max-height: calc(var(--tile-h) * var(--rows-visible) + var(--sp-2) * (var(--rows-visible) - 1));
  overflow-y: auto;
  min-height: 0;
  padding: 2px 4px 2px 0;
}
/* Custom scrollbar styling so the internal scroll doesn't look OS-default */
.champion-grid::-webkit-scrollbar { width: 8px; }
.champion-grid::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 4px; }
.champion-grid::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 4px; }
.champion-grid::-webkit-scrollbar-thumb:hover { background: #4f556a; }
/* Champion tile — 118px fixed height, laid out in three rows:
   (header: icon + swap button) | (name) | (meta: Lv + A#).
   Fielded state shows a subtle green top border. Locked tiles dim. */
.champion-tile {
  background: var(--surface-2);
  border: 1px solid var(--border-hair);
  border-top: 2px solid transparent;   /* reserved space for fielded accent */
  border-radius: 8px;
  padding: var(--sp-2);
  height: 138px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  transition: background var(--dur-fast),
              border-color var(--dur-fast),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  position: relative;
  /* No overflow:hidden — would clip the portrait rarity-ring glow at corners */
}
.champion-tile:hover:not(.is-locked) {
  background: var(--surface-3);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
}
.champion-tile.selected {
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.06);
}
.champion-tile.is-fielded {
  border-top-color: var(--accent-positive);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.15), inset 0 1px 0 rgba(255,255,255,0.04);
}
.champion-tile.is-fielded.selected {
  border-top-color: var(--accent-gold);
}
.champion-tile.is-locked {
  opacity: 0.5;
  cursor: default;
}

/* Tile header row: icon slot on left, swap button on right */
.tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1);
}
.tile-icon {
  flex-shrink: 0;
}

/* Swap button — small pill top-right that toggles fielded/benched */
.tile-swap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: var(--surface-1);
  border: 1px solid var(--border-hair);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
  user-select: none;
}
.tile-swap-btn:hover {
  background: var(--surface-4);
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  transform: scale(1.08);
}
.champion-tile.is-fielded .tile-swap-btn {
  /* When fielded, the button subtly signals "in party" via a green tint */
  color: var(--accent-positive);
  border-color: rgba(74, 222, 128, 0.5);
}

.tile-lock-badge {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: 0.7;
}

/* Name — the focal point of the tile */
.tile-name {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  line-height: 1.15;
  color: var(--text-1);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: -2px;
}

/* Meta line — level + personal awakening count */
.tile-meta {
  font-size: var(--text-xs);
  color: var(--text-2);
  letter-spacing: 0.3px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

/* === Champion tile stars — same tier colors as grid === */
.champion-tile-stars {
  margin-left: 0.35rem;
  letter-spacing: 1px;
}
.champion-tile-stars.tier-1 { color: #d4914d; text-shadow: 0 0 2px rgba(212, 145, 77, 0.6); }
.champion-tile-stars.tier-2 { color: #d0e0f0; text-shadow: 0 0 3px rgba(220, 235, 255, 0.65); }
.champion-tile-stars.tier-3 { color: #ffd700; text-shadow: 0 0 3px rgba(255, 215, 0, 0.8); }

/* "bench" tag on locked-but-fielded champions in Characters tab */
.benched-tag {
  display: inline-block;
  padding: 0 0.35rem;
  background: #2b303a;
  border-radius: 3px;
  color: #ccc;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 0.15rem;
}

/* === Inventory tab: materials list === */
.inventory-panel { padding: 0.3rem 0; }
.inventory-header { margin-bottom: 0.7rem; }
.inventory-header h3 {
  margin: 0;
  color: #ffd700;
  font-size: 1rem;
}
.inventory-sub {
  color: #ccc;
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

.materials-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.material-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 60px 90px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  background: #22262d;
  border: 1px solid #2a2e35;
  border-radius: 5px;
  font-size: 0.82rem;
}
.material-row.empty { opacity: 0.4; }
.mat-tier {
  color: #ffd700;
  font-weight: bold;
  font-size: 0.75rem;
  text-align: center;
}
.mat-name {
  color: #ddd;
  font-weight: 500;
}
.mat-tier-prefix {
  color: #ccc;
  font-size: 0.72rem;
}
.mat-count {
  text-align: right;
  color: #ffd700;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

/* Bench tiles get a subtle "tap to field" affordance on hover — the bench tag
   shifts to gold and the tile lifts, hinting that clicking will swap them in. */
.champion-tile:hover .benched-tag {
  background: #4a3a1a;
  color: #ffd700;
}
.champion-tile:hover .benched-tag::after {
  content: ' → field';
  color: #ffd700;
}

/* === Rarity badge (colored square with letter, e.g. C/U/R/E/L) === */
.rarity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 4px;
  color: #000;
  font-weight: bold;
  font-size: 0.85rem;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

/* Colored dot for class materials in inventory + gear "have" line */
.mat-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
}
.mat-dot.inline {
  display: inline-block;
  width: 10px; height: 10px;
  vertical-align: middle;
  margin: 0 0.15rem 0 0.25rem;
}

/* Materials list rows — column layout tuned for the framed material icon slot */
.material-row {
  grid-template-columns: 32px minmax(0, 1fr) auto 90px;
}
.mat-class {
  color: #ccc;
  font-size: 0.72rem;
  padding-right: 0.4rem;
}

/* Rarity ring on champion tiles — colored border matching equipped weapon rarity.
   Uses the --rarity-color CSS variable set inline per tile. Common (gray) reads
   as "starter" and stays low-key. Legendary glows gold. */
.champion-tile[data-rarity="1"] { border-color: var(--rarity-color); }
.champion-tile[data-rarity="2"] { border-color: var(--rarity-color); box-shadow: 0 0 4px rgba(74, 222, 128, 0.3); }
.champion-tile[data-rarity="3"] { border-color: var(--rarity-color); box-shadow: 0 0 6px rgba(96, 165, 250, 0.4); }
.champion-tile[data-rarity="4"] { border-color: var(--rarity-color); box-shadow: 0 0 7px rgba(192, 132, 252, 0.5); }
.champion-tile[data-rarity="5"] { border-color: var(--rarity-color); box-shadow: 0 0 9px rgba(251, 191, 36, 0.6); }
/* Selected still wins the border color, but the rarity glow shows through */
.champion-tile.selected {
  border-color: #ffd700 !important;
}

/* === Materials view (flat grid) ===
   Filter chips row, grid of 189 tiles (180 char-mats + 9 class essences).
   Char-mat tiles use a class-colored dot; essence tiles use the class icon.
   Legendary tiles get a gold border + subtle glow so they stand out.
   Zero-count tiles dim; the "Owned only" toggle hides them entirely. */
.materials-view {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
}
.materials-header-title {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
}
.materials-header-title h3 {
  margin: 0;
  color: var(--accent-gold);
  font-size: var(--text-md);
}
.materials-sub {
  color: var(--text-2);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}
.materials-header-desc {
  color: var(--text-2);
  font-size: var(--text-xs);
  margin-top: 4px;
  line-height: 1.4;
}
.materials-filters {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border-hair);
}
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--sp-2);
}
.material-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-hair);
  border-radius: 5px;
  cursor: help;
  transition: border-color var(--dur-fast), background var(--dur-fast);
  text-align: center;
  min-width: 0;
}
.material-tile:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}
.material-tile.is-zero { opacity: 0.4; }
.material-tile.is-legendary {
  border-color: var(--rarity-legendary);
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.2);
}
.material-tile.is-legendary.is-zero { box-shadow: none; }
.material-tile.is-essence { background: var(--surface-1); }

.material-tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
}
.mat-dot.mat-dot-lg {
  width: 26px; height: 26px;
}
.material-tile-name {
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--text-1);
  line-height: 1.2;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 2.4em;   /* reserve 2 lines so counts align across the grid */
}
.material-tile-count {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--accent-gold);
  font-variant-numeric: tabular-nums;
}
.materials-empty {
  text-align: center;
  color: var(--text-2);
  padding: var(--sp-5) var(--sp-3);
  font-size: var(--text-sm);
}

/* === Rarity-upgrade requirements line ===
   Sits directly under the rarity button inside the compact gear card. Shows
   each cost pool (essence, character slot-mat, legendary mat if applicable)
   with a green ✓ when satisfied or red ✗ when short. Have/need are shown as
   tabular numbers so columns visually align across cost rows. */
.gear-req-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}
.gear-req-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.gear-req-item.is-ok   { color: var(--accent-positive); }
.gear-req-item.is-miss { color: var(--accent-negative); }
.gear-req-mark {
  font-weight: var(--weight-bold);
  text-align: center;
}
.gear-req-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}
.gear-req-item.is-ok   .gear-req-name { color: var(--text-1); }
.gear-req-item.is-miss .gear-req-name { color: var(--text-1); }
.gear-req-count {
  font-weight: var(--weight-bold);
}
/* ═══════════════════════════════════════════════════════════
   EQUIPMENT TAB — game-scale rebuild
   Pulls from design tokens in base.css. Uses new eq-* class
   names so the old .detail-* rules can be safely deleted
   later without a rush. Paste at the bottom of detail.css.
   ═══════════════════════════════════════════════════════════ */

/* Container spacing — panels stack with real breathing room */
#char-detail .panel + .panel,
#char-detail .panel + .eq-actions,
#char-detail .eq-hero + .eq-gear {
  margin-top: var(--sp-3);
}

.eq-empty {
  text-align: center;
  color: var(--text-2);
  padding: var(--sp-6) var(--sp-3);
  font-size: var(--text-md);
}

/* ── Character panel ─────────────────────────────────────── */

.eq-hero {
  padding: var(--sp-4);
  position: relative;
  /* No overflow:hidden here — portrait rarity ring glows past its bounds
     and getting clipped looks awful at the top/left corner. The corner wash
     below uses a clipped inner pseudo-element instead. */
  border-radius: var(--panel-radius);
}

/* Faint class-color wash bleeding in from the corner. Rendered as an
   inset absolute pseudo so it stays inside the panel's radius without
   needing overflow:hidden on the parent. */
.eq-hero::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at top right, var(--this-class, transparent) 0%, transparent 65%);
  opacity: 0.10;
  pointer-events: none;
  overflow: hidden;
}

.eq-hero > * { position: relative; }

.eq-hero-top {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  margin-bottom: var(--sp-4);
  /* Give the portrait's outer glow room to breathe at top/left */
  padding: 4px 0 0 4px;
}
.eq-hero-ident {
  flex: 1;
  min-width: 0;
}
.eq-hero-name-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.eq-hero-name-row .eq-name {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.eq-hero-swap {
  flex-shrink: 0;
}
.eq-name {
  margin: 0 0 var(--sp-2);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--accent-gold);
  line-height: 1.15;
}

/* Chip row under the name — class + damage type + archetype */
.eq-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

/* Short bio blurb + backstory button row. The bio is the elevator pitch;
   the button opens the full Gemini-written backstory in the story modal. */
.eq-bio-row {
  margin: var(--sp-3) 0 0;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}
.eq-bio {
  margin: 0;
  flex: 1;
  color: var(--text-2);
  font-size: var(--text-sm);
  line-height: 1.4;
  font-style: italic;
}
.eq-story-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  background: var(--surface-3);
  color: var(--text-1);
  border: 1px solid var(--border-hair);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.eq-story-btn:hover {
  background: var(--surface-4);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  transform: translateY(-1px);
}

/* Awakening row — houses the class stars (shared count for the class) AND
   the personal awakening badge (this specific champion's count). They live
   side-by-side so the player sees both metrics at once. */
.eq-awaken-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  flex-wrap: wrap;
}
.eq-personal-awaken {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 8px;
  background: linear-gradient(180deg, #2e3a5a 0%, #1c2340 100%);
  border: 1px solid var(--accent-xp);
  border-radius: 6px;
  color: #cddfff;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  cursor: help;
  box-shadow: 0 0 6px rgba(123, 156, 255, 0.25), inset 0 1px 0 rgba(255,255,255,0.08);
}
.eq-personal-awaken:hover { border-color: #a8b8ff; }

/* Inline personal-awaken badge used in the roster tile status line —
   small, subtle, cool-blue to distinguish from level (white) and bench (gray). */
.personal-awaken-inline {
  color: #a8b8ff;
  font-weight: var(--weight-bold);
  letter-spacing: 0.3px;
}

/* Ascension stars row */
.eq-stars {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  font-size: var(--text-sm);
}
.eq-stars-glyphs {
  font-size: var(--text-md);
  letter-spacing: 2px;
  line-height: 1;
}
.eq-stars.tier-1 .eq-stars-glyphs { color: var(--tier-bronze); text-shadow: 0 0 4px rgba(212,145,77,0.6); }
.eq-stars.tier-2 .eq-stars-glyphs { color: var(--tier-silver); text-shadow: 0 0 5px rgba(220,235,255,0.7); }
.eq-stars.tier-3 .eq-stars-glyphs { color: var(--tier-gold);   text-shadow: 0 0 6px rgba(255,215,0,0.85); }
.eq-stars-label { color: var(--text-2); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.6px; }
.eq-stars-placeholder { margin-top: var(--sp-3); color: var(--text-2); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.6px; }

/* ── Level + XP block ────────────────────────────────────── */

.eq-level {
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
  background: var(--inset-bg);
  border: var(--inset-border);
  border-radius: 8px;
  box-shadow: var(--inset-shadow);
}
.eq-level-line {
  display: flex;
  align-items: baseline;
  gap: var(--sp-1);
  margin-bottom: var(--sp-2);
}
.eq-level-num {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: #fff;
  line-height: 1;
  letter-spacing: 0.5px;
}
.eq-level-max {
  font-size: var(--text-md);
  color: var(--text-2);
}
.eq-xp-bar-outer {
  height: 10px;
  background: #0d1015;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}
.eq-xp-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #4a63c8 0%, var(--accent-xp) 60%, #a8b8ff 100%);
  transition: width 100ms linear;
  box-shadow: 0 0 6px rgba(123, 156, 255, 0.55);
}
.eq-xp-text {
  margin-top: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--text-2);
  letter-spacing: 0.3px;
}

/* ── Stat grid — 2×2 cards ───────────────────────────────── */

.eq-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.eq-stat {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-2);
  border: 1px solid var(--border-hair);
  border-radius: 8px;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.eq-stat:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}
.eq-stat-icon {
  font-size: var(--text-lg);
  color: var(--text-1);
  line-height: 1;
}
.eq-stat-icon[data-stat="dps"]  { color: #ff8080; }
.eq-stat-icon[data-stat="wpn"]  { color: var(--accent-warning); }
.eq-stat-icon[data-stat="crit"] { color: #ec4899; }
.eq-stat-icon[data-stat="arm"]  { color: var(--accent-xp); }
.eq-stat-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.eq-stat-label {
  font-size: var(--text-xs);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.1;
}
.eq-stat-value {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: #fff;
  line-height: 1.1;
}
.eq-stat-suffix {
  font-size: var(--text-sm);
  color: var(--text-2);
  font-weight: var(--weight-medium);
  margin-left: 1px;
}

/* Position footer chip */
.eq-position {
  display: flex;
  justify-content: center;
}

/* ── Gear panel ──────────────────────────────────────────── */

.eq-gear {
  padding: var(--sp-3);
}

/* Override the existing .gear-tabs / .gear-tab from detail.css
   with sturdier sizes so they read like real tabs, not text links */
.eq-gear .gear-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-1);
  padding: 4px;
  background: var(--surface-1);
  border-radius: 8px;
  margin-bottom: var(--sp-3);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}
.eq-gear .gear-tab {
  padding: var(--sp-2) var(--sp-1);
  min-height: 52px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-2);
  font-family: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
  position: relative;
}
.eq-gear .gear-tab:hover { color: var(--text-1); background: var(--surface-3); }
.eq-gear .gear-tab.active {
  background: var(--surface-3);
  color: var(--accent-gold);
  border-color: var(--border-strong);
  font-weight: var(--weight-bold);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 0 8px rgba(255, 215, 0, 0.15);
}
.eq-gear .gear-tab-icon { font-size: var(--text-lg); line-height: 1; }
.eq-gear .gear-tab-badge {
  font-size: 10px;
  color: var(--text-2);
  font-weight: var(--weight-normal);
  margin-top: 1px;
  letter-spacing: 0.2px;
}
.eq-gear .gear-tab.active .gear-tab-badge { color: var(--accent-gold); }

/* Gear section: equipped item card + level buttons + rarity upgrade
   Overrides the flat .weapon-row treatment with something game-sized */
.eq-gear .gear-section { margin: 0; }

.eq-gear .weapon-row.equipped {
  display: grid;
  grid-template-columns: var(--icon-xl) 1fr;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3);
  background: var(--inset-bg);
  border: var(--inset-border);
  border-radius: 8px;
  box-shadow: var(--inset-shadow);
  margin-bottom: var(--sp-3);
}
/* Gear icon slot on the equipped item card — reuses .slot from base.css,
   sized to sz-icon-xl (56px), gets rarity-tinted via data-rarity. */
.eq-gear .gear-slot {
  background: linear-gradient(180deg, #14171d 0%, #0b0d12 100%);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.55),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}
.eq-gear .weapon-info { min-width: 0; }
.eq-gear .weapon-name {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: 1.15;
  margin-bottom: 2px;
}
.eq-gear .weapon-stats {
  font-size: var(--text-sm);
  color: var(--text-2);
  margin-top: 0;
}

.eq-gear .weapon-mat-have {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 4px var(--sp-2);
  background: var(--surface-2);
  border: 1px solid var(--border-hair);
  border-radius: 999px;
  font-size: var(--text-xs);
  color: var(--text-1);
  margin-bottom: var(--sp-2);
}

.eq-gear .weapon-level-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-1);
  margin-bottom: var(--sp-3);
}
.eq-gear .weapon-level-btn {
  padding: var(--sp-2) var(--sp-1);
  background: var(--surface-4);
  color: var(--text-1);
  border: 1px solid var(--border-hair);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.eq-gear .weapon-level-btn:hover:not(:disabled) {
  background: #4a5262;
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.eq-gear .weapon-level-btn:disabled {
  background: var(--surface-1);
  color: var(--text-2);
  cursor: not-allowed;
  opacity: 0.55;
}
.eq-gear .weapon-level-btn .btn-label {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--accent-gold);
}
.eq-gear .weapon-level-btn:disabled .btn-label { color: var(--text-2); }
.eq-gear .weapon-level-btn .btn-cost {
  font-size: 10px;
  color: var(--text-2);
  line-height: 1.15;
  text-align: center;
}

.eq-gear .tier-upgrade-btn {
  width: 100%;
  padding: var(--sp-3);
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(0,0,0,0.15) 100%);
  border: 2px solid;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: background var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.eq-gear .tier-upgrade-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0.1) 100%);
  transform: translateY(-1px);
  box-shadow: 0 0 16px currentColor;
}
.eq-gear .tier-upgrade-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.eq-gear .tier-upgrade-btn .btn-label {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.eq-gear .tier-upgrade-btn .btn-cost {
  font-size: var(--text-xs);
  color: var(--text-2);
}
.eq-gear .tier-upgrade-max {
  padding: var(--sp-3);
  background: var(--inset-bg);
  border: var(--inset-border);
  border-radius: 8px;
  text-align: center;
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  letter-spacing: 0.5px;
}

/* ── Awaken action button ─────────────────────────────────── */

.eq-actions { display: block; }
.eq-awaken-btn {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border-hair);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: background var(--dur-normal), transform var(--dur-fast), box-shadow var(--dur-normal);
  min-height: 64px;
  justify-content: center;
}
.eq-awaken-btn:disabled { cursor: not-allowed; }
.eq-awaken-btn.is-ready {
  background: linear-gradient(180deg, #b8860b 0%, #7a5a08 100%);
  border-color: var(--accent-gold);
  color: #14161a;
  box-shadow:
    0 0 20px rgba(255, 215, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: eq-awaken-pulse 2.2s ease-in-out infinite;
}
.eq-awaken-btn.is-ready:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 28px rgba(255, 215, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
@keyframes eq-awaken-pulse {
  0%, 100% { box-shadow: 0 0 18px rgba(255, 215, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
  50%      { box-shadow: 0 0 30px rgba(255, 215, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
}
.eq-awaken-label {
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  letter-spacing: 1px;
  line-height: 1;
}
.eq-awaken-cost {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  opacity: 0.85;
  letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════════════════
   (Roster styles now live in the .characters-panel block above)
   ═══════════════════════════════════════════════════════════ */
