@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;700&display=swap');

/* ==========================================================================
   1. DESIGN TOKENS & CSS VARIABLES
   ========================================================================== */

:root {
  /* "Panel oscuro": graphite surfaces, one yellow accent. Native controls (selects, scrollbars) dark too */
  color-scheme: dark;

  /* Surface Colors */
  --bg-primary: #111214;
  --bg-secondary: #1a1b1f;
  --bg-card: #18191c;
  --bg-elevated: #1f2024;
  --border-color: #26282c;
  --border-hover: #3a3c42;
  --divider: #222428;

  --text-main: #e8e8ea;
  --text-muted: #8a8b91;
  --text-faint: #5d5f66;

  /* Game-Accurate Ability Colors */
  --color-gadget: #28a745;
  --color-starpower: #ffcc00;
  --color-gear: #007bff;
  --color-hypercharge: #a600ff;
  --color-buffie: #00e5ff;

  /* Semantic */
  --accent: #ffc400;
  --accent-light: rgba(255, 196, 0, 0.12);
  --success: #1b9c45;
  --warning: #cc8e00;
  --danger: #d9264c;

  /* Rarity Colors */
  --rarity-starting: #7e7e80;
  --rarity-rare: #1f9e28;
  --rarity-super-rare: #0066cc;
  --rarity-epic: #a300cc;
  --rarity-mythic: #d60047;
  --rarity-legendary: #d98200;
  --rarity-ultra-legendary: #ff6b2b;

  /* Typography */
  --font-main: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Elevations: flat panels, only floating things (menus, modals) cast a shadow */
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.5);
  --side: 224px; /* side menu width */
  --shadow-card-dark: 0 8px 24px rgba(0,0,0,0.45);

  /* Radii scale */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Motion */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

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

body {
  background-color: var(--bg-primary);
  padding-left: var(--side);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 60px;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   3. HEADER
   ========================================================================== */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 24px;
  background: rgba(240, 238, 246, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

/* Same width as .container, so the content lines up with the page */
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

#btn-api-tag {
  padding: 8px 11px;
}

/* Header dropdown ("Datos": export / import) */
.header-menu {
  position: relative;
}

.header-menu > summary {
  list-style: none;
}

.header-menu > summary::-webkit-details-marker {
  display: none;
}

.header-menu-caret {
  transition: transform var(--transition-fast);
}

.header-menu[open] .header-menu-caret {
  transform: rotate(180deg);
}

.header-menu-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 110;
  min-width: 190px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  text-align: left;
}

.header-menu-item {
  font-family: var(--font-main);
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.header-menu-item:hover {
  background: var(--divider);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  background: linear-gradient(135deg, #ffcc00, #ff8400);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 132, 0, 0.25);
  transform: rotate(-5deg);
  flex-shrink: 0;
}

.logo-icon svg {
  width: 26px;
  height: 26px;
  fill: #ffffff;
}

.logo-title h1 {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-main) 30%, #ff8400 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.logo-title p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Global Header Trophy Pill */
.header-trophy-pill {
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 3px 10px rgba(255, 140, 0, 0.25);
  text-transform: uppercase;
  flex-shrink: 0;
}

.header-trophy-pill svg {
  width: 14px;
  height: 14px;
  fill: #ffffff;
}

/* ==========================================================================
   4. BUTTONS
   ========================================================================== */

.btn {
  font-family: var(--font-main);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}

.btn:hover {
  background-color: #fcfbfe;
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #00b0ff, #0080ff);
  border: none;
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(0, 128, 255, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #00c0ff, #0090ff);
  color: #ffffff;
  box-shadow: 0 5px 16px rgba(0, 128, 255, 0.35);
}

.btn-accent {
  background: linear-gradient(135deg, #ffcc00, #ff9000);
  border: none;
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(255, 144, 0, 0.25);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #ffd726, #ffa200);
  color: #ffffff;
  box-shadow: 0 5px 16px rgba(255, 144, 0, 0.35);
}

.btn-danger {
  background: rgba(217, 38, 76, 0.06);
  border-color: rgba(217, 38, 76, 0.18);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
  box-shadow: 0 3px 12px rgba(217, 38, 76, 0.25);
}

/* ==========================================================================
   5. GLOBAL PROGRESS BANNER
   ========================================================================== */

.global-progress-banner {
  background: linear-gradient(135deg, #18191c 0%, #18191c 100%);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: var(--radius-xl);
  padding: 24px 28px 20px;
  margin-bottom: 28px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

/* Subtle radial glow behind the banner */
.global-progress-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.banner-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.banner-title-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.35);
  flex-shrink: 0;
}

.banner-icon svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
}

.banner-badge-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.banner-badge-wrapper h2 {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.preset-pill {
  background: linear-gradient(135deg, #00b0ff, #0070ff);
  color: #ffffff;
  padding: 3px 10px;
  border-radius: var(--radius-md);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 112, 255, 0.3);
}

.banner-title-area p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
  margin-top: 2px;
}

.banner-stat-box {
  text-align: right;
}

.banner-percentage {
  font-size: 40px;
  font-weight: 950;
  background: linear-gradient(135deg, #ffffff 0%, #ffd700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.banner-stat-sub {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 1px;
  margin-top: 2px;
}

.banner-bar-bg {
  height: 10px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.banner-bar-fill {
  height: 100%;
  border-radius: 5px;
  width: 0%;
  background: linear-gradient(90deg, #00b0ff, #00ffcc, #ffd700);
  transition: width 0.8s cubic-bezier(0.1, 0.8, 0.3, 1);
  box-shadow: 0 0 12px rgba(0, 255, 204, 0.5);
}

/* ==========================================================================
   6. DASHBOARD GRID & CARDS
   ========================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 24px;
  margin-bottom: 28px;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--divider);
  padding-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-main);
}

.card-title svg {
  width: 20px;
  height: 20px;
  fill: var(--accent);
  flex-shrink: 0;
}

/* ==========================================================================
   7. INVENTORY CARD
   ========================================================================== */

.inventory-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.input-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrapper svg {
  position: absolute;
  left: 12px;
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 1;
}

.input-icon-wrapper input {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 12px 12px 42px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-main);
  transition: all var(--transition-fast);
}

.input-icon-wrapper input:focus {
  border-color: var(--accent);
  background-color: var(--bg-elevated);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Rates / Income Settings */
.rates-settings {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--divider);
}

.rates-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.rates-title-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

.rates-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rates-inputs input {
  padding: 8px 10px 8px 30px;
  font-size: 14px;
}

.rates-inputs .input-icon-wrapper svg {
  width: 16px;
  height: 16px;
  left: 8px;
}

/* Estimator Box */
.estimator-box {
  background: var(--accent-light);
  border: 1px solid rgba(255, 196, 0, 0.12);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 16px;
}

.estimator-box h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.estimator-box p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.estimator-box strong {
  color: var(--text-main);
  font-weight: 800;
}

/* ==========================================================================
   8. RESOURCES NEEDED CARD
   ========================================================================== */

.stats-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.resource-needed-box {
  background: rgba(255, 255, 255, 0.025);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--divider);
  position: relative;
}

.resource-needed-box.gold-box {
  border-left: 3px solid #ffcc00;
}

.resource-needed-box:not(.gold-box) {
  border-left: 3px solid #ff2a7a;
}

.res-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.res-value {
  font-size: 26px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}

.res-value svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.res-gold { color: #b38f00; }
.res-pp { color: #cc1a60; }

.res-details {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--divider);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.res-details span strong {
  color: var(--text-main);
  font-weight: 700;
}

/* ==========================================================================
   9. PROGRESS DONUTS
   ========================================================================== */

.progress-donuts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 12px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  border: 1px solid var(--divider);
}

@media (max-width: 480px) {
  .progress-donuts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.progress-donut-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  text-align: center;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  stroke: rgba(255, 255, 255, 0.06);
}

.progress-ring-fill {
  transition: stroke-dashoffset 0.8s cubic-bezier(0.1, 0.8, 0.3, 1);
  stroke-linecap: round;
}

.donut-center {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.donut-icon {
  font-size: 16px;
  line-height: 1;
  margin-bottom: 2px;
}

.donut-value {
  font-size: 12px;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1;
}

.donut-label {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  pointer-events: none;
}

/* ==========================================================================
   10. PROGRESS BARS (Prestige & Skins)
   ========================================================================== */

.progress-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.progress-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
}

.progress-label svg {
  width: 14px;
  height: 14px;
}

.progress-bar-bg {
  height: 8px;
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.1, 0.8, 0.3, 1);
  background: linear-gradient(to right, var(--accent), #00cdff);
}

/* Bottleneck Pills */
.bottleneck-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: 6px;
  letter-spacing: 0.3px;
}

.bottleneck-pill.pill-gold {
  background: rgba(255, 204, 0, 0.12);
  color: #b38f00;
  border: 1px solid rgba(255, 204, 0, 0.3);
}

.bottleneck-pill.pill-pp {
  background: rgba(255, 42, 122, 0.1);
  color: #cc1a60;
  border: 1px solid rgba(255, 42, 122, 0.3);
}

/* ==========================================================================
   11. CONTROLS PANEL (Filters, Sort, Presets)
   ========================================================================== */

.controls-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.controls-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 16px;
  align-items: flex-end;
}

@media (max-width: 900px) {
  .controls-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .controls-grid {
    grid-template-columns: 1fr;
  }
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-group label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Search */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrapper svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
  pointer-events: none;
}

.search-wrapper input {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 12px 10px 38px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-main);
  transition: all var(--transition-fast);
}

.search-wrapper input:focus {
  border-color: var(--accent);
  background-color: var(--bg-elevated);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Select */
select.select-control {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 32px 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%236e6b7d' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
}

select.select-control:focus {
  border-color: var(--accent);
  background-color: var(--bg-elevated);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-light);
}

.select-sm {
  padding: 4px 24px 4px 8px !important;
  font-size: 12px !important;
  height: 30px;
}

/* Milestone Tabs */
.milestone-tabs {
  display: flex;
  background-color: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  width: 100%;
}

.milestone-tab {
  flex: 1;
  font-family: var(--font-main);
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.milestone-tab:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.04);
}

.milestone-tab.active {
  background: linear-gradient(180deg, #ff9000 0%, #ff6c00 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 108, 0, 0.3);
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

/* ==========================================================================
   12. BRAWLER GRID
   ========================================================================== */

.brawlers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* ==========================================================================
   13. BRAWLER CARD
   ========================================================================== */

.brawler-card {
  background: linear-gradient(180deg, #1d1e22 0%, #141518 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.22s ease, border-color 0.2s ease;
  cursor: pointer;
  z-index: 1;
}

.brawler-card.menu-open {
  z-index: 200;
}

.brawler-card:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65), 0 0 16px rgba(255, 196, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.18);
}

.brawler-card.locked {
  opacity: 0.52;
  filter: grayscale(0.55);
}

.brawler-card.locked:hover {
  opacity: 0.75;
  filter: grayscale(0.3);
}

.brawler-card.locked .card-bottom-bar {
  pointer-events: none;
  opacity: 0.5;
}

/* Card Header Row */
.card-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 8px;
}

.card-portrait-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

.portrait-img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
  display: block;
}

.card-mastery-badge {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}

.card-title-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-brawler-name {
  color: #ffffff;
  text-transform: uppercase;
  font-weight: 900;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-power-badge {
  background-color: #24b547;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.card-sub-line {
  font-size: 11px;
  font-weight: 800;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-mastery-txt {
  color: #8a8895;
}

/* Trophy Display */
.card-trophy-display-yellow {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1.5px solid #ffaa00;
  background-color: rgba(255, 170, 0, 0.08);
  border-radius: 6px;
  padding: 4px 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.card-trophy-display-yellow svg {
  width: 18px;
  height: 18px;
  fill: #ffaa00;
  flex-shrink: 0;
}

/* ==========================================================================
   14. MASTERY PROGRESS TRACK
   ========================================================================== */

.card-mastery-track {
  padding: 0 16px;
  margin: 4px 0 10px;
  position: relative;
}

/* ==========================================================================
   15. ABILITY SLOTS
   ========================================================================== */

/* Status Strip: Skin Badge, Ranked Core, Prestige, and Cost Pill */
.card-status-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px 10px;
  flex-wrap: wrap;
}

.card-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 9.5px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.card-meta-pill svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}

.card-meta-pill.ranked {
  background: rgba(255, 196, 0, 0.18);
  color: #00d2ff;
  border: 1px solid rgba(0, 210, 255, 0.4);
}

.card-meta-pill.prestige {
  background: rgba(255, 215, 0, 0.18);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.4);
}

.card-cost-pill {
  margin-left: auto;
  font-size: 10px;
  font-weight: 850;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(255, 170, 0, 0.12);
  color: #ffaa00;
  border: 1px solid rgba(255, 170, 0, 0.35);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Equipment & Abilities Section */
.card-equipment-section {
  background: rgba(0, 0, 0, 0.24);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-section-label {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #6d6880;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
}

/* Primary Abilities Row: Star Powers, Gadgets, Hypercharge */
.card-abilities-main-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.card-ability-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 1px;
}

/* Icon paths use fill="currentColor", so each slot type sets `color` (setting `fill` on the <svg> is not enough) */

/* Secondary Row: Gears Strip & Buffies Strip */
.card-gears-buffies-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-gears-strip {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Buffies Strip & Chips */
.card-buffies-strip {
  display: flex;
  gap: 4px;
  align-items: center;
}

.card-buffie-chip {
  width: 23px;
  height: 23px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0.35;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
}

.card-buffie-chip.active {
  opacity: 1;
  background: rgba(0, 229, 255, 0.2);
  border-color: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  transform: scale(1.05);
}

/* Legacy Card Abilities Row (kept for backward compatibility) */
.card-abilities-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  margin-bottom: 6px;
}

/* ==========================================================================
   16. WIN STREAK PANEL
   ========================================================================== */

.card-streak-panel {
  padding: 8px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ==========================================================================
   17. BATTLES PANEL
   ========================================================================== */

.card-battles-panel {
  padding: 6px 16px 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ==========================================================================
   18. CARD FOOTER
   ========================================================================== */

.card-footer {
  padding: 8px 16px 12px;
}

.card-footer-bar {
  display: flex;
  align-items: stretch;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

.card-skin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: #8c889d;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
  user-select: none;
}

.card-skin-toggle svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.card-skin-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.card-skin-toggle.active {
  background: linear-gradient(135deg, rgba(166, 0, 255, 0.35) 0%, rgba(255, 0, 127, 0.35) 100%);
  color: #ff40bf;
  border-right-color: rgba(255, 0, 127, 0.3);
  text-shadow: 0 0 8px rgba(255, 0, 127, 0.5);
}

.card-skin-toggle.active svg {
  fill: #ff40bf;
  filter: drop-shadow(0 0 4px rgba(255, 0, 127, 0.6));
}

.card-footer-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: transparent;
  border: none;
  color: #928fa5;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
}

.card-footer-arrow {
  font-size: 12px;
  color: #726f85;
  transition: transform 0.2s ease, color 0.2s ease;
}

.card-footer-action:hover {
  color: #ffffff;
  background-color: rgba(255, 196, 0, 0.18);
}

.card-footer-action:hover .card-footer-arrow {
  transform: translateX(4px);
  color: #00d2ff;
}

.card-footer-action:hover .card-footer-arrow {
  transform: translateX(4px);
  color: #00d2ff;
}

/* ==========================================================================
   19. CARD MENU BUTTON & DROPDOWN
   ========================================================================== */

.card-menu-btn {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 24px;
  height: 24px;
  background-color: rgba(26, 26, 46, 0.75);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 5;
  transition: all 0.15s ease;
}

.card-menu-btn svg {
  width: 12px;
  height: 12px;
  fill: #8a8895;
}

.card-menu-btn:hover,
.card-menu-btn.active {
  background: #ffda44;
  border-color: #ffda44;
  box-shadow: 0 0 8px rgba(255, 218, 68, 0.5);
}

.card-menu-btn:hover svg,
.card-menu-btn.active svg {
  fill: #111214;
}

/* Dropdown Menu */
.brawler-menu-dropdown {
  position: absolute;
  top: 42px;
  right: 8px;
  width: 200px;
  background: rgba(16, 14, 36, 0.97);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.75), 0 0 16px rgba(255, 196, 0, 0.3);
  backdrop-filter: blur(14px);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  max-height: 240px;
  overflow-y: auto;
}

.brawler-menu-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ==========================================================================
   20. HOLOGRAPHIC MAXED CARD EFFECT
   ========================================================================== */

@keyframes holoGlow {
  0%   { border-color: #ff00ff; box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 12px rgba(255, 0, 255, 0.5); }
  33%  { border-color: #00ffff; box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 14px rgba(0, 255, 255, 0.6); }
  66%  { border-color: #ffff00; box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 12px rgba(255, 255, 0, 0.5); }
  100% { border-color: #ff00ff; box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 12px rgba(255, 0, 255, 0.5); }
}

.brawler-card.card-maxed-holographic {
  animation: holoGlow 3s infinite linear;
}

.brawler-card.card-maxed-holographic::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 11px;
  background: linear-gradient(125deg, rgba(255,255,255,0) 30%, rgba(255,255,255,0.12) 40%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.12) 60%, rgba(255,255,255,0) 70%);
  background-size: 250% 250%;
  animation: shunt 2.5s infinite linear;
  pointer-events: none;
  z-index: 5;
}

@keyframes shunt {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 200%; }
}

/* ==========================================================================
   21. LEGACY CARD ELEMENTS (from old layout, kept for compat)
   ========================================================================== */

/* Notes Badge */
.card-notes-badge {
  position: absolute;
  bottom: 30px;
  right: 8px;
  background: rgba(255, 174, 0, 0.2);
  border: 1px solid #ffae00;
  color: #ffae00;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
  z-index: 15;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.card-notes-badge svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}

/* Meta Badge */

/* Meta indicators */
.card-meta-indicators {
  position: absolute;
  bottom: 4px;
  left: 4px;
  display: flex;
  gap: 4px;
  z-index: 3;
}

/* Old card elements kept for backward compatibility */
.card-trophy-bar {
  background-color: #271c14;
  border-bottom: 2px solid #111214;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
  color: #ffda44;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  position: relative;
}

.card-trophy-input-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
}

.card-trophy-input-wrap svg {
  width: 11px;
  height: 11px;
  fill: #ffd214;
}

.card-trophy-input {
  width: 40px;
  background: transparent;
  border: none;
  color: #ffd214;
  font-size: 11px;
  font-weight: 950;
  outline: none;
  font-family: var(--font-main);
  padding: 0;
  margin: 0;
  text-align: left;
}

.card-trophy-input::-webkit-outer-spin-button,
.card-trophy-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.card-cost-wrap {
  font-size: 10px;
  color: #ffffff;
}

.card-cost-wrap span {
  color: #ffda44;
}

/* Card Portrait Area (old layout) */
.card-portrait-area {
  flex: 1;
  position: relative;
  background-color: #2e3035;
  overflow: hidden;
}

/* Fallback Portrait */
.portrait-fallback-bg {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  color: #ffffff;
  position: relative;
}

/* Card Name Plate */
.card-name-plate {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background-color: #000000;
  border: 1.5px solid #000000;
  border-radius: 4px;
  padding: 1px 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  z-index: 2;
  font-family: var(--font-main);
}

/* Old Bottom Level Bar */
.card-bottom-bar {
  height: 84px;
  border-top: 2px solid #111214;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 6px;
  position: relative;
  z-index: 2;
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.card-ability-slot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #111214;
  background-color: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  position: relative;
  box-shadow: inset 0 1.5px 3px rgba(0,0,0,0.4);
}

.card-ability-slot:hover {
  transform: scale(1.1);
  background-color: rgba(0, 0, 0, 0.6);
}

.card-ability-slot svg { width: 13px; height: 13px; }

/* Card Top Right Group */
.card-top-right-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Floating Compact Ability Badges */
.card-abilities-floating {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: flex;
  gap: 3px;
  z-index: 10;
  pointer-events: none;
}

/* 3D XP Bar */
.card-bottom-bar-xp {
  height: 34px;
  background-color: #111214;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  position: relative;
  z-index: 2;
  border-bottom-left-radius: 9px;
  border-bottom-right-radius: 9px;
}

.card-xp-bar-container {
  width: 100%;
  height: 16px;
  background-color: #0e0f11;
  border: 1.5px solid #1f2024;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.6);
}

.card-xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(180deg, #ff8c00, #d95d00);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4);
  transition: width 0.4s ease;
}

.card-xp-bar-fill.maxed {
  background: linear-gradient(180deg, #ee00ff, #8c00ff);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5), 0 0 5px rgba(238, 0, 255, 0.5);
}

.card-xp-bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: -0.2px;
  text-shadow: 0 1px 1.5px #000000, 0 1px 1.5px #000000;
  white-space: nowrap;
  z-index: 3;
  pointer-events: none;
}

/* ==========================================================================
   22. MODALS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--divider);
  padding-bottom: 14px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.2px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.dark-modal-content .modal-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.dark-modal-content .btn-close-modal {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.dark-modal-content .btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Form */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input, .form-group select {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-main);
  transition: all var(--transition-fast);
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--accent);
  background-color: var(--bg-elevated);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.checkbox-row label {
  margin-bottom: 0;
  cursor: pointer;
}

.hidden-file-input { display: none; }

/* ==========================================================================
   23. BRAWLER DETAIL MODAL (Dark Theme)
   ========================================================================== */

.modal-content.modal-lg {
  max-width: 680px;
  width: 95%;
}

.dark-modal-content {
  background: #18191c !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 196, 0, 0.4) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 24px rgba(255, 196, 0, 0.2) !important;
}

.dark-modal-content .modal-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dark-modal-content .modal-header h2 {
  color: #ffffff;
}

.dark-modal-content .detail-stat-card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.dark-modal-content .detail-stat-label {
  color: #c0c0d8;
}

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

.detail-top-layout {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 580px) {
  .detail-top-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.detail-portrait-box {
  position: relative;
  width: 140px;
  height: 160px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--accent);
  background: rgba(16, 14, 36, 0.8);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-portrait-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-status-pill {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 210, 255, 0.9);
  color: #000;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.detail-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.detail-stat-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.detail-lvl-num {
  font-size: 18px;
  font-weight: 900;
  color: var(--accent);
  min-width: 24px;
  text-align: center;
}

.detail-trophies-val {
  font-size: 18px;
  font-weight: 900;
  color: #ffd700;
}

/* Rarity badge */
.rarity-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #ffffff;
  background: var(--accent);
}

/* Section Titles */
.detail-section-title {
  font-size: 12px;
  font-weight: 800;
  color: #00d2ff;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 18px 0 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 6px;
}

/* Ability Controls Grid */

/* Buffies Grid (Modal) */

/* Official Abilities Showcase */

/* Investment Simulator Widget */

.modal-body-detail {
  position: relative;
}

.btn-close-modal {
  /* No special styling needed, uses .btn base */
}

/* ==========================================================================
   24. TOAST NOTIFICATIONS
   ========================================================================== */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--bg-elevated);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow-lg);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  transform: translateY(120%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  max-width: 400px;
}

.toast.active {
  transform: translateY(0);
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--accent); }

/* ==========================================================================
   25. EMPTY STATE
   ========================================================================== */

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-state svg {
  width: 56px;
  height: 56px;
  fill: var(--text-faint);
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 800;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 380px;
  font-size: 14px;
  line-height: 1.5;
}

/* ==========================================================================
   26. RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  .header-inner {
    justify-content: center;
    text-align: center;
    padding: 12px 24px;
  }

  .logo-area {
    justify-content: center;
  }

  .header-actions {
    justify-content: center;
    width: 100%;
  }

  .btn {
    padding: 7px 12px;
    font-size: 12px;
  }

  .banner-percentage {
    font-size: 32px;
  }

  .stats-summary {
    grid-template-columns: 1fr;
  }

  .brawlers-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .header-inner {
    padding: 12px;
  }

  .logo-title h1 {
    font-size: 20px;
  }

  .global-progress-banner {
    padding: 16px 16px 14px;
  }

  .banner-badge-wrapper h2 {
    font-size: 18px;
  }

  .card {
    padding: 16px;
  }

  .brawlers-grid {
    grid-template-columns: 1fr;
  }

  .inventory-inputs {
    grid-template-columns: 1fr;
  }

  .controls-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   27. ACCESSIBILITY & FOCUS
   ========================================================================== */

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================================================
   28. UTILITY & ANIMATION HELPERS
   ========================================================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brawler-card {
  animation: fadeInUp 0.3s ease both;
}

/* Stagger animation for cards */
.brawler-card:nth-child(1) { animation-delay: 0.02s; }
.brawler-card:nth-child(2) { animation-delay: 0.04s; }
.brawler-card:nth-child(3) { animation-delay: 0.06s; }
.brawler-card:nth-child(4) { animation-delay: 0.08s; }
.brawler-card:nth-child(5) { animation-delay: 0.10s; }
.brawler-card:nth-child(6) { animation-delay: 0.12s; }
.brawler-card:nth-child(7) { animation-delay: 0.14s; }
.brawler-card:nth-child(8) { animation-delay: 0.16s; }
.brawler-card:nth-child(9) { animation-delay: 0.18s; }

/* ==========================================================================
   29. BRAWLER CARD v2 (bc-*)
   Dark card, rarity shown as a thin accent + label, "what's missing" chips,
   cost + progress footer. Rendered by cardBodyHtml() / updateBrawlerCard().
   ========================================================================== */

.brawlers-grid {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.brawler-card.bc {
  --rarity: var(--rarity-starting);
  --rarity-text: #c9c9d1;
  background: #18191c;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 3px solid var(--rarity);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  color: #e8e8ea;
  gap: 0;
}

.brawler-card.bc:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.16);
  border-top-color: var(--rarity);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.brawler-card.bc:focus-within {
  border-color: rgba(255, 255, 255, 0.2);
  border-top-color: var(--rarity);
}

.bc-rarity-starting        { --rarity: var(--rarity-starting);        --rarity-text: #b9d6e6; }
.bc-rarity-rare            { --rarity: var(--rarity-rare);            --rarity-text: #6fe06a; }
.bc-rarity-super-rare      { --rarity: var(--rarity-super-rare);      --rarity-text: #6cb6ff; }
.bc-rarity-epic            { --rarity: var(--rarity-epic);            --rarity-text: #dc7bff; }
.bc-rarity-mythic          { --rarity: var(--rarity-mythic);          --rarity-text: #ff7a8e; }
.bc-rarity-legendary       { --rarity: var(--rarity-legendary);       --rarity-text: #ffd24a; }
.bc-rarity-ultra-legendary { --rarity: var(--rarity-ultra-legendary); --rarity-text: #ff9a66; }

/* Goal reached: calm gold edge instead of the old looping holo animation */
.brawler-card.bc.bc-done {
  border-color: rgba(255, 204, 0, 0.35);
  border-top-color: var(--rarity);
}

.brawler-card.bc.locked {
  opacity: 0.55;
  filter: grayscale(0.6);
}

/* Header */
.bc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 10px;
}

.bc-portrait {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #0e0f11;
  box-shadow: 0 0 0 2px var(--rarity);
}

.bc-portrait .portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bc-portrait .portrait-fallback-bg {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--rarity);
  font-size: 20px;
}

.bc-portrait-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #ff6b6b;
}

.bc-portrait-lock svg {
  width: 18px;
  height: 18px;
}

.bc-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bc-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.bc-name {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bc-power {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #d6d7db;
}

.bc-power.max {
  background: linear-gradient(135deg, #ffd700, #ff9f00);
  color: #2a1d00;
}

.bc-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  min-width: 0;
}

.bc-rarity {
  color: var(--rarity-text);
  white-space: nowrap;
}

/* Trophies: compact inline field (resets the legacy boxed style) */
.bc-trophies.card-trophy-display-yellow {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0;
  padding: 1px 4px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #ffb938;
}

.bc-trophies.card-trophy-display-yellow svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.bc-trophies-val {
  font-size: 12px;
  font-weight: 900;
}

/* Header flags: ranked / prestige / skin toggle */
.bc-flags {
  display: flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
}

.bc-flag {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  padding: 0;
}

.bc-flag svg {
  width: 14px;
  height: 14px;
}

.bc-flag-ranked { color: #3fd0ff; background: rgba(63, 208, 255, 0.12); }
.bc-flag-prestige { color: #ffd23f; background: rgba(255, 210, 63, 0.12); }

.bc-flag-skin {
  color: #5a5c62;
  border-color: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.bc-flag-skin:hover { color: #b4b5ba; border-color: rgba(255, 255, 255, 0.2); }
.bc-flag-skin.on { color: #ff6ad5; background: rgba(255, 106, 213, 0.14); border-color: rgba(255, 106, 213, 0.4); }
.bc-flag-skin:focus-visible { outline: 2px solid #ff6ad5; outline-offset: 1px; }

/* Kit: ability groups */
.bc-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.bc-kit {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 0 14px;
  padding: 10px 10px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.bc-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.bc-slots {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
}

.bc-group-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #75767d;
  white-space: nowrap;
}

.bc-slot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-sizing: border-box;
  border: 1.5px dashed rgba(255, 255, 255, 0.12);
  color: #45474d;
}

.bc-slot svg {
  width: 12px;
  height: 12px;
}

.bc-slot .slot-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.bc-slot.owned {
  border-style: solid;
  border-width: 2px;
  background: #222428;
}

.bc-slot.owned svg {
  width: 16px;
  height: 16px;
}

.bc-slot-starpower.owned   { border-color: var(--color-starpower); color: var(--color-starpower); }
.bc-slot-gadget.owned      { border-color: var(--color-gadget); color: #3ddc6a; }
.bc-slot-hypercharge.owned { border-color: #c04bff; color: #d77bff; background: rgba(166, 0, 255, 0.2); }

.bc-slot-gear {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.bc-slot-gear.owned { border-color: #3d8bff; color: #6aa8ff; }
.bc-slot-gear.owned svg { width: 14px; height: 14px; }
.bc-slot-gear .slot-icon { padding: 2px; box-sizing: border-box; }

.bc-slot-na {
  border-style: dotted;
  color: #45474d;
  font-weight: 900;
  font-size: 12px;
}

.bc-gear-extra {
  font-size: 10px;
  font-weight: 900;
  color: #6aa8ff;
}

.bc-group-gears .card-gear-count {
  color: #96979d;
}

/* Buffie dot next to the SP / Gadget / HC label */
.bc-buffie {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.4);
  display: inline-block;
}

.bc-buffie.on {
  background: var(--color-buffie);
  border-color: var(--color-buffie);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.7);
}

/* What's missing for the goal */
.bc-missing {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px 14px 0;
  min-height: 22px;
}

.bc-chip {
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 7px;
  border-radius: 6px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.07);
  color: #d6d7db;
}

.bc-chip-level       { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
.bc-chip-gadget      { background: rgba(40, 167, 69, 0.16); color: #5fe38a; }
.bc-chip-starpower   { background: rgba(255, 204, 0, 0.14); color: #ffd84d; }
.bc-chip-gear        { background: rgba(61, 139, 255, 0.16); color: #7db4ff; }
.bc-chip-hypercharge { background: rgba(166, 0, 255, 0.18); color: #d98bff; }
.bc-chip-buffie      { background: rgba(0, 229, 255, 0.12); color: #6ff0ff; }

.bc-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  color: #8a8b91;
}

.bc-note svg {
  width: 13px;
  height: 13px;
}

.bc-note-done {
  color: #4cd97b;
}

/* Footer: pending cost + progress */
.bc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 10px;
  margin-top: auto;
}

.bc-costs {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bc-cost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.bc-cost i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.bc-cost-gold { color: #ffc93c; }
.bc-cost-gold i { background: radial-gradient(circle at 35% 35%, #fff2a8, #f0a800); }
.bc-cost-pp { color: #ff8ad0; }
.bc-cost-pp i { background: radial-gradient(circle at 35% 35%, #ffd0ee, #e0409e); }

.bc-cost-muted {
  font-size: 11px;
  font-weight: 800;
  color: #6c6d74;
}

.bc-pct {
  font-size: 12px;
  font-weight: 900;
  color: #96979d;
}

.bc-done .bc-pct { color: #ffd23f; }

.bc-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.bc-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rarity), #ffd23f);
  transition: width 0.3s ease;
}

.bc-done .bc-progress span {
  background: linear-gradient(90deg, #ffb400, #ffe066);
}

@media (prefers-reduced-motion: reduce) {
  .brawler-card.bc,
  .brawler-card.bc:hover {
    animation: none;
    transition: none;
    transform: none;
  }
}

/* ==========================================================================
   30. UPGRADE RECOMMENDER (reco-*)
   ========================================================================== */

.btn-recommend {
  background: linear-gradient(135deg, #2c2e33, #18191c);
  border: none;
  color: #ffd84d;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}

.btn-recommend:hover {
  background: linear-gradient(135deg, #34363c, #1d1e22);
  color: #ffe27a;
}

.reco-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ffd23f;
  color: #2a1d00;
  font-size: 11px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
}

.reco-modal.modal-content {
  max-width: 720px;
}

.reco-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #a3a4aa;
}

.reco-control select {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: #222428;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 6px 10px;
}


.reco-headline {
  margin: 14px 0 10px;
  font-size: 13px;
  color: #c4c5ca;
}

.reco-headline strong {
  color: #ffffff;
}

.reco-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reco-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #1d1e22;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.reco-rank {
  width: 22px;
  flex-shrink: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  color: #6c6d74;
}

.reco-portrait {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 9px;
  object-fit: cover;
  background: #0e0f11;
}

.reco-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reco-name {
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  color: #ffffff;
}

.reco-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.reco-cost {
  display: inline-flex;
  gap: 10px;
}

.reco-footnote {
  margin: 18px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: #75767d;
}

/* Recommendations: "Gustos ↔ Coste" slider, next step, reason */
.reco-alpha {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.reco-alpha label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #8a8b91;
}

.reco-alpha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  color: #c4c5ca;
}

.reco-alpha-row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: #ffd84d;
  cursor: pointer;
}

.reco-alpha small {
  font-size: 12px;
  font-weight: 800;
  color: #ffd84d;
}

.reco-hint {
  margin: -4px 0 12px;
  font-size: 12px;
  color: #a3a4aa;
}

.reco-link {
  margin-left: 4px;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 800;
  color: #3fd0ff;
  text-decoration: underline;
  cursor: pointer;
}

.reco-item.reco-pinned {
  border-color: rgba(255, 216, 77, 0.45);
  background: linear-gradient(135deg, rgba(255, 216, 77, 0.10), #1d1e22 60%);
}

.reco-name small.reco-level {
  font-size: 11px;
  font-weight: 800;
  color: #8a8b91;
}

.reco-route {
  margin-left: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 216, 77, 0.16);
  color: #ffd84d;
  font-size: 10px;
  font-weight: 900;
  text-transform: none;
  white-space: nowrap;
}

.reco-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #a3a4aa;
}

.reco-next-label {
  font-weight: 800;
}

.reco-next-cost {
  display: inline-flex;
  gap: 8px;
}

.reco-ok,
.reco-lack {
  font-size: 11px;
  font-weight: 900;
}

.reco-ok { color: #4cd97b; }
.reco-lack { color: #ff7a8f; }
.reco-ok.reco-ok-alone { color: #ffcf70; }

/* "Recomendadas" / "Hacia nivel 9" */
.reco-views {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.reco-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #a3a4aa;
  font-family: var(--font-main);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.reco-view strong {
  font-size: 14px;
  font-weight: 900;
}

.reco-view small {
  font-size: 11px;
  font-weight: 700;
  color: #75767d;
}

.reco-view:hover {
  color: #ffffff;
}

.reco-view.active {
  background: #2c2e33;
  color: #ffd84d;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.reco-view.active small {
  color: #b4b5ba;
}

.reco-alpha[hidden],
.reco-footnote[hidden] {
  display: none;
}

.reco-item.reco-in-budget {
  border-color: rgba(76, 217, 123, 0.35);
}

.reco-reason {
  margin: 0;
  font-size: 12px;
  font-style: italic;
  color: #c4c5ca;
}

.reco-side-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #8a8b91;
}

.reco-score {
  min-width: 34px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(63, 208, 255, 0.14);
  color: #3fd0ff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  cursor: help;
}

@media (max-width: 560px) {
  .reco-item { flex-wrap: wrap; }
  .reco-rank { display: none; }
  .reco-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
}

/* Upgrade calculator (js/upgrade-calc.js) */
.calc-modal.modal-content {
  max-width: 820px;
}

.calc-modal .tl-toolbar select {
  flex: 1 1 220px;
  min-width: 0;
}

.calc-summary {
  position: sticky;
  top: -1px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 6px 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #2c2e33;
  border: 1px solid rgba(255, 216, 77, 0.3);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.calc-summary:empty { display: none; }

.calc-total {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calc-total-cost {
  display: inline-flex;
  gap: 14px;
}

.calc-total-cost .bc-cost {
  font-size: 20px;
}

.calc-total-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 12px;
  color: #a3a4aa;
}

.calc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #1d1e22;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.calc-row-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calc-row-name {
  flex: 1;
  min-width: 0;
}

.calc-row-name small {
  font-size: 12px;
  font-weight: 700;
  color: #8a8b91;
}

.calc-row-name small b {
  color: #ffd84d;
}

.calc-row-cost {
  display: inline-flex;
  gap: 10px;
}

.calc-remove {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #a3a4aa;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.calc-remove:hover {
  background: rgba(255, 122, 143, 0.18);
  color: #ff7a8f;
}

.calc-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calc-opt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
}

.calc-opt-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #8a8b91;
}

.calc-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calc-stepper b {
  min-width: 18px;
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  color: #ffffff;
}

.calc-stepper button,
.calc-toggle {
  min-width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: #222428;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.calc-toggle {
  padding: 0 10px;
  font-size: 12px;
  color: #a3a4aa;
}

.calc-toggle.on {
  background: rgba(166, 0, 255, 0.25);
  border-color: rgba(217, 139, 255, 0.5);
  color: #d98bff;
}

.calc-stepper button:hover:not(:disabled),
.calc-toggle:hover:not(:disabled) {
  border-color: #ffd84d;
}

.calc-stepper button:disabled,
.calc-toggle:disabled {
  opacity: 0.35;
  cursor: default;
}

.calc-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.calc-part {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calc-note {
  font-size: 11px;
  font-weight: 900;
  color: #ffcf70;
}

.calc-note-muted {
  color: #75767d;
}

@media (max-width: 560px) {
  .calc-row-head { flex-wrap: wrap; }
  .calc-row-cost { order: 3; width: 100%; }
  .calc-total-status { align-items: flex-start; }
}

/* Personal tier badge (lt-*), shown next to brawler names everywhere */
.lt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  margin-left: 5px;
  border-radius: 5px;
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
  text-transform: none;
  letter-spacing: 0;
  flex-shrink: 0;
}

.lt-S { background: #ff4d6d; color: #ffffff; }
.lt-A { background: #ff9a3d; color: #2a1200; }
.lt-B { background: #ffd84d; color: #2a1d00; }
.lt-C { background: #4cd97b; color: #062b14; }
.lt-D { background: #5b8cff; color: #ffffff; }
.lt-badge.lt-unset { opacity: 0.45; }

.bc-like:empty { display: none; }
.bc-like .lt-badge { margin-left: 0; }
.detail-like .lt-badge { height: 22px; min-width: 22px; font-size: 13px; }

/* Tier list page */
.tl-modal.modal-content {
  position: relative;
  max-width: 980px;
}

.tl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 8px;
}

.tl-toolbar input,
.tl-toolbar select {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: #222428;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 7px 10px;
}

.tl-toolbar input {
  flex: 1 1 180px;
  min-width: 0;
}

.tl-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 800;
  color: #a3a4aa;
}

.tl-help {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #8a8b91;
}

.tl-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tl-row {
  display: flex;
  align-items: stretch;
  min-height: 64px;
  border-radius: 12px;
  background: #1d1e22;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tl-row.tl-over {
  border-color: #ffd84d;
  background: #2a2c30;
}

.tl-row-none {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-style: dashed;
}

.tl-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 92px;
  flex-shrink: 0;
  padding: 6px;
  text-align: center;
}

.tl-label strong {
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.tl-label small {
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.tl-label-none {
  background: rgba(255, 255, 255, 0.05);
  color: #a3a4aa;
}

.tl-label-none strong { font-size: 13px; }

.tl-zone {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  padding: 8px;
  min-width: 0;
}

.tl-empty {
  align-self: center;
  font-size: 12px;
  font-weight: 700;
  color: #5f5a73;
}

.tl-row:not(.tl-row-empty) .tl-empty { display: none; }

.tl-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 66px;
  padding: 5px 3px 4px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #26282c;
  color: #ffffff;
  font-family: var(--font-main);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

body.viewer-mode .tl-chip { cursor: default; }

.tl-chip img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #0e0f11;
  pointer-events: none;
}

.tl-chip span {
  max-width: 100%;
  overflow: hidden;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tl-chip:hover { border-color: rgba(255, 216, 77, 0.5); }
.tl-chip:focus-visible { outline: 2px solid #ffd84d; outline-offset: 2px; }
.tl-chip.tl-locked { opacity: 0.5; }
.tl-chip.tl-hidden { display: none; }
.tl-chip.tl-dragging { opacity: 0.25; }
.tl-chip.tl-pressing { transform: scale(0.94); }
.tl-chip.tl-moved { animation: tl-pop 0.5s ease; }

@keyframes tl-pop {
  0% { transform: scale(0.8); border-color: #ffd84d; }
  60% { transform: scale(1.08); border-color: #ffd84d; }
  100% { transform: scale(1); }
}

.tl-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  pointer-events: none;
  cursor: grabbing;
  border-color: #ffd84d;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  opacity: 0.95;
}

body.tl-drag-on,
body.tl-drag-on * {
  cursor: grabbing !important;
}

.tl-menu {
  position: absolute;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 16px);
  padding: 8px 10px;
  border-radius: 10px;
  background: #2c2e33;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.tl-menu[hidden] { display: none; }

.tl-menu-title {
  width: 100%;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  color: #a3a4aa;
}

.tl-menu .lt-badge {
  min-width: 32px;
  height: 32px;
  margin: 0;
  border: 2px solid transparent;
  font-size: 15px;
  cursor: pointer;
}

.tl-menu-clear {
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.tl-menu .tl-current { border-color: #ffffff; }
.tl-menu button:focus-visible { outline: 2px solid #3fd0ff; outline-offset: 2px; }

@media (max-width: 560px) {
  .tl-label { width: 58px; }
  .tl-label strong { font-size: 20px; }
  .tl-label small { display: none; }
  .tl-label-none strong { font-size: 11px; }
  .tl-chip { width: 58px; }
  .tl-chip img { width: 38px; height: 38px; }
  .tl-count { width: 100%; margin-left: 0; }
}

/* Challenge roulette: chance per candidate and tier weights in the settings */
.ch-chance {
  font-size: 11px;
  font-weight: 900;
  color: #ffd84d;
}

.ch-weights-title {
  margin-top: 14px;
}

.ch-weight span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ch-weight .lt-badge { margin-left: 0; }

/* Segmented tabs (statistics modal) */
.reco-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.reco-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #a3a4aa;
  font-family: var(--font-main);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.reco-tab strong {
  font-size: 14px;
  font-weight: 900;
}

.reco-tab small {
  font-size: 11px;
  font-weight: 700;
  color: #75767d;
}

.reco-tab:hover {
  color: #ffffff;
}

.reco-tab.active {
  background: #2c2e33;
  color: #ffd84d;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.reco-tab.active small {
  color: #b4b5ba;
}

.reco-tab:focus-visible {
  outline: 2px solid #ffd84d;
  outline-offset: 2px;
}

.donut-count {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text-muted);
}

/* Detail modal: "charge upgrades to the inventory" toggle */

/* ==========================================================================
   31. PUBLIC DEPLOYMENT: viewer mode + fan content footer
   ========================================================================== */

.viewer-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: #18191c;
  color: #d6d7db;
  font-size: 13px;
  line-height: 1.4;
}

.viewer-banner strong {
  color: #ffd84d;
}

body.viewer-mode .viewer-banner {
  display: flex;
}

/* Editing controls are hidden or inert for visitors (nothing they do is saved anyway) */
body.viewer-mode #data-menu,
body.viewer-mode #btn-api-sync,
body.viewer-mode #btn-api-tag {
  display: none !important;
}

body.viewer-mode .card-skin-toggle {
  pointer-events: none;
}

.app-footer {
  margin: 32px 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  color: var(--text-muted);
}

.app-footer a {
  color: inherit;
  text-decoration: underline;
}

/* ==========================================================================
   32. STATS PANEL (st-*) - rendered by js/stats.js
   ========================================================================== */

.stats-modal.modal-content {
  max-width: 960px;
}

.st-tracking {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #a3a4aa;
}

.st-tracking strong {
  color: #ffffff;
}

.st-poll {
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 900;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid rgba(63, 208, 255, 0.45);
  background: rgba(63, 208, 255, 0.12);
  color: #3fd0ff;
  cursor: pointer;
}

.st-tabs.reco-tabs {
  grid-template-columns: repeat(4, 1fr);
}

.st-muted {
  color: #8a8b91;
  font-size: 12px;
}

.st-note {
  margin: 0 0 12px;
}

.st-empty {
  padding: 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #c4c5ca;
  font-size: 13px;
  line-height: 1.5;
}

.st-pos { color: #4cd97b; }
.st-neg { color: #ff6b81; }

.st-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.st-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.st-tile-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #8a8b91;
}

.st-tile-value {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
}

.st-tile-sub {
  font-size: 11px;
  color: #a3a4aa;
}

.st-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.st-card {
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #1d1e22;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.st-card h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #d6d7db;
}

.st-card h3 small {
  color: #8a8b91;
}

.st-chart {
  display: block;
  width: 100%;
  height: 120px;
}

.st-chart-line {
  fill: none;
  stroke: #ffc93c;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.st-chart-area {
  fill: rgba(255, 201, 60, 0.12);
}

.st-chart-axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 10px;
  color: #8a8b91;
}

.st-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
}

.st-bar {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.st-bar-total {
  display: flex;
  align-items: flex-end;
  width: 100%;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: rgba(255, 107, 129, 0.55);
  overflow: hidden;
}

.st-bar-wins {
  display: block;
  width: 100%;
  background: #4cd97b;
}

.st-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 3px 0 8px;
  border-radius: 2px;
  background: rgba(255, 107, 129, 0.55);
}

.st-dot-win {
  background: #4cd97b;
}

.st-modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.st-mode {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 2fr auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.st-mode-name {
  font-weight: 800;
  color: #ffffff;
}

.st-mode-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.st-mode-bar span {
  display: block;
  height: 100%;
  background: #4cd97b;
}

.st-mode-num {
  color: #a3a4aa;
  white-space: nowrap;
}

.st-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.st-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: #d6d7db;
}

.st-table th {
  position: sticky;
  top: 0;
  padding: 9px 10px;
  background: #222428;
  text-align: left;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #a3a4aa;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.st-table th:hover {
  color: #ffffff;
}

.st-table td {
  padding: 7px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}

.st-table td small {
  color: #8a8b91;
}

.st-brawler {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: #ffffff;
}

.st-brawler img,
.st-list img,
.st-battle img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
  background: #0e0f11;
  flex-shrink: 0;
}

.st-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.st-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #c4c5ca;
}

.st-list strong {
  color: #ffffff;
}

.st-list em {
  font-style: normal;
  color: #ffd84d;
}

.st-battles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.st-battle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #1d1e22;
  border-left: 3px solid #6c6d74;
  font-size: 12px;
}

.st-battle-victory { border-left-color: #4cd97b; }
.st-battle-defeat { border-left-color: #ff6b81; }

.st-battle-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  color: #ffffff;
}

.st-battle-main small {
  color: #8a8b91;
}

.st-battle-result {
  font-weight: 800;
  color: #c4c5ca;
  white-space: nowrap;
}

.st-battle-trophies {
  min-width: 36px;
  text-align: right;
  font-weight: 900;
}

/* Detail modal stats line */
.detail-brawler-stats:empty {
  display: none;
}

.detail-brawler-stats {
  margin: 4px 0 0;
  font-size: 12px;
  color: #c4c5ca;
}

.detail-brawler-stats .detail-section-title small {
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: #8a8b91;
}

.dst-tiles {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin-bottom: 10px;
}

.dst-tiles .st-tile-value {
  font-size: 19px;
}

.dst-table th {
  cursor: default;
}

.dst-table td.dst-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dst-rate {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dst-rate .st-mode-bar {
  flex: 1;
  min-width: 60px;
}

.dst-rate strong {
  min-width: 44px;
  text-align: right;
  color: #ffffff;
}

.dst-table tr.dst-best td {
  background: rgba(76, 217, 123, 0.08);
}

.dst-table tr.dst-few td {
  color: #75767d;
}

.dst-table tr.dst-few .st-mode-bar span {
  background: #5d5870;
}

.dst-table tr.dst-few .dst-rate strong {
  color: #8a8b91;
}

.dst-best-tag {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(76, 217, 123, 0.16);
  color: #4cd97b;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.dst-empty,
.dst-foot {
  margin-top: 8px;
}

@media (max-width: 560px) {
  .st-tabs.reco-tabs { grid-template-columns: repeat(2, 1fr); }
  .st-mode { grid-template-columns: 1fr auto; }
  .st-mode-bar { display: none; }
}

/* Stats: month-by-month history */
.st-month-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.st-month-bar-row {
  display: grid;
  grid-template-columns: 170px 1fr 90px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.st-month-bar-label {
  font-weight: 800;
  color: #ffffff;
}

.st-month-bar-label small {
  color: #8a8b91;
  font-weight: 700;
}

.st-month-bar {
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.st-month-bar span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: 5px;
  background: linear-gradient(90deg, #ffb400, #ffe066);
}

.st-month-bar-num {
  font-weight: 900;
  color: #ffc93c;
  white-space: nowrap;
}

.st-month summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  cursor: pointer;
  list-style: none;
}

.st-month summary::-webkit-details-marker {
  display: none;
}

.st-month summary::before {
  content: '▸';
  color: #8a8b91;
  margin-right: 6px;
  transition: transform 0.15s ease;
}

.st-month[open] summary::before {
  transform: rotate(90deg);
  display: inline-block;
}

.st-month summary .st-month-title {
  flex: 1;
}

.st-month-title {
  font-size: 15px;
  font-weight: 900;
  color: #ffffff;
}

.st-best {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 201, 60, 0.16);
  color: #ffc93c;
  font-size: 11px;
}

.st-month[open] summary {
  margin-bottom: 12px;
}

.st-tiles-compact {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.st-tiles-compact .st-tile-value {
  font-size: 18px;
}

.st-subsection {
  margin-top: 12px;
}

.st-subsection h4 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #a3a4aa;
}

.st-subsection h4 small {
  color: #6c6d74;
}

/* Stats: month unlocks as colour-coded card grids (like Brawlify's timeline) */
.st-unlocks {
  --u: #a3a4aa;
  --u-bg: rgba(255, 255, 255, 0.05);
  margin-top: 18px;
}

.st-unlocks-new      { --u: #4cd97b; --u-bg: rgba(76, 217, 123, 0.10); }
.st-unlocks-power    { --u: #c084ff; --u-bg: rgba(166, 0, 255, 0.12); }
.st-unlocks-sp       { --u: #ffc93c; --u-bg: rgba(255, 201, 60, 0.10); }
.st-unlocks-gadget   { --u: #5fe38a; --u-bg: rgba(40, 167, 69, 0.12); }
.st-unlocks-hc       { --u: #e27bff; --u-bg: rgba(225, 0, 255, 0.10); }
.st-unlocks-gear     { --u: #9fc3ff; --u-bg: rgba(61, 139, 255, 0.10); }
.st-unlocks-rank     { --u: #ffb938; --u-bg: rgba(255, 185, 56, 0.10); }
.st-unlocks-buffie   { --u: #6ff0ff; --u-bg: rgba(0, 229, 255, 0.10); }
.st-unlocks-trophies { --u: #ff9a4d; --u-bg: rgba(255, 140, 60, 0.10); }
.st-unlocks-prestige { --u: #ffd23f; --u-bg: rgba(255, 210, 63, 0.10); }

.st-unlocks-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 900;
  color: var(--u);
}

.st-unlocks-count {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--u-bg);
  border: 1px solid var(--u);
  font-size: 13px;
  text-align: center;
}

.st-unlock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}

.st-unlock {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--u-bg);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.st-unlock-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.st-unlock-name {
  font-size: 15px;
  font-weight: 900;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-unlock-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.st-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--u);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid color-mix(in srgb, var(--u) 45%, transparent);
}

.st-pill-strong {
  background: var(--u);
  color: #18191c;
  border-color: var(--u);
}

.st-pill-muted {
  color: #a3a4aa;
  border-color: rgba(255, 255, 255, 0.12);
}

.st-pill-arrow {
  color: #8a8b91;
  font-weight: 900;
}

/* Portrait with the brawler's initial underneath (visible when the image can't load) */
.st-av {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #0e0f11;
  overflow: hidden;
}

.st-av::before {
  content: attr(data-initial);
  font-size: 13px;
  font-weight: 900;
  color: #8a8b91;
}

.st-av img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.st-av-lg {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  box-shadow: 0 0 0 2px var(--u, rgba(255, 255, 255, 0.1));
}

.st-av-lg::before {
  font-size: 18px;
}

@media (max-width: 560px) {
  .st-unlock-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   33. SEASON CHALLENGE (ch-*) - rendered by js/challenge-ui.js
   ========================================================================== */

.ch-modal.modal-content {
  max-width: 900px;
}

.ch-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 14px;
}

.ch-new {
  display: flex;
  gap: 6px;
}

.ch-new input,
.ch-field input {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: #222428;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 6px 10px;
}

.ch-new input {
  width: 120px;
}

.ch-btn {
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 900;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #d6d7db;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ch-btn:hover:not(:disabled),
.ch-btn.active {
  background: #2c2e33;
  color: #ffd84d;
}

.ch-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.ch-btn-primary {
  border-color: rgba(255, 210, 63, 0.5);
  background: rgba(255, 210, 63, 0.14);
  color: #ffd23f;
}

.ch-btn-danger:hover:not(:disabled) {
  background: rgba(255, 107, 129, 0.14);
  color: #ff8a9b;
}

.ch-tiles {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* Rounds of a season: tabs + the button for the next round */
.ch-round-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.ch-round-tab {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 900;
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #a3a4aa;
  cursor: pointer;
}

.ch-round-tab:hover {
  color: #ffffff;
}

.ch-round-tab.active {
  background: #2c2e33;
  border-color: rgba(255, 210, 63, 0.5);
  color: #ffd84d;
}

/* The buttons after the tabs go to the right, together */
.ch-round-tabs .ch-round-tab + .ch-btn {
  margin-left: auto;
}

.ch-round-intro {
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #a3a4aa;
}

.ch-round-intro strong {
  color: #ffffff;
}

.ch-flag.ch-flag-close {
  color: #ffd23f;
}

.ch-target-type {
  display: block;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #8a8b91;
}

.ch-roll-cancelled {
  opacity: 0.5;
}

.ch-roll-cancelled .ch-roll-result {
  text-decoration: line-through;
}

.ch-cancelled-tag {
  color: #ff8a9b;
  text-transform: none;
}

.ch-roll-round {
  margin-right: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffd23f;
}

.ch-settings .ch-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.ch-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  color: #d6d7db;
}

.ch-field small {
  font-weight: 600;
  color: #8a8b91;
}

.ch-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #a3a4aa;
}

.ch-warnings {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 170, 0, 0.1);
  border: 1px solid rgba(255, 170, 0, 0.3);
  color: #ffcf70;
  font-size: 12px;
  line-height: 1.5;
}

.ch-table td.ch-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ch-table th {
  cursor: default;
}

.ch-pos {
  font-weight: 900;
  color: #ffffff;
}

.ch-phase {
  display: block;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ch-table .ch-phase-inicio { color: #4cd97b; }
.ch-table .ch-phase-mitad { color: #ffcf70; }
.ch-table .ch-phase-final { color: #ff8a9b; }

.ch-table tbody tr.ch-current td {
  background: rgba(255, 210, 63, 0.09);
}

.ch-table tbody tr.ch-current td:first-child {
  box-shadow: inset 3px 0 0 #ffd23f;
}

.ch-table tbody tr.ch-done td {
  opacity: 0.7;
}

.ch-flag {
  display: inline-block;
  margin-left: 34px;
  font-size: 10px;
  font-weight: 800;
  color: #ff8a9b;
}

.ch-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ch-status-pending { background: rgba(255, 255, 255, 0.07); color: #a3a4aa; }
.ch-status-maxing { background: rgba(63, 208, 255, 0.14); color: #3fd0ff; }
.ch-status-pushing { background: rgba(255, 210, 63, 0.16); color: #ffd23f; }
.ch-status-done { background: rgba(76, 217, 123, 0.16); color: #4cd97b; }

.ch-joker {
  font-size: 15px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.ch-joker:hover {
  background: rgba(255, 210, 63, 0.18);
}

.ch-table tfoot td {
  padding: 7px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 800;
  white-space: nowrap;
}

.ch-table tfoot .ch-total td {
  color: #ffffff;
  background: #222428;
}

.ch-table tfoot .ch-have td,
.ch-table tfoot .ch-lack td {
  color: #a3a4aa;
  border-top-color: rgba(255, 255, 255, 0.04);
}

.ch-tip {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #d6d7db;
}

.ch-tip-list {
  list-style: none;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ch-tip-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(76, 217, 123, 0.08);
}

.ch-tip-list li.ch-later {
  background: rgba(255, 255, 255, 0.04);
  color: #8a8b91;
}

.ch-tip-list small {
  color: #8a8b91;
}

.ch-cost {
  font-weight: 800;
  color: #ffd23f;
}

.ch-later .ch-cost {
  color: inherit;
}

.ch-rolls {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.ch-roll {
  display: grid;
  grid-template-columns: 160px 140px 1fr auto;
  gap: 4px 10px;
  align-items: baseline;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #d6d7db;
}

.ch-roll-type {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #a3a4aa;
}

.ch-roll-comodin .ch-roll-type { color: #ffd23f; }
.ch-roll-auto .ch-roll-type { color: #ff8a9b; }

.ch-roll-result {
  font-weight: 800;
  color: #ffffff;
}

.ch-roll-when {
  font-size: 11px;
  color: #8a8b91;
}

.ch-roll-cands {
  grid-column: 1 / -1;
  color: #a3a4aa;
}

.ch-roll-cands summary {
  cursor: pointer;
  font-size: 11px;
}

.ch-roll-cands p {
  margin-top: 4px;
  line-height: 1.6;
}

.ch-roll small,
.ch-roll-cands small {
  color: #8a8b91;
}

/* Draw board: every possible result of the next spin, with the roulette highlight running over them */
.ch-draw {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #222428 0%, #1b1c20 100%);
  border: 1px solid rgba(255, 210, 63, 0.3);
}

.ch-draw-joker {
  border-color: rgba(166, 0, 255, 0.45);
}

.ch-draw-head h3 {
  margin: 2px 0 4px;
  font-size: 17px;
  font-weight: 900;
  color: #ffffff;
}

.ch-draw-head p {
  font-size: 12px;
  line-height: 1.5;
  color: #a3a4aa;
}

.ch-draw-step {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #ffd23f;
}

.ch-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.ch-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px 8px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, opacity 0.3s ease;
}

.ch-chip img {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
  background: #0e0f11;
}

.ch-chip-icon {
  font-size: 30px;
  line-height: 1.2;
}

.ch-chip-name {
  font-size: 12px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.2;
}

.ch-chip small {
  font-size: 10px;
  color: #8a8b91;
}

.ch-chip.ch-hl {
  border-color: #ffd23f;
  background: rgba(255, 210, 63, 0.16);
  transform: scale(1.06);
}

.ch-chip.ch-win {
  border-color: #ffd23f;
  background: rgba(255, 210, 63, 0.22);
  box-shadow: 0 0 22px rgba(255, 210, 63, 0.45);
  transform: scale(1.1);
}

.ch-chip.ch-lose {
  opacity: 0.35;
}

.ch-board-empty {
  grid-column: 1 / -1;
  padding: 18px;
  border-radius: 12px;
  background: rgba(255, 107, 129, 0.08);
  color: #ff8a9b;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.ch-draw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ch-btn.ch-btn-spin {
  padding: 10px 22px;
  font-size: 15px;
  border-color: #ffd23f;
  background: #ffd23f;
  color: #2a1d00;
}

.ch-btn.ch-btn-spin:hover:not(:disabled) {
  background: #ffe07a;
  color: #2a1d00;
}

.ch-draw-note {
  margin-top: 10px;
  font-size: 11px;
  color: #8a8b91;
}

.ch-draw-log {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.ch-draw-log li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 11px;
  color: #8a8b91;
}

.ch-draw-log li.filled {
  border-style: solid;
  color: #d6d7db;
}

.ch-draw-log li.picked {
  border-color: rgba(76, 217, 123, 0.4);
  background: rgba(76, 217, 123, 0.07);
}

.ch-log-pos {
  font-size: 10px;
  font-weight: 900;
  color: #ffd23f;
}

.ch-log-class {
  font-weight: 800;
}

.ch-log-who {
  font-weight: 900;
  color: #ffffff;
}

.detail-class-select {
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  background: #222428;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 3px 6px;
}

@media (max-width: 560px) {
  .ch-roll { grid-template-columns: 1fr auto; }
  .ch-board { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}

/* Automatic spending panel (inventory card, js/spending-ui.js) */
.spend-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.spend-panel[hidden] { display: none; }

.spend-ask {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 204, 0, 0.12);
  border: 1px solid rgba(204, 142, 0, 0.35);
}

.spend-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-main);
}

.spend-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-main);
}

.spend-row img {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: cover;
  background: #0e0f11;
}

.spend-what {
  flex: 1 1 140px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.spend-what small {
  font-size: 11px;
  color: var(--text-muted);
}

.spend-cost {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  white-space: nowrap;
}

.spend-row-deshecho .spend-what,
.spend-row-deshecho .spend-cost {
  opacity: 0.55;
  text-decoration: line-through;
}

.spend-btn {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.spend-btn:hover { border-color: var(--border-hover); }
.spend-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.spend-buy { border-color: rgba(27, 156, 69, 0.45); color: var(--success); }
.spend-buy small { font-weight: 700; opacity: 0.8; }
.spend-drop { color: var(--accent); }
.spend-undo { font-size: 11px; padding: 3px 8px; color: var(--text-muted); }

.spend-log {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.spend-log summary {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
}

.spend-log .spend-row { margin-top: 8px; }

.spend-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
/* Skins checklist in the brawler detail modal (js/skins.js) */
.detail-brawler-skins:empty {
  display: none;
}

.detail-brawler-skins .detail-section-title small {
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: #8a8b91;
}

.skins-group {
  margin-bottom: 12px;
}

.skins-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--skin-color);
  margin-bottom: 6px;
}

.skins-group-head span {
  font-weight: 700;
  color: #8a8b91;
}

.skins-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skin-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--skin-color) 45%, transparent);
  background: rgba(255, 255, 255, 0.03);
  color: #c4c5ca;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.skin-chip:hover:not(:disabled) {
  border-color: var(--skin-color);
}

.skin-chip:disabled {
  cursor: default;
}

.skin-chip .skin-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--skin-color) 60%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: #18191c;
}

.skin-chip.on {
  background: color-mix(in srgb, var(--skin-color) 22%, transparent);
  border-color: var(--skin-color);
  color: #ffffff;
}

.skin-chip.on .skin-check {
  background: var(--skin-color);
  border-color: var(--skin-color);
}

.skin-r-rare { --skin-color: #3ccf4a; }
.skin-r-super-rare { --skin-color: #2e9bff; }
.skin-r-epic { --skin-color: #d24dff; }
.skin-r-mythic { --skin-color: #ff3d6e; }
.skin-r-legendary { --skin-color: #ffb21e; }
.skin-r-hypercharge { --skin-color: #b56bff; }
.skin-r-pro-pass { --skin-color: #00d2ff; }
.skin-r-especial { --skin-color: #c0c4cc; }

.skins-empty,
.skins-source {
  font-size: 11px;
  color: #8a8b91;
  margin: 4px 0 0;
}

/* ==========================================================================
   PANEL OSCURO: side menu, dense brawler list, graphite + yellow.
   Last on purpose: it reshapes the blocks defined above.
   ========================================================================== */

.btn, .card-title, .control-group label, .input-group label, .milestone-tab, .preset-pill,
.banner-stat-sub, .bc-name, .bc-group-label, .logo-title p, .header-trophy-pill, .rates-title-label,
.res-label, .donut-label, .modal-header h2 {
  text-transform: none;
  letter-spacing: 0;
}

/* The old all-caps labels are gone everywhere (panels, cards, modals) */
.container *,
.modal-content * {
  text-transform: none !important;
}

select option {
  background: var(--bg-elevated);
  color: var(--text-main);
}

/* Header becomes the side menu */
header {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--side);
  margin: 0;
  overflow-y: auto;
  background: var(--bg-card);
  border-bottom: none;
  border-right: 1px solid var(--border-color);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.header-inner {
  max-width: none;
  min-height: 100%;
  padding: 18px 12px;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 18px;
  text-align: left;
}

.logo-area { gap: 10px; padding: 0 6px; }
.logo-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); transform: none; box-shadow: none; }
.logo-icon svg { width: 18px; height: 18px; }
.logo-title h1 { background: none; -webkit-text-fill-color: var(--text-main); font-size: 15px; font-weight: 700; letter-spacing: 0; }
.logo-title p { display: none; }

.header-actions { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 2px; width: 100%; }

.header-trophy-pill {
  order: -1;
  justify-content: flex-start;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--divider);
  color: var(--accent);
  box-shadow: none;
  font-family: var(--font-mono);
  font-weight: 700;
}

.header-actions .btn,
.header-menu > summary.btn {
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 8px;
  box-shadow: none;
  font-weight: 500;
  font-size: 14px;
}

.header-actions .btn:hover { background: var(--divider); color: var(--text-main); transform: none; }
.reco-badge { margin-left: auto; background: #2c2e33; color: var(--accent); font-weight: 600; }

.header-menu { border-top: 1px solid var(--border-color); margin-top: 10px; padding-top: 10px; }
.header-menu-caret { margin-left: auto; }
.header-menu-list { position: static; box-shadow: none; border: none; background: transparent; padding: 2px 0 2px 26px; }
.header-menu-item { color: var(--text-muted); font-weight: 500; }
.header-menu-item:hover { background: var(--divider); color: var(--text-main); }

.header-actions #btn-api-sync { margin-top: 10px; background: var(--accent); color: #1a1300; font-weight: 600; justify-content: center; }
.header-actions #btn-api-sync:hover { background: #ffd23f; color: #1a1300; }
.header-actions #btn-api-tag { justify-content: center; color: var(--text-faint); }

.container { max-width: 1280px; padding-top: 24px; }

/* Buttons outside the menu */
.btn { box-shadow: none; text-transform: none; font-weight: 600; }
.btn-recommend { background: var(--divider); color: var(--accent); box-shadow: none; }
.btn-recommend:hover { background: #2c2e33; color: #ffd23f; }

/* Progress: a flat strip */
.global-progress-banner { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: none; padding: 18px 22px; }
.global-progress-banner::before { display: none; }
.banner-icon { display: none; }
.banner-badge-wrapper h2 { font-size: 16px; font-weight: 600; }
.banner-title-area p { color: var(--text-muted); font-weight: 400; }
.preset-pill { background: var(--divider); color: var(--text-muted); box-shadow: none; font-weight: 500; }
.banner-percentage { background: none; -webkit-text-fill-color: var(--accent); font-family: var(--font-mono); font-size: 34px; }
.banner-bar-bg { height: 6px; background: var(--divider); }
.banner-bar-fill { background: var(--accent); box-shadow: none; }

.card,
.controls-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: none; backdrop-filter: none; }
.card:hover { box-shadow: none; }
.card-title { font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--divider); }
.card-title svg { fill: var(--text-faint); }

.input-icon-wrapper input,
.search-wrapper input,
select.select-control { background-color: var(--bg-primary); color: var(--text-main); border: 1px solid var(--border-color); }
.input-icon-wrapper input { font-family: var(--font-mono); }
select.select-control {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%238a8b91' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
}

.controls-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.controls-grid .control-group { min-width: 0; }

.milestone-tabs { background: var(--bg-primary); border: 1px solid var(--border-color); }
.milestone-tab.active { background: #2c2e33; color: var(--accent); box-shadow: none; text-shadow: none; }

/* Brawlers: one dense row each */
.brawlers-grid { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; }

.brawler-card.bc {
  position: relative;
  flex-direction: row;
  align-items: center;
  background: var(--bg-card);
  border: none;
  border-bottom: 1px solid var(--divider);
  border-left: 3px solid var(--rarity);
  border-radius: 0;
  box-shadow: none;
  animation: none;
}

.brawler-card.bc:hover { transform: none; background: #1d1e22; border-color: var(--divider); border-left-color: var(--rarity); box-shadow: none; }
.brawler-card.bc.bc-done { border-color: var(--divider); border-left-color: var(--rarity); }

.bc-head { width: 300px; flex-shrink: 0; padding: 8px 12px; }
.bc-portrait { width: 36px; height: 36px; border-radius: 8px; box-shadow: none; }
.bc-name { font-size: 14px; font-weight: 600; }
.bc-sub { font-weight: 500; }
.bc-trophies-val { font-family: var(--font-mono); }

/* Flags (ranked / prestige / skin) in a fixed right-aligned slot, so they line up row after row */
.bc-flags { align-self: center; width: 80px; justify-content: flex-end; }

.bc-body { flex-direction: row; align-items: center; flex: 1; min-width: 0; gap: 12px; }
.bc-kit { margin: 0; padding: 4px 8px; background: transparent; gap: 14px; }
.bc-slots { min-height: 24px; }
.bc-slot { width: 22px; height: 22px; }
.bc-slot-gear { width: 20px; height: 20px; }
.bc-group-label { display: none; }
.bc-missing { flex: 1; min-width: 0; padding: 0; min-height: 0; }
.bc-chip { font-weight: 500; }
.bc-foot { margin: 0; padding: 0 14px; width: 220px; justify-content: flex-end; }
.bc-cost, .bc-pct { font-family: var(--font-mono); font-weight: 500; }
.bc-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; }
.bc-progress span, .bc-done .bc-progress span { background: var(--accent); opacity: 0.3; }

/* Modals (calculator, tier list, stats, challenge...): same graphite panel, no glow */
.modal-content,
.dark-modal-content {
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 14px;
  box-shadow: var(--shadow-lg) !important;
}

.modal-header,
.dark-modal-content .modal-header { border-bottom: 1px solid var(--divider); }
.modal-header h2 { font-size: 17px; font-weight: 600; }

@media (max-width: 900px) {
  body { padding-left: 0; }
  header { position: relative; width: auto; bottom: auto; overflow: visible; border-right: none; border-bottom: 1px solid var(--border-color); }
  .header-inner { flex-direction: row; flex-wrap: wrap; align-items: center; min-height: 0; gap: 10px; }
  .header-actions { flex-direction: row; flex-wrap: wrap; }
  .header-actions .btn, .header-menu > summary.btn { width: auto; }
  .header-trophy-pill { margin-bottom: 0; }
  .header-menu { border-top: none; margin-top: 0; padding-top: 0; }
  .header-menu-list { position: absolute; background: var(--bg-elevated); border: 1px solid var(--border-color); padding: 6px; }
  .header-actions #btn-api-sync { margin-top: 0; }
  .brawler-card.bc { flex-wrap: wrap; }
  .bc-head { width: 100%; }
  .bc-body { flex: 1 1 100%; flex-wrap: wrap; gap: 8px; padding: 0 12px 10px; }
  .bc-kit { padding: 0; }
  .bc-missing { flex: 1 1 100%; }
  .bc-foot { width: 100%; padding: 0; justify-content: space-between; }
}