:root {
  --bg-primary: #080a10;
  --bg-secondary: #0f1422;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 56, 0.9);
  --border-color: rgba(99, 120, 160, 0.25);
  --border-focus: #38bdf8;
  
  --text-main: #f0f4fc;
  --text-muted: #8e9bb5;
  --text-highlight: #ffffff;
  
  --accent-cyan: #38bdf8;
  --accent-green: #34d399;
  --accent-gold: #fbbf24;
  --accent-purple: #c084fc;
  --accent-red: #f87171;
  
  --glow-cyan: 0 0 20px rgba(56, 189, 248, 0.35);
  --glow-gold: 0 0 20px rgba(251, 191, 36, 0.35);
  --glow-purple: 0 0 20px rgba(192, 132, 252, 0.35);

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(168, 85, 247, 0.08) 0%, transparent 45%),
    linear-gradient(180deg, rgba(8, 10, 16, 0.95) 0%, rgba(12, 16, 26, 0.98) 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 10, 16, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.brand-logo-img:hover {
  transform: rotate(8deg) scale(1.08);
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-cyan);
  font-size: 1.35rem;
  font-weight: bold;
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(90deg, #ffffff, #cbd5e1, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Server Mode Selector */
.server-mode-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.server-mode-select {
  background: transparent;
  border: none;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
  outline: none;
}

.server-mode-select option {
  background: var(--bg-secondary);
  color: var(--text-main);
}

.connection-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.connection-pill:hover {
  border-color: var(--text-muted);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
  transition: var(--transition);
}

.status-dot.connected {
  background-color: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
}

/* Navigation Tabs */
.nav-tabs {
  position: sticky;
  top: 65px;
  z-index: 45;
  display: flex;
  gap: 0.35rem;
  background: var(--bg-secondary);
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: #fff;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

/* Main Container */
.main-container {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Give the stage browser the full available width when it is active. */
.main-container:has(#tab-monster-settings.active) {
  max-width: none;
}

.tab-content {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99, 120, 160, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  color: var(--text-highlight);
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Stat Box */
.stat-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border-color: rgba(56, 189, 248, 0.4);
}

.btn-primary:hover {
  box-shadow: var(--glow-cyan);
  filter: brightness(1.1);
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  border-color: rgba(52, 211, 153, 0.4);
}

.btn-success:hover {
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.4);
  filter: brightness(1.1);
}

.btn-gold {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #fff;
  border-color: rgba(251, 191, 36, 0.5);
}

.btn-gold:hover {
  box-shadow: var(--glow-gold);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.775rem;
}

/* ==========================================================================
   Honkai: Star Rail Themed Avatar Cards & Portraits
   ========================================================================== */

.avatar-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
  position: relative;
  cursor: pointer;
  border-width: 1.5px;
  padding: 1rem;
  border-radius: var(--radius-md);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.avatar-card:hover {
  transform: translateY(-4px);
}

/* 5-Star Card Theme */
.avatar-card.card-rarity-5 {
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.08) 0%, rgba(18, 24, 38, 0.95) 100%);
}

.avatar-card.card-rarity-5:hover {
  border-color: rgba(251, 191, 36, 0.9);
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.25), 0 0 15px rgba(251, 191, 36, 0.15);
}

/* 4-Star Card Theme */
.avatar-card.card-rarity-4 {
  border-color: rgba(192, 132, 252, 0.4);
  background: linear-gradient(145deg, rgba(192, 132, 252, 0.08) 0%, rgba(18, 24, 38, 0.95) 100%);
}

.avatar-card.card-rarity-4:hover {
  border-color: rgba(192, 132, 252, 0.9);
  box-shadow: 0 8px 24px rgba(192, 132, 252, 0.25), 0 0 15px rgba(192, 132, 252, 0.15);
}

.avatar-badge-rarity {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.725rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  letter-spacing: 0.05em;
}

.rarity-5 {
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: var(--accent-gold);
}

.rarity-4 {
  background: rgba(192, 132, 252, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.6);
  color: var(--accent-purple);
}

.avatar-header-info {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-right: 2.2rem;
}

.avatar-meta-details {
  flex: 1;
  min-width: 0;
}

/* Circular / Rounded Avatar Portrait */
.avatar-image-container {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.card-rarity-5 .avatar-image-container {
  border-color: var(--accent-gold);
}

.card-rarity-4 .avatar-image-container {
  border-color: var(--accent-purple);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.avatar-card:hover .avatar-img {
  transform: scale(1.12);
}

.avatar-icon-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.25rem;
  color: var(--text-muted);
}

.avatar-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-highlight);
  line-height: 1.25;
}

.avatar-subinfo {
  font-size: 0.775rem;
  margin-top: 0.35rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Star Rail Element Badges */
.element-badge {
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.725rem;
  font-weight: 700;
}

.elem-fire { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.elem-ice { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.elem-lightning { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.elem-wind { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.elem-physical { background: rgba(156, 163, 175, 0.2); color: #e5e7eb; border: 1px solid rgba(156, 163, 175, 0.4); }
.elem-quantum { background: rgba(99, 102, 241, 0.2); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.4); }
.elem-imaginary { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }

.path-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.725rem;
  font-weight: 600;
}

/* Star Rail Official Element & Path Icon Badges */
.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-color);
  padding: 3px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  vertical-align: middle;
}

.icon-badge:hover {
  transform: scale(1.18);
}

.icon-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.icon-badge.elem-fire { border-color: rgba(239, 68, 68, 0.6); background: rgba(239, 68, 68, 0.18); box-shadow: 0 0 8px rgba(239, 68, 68, 0.3); }
.icon-badge.elem-ice { border-color: rgba(56, 189, 248, 0.6); background: rgba(56, 189, 248, 0.18); box-shadow: 0 0 8px rgba(56, 189, 248, 0.3); }
.icon-badge.elem-lightning { border-color: rgba(168, 85, 247, 0.6); background: rgba(168, 85, 247, 0.18); box-shadow: 0 0 8px rgba(168, 85, 247, 0.3); }
.icon-badge.elem-wind { border-color: rgba(16, 185, 129, 0.6); background: rgba(16, 185, 129, 0.18); box-shadow: 0 0 8px rgba(16, 185, 129, 0.3); }
.icon-badge.elem-physical { border-color: rgba(156, 163, 175, 0.6); background: rgba(156, 163, 175, 0.18); box-shadow: 0 0 8px rgba(156, 163, 175, 0.3); }
.icon-badge.elem-quantum { border-color: rgba(99, 102, 241, 0.6); background: rgba(99, 102, 241, 0.18); box-shadow: 0 0 8px rgba(99, 102, 241, 0.3); }
.icon-badge.elem-imaginary { border-color: rgba(245, 158, 11, 0.6); background: rgba(245, 158, 11, 0.18); box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }

.path-icon-badge {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.path-icon-badge:hover {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
}

/* Avatar Card Footer & Status */
.avatar-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 0.775rem;
  font-weight: 700;
}

.avatar-lvl {
  color: var(--accent-cyan);
}

.avatar-eidolon {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.avatar-eidolon.e6 {
  color: #0b0d14;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
  font-weight: 900;
}

.btn-card-quick-max {
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 6px;
}

/* Eidolon Selector */
.eidolon-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.eidolon-buttons {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.eidolon-pip {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 0.825rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.eidolon-pip:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.15);
  color: #fff;
  transform: translateY(-2px);
}

.eidolon-pip.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border-color: #38bdf8;
  color: #0b0d14;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
  font-weight: 900;
}

.modal-eidolon-pip {
  width: 44px;
  height: 44px;
  font-size: 1rem;
  font-weight: 900;
  border-radius: 8px;
}

.modal-eidolon-pip.active {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  border-color: #fbbf24;
  color: #0b0d14;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.6);
}

/* ==========================================================================
   Party / Lineup Builder
   ========================================================================== */
.lineup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.lineup-slot-card {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 200px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.lineup-slot-card.filled {
  border-style: solid;
  border-color: rgba(56, 189, 248, 0.4);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, rgba(18, 24, 38, 0.85) 100%);
}

.lineup-slot-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

.lineup-slot-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
  object-fit: cover;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.lineup-slot-num {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(2, 132, 199, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-lineup-remove-slot {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  font-size: 0.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
}

.btn-lineup-remove-slot:hover {
  background: rgba(239, 68, 68, 0.5);
  border-color: var(--accent-red);
  color: #fff;
  transform: scale(1.12);
}

.lineup-add-slot-card {
  border-style: dashed;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.05);
}

.lineup-add-slot-card:hover {
  border-color: var(--accent-green);
  background: rgba(34, 197, 94, 0.12);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.25);
}

.badge-creative {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(239, 68, 68, 0.2) 100%);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  letter-spacing: 0.03em;
  animation: pulseCreativeGlow 2.5s infinite;
}

@keyframes pulseCreativeGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 14px rgba(245, 158, 11, 0.6); }
}

/* Ex Rank Toggle Switch */
.ex-switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  transition: var(--transition);
}

.ex-switch-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99, 120, 160, 0.45);
}

/* Aha's Help level picker */
.aha-help-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin: 0.25rem 0 1rem;
  padding: clamp(1rem, 2.2vw, 1.5rem);
  border: 1px solid rgba(245, 180, 75, 0.28);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 100% 0, rgba(245, 158, 11, 0.09), transparent 42%),
    linear-gradient(145deg, rgba(25, 29, 42, 0.96), rgba(15, 19, 30, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.aha-help-heading {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.aha-help-emblem {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.06));
  color: #fcd34d;
  font-size: 1.65rem;
  text-shadow: 0 0 16px rgba(251, 191, 36, 0.55);
}

.aha-help-heading-copy {
  min-width: 0;
}

.aha-help-eyebrow {
  margin: 0 0 0.3rem;
  color: #fbbf24;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.aha-help-heading h3 {
  margin: 0;
  color: var(--text-highlight);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.25;
}

.aha-help-heading p {
  max-width: 760px;
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.aha-help-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
  gap: 0.75rem;
}

.aha-help-option {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 112px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.45rem;
  padding: 1rem 2.4rem 1rem 1rem;
  border: 1px solid rgba(110, 123, 148, 0.28);
  border-radius: 13px;
  background: rgba(9, 13, 22, 0.62);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.aha-help-option:hover {
  transform: translateY(-2px);
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(32, 34, 42, 0.92);
}

.aha-help-option:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.8);
  outline-offset: 2px;
}

.aha-help-option.is-selected {
  border-color: rgba(251, 191, 36, 0.88);
  background: linear-gradient(145deg, rgba(120, 82, 22, 0.34), rgba(37, 31, 27, 0.82));
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.18), 0 8px 24px rgba(0, 0, 0, 0.17);
}

.aha-help-option[data-kind="off"].is-selected {
  border-color: rgba(148, 163, 184, 0.7);
  background: linear-gradient(145deg, rgba(71, 85, 105, 0.3), rgba(24, 29, 40, 0.88));
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.15);
}

.aha-help-option-title {
  color: var(--text-highlight);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
}

.aha-help-option-detail {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.aha-help-option-check {
  position: absolute;
  top: 0.8rem;
  right: 0.85rem;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 50%;
  color: transparent;
  font-size: 0.8rem;
  font-weight: 900;
}

.aha-help-option.is-selected .aha-help-option-check {
  border-color: #fbbf24;
  background: #fbbf24;
  color: #171717;
}

.aha-help-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.15rem;
}

.aha-help-save-state {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.aha-help-state-dot {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 9px currentColor;
}

.aha-help-save-state[data-state="saved"] .aha-help-state-dot { background: #34d399; }
.aha-help-save-state[data-state="unsaved"] .aha-help-state-dot { background: #fbbf24; }
.aha-help-save-state[data-state="error"] .aha-help-state-dot { background: #fb7185; }
.aha-help-save-state[data-state="unavailable"] .aha-help-state-dot { background: #94a3b8; }

.aha-help-save-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.7rem 1.15rem;
  white-space: nowrap;
}

.aha-help-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #374151;
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#btn-save-aha-help:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: rgba(10, 13, 20, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

/* JSON Editor */
.json-editor-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.json-textarea {
  width: 100%;
  height: 480px;
  padding: 1rem;
  font-family: "Fira Code", Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  background: #07090e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #38bdf8;
  resize: vertical;
  line-height: 1.4;
  outline: none;
}

.json-textarea:focus {
  border-color: var(--accent-cyan);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 0.875rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { border-left: 4px solid var(--accent-green); }
.toast.error { border-left: 4px solid var(--accent-red); }
.toast.info { border-left: 4px solid var(--accent-cyan); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 10001;
  pointer-events: auto;
  padding: 1.75rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  animation: fadeIn 0.2s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

/* Modal Sub-tabs */
.modal-subtabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.modal-subtab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.modal-subtab-btn:hover {
  color: var(--text-highlight);
  background: rgba(255, 255, 255, 0.05);
}

.modal-subtab-btn.active {
  color: #fff;
  background: var(--accent-blue);
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.45);
}

/* Skill Stepper & Row Cards (Inspired by srtools.punklorde.org/skills-info) */
.skill-row-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.skill-row-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.1);
}

.skill-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.skill-name {
  font-weight: 700;
  font-size: 0.925rem;
  color: var(--text-highlight);
}

.skill-lvl-badge {
  font-size: 0.85rem;
  font-family: monospace;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.skill-stepper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-step {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-step:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.25);
  transform: scale(1.05);
}

.btn-max-pill {
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent-gold);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-max-pill:hover {
  background: rgba(251, 191, 36, 0.35);
  transform: scale(1.05);
}

.skill-range {
  flex: 1;
  accent-color: var(--accent-cyan);
  cursor: pointer;
  height: 6px;
}

.trace-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.trace-toggle-label:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.trace-checkbox {
  width: 17px;
  height: 17px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.lc-super-pip {
  width: 40px;
  height: 36px;
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 900px) {
  .lineup-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }
}

@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-controls {
    width: 100%;
    justify-content: space-between;
  }
  .lineup-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Lineup Character Picker Modal Grid & Cards
   ========================================================================== */
.picker-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  align-content: start;
  grid-auto-rows: min-content;
  min-height: 0;
  width: 100%;
}

.picker-card-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding: 0.65rem 0.85rem !important;
  min-height: 60px !important;
  height: auto !important;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.picker-card-item:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.picker-card-item.card-rarity-5 {
  border-color: rgba(251, 191, 36, 0.4);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(18, 24, 38, 0.95) 100%);
}

.picker-card-item.card-rarity-5:hover {
  border-color: rgba(251, 191, 36, 0.9);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.25);
}

.picker-card-item.card-rarity-4 {
  border-color: rgba(192, 132, 252, 0.4);
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.08) 0%, rgba(18, 24, 38, 0.95) 100%);
}

.picker-card-item.card-rarity-4:hover {
  border-color: rgba(192, 132, 252, 0.9);
  box-shadow: 0 6px 20px rgba(192, 132, 252, 0.25);
}

.picker-card-item .picker-avatar-img-wrap {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.picker-card-item.card-rarity-5 .picker-avatar-img-wrap {
  border-color: var(--accent-gold);
}

.picker-card-item.card-rarity-4 .picker-avatar-img-wrap {
  border-color: var(--accent-purple);
}

.picker-card-item .picker-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.picker-card-item .picker-avatar-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}

.picker-card-item .picker-avatar-name {
  font-weight: 700;
  font-size: 0.925rem;
  color: var(--text-highlight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.picker-card-item .picker-avatar-subinfo {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.picker-remove-card {
  grid-column: 1 / -1;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.6rem !important;
  padding: 0.75rem 1rem !important;
  min-height: 48px !important;
  background: rgba(239, 68, 68, 0.08);
  border: 1px dashed rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  color: var(--accent-red);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0.25rem;
  box-sizing: border-box;
}

.picker-remove-card:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: var(--accent-red);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

/* ==========================================================================
   Modal Avatar Detail Widescreen Expansion
   ========================================================================== */
#modal-avatar-detail .modal-content {
  max-width: 980px !important;
  width: 96% !important;
  max-height: 92vh !important;
  overflow-y: auto !important;
}

/* ==========================================================================
   Full Light Cone Art & Preview Section
   ========================================================================== */
.lc-preview-container {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 1.5rem;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  align-items: start;
}

@media (max-width: 768px) {
  .lc-preview-container {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.lc-art-wrapper {
  width: 210px;
  height: 290px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  background: #0b0f19;
  border: 2px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 20px rgba(251, 191, 36, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lc-art-wrapper.rarity-5 {
  border-color: rgba(251, 191, 36, 0.8);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(251, 191, 36, 0.35);
}

.lc-art-wrapper.rarity-4 {
  border-color: rgba(192, 132, 252, 0.8);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(192, 132, 252, 0.35);
}

.lc-full-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.lc-art-wrapper:hover .lc-full-img {
  transform: scale(1.05);
}

.lc-placeholder-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

.lc-details-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
}

.badge-super-tag {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.lc-passive-card {
  background: rgba(11, 15, 25, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-top: 0.5rem;
}

.lc-passive-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 0.35rem;
  letter-spacing: 0.5px;
}

.lc-passive-body {
  font-size: 0.85rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.lc-passive-body strong {
  color: #38bdf8;
}

/* ==========================================================================
   Showcase Card System (Matching srtools.punklorde.org/showcase-card)
   ========================================================================== */
.showcase-card-layout {
  background: linear-gradient(135deg, #0d111a 0%, #151a27 50%, #0f131f 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), inset 0 0 40px rgba(56, 189, 248, 0.03);
  display: grid;
  grid-template-columns: 360px 320px 370px;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
  min-width: 1050px;
  width: 1050px;
  box-sizing: border-box;
}

.showcase-splash-col {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.15) 0%, rgba(11, 15, 25, 0.8) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 520px;
  width: 360px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.showcase-splash-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transition: transform 0.4s ease;
}

.showcase-splash-col:hover .showcase-splash-img {
  transform: scale(1.04);
}

.showcase-splash-overlay {
  position: relative;
  z-index: 2;
  background: linear-gradient(to top, rgba(10, 14, 23, 0.95) 0%, rgba(10, 14, 23, 0.75) 50%, transparent 100%);
  padding: 1rem 0.85rem;
}

.showcase-char-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  margin-bottom: 0.25rem;
}

.showcase-eidolon-strip {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.showcase-eidolon-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
}

.showcase-eidolon-dot.active {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  border-color: #fbbf24;
  color: #000;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

.showcase-center-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.showcase-lc-box {
  background: rgba(18, 24, 38, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.showcase-lc-thumb {
  width: 52px;
  height: 72px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(251, 191, 36, 0.5);
  flex-shrink: 0;
}

.showcase-sets-box {
  background: rgba(18, 24, 38, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.showcase-set-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.showcase-set-badge {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.showcase-stats-list {
  background: rgba(18, 24, 38, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.85rem;
}

.showcase-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  padding-bottom: 0.25rem;
}

.showcase-stat-label {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.showcase-stat-val {
  font-weight: 800;
  font-family: monospace;
  color: var(--text-highlight);
}

.showcase-relics-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.showcase-relic-card {
  background: rgba(18, 24, 38, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.showcase-relic-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateX(3px);
}

.showcase-relic-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(251, 191, 36, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.showcase-relic-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.showcase-relic-lvl-tag {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #fbbf24;
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0 0.25rem;
  border-radius: 3px;
  line-height: 1.2;
}

.showcase-relic-info {
  flex: 1;
  min-width: 0;
}

.showcase-relic-main-stat {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-highlight);
  display: flex;
  justify-content: space-between;
}

.showcase-relic-subs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.15rem 0.4rem;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Equipment Inventory Tiles Grid & Inspector (Matching srtools neonteam)
   ========================================================================== */
.eq-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 0.75rem;
  max-height: 720px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.eq-tile-card {
  position: relative;
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, box-shadow 0.2s;
  aspect-ratio: 0.78;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  user-select: none;
}

.eq-tile-card:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.3);
  z-index: 3;
}

.eq-tile-card.active {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px var(--accent-gold), 0 8px 25px rgba(234, 179, 8, 0.45);
}

.eq-tile-card.rarity-5 {
  border-color: rgba(234, 179, 8, 0.5);
  background: radial-gradient(circle at 50% 20%, rgba(234, 179, 8, 0.25) 0%, rgba(15, 23, 42, 0.95) 85%);
}

.eq-tile-card.rarity-4 {
  border-color: rgba(168, 85, 247, 0.5);
  background: radial-gradient(circle at 50% 20%, rgba(168, 85, 247, 0.25) 0%, rgba(15, 23, 42, 0.95) 85%);
}

.eq-tile-card.rarity-3 {
  border-color: rgba(56, 189, 248, 0.5);
  background: radial-gradient(circle at 50% 20%, rgba(56, 189, 248, 0.25) 0%, rgba(15, 23, 42, 0.95) 85%);
}

.eq-tile-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.eq-tile-card:hover .eq-tile-img {
  transform: scale(1.08);
}

.eq-tile-top-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(11, 15, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  backdrop-filter: blur(4px);
}

.eq-tile-wearer-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-gold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  z-index: 2;
  background: #000;
}

.eq-tile-wearer-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eq-tile-bottom-bar {
  position: relative;
  z-index: 2;
  background: linear-gradient(to top, rgba(11, 15, 25, 0.95) 0%, rgba(11, 15, 25, 0.75) 70%, transparent 100%);
  padding: 0.4rem 0.5rem 0.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.eq-tile-level {
  font-size: 0.725rem;
  font-weight: 800;
  color: #fff;
  font-family: monospace;
}

.eq-tile-name-snippet {
  font-size: 0.675rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65px;
}

/* Side Inspector Card */
.eq-inspector-wrapper {
  background: linear-gradient(135deg, rgba(20, 27, 45, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

.eq-inspector-hero {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.eq-inspector-thumb {
  width: 72px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid var(--accent-gold);
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.eq-inspector-info {
  flex: 1;
  min-width: 0;
}

.eq-inspector-title {
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  line-height: 1.3;
}

.eq-inspector-stars {
  color: var(--accent-gold);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.eq-inspector-stats {
  background: rgba(11, 15, 25, 0.75);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
}

.eq-inspector-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.eq-inspector-ability {
  background: rgba(11, 15, 25, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  font-size: 0.775rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.eq-inspector-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* ==========================================================================
   Neonteam & Punklorde Features: Character Switcher, Overview, Relics, Skills
   ========================================================================== */

/* Character Switcher Strip */
.modal-char-switcher-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 0.65rem 0.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.modal-char-switcher-item {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-card);
  position: relative;
  flex-shrink: 0;
}

.modal-char-switcher-item:hover {
  transform: scale(1.1);
  border-color: var(--accent-cyan);
}

.modal-char-switcher-item.active {
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
  transform: scale(1.15);
}

.modal-char-switcher-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Overview Layout (Neonteam Style) */
.overview-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 820px) {
  .overview-layout {
    grid-template-columns: 1fr;
  }
}

.overview-portrait-box {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 420px;
  background: radial-gradient(circle at 50% 25%, rgba(56, 189, 248, 0.15) 0%, rgba(10, 14, 23, 0.95) 100%);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.overview-portrait-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transition: transform 0.4s ease;
  z-index: 1;
}

.overview-portrait-box:hover .overview-portrait-img {
  transform: scale(1.03);
}

.overview-portrait-info {
  position: relative;
  z-index: 2;
  padding: 1.25rem 1rem;
  background: linear-gradient(to top, rgba(10, 14, 23, 0.98) 0%, rgba(10, 14, 23, 0.75) 60%, transparent 100%);
}

.overview-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.overview-stat-card {
  background: rgba(18, 24, 38, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.overview-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.overview-stat-val {
  font-size: 0.925rem;
  font-weight: 800;
  font-family: monospace;
  color: var(--text-highlight);
}

/* Relics 6 Slots Layout */
.relics-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 0.85rem;
}

.relic-slot-box {
  background: rgba(18, 24, 38, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  gap: 0.85rem;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.relic-slot-box.empty {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(14, 19, 31, 0.5);
}

.relic-slot-box:hover {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(22, 30, 48, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.relic-slot-box .btn-slot-unequip-corner {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  z-index: 5;
}

.relic-slot-box .btn-slot-unequip-corner:hover {
  background: #ef4444;
  color: #fff;
  transform: scale(1.1);
}

.relic-slot-icon-wrap {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.relic-slot-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.85);
  font-size: 0.6rem;
  text-align: center;
  font-weight: 800;
  color: #cbd5e1;
  padding: 0.05rem 0;
}

.relic-slot-content {
  flex: 1;
  min-width: 0;
}

.relic-slot-title {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--text-highlight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.relic-slot-lvl {
  font-size: 0.7rem;
  font-weight: 800;
  color: #000;
  background: var(--accent-gold);
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
}

.relic-slot-main {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-top: 0.2rem;
}

.relic-slot-subs {
  font-size: 0.725rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.35;
}

/* Lightcone Picker Card */
.lc-picker-card {
  background: rgba(18, 24, 38, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.lc-picker-card:hover {
  background: rgba(28, 38, 60, 0.95);
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.lc-picker-card.active-equipped {
  border-color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.1);
}

.lc-picker-thumb {
  width: 44px;
  height: 60px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

/* Add Lightcone Visual Grid & Cards */
.add-lc-card {
  background: rgba(18, 24, 38, 0.75);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
}

.add-lc-card:hover {
  background: rgba(28, 38, 60, 0.95);
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.add-lc-card.selected {
  border-color: var(--accent-gold) !important;
  background: rgba(251, 191, 36, 0.14) !important;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

.add-lc-card.rarity-5 {
  border-left: 3.5px solid #eab308;
}

.add-lc-card.rarity-4 {
  border-left: 3.5px solid #a855f7;
}

.add-lc-card.rarity-3 {
  border-left: 3.5px solid #38bdf8;
}

.add-lc-card-thumb {
  width: 42px;
  height: 58px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #0b0d14;
}

.add-lc-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.add-lc-card-name {
  font-weight: 700;
  font-size: 0.825rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.add-lc-card-stars {
  font-size: 0.68rem;
  color: var(--accent-gold);
  line-height: 1;
}

.add-lc-card-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.add-lc-card-path {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--accent-cyan);
}

.add-lc-card-id {
  font-family: monospace;
  opacity: 0.7;
}

/* Rich Skills & Traces */
.skill-row-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  object-fit: contain;
  padding: 3px;
}

.skill-type-tag {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}

.skill-desc-box {
  background: rgba(11, 15, 25, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.skill-desc-box .param-val {
  color: var(--accent-cyan);
  font-weight: 700;
}

.trace-card-item {
  background: rgba(18, 24, 38, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.trace-icon-small {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  object-fit: contain;
  padding: 2px;
}

/* Outside Character Card Quick Buttons (E0S1 / E6S5) */
.btn-card-e0s1 {
  background: rgba(56, 189, 248, 0.15) !important;
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
  color: var(--accent-cyan) !important;
  font-weight: 800 !important;
  font-size: 0.725rem !important;
  padding: 0.25rem 0.55rem !important;
}

.btn-card-e0s1:hover {
  background: rgba(56, 189, 248, 0.35) !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4) !important;
  transform: translateY(-1px);
}

.btn-card-e6s5 {
  background: rgba(251, 191, 36, 0.15) !important;
  border: 1px solid rgba(251, 191, 36, 0.5) !important;
  color: var(--accent-gold) !important;
  font-weight: 800 !important;
  font-size: 0.725rem !important;
  padding: 0.25rem 0.55rem !important;
}

.btn-card-e6s5:hover {
  background: rgba(251, 191, 36, 0.35) !important;
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.4) !important;
  transform: translateY(-1px);
}

/* Locked Creative Mode Styling */
.switch input:disabled + .slider {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

/* Gachabase Importer & Modal Styling */
.gachabase-quick-chip {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  cursor: pointer;
  transition: var(--transition);
}

.gachabase-quick-chip:hover {
  background: rgba(251, 191, 36, 0.15) !important;
  border-color: var(--accent-gold) !important;
  color: var(--accent-gold) !important;
}

.gachabase-preview-card {
  display: flex;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.gachabase-art-column {
  width: 220px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.gachabase-art-img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.4);
}

.gachabase-details-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.gachabase-header-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.gachabase-skill-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.gachabase-skill-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  object-fit: contain;
  padding: 2px;
}

.gachabase-eidolon-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

@media (max-width: 768px) {
  .gachabase-preview-card {
    flex-direction: column;
    align-items: center;
  }
  .gachabase-art-column {
    width: 100%;
  }
}

/* ==========================================
   Team Combat Synergy & Role Balance
   ========================================== */
.synergy-elements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
  gap: 0.5rem;
}

.synergy-element-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.35rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  text-align: center;
}

.synergy-element-chip.active {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.synergy-element-chip.inactive {
  opacity: 0.35;
  filter: grayscale(80%);
}

.synergy-element-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.synergy-element-chars {
  font-size: 0.675rem;
  color: var(--accent-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.synergy-metrics-grid,
.mini-battle-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .synergy-metrics-grid,
  .mini-battle-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.synergy-metric-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.4rem;
  text-align: center;
}

.synergy-metric-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-gold);
  font-family: monospace;
}

.synergy-metric-lbl {
  font-size: 0.675rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ==========================================
   GM Command Dispatcher & Live Log Console
   ========================================== */
.console-suggestions {
  margin-top: -0.45rem;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 7px;
  overflow: hidden;
  background: #080c13;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.console-suggestions[hidden] {
  display: none;
}

.console-suggestions-header {
  display: flex;
  justify-content: space-between;
  padding: 0.32rem 0.65rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.7rem;
}

.console-suggestion-count {
  color: #fbbf24;
}

.console-suggestion-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.65rem;
  color: #38e8f2;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.console-suggestion-option:hover,
.console-suggestion-option[aria-selected="true"] {
  color: #fff;
  background: rgba(56, 189, 248, 0.13);
}

.console-suggestion-option::before {
  content: ">";
  color: #34d399;
  font-weight: 800;
}

.console-suggestion-command {
  font-size: 0.8rem;
}

.console-suggestion-description {
  margin-left: auto;
  color: #64748b;
  font-family: inherit;
  font-size: 0.68rem;
}

.console-suggestion-option:hover .console-suggestion-description,
.console-suggestion-option[aria-selected="true"] .console-suggestion-description {
  color: #94a3b8;
}

@media (max-width: 640px) {
  .console-suggestion-description {
    display: none;
  }
}

.console-terminal-wrapper {
  background: #070b12;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6);
}

.console-terminal-header {
  background: #0f172a;
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-family: monospace;
  margin-left: 0.35rem;
}

.console-terminal-log {
  height: 200px;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.75rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.775rem;
  line-height: 1.55;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-line {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.log-time {
  color: #64748b;
  flex-shrink: 0;
  user-select: none;
}

.log-tag {
  font-weight: 700;
  flex-shrink: 0;
  padding: 0 0.3rem;
  border-radius: 3px;
  font-size: 0.7rem;
}

.log-tag.tag-sys { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.log-tag.tag-cmd { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.log-tag.tag-ok  { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.log-tag.tag-err { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.log-tag.tag-net { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.log-msg {
  flex: 1;
}

/* ========================================================
   Honkai: Star Rail In-Game Authentic Attributes Panel
   ======================================================== */
.hsr-attributes-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(13, 19, 31, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.hsr-attr-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hsr-attr-header {
  font-size: 0.8rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.25rem;
}

.hsr-attr-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hsr-attr-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.hsr-attr-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.hsr-attr-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.hsr-attr-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.hsr-attr-name {
  font-size: 0.85rem;
  color: #e2e8f0;
  font-weight: 600;
}

.hsr-attr-right {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  text-align: right;
}

.hsr-attr-total {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  min-width: 50px;
}

.hsr-attr-breakdown {
  font-size: 0.75rem;
  display: inline-flex;
  gap: 0.2rem;
  align-items: baseline;
}

.hsr-attr-base {
  color: #94a3b8;
}

.hsr-attr-extra {
  color: #38bdf8;
  font-weight: 700;
}

/* ========================================================
   Spacious Relic Slot Picker Modal Styles
   ======================================================== */
.relic-picker-modal-content {
  width: 95vw;
  max-width: 960px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.25rem;
}

.slot-picker-current-banner {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.slot-picker-current-banner.empty {
  border-style: dashed;
  color: var(--text-muted);
  justify-content: center;
  padding: 1rem;
}

.slot-picker-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
  padding-bottom: 0.25rem;
}

.slot-picker-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.slot-picker-tab-btn:hover {
  color: var(--text-color);
}

.slot-picker-tab-btn.active {
  color: var(--accent-cyan);
}

.slot-picker-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -0.25rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.slot-picker-tab-pane {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.slot-picker-rec-highlight {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(14, 165, 233, 0.05) 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.1);
}

.slot-picker-set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.65rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.35rem 0.2rem;
}

.slot-picker-set-card {
  background: rgba(18, 24, 38, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.slot-picker-set-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(30, 41, 59, 0.8);
  transform: translateY(-2px);
}

.slot-picker-set-card.selected {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.15);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.slot-picker-set-card img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.slot-picker-set-card span {
  font-size: 0.725rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.slot-picker-mainstat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.slot-picker-pill {
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  background: rgba(18, 24, 38, 0.75);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.slot-picker-pill:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(30, 41, 59, 0.9);
}

.slot-picker-pill.selected {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.slot-picker-pill.recommended {
  border-color: rgba(251, 191, 36, 0.6);
}

.slot-picker-inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
  max-height: 440px;
  overflow-y: auto;
  padding: 0.35rem 0.2rem;
}

.slot-picker-inv-card {
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.slot-picker-inv-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.slot-picker-inv-card.active-wearer {
  border-color: var(--accent-gold);
}

/* Substats Customizer */
.slot-picker-substats-section {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-top: 0.85rem;
}

.substat-presets-strip {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.btn-substat-preset {
  background: rgba(18, 24, 38, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-substat-preset:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.15);
  color: #fff;
}

.slot-picker-substats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.substat-row-card {
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.substat-row-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.substat-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.substat-slot-label {
  font-weight: 700;
  color: var(--text-muted);
}

.substat-preview-badge {
  font-weight: 800;
  color: var(--accent-cyan);
  font-family: monospace;
  font-size: 0.825rem;
  background: rgba(56, 189, 248, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.substat-row-controls {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.substat-select {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  background: rgba(10, 14, 23, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.substat-select:focus {
  border-color: var(--accent-cyan);
  outline: none;
}

.substat-stepper {
  display: flex;
  align-items: center;
  background: rgba(10, 14, 23, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.btn-substat-step {
  background: transparent;
  border: none;
  color: var(--text-color);
  width: 26px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: background 0.15s;
}

.btn-substat-step:hover {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
}

.substat-count-input {
  width: 32px;
  border: none;
  background: transparent;
  text-align: center;
  color: var(--accent-gold);
  font-weight: 800;
  font-family: monospace;
  font-size: 0.875rem;
  -moz-appearance: textfield;
}

.substat-count-input::-webkit-outer-spin-button,
.substat-count-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}


/* Git Branch Indicators */
.badge-branch {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.02em;
  user-select: none;
}

.nav-branch-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 9999px;
  color: #a5b4fc;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  user-select: none;
  transition: all 0.2s ease;
}

.nav-branch-pill:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.55);
  color: #c7d2fe;
}

.branch-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.build-guide-content {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.build-guide-topline,
.build-guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.build-guide-title {
  color: var(--text-highlight);
  font-size: 1.05rem;
  font-weight: 800;
}

.build-guide-meta,
.build-guide-note,
.build-guide-sample,
.build-guide-footer {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.build-guide-note {
  margin: 0;
  line-height: 1.55;
}

.build-guide-sample {
  display: inline-flex;
  align-self: flex-start;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  color: #bae6fd;
  padding: 0.3rem 0.7rem;
}

.build-guide-low-sample {
  color: var(--accent-gold);
  font-size: 0.75rem;
}

.build-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.build-guide-card {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(18, 24, 38, 0.72);
}

.build-guide-card h4 {
  margin: 0 0 0.6rem;
  color: var(--accent-cyan);
  font-size: 0.85rem;
}

.build-guide-ranked-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.build-guide-ranked-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.build-guide-ranked-list li span {
  min-width: 0;
}

.build-guide-ranked-list li strong {
  flex-shrink: 0;
  color: var(--accent-gold);
  font-size: 0.72rem;
}

.build-guide-empty,
.build-guide-no-data {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.build-guide-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.build-guide-stat-grid > div > span {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.build-guide-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 0.65rem;
}

.build-guide-footer a:not(.btn) {
  color: var(--accent-cyan);
}

@media (max-width: 640px) {
  .build-guide-grid,
  .build-guide-stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .aha-help-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .aha-help-save-button {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .aha-help-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .aha-help-heading {
    gap: 0.7rem;
  }

  .aha-help-emblem {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }
}

/* Anomaly Arbitration monster wave editor */
.monster-settings-intro { margin-bottom: 1rem; }
.monster-settings-rule { display: flex; gap: .65rem; align-items: flex-start; margin-top: .8rem; padding: .8rem 1rem; border: 1px solid rgba(251, 191, 36, .28); border-radius: 10px; background: rgba(245, 158, 11, .08); color: var(--text-main); line-height: 1.55; }
.monster-settings-tabs { display: flex; gap: .5rem; margin: 1rem 0; padding: .45rem; overflow-x: auto; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-secondary); }
.monster-settings-tab { flex: 1 0 auto; min-height: 44px; padding: .65rem .9rem; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text-muted); font: inherit; font-weight: 700; white-space: nowrap; cursor: pointer; }
.monster-settings-tab:hover { color: var(--text-main); background: rgba(148, 163, 184, .08); }
.monster-settings-tab.active { color: var(--text-highlight); border-color: rgba(56, 189, 248, .36); background: rgba(14, 165, 233, .13); }
.monster-settings-tab-aha.active { color: #fcd34d; border-color: rgba(251, 191, 36, .45); background: rgba(245, 158, 11, .12); }
.monster-settings-status { margin: .75rem 0; padding: .8rem 1rem; border: 1px solid var(--border-color); border-radius: 10px; color: var(--text-muted); background: var(--bg-card); line-height: 1.5; }
.monster-settings-status[data-state="saved"] { color: #6ee7b7; }
.monster-settings-status[data-state="error"] { color: #fda4af; }
.monster-settings-status[data-state="loading"] { color: #7dd3fc; }
.monster-settings-view { display: grid; gap: 1rem; }
.monster-settings-picker-section { display: grid; gap: .65rem; }
.monster-settings-picker-title { margin: 0; color: var(--text-muted); font-size: .88rem; font-weight: 800; letter-spacing: .02em; }
.monster-settings-group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: .75rem; }
.monster-settings-group-card { display: flex; min-width: 0; min-height: 78px; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem .85rem; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-card); color: var(--text-main); text-align: left; cursor: pointer; transition: border-color 140ms ease, background 140ms ease, transform 140ms ease; }
.monster-settings-group-card:hover, .monster-settings-stage-card:hover { transform: translateY(-1px); border-color: rgba(56, 189, 248, .45); background: rgba(25, 35, 51, .95); }
.monster-settings-group-card.active { border-color: rgba(56, 189, 248, .72); background: linear-gradient(125deg, rgba(14, 165, 233, .16), rgba(15, 23, 42, .9)); box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .1); }
.monster-settings-group-copy, .monster-settings-stage-copy { display: grid; gap: .3rem; min-width: 0; }
.monster-settings-group-name { color: var(--text-main); font-size: .91rem; line-height: 1.3; overflow-wrap: anywhere; }
.monster-settings-group-meta, .monster-settings-stage-meta { color: var(--text-muted); font-size: .75rem; line-height: 1.3; }
.monster-settings-monster.group-feature { flex: 0 0 56px; width: 56px; padding: 0; border: 0; background: transparent; }
.monster-settings-monster.group-feature .monster-settings-monster-portrait { width: 56px; height: 56px; flex-basis: 56px; }
.monster-settings-monster.group-feature .monster-settings-monster-copy { display: none; }
.monster-settings-stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: .75rem; }
.monster-settings-stage-card { display: flex; min-width: 0; min-height: 144px; align-items: center; gap: .9rem; padding: .85rem; border: 1px solid var(--border-color); border-radius: 14px; background: var(--bg-card); color: var(--text-main); text-align: left; cursor: pointer; transition: border-color 140ms ease, background 140ms ease, transform 140ms ease; }
.monster-settings-stage-card.active { border-color: rgba(56, 189, 248, .76); background: linear-gradient(125deg, rgba(14, 165, 233, .16), rgba(15, 23, 42, .94)); box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .12); }
.monster-settings-stage-card.is-boss { border-color: rgba(251, 191, 36, .3); }
.monster-settings-stage-card.is-boss.active { border-color: rgba(251, 191, 36, .78); background: linear-gradient(125deg, rgba(245, 158, 11, .16), rgba(15, 23, 42, .94)); }
.monster-settings-stage-card:focus-visible, .monster-settings-group-card:focus-visible { outline: 2px solid rgba(56, 189, 248, .75); outline-offset: 2px; }
.monster-settings-monster.stage-feature { flex: 0 0 92px; width: 92px; flex-direction: column; align-items: center; padding: 0; border: 0; background: transparent; }
.monster-settings-monster.stage-feature .monster-settings-monster-portrait { width: 88px; height: 88px; flex-basis: 88px; border-radius: 12px; }
.monster-settings-monster.stage-feature .monster-settings-monster-copy { display: none; }
.monster-settings-stage-copy { flex: 1; }
.monster-settings-stage-copy strong { color: var(--text-main); font-size: .92rem; line-height: 1.28; overflow-wrap: anywhere; }
.monster-settings-stage-card.is-boss .monster-settings-stage-meta:first-of-type { color: #fcd34d; }
.monster-settings-view[hidden] { display: none; }
.monster-aa-round-control { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr); align-items: center; gap: 1.25rem; padding: 1rem 1.1rem; border: 1px solid rgba(56, 189, 248, .28); border-radius: 14px; background: linear-gradient(120deg, rgba(14, 165, 233, .1), rgba(15, 23, 42, .72)); }
.monster-aa-round-header { display: grid; gap: .6rem; min-width: 0; }
.monster-aa-round-copy h3 { margin: 0; color: var(--text-highlight); font-size: 1rem; }
.monster-aa-round-copy p { margin: .35rem 0 0; color: var(--text-muted); line-height: 1.5; }
.monster-aa-round-status { color: var(--text-muted); font-size: .88rem; line-height: 1.45; overflow-wrap: anywhere; }
.monster-aa-round-status.is-pending { color: #86efac; }
.monster-aa-round-status.is-error { color: #fda4af; }
.monster-aa-round-picker-wrap { display: grid; gap: .5rem; min-width: 0; }
.monster-aa-round-picker-label { color: var(--text-muted); font-size: .82rem; font-weight: 800; }
.monster-aa-round-picker { min-height: 46px; width: 100%; }
.monster-aa-round-picker:disabled { opacity: .55; cursor: not-allowed; }
.monster-settings-stage-heading { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.monster-settings-stage-heading h3 { margin: 0; color: var(--text-highlight); font-size: 1.1rem; }
.monster-settings-badge { padding: .25rem .55rem; border: 1px solid rgba(192, 132, 252, .3); border-radius: 999px; color: #d8b4fe; background: rgba(168, 85, 247, .1); font-size: .75rem; font-weight: 700; }
.monster-settings-battle { display: grid; gap: .7rem; padding: 1rem; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-card); }
.monster-settings-battle h4 { margin: 0; color: var(--text-main); }
.monster-settings-encounter-heading { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.monster-settings-id-badge { color: var(--text-muted); font-size: .76rem; }
.monster-settings-meta { display: flex; gap: .55rem; flex-wrap: wrap; color: var(--text-muted); font-size: .8rem; }
.monster-settings-wave { display: flex; align-items: flex-start; gap: .8rem; padding: .7rem; border: 1px solid rgba(148, 163, 184, .13); border-radius: 9px; background: rgba(148, 163, 184, .035); }
.monster-settings-wave strong { flex: 0 0 85px; color: var(--text-muted); font-size: .82rem; }
.monster-settings-monsters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: .65rem; flex: 1; min-width: 0; }
.monster-settings-monster { display: flex; align-items: center; gap: .75rem; min-width: 0; padding: .5rem .65rem; border: 1px solid rgba(56, 189, 248, .16); border-radius: 10px; background: rgba(14, 165, 233, .055); }
.monster-settings-monster-portrait { position: relative; display: grid; flex: 0 0 72px; width: 72px; height: 72px; place-items: center; overflow: hidden; border-radius: 10px; background: rgba(15, 23, 42, .8); font-size: 1.55rem; }
.monster-settings-monster-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.monster-settings-monster-copy { display: grid; gap: .18rem; min-width: 0; }
.monster-settings-monster-copy strong { overflow-wrap: anywhere; color: var(--text-main); font-size: .86rem; line-height: 1.25; }
.monster-settings-monster-copy code { width: fit-content; color: var(--text-muted); font-size: .72rem; }
.monster-settings-monster.compact { padding: .25rem; }
.monster-settings-empty { padding: 1.4rem; border: 1px dashed rgba(148, 163, 184, .3); border-radius: 12px; color: var(--text-muted); background: var(--bg-card); text-align: center; line-height: 1.6; }
.monster-settings-aha-help[hidden] { display: none; }
.monster-settings-aha-help { margin-top: 1rem; }
.monster-custom-card { display: grid; gap: .85rem; }
.monster-custom-card h3 { margin: 0; color: var(--text-highlight); }
.monster-custom-card > .card-subtitle { margin: 0; }
.monster-settings-source { color: var(--text-muted); font-size: .82rem; }
.monster-custom-wave-list { display: grid; gap: .8rem; }
.monster-custom-wave { display: grid; gap: .75rem; padding: .9rem; border: 1px solid rgba(110, 123, 148, .23); border-radius: 12px; background: rgba(9, 13, 22, .5); }
.monster-custom-wave-heading, .monster-custom-row, .monster-custom-toolbar, .monster-custom-actions, .monster-custom-save-actions { display: flex; align-items: center; gap: .65rem; }
.monster-custom-wave-heading, .monster-custom-toolbar { justify-content: space-between; }
.monster-custom-wave-heading strong { color: var(--text-highlight); }
.monster-custom-rows { display: grid; gap: .55rem; }
.monster-custom-row { align-items: flex-end; padding: .7rem; border: 1px solid rgba(110, 123, 148, .16); border-radius: 10px; background: rgba(255, 255, 255, .018); }
.monster-custom-field { display: flex; min-width: 0; flex: 1 1 0; flex-direction: column; gap: .35rem; color: var(--text-muted); font-size: .76rem; font-weight: 700; }
.monster-custom-field input { width: 100%; min-height: 42px; padding: .55rem .65rem; border: 1px solid rgba(110, 123, 148, .32); border-radius: 8px; background: rgba(7, 10, 17, .76); color: var(--text-main); }
.monster-custom-field input:focus { outline: 2px solid rgba(56, 189, 248, .55); outline-offset: 1px; }
.monster-custom-monster-preview { min-height: 62px; }
.monster-custom-monster-field { min-width: 250px; }
.monster-custom-picker { position: relative; width: 100%; }
.monster-custom-picker-results { position: absolute; z-index: 30; top: calc(100% + .35rem); left: 0; right: 0; display: grid; max-height: 340px; overflow-y: auto; padding: .35rem; border: 1px solid rgba(92, 115, 148, .55); border-radius: 12px; background: #111827; box-shadow: 0 18px 42px rgba(0, 0, 0, .5); }
.monster-custom-picker-results[hidden] { display: none; }
.monster-custom-picker-option { display: flex; width: 100%; min-width: 0; padding: .25rem; border: 0; border-radius: 8px; background: transparent; color: var(--text-main); text-align: left; cursor: pointer; }
.monster-custom-picker-option:hover, .monster-custom-picker-option:focus-visible { outline: none; background: rgba(56, 189, 248, .14); }
.monster-custom-picker-option .monster-settings-monster { width: 100%; padding: .25rem .35rem; border: 0; background: transparent; }
.monster-custom-picker-option .monster-settings-monster-portrait { flex-basis: 52px; width: 52px; height: 52px; }
.monster-custom-picker-option .monster-settings-monster-copy strong { font-size: .84rem; }
.monster-custom-picker-option .monster-settings-monster-copy code { font-size: .7rem; }
.monster-custom-monster-preview .monster-settings-monster { width: fit-content; max-width: 100%; padding: .2rem .35rem; }
.monster-custom-monster-preview .monster-settings-monster-portrait { flex-basis: 80px; width: 80px; height: 80px; }
.monster-custom-monster-preview .monster-settings-monster-copy strong { font-size: .76rem; }
.monster-custom-monster-preview .monster-settings-monster-copy code { font-size: .66rem; }
.monster-custom-remove { min-width: 42px; min-height: 42px; }
.monster-custom-add-enemy { justify-self: start; }
.monster-custom-save-actions { justify-content: flex-end; }
.monster-custom-save-actions .monster-settings-status { margin: 0; }
.monster-custom-card button:disabled, .monster-custom-card input:disabled { cursor: not-allowed; opacity: .55; }

@media (max-width: 700px) {
  .monster-settings-wave { flex-direction: column; }
  .monster-settings-monsters { width: 100%; }
  .monster-settings-stage-grid { grid-template-columns: 1fr; }
  .monster-aa-round-control { grid-template-columns: 1fr; align-items: stretch; }
  .monster-custom-toolbar, .monster-custom-save-actions { align-items: stretch; flex-direction: column; }
  .monster-custom-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
  .monster-custom-save-actions .btn { width: 100%; }
  .monster-custom-row { align-items: stretch; flex-wrap: wrap; }
  .monster-custom-field { flex-basis: calc(50% - .65rem); }
  .monster-custom-monster-field { flex-basis: 100%; }
  .monster-custom-remove { margin-left: auto; }
}

@media (max-width: 390px) {
  .monster-settings-wave { flex-direction: column; }
  .monster-custom-field { flex-basis: 100%; }
}
