/* ==========================================================================
   ONCE HUMAN — TACTICAL DASHBOARD STYLESHEET
   Version: 3.0.0
   Design: Matte Tactical Glassmorphism & Sidebar Architecture
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. THEME PALETTES (MATTE & AUGENSCHONEND)
   -------------------------------------------------------------------------- */

/* --- 1.1 DEFAULT: ONCE HUMAN (Official Amber & Charcoal) --- */
:root, [data-theme="once-human"] {
  --bg-main: #090b0e;
  --bg-sidebar: #0e1217;
  --bg-card: #151a22;
  --bg-input: #0a0d12;
  
  --accent: #cca262;           /* Warmes Amber Gold aus dem Logo */
  --accent-hover: #dbb374;
  --accent-muted: rgba(204, 162, 98, 0.15);
  --accent-subtle: rgba(204, 162, 98, 0.05);
  
  --border-soft: #222a36;
  --border-strong: #364356;
  
  --text-main: #e8ecf2;
  --text-muted: #8290a6;
  --card-radius: 6px;
}

/* --- 1.2 VULTURE (Mattes Glut-Orange & Asche) --- */
[data-theme="vulture"] {
  --bg-main: #0a0909;
  --bg-sidebar: #120e0e;
  --bg-card: #1c1515;
  --bg-input: #0d0909;
  
  --accent: #d45d3f;           /* Abgedunkeltes Rost-Orange */
  --accent-hover: #e06e52;
  --accent-muted: rgba(212, 93, 63, 0.18);
  --accent-subtle: rgba(212, 93, 63, 0.05);
  
  --border-soft: #2e2020;
  --border-strong: #4a3232;
  
  --text-main: #f2ecec;
  --text-muted: #9c8484;
  --card-radius: 4px;
}

/* --- 1.3 ENDLESS DREAM (Mattes Soft-Violett & Teal) --- */
[data-theme="endless-dream"] {
  --bg-main: #09080e;
  --bg-sidebar: #100e18;
  --bg-card: #181524;
  --bg-input: #0a0910;
  
  --accent: #4db8c4;           /* Sanftes Teal-Blau */
  --accent-hover: #63c9d5;
  --accent-muted: rgba(77, 184, 196, 0.18);
  --accent-subtle: rgba(77, 184, 196, 0.05);
  
  --border-soft: #2a233b;
  --border-strong: #43375e;
  
  --text-main: #eceaf2;
  --text-muted: #8d859e;
  --card-radius: 8px;
}

/* --- 1.4 LUNAR WHISPERS (Mattes Granatrot & Obsidian) --- */
[data-theme="lunar-whispers"] {
  --bg-main: #090607;
  --bg-sidebar: #110b0d;
  --bg-card: #1c1114;
  --bg-input: #0b0608;
  
  --accent: #c04851;           /* Gedämpftes Granatrot */
  --accent-hover: #d15861;
  --accent-muted: rgba(192, 72, 81, 0.18);
  --accent-subtle: rgba(192, 72, 81, 0.05);
  
  --border-soft: #2e1a20;
  --border-strong: #4a2b34;
  
  --text-main: #f2ebee;
  --text-muted: #9c838a;
  --card-radius: 3px;
}

/* --- 1.5 WAY OF WINTER (Mattes Gletschereis) --- */
[data-theme="way-of-winter"] {
  --bg-main: #07090c;
  --bg-sidebar: #0e1218;
  --bg-card: #151b24;
  --bg-input: #090c10;
  
  --accent: #5ba4bf;           /* Mattes Eisblau */
  --accent-hover: #71b4ce;
  --accent-muted: rgba(91, 164, 191, 0.18);
  --accent-subtle: rgba(91, 164, 191, 0.05);
  
  --border-soft: #202c3a;
  --border-strong: #35475e;
  
  --text-main: #eaf0f5;
  --text-muted: #8395a8;
  --card-radius: 6px;
}

/* --- 1.6 MITSUKO (Mattes Blüten-Pink) --- */
[data-theme="mitsuko"] {
  --bg-main: #090709;
  --bg-sidebar: #120d11;
  --bg-card: #1c141b;
  --bg-input: #0a070a;
  
  --accent: #c45b78;           /* Mattes Altrosa/Crimson */
  --accent-hover: #d56c89;
  --accent-muted: rgba(196, 91, 120, 0.18);
  --accent-subtle: rgba(196, 91, 120, 0.05);
  
  --border-soft: #2e1e28;
  --border-strong: #4a3241;
  
  --text-main: #f2eaee;
  --text-muted: #9c8390;
  --card-radius: 6px;
}

/* --------------------------------------------------------------------------
   2. GLOBAL RESET & SIDEBAR LAYOUT
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.app-layout {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* --------------------------------------------------------------------------
   3. SIDEBAR NAVIGATION
   -------------------------------------------------------------------------- */
.app-sidebar {
  width: 240px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

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

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--card-radius);
  border: 1px solid var(--accent);
}

.brand-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
}

.brand-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.sidebar-nav {
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: var(--text-muted);
  font-family: 'Oswald', sans-serif;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: 0 var(--card-radius) var(--card-radius) 0;
  transition: all 0.2s ease;
  text-align: left;
}

.nav-item:hover {
  color: var(--text-main);
  background-color: var(--accent-subtle);
}

.nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background-color: var(--accent-muted);
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-soft);
}

/* --------------------------------------------------------------------------
   4. VIEWPORT & TOPBAR
   -------------------------------------------------------------------------- */
.app-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-bar {
  height: 52px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.top-bar-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.top-bar-title {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.content-area {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

/* Views Controller */
.view { display: none; }
.view.active { display: block; }

.subview { display: none; }
.subview.active { display: block; }

/* --------------------------------------------------------------------------
   5. INTERAKTIVE CARDS & MATRIX
   -------------------------------------------------------------------------- */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--card-radius);
  padding: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.card-header h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: var(--accent);
}

/* Stats Matrix Layout */
.stats-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-box {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-soft);
  border-radius: var(--card-radius);
  padding: 12px;
  text-align: center;
}

.stat-box.highlight {
  border-color: var(--accent);
  background-color: var(--accent-subtle);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  color: var(--accent);
}

.section-title {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 16px 0 8px 0;
}

.empty-placeholder {
  background-color: var(--bg-input);
  border: 1px dashed var(--border-soft);
  border-radius: var(--card-radius);
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   6. GRID & UTILITIES
   -------------------------------------------------------------------------- */
.grid { display: grid; }
.grid-cols-12 { grid-template-columns: repeat(12, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }

.col-span-4 { grid-column: span 4; }
.col-span-8 { grid-column: span 8; }

.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.max-w-300 { max-width: 300px; }
.text-subtle { color: var(--text-muted); font-size: 0.85rem; }
.divider { height: 1px; background-color: var(--border-soft); margin: 16px 0; }

/* --------------------------------------------------------------------------
   7. FORM CONTROLS & BUTTONS
   -------------------------------------------------------------------------- */
.field { margin-bottom: 14px; }

.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  color: var(--text-main);
  font-size: 0.85rem;
}

.form-control {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: var(--card-radius);
  color: var(--text-main);
  padding: 8px 12px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent-muted);
}

.slider-control {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Toggle Control */
.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-control input { display: none; }

.toggle-box {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background-color: var(--bg-input);
  transition: all 0.2s ease;
}

.toggle-control input:checked + .toggle-box {
  background-color: var(--accent);
  border-color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: var(--card-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-accent {
  background-color: var(--accent);
  color: #0d0f12;
  font-weight: 700;
}

.btn-accent:hover {
  background-color: var(--accent-hover);
}

.btn-primary {
  background-color: var(--accent-muted);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent);
  color: #0d0f12;
}

.btn-secondary, .btn-settings {
  background-color: var(--bg-sidebar);
  color: var(--text-muted);
  border-color: var(--border-soft);
}

.btn-secondary:hover, .btn-settings:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm { padding: 5px 10px; font-size: 0.75rem; }

/* Filter & Subtab Buttons */
.filter-btn, .subtab-btn {
  background-color: var(--bg-input);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--card-radius);
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.filter-btn.active, .subtab-btn.active,
.filter-btn:hover, .subtab-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background-color: var(--accent-subtle);
}

.toolbar-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.styled-list { list-style: none; }
.styled-list li { padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.code-block {
  font-family: 'JetBrains Mono', monospace;
  background-color: var(--bg-input);
  padding: 10px;
  border-radius: var(--card-radius);
  border: 1px solid var(--border-soft);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   8. MODALS & OVERLAYS
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
}

.modal-backdrop.active { display: flex; }

.modal {
  background-color: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--card-radius);
  width: 90%; max-width: 500px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.modal.max-w-820 { max-width: 820px; }

.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-close {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 1.4rem; cursor: pointer;
}

.modal-close:hover { color: var(--accent); }

.form-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}

.form-grid.single-col { grid-template-columns: 1fr; }

.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 20px; padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

/* --------------------------------------------------------------------------
   9. RESPONSIVE DESIGN
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  body.app-layout { flex-direction: column; }
  .app-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-soft); }
  .grid-cols-12 { display: flex; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   APP BACKSCREEN THEMES & CAROUSEL CARD IMAGES (v2.4.0)
   ========================================================================== */
:root {
  /* Dynamic App Backscreen Theme Assets */
  --bg-way-of-winter: url('Media/Standard/Way%20of%20Winter%20Theme%20Picture.png');
  --bg-vultures: url('Media/Standard/Vultures%20Theme%20Picture.png');
  --bg-lunar-whisper: url('Media/Standard/Lunar%20Whisper%20Theme%20Picture.png');
  --bg-endless-dream: url('Media/Standard/Endless%20Dream%20Theme%20Picture.png');

  /* Active Theme Pointer */
  --bg-active-theme: var(--bg-way-of-winter);
}

/* Theme Selectors */
body[data-theme="way-of-winter"] { --bg-active-theme: var(--bg-way-of-winter); }
body[data-theme="vultures"]      { --bg-active-theme: var(--bg-vultures); }
body[data-theme="lunar-whisper"]  { --bg-active-theme: var(--bg-lunar-whisper); }
body[data-theme="endless-dream"]  { --bg-active-theme: var(--bg-endless-dream); }

/* --------------------------------------------------------------------------
   3D CAROUSEL CUSTOM ARTWORK PLACEHOLDERS
   -------------------------------------------------------------------------- */
.card-3d.card-default-dark {
  background: linear-gradient(145deg, rgba(21, 26, 34, 0.95), rgba(14, 18, 23, 0.98));
  border: 1px solid var(--border-soft);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.card-3d.card-default-dark:hover {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-muted);
}
/* ==========================================================================
   ADDITIONS — v2.7.0
   Missing styles that caused visual regressions and broken layouts.
   ========================================================================== */

/* --------------------------------------------------------------------------
   A1. BADGE
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--accent-muted);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.badge-set {
  background-color: rgba(91, 164, 191, 0.12);
  color: #5ba4bf;
  border-color: rgba(91, 164, 191, 0.4);
}

.badge-mod {
  background-color: rgba(204, 162, 98, 0.12);
  color: var(--accent);
  border-color: rgba(204, 162, 98, 0.35);
}

/* --------------------------------------------------------------------------
   A2. STAT TAGS  (inline stat pills)
   -------------------------------------------------------------------------- */
.stat-tag {
  display: inline-block;
  background-color: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  padding: 2px 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 2px 2px 2px 0;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   A3. DATA TABLE
   -------------------------------------------------------------------------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table thead {
  background-color: var(--bg-input);
}

.data-table th {
  padding: 9px 12px;
  text-align: left;
  font-family: 'Oswald', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  color: var(--text-main);
}

.data-table tbody tr:hover {
  background-color: var(--accent-subtle);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .stat-cell {
  max-width: 240px;
  white-space: normal;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   A4. TEXT UTILITIES
   -------------------------------------------------------------------------- */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mono        { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; }

/* --------------------------------------------------------------------------
   A5. TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background-color: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--card-radius);
  padding: 10px 16px;
  font-size: 0.84rem;
  color: var(--text-main);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
  max-width: 320px;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success { border-color: #4caf7a; color: #4caf7a; }
.toast-danger  { border-color: #e05555; color: #e05555; }
.toast-warning { border-color: var(--accent); color: var(--accent); }
.toast-info    { border-color: var(--border-strong); color: var(--text-muted); }

/* --------------------------------------------------------------------------
   A6. DATABASE VIEW CARDS
   -------------------------------------------------------------------------- */
.db-item-card {
  padding: 16px;
  transition: border-color 0.2s ease;
}

.db-item-card:hover {
  border-color: var(--accent);
}

.db-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.db-item-name {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.db-item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.db-set-bonuses {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.set-bonus-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.set-piece-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-muted);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.set-bonus-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

/* --------------------------------------------------------------------------
   A7. OPTIMIZER RESULT CARDS
   -------------------------------------------------------------------------- */
.result-card {
  padding: 16px;
  margin-bottom: 12px;
}

.result-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.result-rank {
  font-family: 'Oswald', sans-serif;
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 700;
  min-width: 40px;
}

.result-score {
  font-size: 0.9rem;
  color: var(--text-main);
}

.result-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}

.result-slot {
  background-color: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: var(--card-radius);
  padding: 10px;
}

.result-slot-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-slot-item {
  font-size: 0.82rem;
  line-height: 1.4;
}

.result-totals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   A8. PROGRESS BAR
   -------------------------------------------------------------------------- */
.progress-track {
  height: 6px;
  background-color: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-muted), var(--accent));
  border-radius: 3px;
  transition: width 0.25s ease;
}

/* --------------------------------------------------------------------------
   A9. EMPTY STATE / PLACEHOLDERS
   -------------------------------------------------------------------------- */
.empty-state {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border: 1px dashed var(--border-soft);
  border-radius: var(--card-radius);
  background-color: var(--bg-input);
  margin: 8px 0;
}

/* --------------------------------------------------------------------------
   A10. CARD HEAD (toolbar inside card)
   -------------------------------------------------------------------------- */
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card-head input[type="search"],
.card-head input[type="text"] {
  flex: 1;
  min-width: 160px;
}

.card-head .filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   A11. SUBTAB + ACTION TOOLBAR
   -------------------------------------------------------------------------- */
.toolbar-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 16px;
}

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

.actions {
  display: flex;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   A12. ITEMS WITHIN SUBVIEWS
   -------------------------------------------------------------------------- */
.subview { display: none; }
.subview.active { display: block; }

/* --------------------------------------------------------------------------
   A13. GRID COLUMN SPAN — add col-span-12 for full-width sections
   -------------------------------------------------------------------------- */
.col-span-12 { grid-column: span 12; }

/* --------------------------------------------------------------------------
   A14. RESPONSIVE — stack result slots on narrow screens
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .result-slots { grid-template-columns: repeat(2, 1fr); }
  .data-table th,
  .data-table td { padding: 8px 6px; font-size: 0.78rem; }
  #toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }
}


/* ==========================================================================
   ADDITIONS — v2.7.1  (E-3 Loadouts, E-5 Share Keys)
   ========================================================================== */

/* --------------------------------------------------------------------------
   LOADOUT CARDS  (E-3)
   -------------------------------------------------------------------------- */
.loadout-card {
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color 0.2s ease;
}

.loadout-card:last-child {
  margin-bottom: 0;
}

.loadout-card:hover {
  border-color: var(--accent);
}

.loadout-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.loadout-name {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.loadout-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.loadout-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.loadout-slot-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 0.78rem;
  color: var(--text-main);
  white-space: nowrap;
}

.loadout-slot-pill.empty {
  color: var(--text-muted);
  border-style: dashed;
}

/* --------------------------------------------------------------------------
   SHARE KEY ROW  (E-5)
   -------------------------------------------------------------------------- */
.share-key-row {
  border-color: var(--border-soft);
  border-style: dashed;
}


/* ==========================================================================
   ADDITIONS — v2.7.2  (E-1 Router, E-2 Build Browser, E-6 Guides)
   ========================================================================== */

/* --------------------------------------------------------------------------
   BUILD BROWSER  (E-2)
   -------------------------------------------------------------------------- */
.build-browser-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.preset-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.preset-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-muted);
}

.preset-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.preset-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.preset-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.preset-name {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.preset-difficulty {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preset-description {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.preset-slots {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: var(--card-radius);
  padding: 8px 10px;
}

.preset-slot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.preset-slot-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.preset-mods {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
}

.preset-mods-label {
  color: var(--text-muted);
  white-space: nowrap;
}

.preset-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.preset-pros,
.preset-cons {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pro-con-row {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.preset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-chip {
  display: inline-block;
  background-color: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: lowercase;
}

/* --------------------------------------------------------------------------
   GUIDES — dynamic tables  (E-6)
   -------------------------------------------------------------------------- */
.guide-table {
  font-size: 0.8rem;
  margin-top: 8px;
}

.guide-table th {
  font-size: 0.72rem;
}

.guide-stat-cell {
  color: var(--accent);
  font-weight: 600;
}

.section-title {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* --------------------------------------------------------------------------
   RESPONSIVE — build browser 2-col on tablet, 1-col on mobile
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .preset-card.col-span-4 { grid-column: span 6; }
  .preset-pros-cons { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .preset-card.col-span-4 { grid-column: span 12; }
  .build-browser-head { flex-direction: column; }
}


/* ==========================================================================
   ADDITIONS — v2.7.3  (Armor Stat Picker, Mod Stat Picker, Farming Tab)
   ========================================================================== */

/* --------------------------------------------------------------------------
   STAT PICKER  (modal inline stat input rows)
   -------------------------------------------------------------------------- */
.stat-picker-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-picker-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  align-items: center;
}

/* --------------------------------------------------------------------------
   FIELD HINT  (small help text under label)
   -------------------------------------------------------------------------- */
.field-hint {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

label .field-hint {
  margin-left: 6px;
}

/* --------------------------------------------------------------------------
   FARMING TAB  (styled lists, location tables)
   -------------------------------------------------------------------------- */
.styled-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.styled-list li {
  font-size: 0.84rem;
  color: var(--text-muted);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.styled-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.styled-list li strong {
  color: var(--text-main);
}


/* ==========================================================================
   ADDITIONS — v2.7.4  (Set Bonus Display, Deviant Cards, Divider)
   ========================================================================== */

/* --------------------------------------------------------------------------
   RESULT SET BONUSES
   -------------------------------------------------------------------------- */
.result-set-bonuses {
  background-color: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: var(--card-radius);
  padding: 10px 12px;
  margin: 8px 0;
}

.set-bonus-active-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   DIVIDER
   -------------------------------------------------------------------------- */
.divider {
  height: 1px;
  background-color: var(--border-soft);
  margin: 12px 0;
}

/* --------------------------------------------------------------------------
   DEVIANT RARITY BADGES
   -------------------------------------------------------------------------- */
.db-item-card .badge[style*="a064d8"] {
  background-color: rgba(160, 100, 216, 0.12);
}

/* --------------------------------------------------------------------------
   WEAPON TABLE — type grouping via sticky headers
   -------------------------------------------------------------------------- */
.data-table .type-group-header td {
  background-color: var(--bg-input);
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 6px 12px;
}


/* ==========================================================================
   CAROUSEL & COMING SOON  — v2.9.0
   ========================================================================== */

/* --------------------------------------------------------------------------
   CAROUSEL WRAPPER — must be relative so arrows position correctly
   -------------------------------------------------------------------------- */
.carousel-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   CAROUSEL ARROW BUTTONS
   -------------------------------------------------------------------------- */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  /* push slightly outside the carousel track */
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.carousel-arrow:hover {
  background: var(--accent-muted);
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.08);
}

.carousel-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.carousel-arrow-prev { left:  8px; }
.carousel-arrow-next { right: 8px; }

/* Hint text below carousel */
.carousel-hint {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0.7;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   HIDDEN CAROUSEL CARD  (6+ card decks, no visible slot)
   -------------------------------------------------------------------------- */
.card-3d.carousel-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateZ(-500px) scale(0.5);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* --------------------------------------------------------------------------
   COMING SOON VIEW
   -------------------------------------------------------------------------- */
.coming-soon-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 65vh;
  text-align: center;
  gap: 18px;
  padding: 40px 20px;
}

.coming-soon-icon {
  font-size: 4.5rem;
  line-height: 1;
  filter: grayscale(0.3);
}

.coming-soon-title {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0;
}

.coming-soon-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 380px;
  margin: 0;
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}


/* ==========================================================================
   CAROUSEL FIX v2.9.1  — absolute-position card layout
   ========================================================================== */

/* Wrapper: needs overflow:visible so far cards show at edges */
.carousel-wrapper {
  overflow: visible !important;
  padding-bottom: 44px; /* room for hint text */
}

/* Cursor feedback: side cards invite clicking */
.card-3d:not(.center) {
  cursor: pointer;
}

/* Centre card: the action button is the only navigation trigger */
.card-3d.center {
  cursor: default;
}

.card-3d.center .card-action-btn {
  cursor: pointer;
}

/* Arrow buttons sit outside the carousel track */
.carousel-arrow-prev { left:  -16px; }
.carousel-arrow-next { right: -16px; }


/* ==========================================================================
   THEME OVERLAY ACCENT TINTS  — complement each background image
   ========================================================================== */

/* The backscreen overlay gradient already handles darkening.
   These rules add a subtle accent colour bleed into the overlay. */

body[data-theme="vulture"] .app-backscreen-overlay {
  background: radial-gradient(circle at 50% 30%,
    rgba(212, 93, 63, 0.08) 0%, rgba(9, 9, 9, 0.82) 70%, #0a0909 100%),
    linear-gradient(to bottom, rgba(0,0,0,0) 60%, #0a0909 100%);
}
body[data-theme="lunar-whispers"] .app-backscreen-overlay {
  background: radial-gradient(circle at 50% 30%,
    rgba(192, 72, 81, 0.08) 0%, rgba(9, 6, 7, 0.82) 70%, #090607 100%),
    linear-gradient(to bottom, rgba(0,0,0,0) 60%, #090607 100%);
}
body[data-theme="endless-dream"] .app-backscreen-overlay {
  background: radial-gradient(circle at 50% 30%,
    rgba(77, 184, 196, 0.08) 0%, rgba(9, 8, 14, 0.82) 70%, #09080e 100%),
    linear-gradient(to bottom, rgba(0,0,0,0) 60%, #09080e 100%);
}
body[data-theme="mitsuko"] .app-backscreen-overlay {
  background: radial-gradient(circle at 50% 30%,
    rgba(196, 91, 120, 0.12) 0%, rgba(9, 7, 9, 0.82) 70%, #090709 100%),
    linear-gradient(to bottom, rgba(0,0,0,0) 60%, #090709 100%);
}
body[data-theme="way-of-winter"] .app-backscreen-overlay {
  background: radial-gradient(circle at 50% 30%,
    rgba(91, 164, 191, 0.07) 0%, rgba(7, 9, 12, 0.83) 70%, #07090c 100%),
    linear-gradient(to bottom, rgba(0,0,0,0) 60%, #07090c 100%);
}

/* ==========================================================================
   CARD & FORM ELEMENT ACCENT TINTS — ensure every theme colours inputs/btns
   ========================================================================== */

/* Active filter / subtab buttons pick up the theme accent automatically
   because they use var(--accent) — no extra rules needed.
   These are guard rules for any element that was left with hardcoded gold. */

.btn-primary {
  background-color: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}
.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Focused inputs */
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

/* Section titles */
.section-title {
  color: var(--accent);
}

/* Scrollbar accent */
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-muted);
}

/* ==========================================================================
   THEME VISUAL EFFECTS  — v2.9.2
   Each theme gets: card glow, UI accent tone, and a CSS-layer special effect.
   Canvas particles are handled by ThemeParticles in app.js.
   ========================================================================== */

/* ── Shared: smooth theme transition ─────────────────────────────────────── */
body {
  transition: background-color 0.6s ease;
}
.card, .app-header, .modal-backdrop .modal {
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

/* ==========================================================================
   ❄️  WAY OF WINTER — ice, arctic tundra, frozen mountains
   Palette: #5ba4bf (ice blue) accent
   ========================================================================== */
body[data-theme="way-of-winter"] .card {
  border-color: rgba(91, 164, 191, 0.22);
}
body[data-theme="way-of-winter"] .card:hover {
  box-shadow: 0 0 24px rgba(91, 164, 191, 0.18), 0 8px 32px rgba(0,0,0,0.75);
  border-color: rgba(91, 164, 191, 0.45);
}
/* Frost vignette in corners */
body[data-theme="way-of-winter"]::after {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 0% 0%,   rgba(120,195,225,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 0%,  rgba(120,195,225,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 0% 100%,  rgba(91,164,191,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 100% 100%, rgba(91,164,191,0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 3;
}
/* Soft blue tint on form controls */
body[data-theme="way-of-winter"] .form-control:focus {
  box-shadow: 0 0 0 2px rgba(91,164,191,0.35);
}

/* ==========================================================================
   🔥  VULTURE — post-apocalyptic wasteland, rust, industrial ruins
   Palette: #d45c2a (rust orange) accent
   ========================================================================== */
body[data-theme="vulture"] .card {
  border-color: rgba(212, 92, 42, 0.2);
}
body[data-theme="vulture"] .card:hover {
  box-shadow: 0 0 24px rgba(212, 92, 42, 0.18), 0 8px 32px rgba(0,0,0,0.78);
  border-color: rgba(212, 92, 42, 0.44);
}
/* Heat shimmer vignette */
body[data-theme="vulture"]::after {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 30% at 50% 100%, rgba(180,60,10,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 3;
  animation: heat-shimmer 4s ease-in-out infinite;
}
@keyframes heat-shimmer {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.65; }
}

/* ==========================================================================
   🌕  LUNAR WHISPERS — Blood Moon, Lord of Moonlight, crimson lunacy
   Palette: #c04851 (garnet red) accent
   ========================================================================== */
body[data-theme="lunar-whispers"] .card {
  border-color: rgba(192, 72, 81, 0.2);
}
body[data-theme="lunar-whispers"] .card:hover {
  box-shadow: 0 0 28px rgba(192, 72, 81, 0.2), 0 8px 32px rgba(0,0,0,0.8);
  border-color: rgba(192, 72, 81, 0.48);
}
/* Red moon radial vignette */
body[data-theme="lunar-whispers"]::after {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 50% 50% at 75% 15%, rgba(200,50,70,0.1) 0%, transparent 55%),
    radial-gradient(ellipse 100% 20% at 50% 100%, rgba(120,20,35,0.14) 0%, transparent 70%);
  pointer-events: none;
  z-index: 3;
  animation: moon-pulse 6s ease-in-out infinite;
}
@keyframes moon-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* ==========================================================================
   💻  ENDLESS DREAM — nightmare dreamscape, CRT TVs, psychedelic amusement parks
   Palette: #4db8c4 (teal) accent
   ========================================================================== */
body[data-theme="endless-dream"] .card {
  border-color: rgba(77, 184, 196, 0.2);
}
body[data-theme="endless-dream"] .card:hover {
  box-shadow: 0 0 28px rgba(77, 184, 196, 0.2), 0 8px 32px rgba(0,0,0,0.8);
  border-color: rgba(77, 184, 196, 0.45);
}
/* CRT scanline overlay */
body[data-theme="endless-dream"]::before {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent       0px,
    transparent       3px,
    rgba(0,0,0,0.045) 3px,
    rgba(0,0,0,0.045) 4px
  );
  pointer-events: none;
  z-index: 9997;
  animation: scanroll 12s linear infinite;
}
@keyframes scanroll {
  from { background-position: 0 0; }
  to   { background-position: 0 400px; }
}
/* Occasional CRT flicker */
body[data-theme="endless-dream"]::after {
  content: '';
  position: fixed; inset: 0;
  background: rgba(0,220,255,0.015);
  pointer-events: none;
  z-index: 9998;
  animation: crt-flicker 5s steps(1) infinite;
}
@keyframes crt-flicker {
  0%,89%,91%,100% { opacity: 1; }
  90%             { opacity: 0; }
}

/* ==========================================================================
   🌸  MITSUKO — first Meta-Human, dimensional traveller, supernatural Japan
   Palette: #c45b7a (blossom pink) accent
   ========================================================================== */
body[data-theme="mitsuko"] .card {
  border-color: rgba(196, 91, 122, 0.2);
}
body[data-theme="mitsuko"] .card:hover {
  box-shadow: 0 0 24px rgba(196, 91, 122, 0.2), 0 8px 32px rgba(0,0,0,0.78);
  border-color: rgba(196, 91, 122, 0.44);
}
/* Soft blossom vignette */
body[data-theme="mitsuko"]::after {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 70% 30% at 50% 0%,    rgba(180,80,120,0.08) 0%, transparent 65%),
    radial-gradient(ellipse 100% 15% at 50% 100%, rgba(130,40,80,0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 3;
  animation: blossom-breathe 7s ease-in-out infinite;
}
@keyframes blossom-breathe {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ==========================================================================
   ✨  ONCE HUMAN (default) — Stardust survivors, New Weird post-apocalypse
   Palette: #cca262 (amber gold) accent — the original
   ========================================================================== */
body[data-theme="once-human"] .card {
  border-color: rgba(204, 162, 98, 0.2);
}
body[data-theme="once-human"] .card:hover {
  box-shadow: 0 0 24px rgba(204, 162, 98, 0.2), 0 8px 32px rgba(0,0,0,0.78);
  border-color: rgba(204, 162, 98, 0.42);
}
/* Amber stardust glow at top */
body[data-theme="once-human"]::after {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 60% 25% at 50% 0%, rgba(200,150,60,0.07) 0%, transparent 65%);
  pointer-events: none;
  z-index: 3;
}

/* ==========================================================================
   THEME BADGE on the toggle button
   ========================================================================== */
#btn-theme-toggle::after {
  content: attr(data-current-theme);
  display: none; /* labels handled via toast only */
}


/* ==========================================================================
   ITEM BROWSER  — v1.0
   ========================================================================== */

/* ── Layout ──────────────────────────────────────────────────────────────── */
.item-browser {
  display: flex;
  height: calc(100vh - var(--header-h, 56px));
  overflow: hidden;
  gap: 0;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.browser-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border-soft);
  overflow-y: auto;
  padding: 12px 10px 16px;
  scrollbar-width: thin;
}

.sidebar-search { margin-bottom: 12px; }
.sidebar-search input { font-size: 0.83rem; }

.sidebar-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.sidebar-section-title {
  font-family: 'Oswald', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin: 0 0 8px;
}

/* Category nav */
.browser-cat-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.83rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}
.cat-btn:hover { background: var(--bg-input); color: var(--text-main); }
.cat-btn.active {
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: 600;
}
.cat-icon  { font-size: 1rem; flex-shrink: 0; }
.cat-label { flex: 1; }
.cat-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* Subcategory nav */
.subcat-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.subcat-btn {
  padding: 5px 8px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.subcat-btn:hover { background: var(--bg-input); color: var(--text-main); }
.subcat-btn.active { color: var(--accent); font-weight: 600; }

/* Rarity filters */
.rarity-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rarity-check {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.rarity-check input { cursor: pointer; accent-color: var(--accent); }
.rarity-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Tag filters */
.tag-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-btn {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
}
.tag-btn:hover { border-color: var(--accent); color: var(--text-main); }
.tag-btn.active {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
}

/* Range filters */
.range-filters { display: flex; flex-direction: column; gap: 10px; }
.range-filter label {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}
.range-row { display: flex; align-items: center; gap: 6px; }
.range-slider {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
  cursor: pointer;
}
.range-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

/* ── Main area ───────────────────────────────────────────────────────────── */
.browser-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-main);
}

.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-card);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.browser-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.browser-toolbar-right { margin-left: auto; display: flex; gap: 8px; }
.sort-select { font-size: 0.8rem; padding: 4px 8px; min-width: 160px; }

.active-filter-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.active-chip {
  display: inline-flex; align-items: center;
  background: var(--accent-muted);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.72rem;
  cursor: pointer;
}

/* Grid wrap — VirtualScroller mounts here */
.browser-grid-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  scrollbar-width: thin;
  position: relative;
}

.browser-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 60px 20px;
  font-size: 0.9rem;
}
.browser-loading .browser-grid-wrap::after {
  content: 'Loading…';
  display: block;
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}
.browser-loading-placeholder {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 8px 10px;
}

/* Virtual Scroller internal */
.vs-wrap  { position: relative; width: 100%; }
.vs-tile-wrap { display: contents; }

/* ── ITEM TILES ──────────────────────────────────────────────────────────── */
.item-tile {
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--tile-border, rgba(255,255,255,0.15));
  background: var(--tile-bg, var(--bg-card));
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition:
    transform      0.22s cubic-bezier(0.25,1,0.5,1),
    border-color   0.22s ease,
    box-shadow     0.22s ease;
  user-select: none;
}

.item-tile:hover {
  transform: translateY(-3px) scale(1.018);
  border-color: var(--tile-color, var(--accent));
  box-shadow: 0 8px 28px var(--tile-glow, transparent);
}

/* Gear tile (larger) */
.tile-gear { /* size set via CSS vars from VirtualScroller */ }

/* Inventory tile (smaller) */
.tile-inventory { /* size set via CSS vars from VirtualScroller */ }

/* Info icon on hover */
.item-tile::after {
  content: 'ℹ';
  position: absolute;
  top: 6px; right: 7px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  line-height: 20px;
  text-align: center;
}
.item-tile:hover::after { opacity: 1; }

/* "Click to view" hint */
.item-tile::before {
  content: 'Click to view';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 10px 6px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  font-size: 9px;
  color: rgba(255,255,255,0.55);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}
.item-tile:hover::before { opacity: 1; transform: translateY(0); }

/* Legendary shimmer */
.tile-shimmer {
  background-image: linear-gradient(
    105deg, transparent 40%, rgba(255,220,80,0.07) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: tile-shimmer 3.5s ease-in-out infinite;
}
@keyframes tile-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Tile internals */
.tile-icon-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tile-bg, var(--bg-input));
  min-height: 0;
}
.tile-icon {
  width: 70%; height: 70%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}
.tile-icon-ph {
  font-size: 2.2rem;
  opacity: 0.6;
}
.tile-new-badge {
  position: absolute; top: 4px; left: 4px;
  background: var(--accent); color: #000;
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px;
  letter-spacing: 0.5px;
}

.tile-info {
  padding: 5px 6px 6px;
  background: rgba(0,0,0,0.35);
}
.tile-rarity-bar {
  height: 2px; border-radius: 1px;
  margin-bottom: 4px;
  opacity: 0.85;
}
.tile-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.tile-stats { display: flex; flex-direction: column; gap: 2px; }
.tile-stat  { display: flex; align-items: center; gap: 4px; font-size: 0.68rem; }
.tile-stat-icon { opacity: 0.7; }
.tile-stat-val  { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.tile-perk-preview { font-size: 0.68rem; color: var(--text-muted); font-style: italic; }

/* ── DETAIL OVERLAY ──────────────────────────────────────────────────────── */
.item-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(8px) saturate(0.55);
  -webkit-backdrop-filter: blur(8px) saturate(0.55);
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 200;
}
.item-backdrop.visible { opacity: 1; pointer-events: auto; }

.item-detail-panel {
  position: fixed;
  top: 50%; left: 50%;
  translate: -50% -50%;
  width: min(420px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.85);
  z-index: 201;
  transform: scale(0.88) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.32s cubic-bezier(0.34,1.56,0.64,1),
    opacity   0.22s ease;
  scrollbar-width: thin;
}
.item-detail-panel.visible {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Detail panel internals */
.detail-close-btn {
  position: sticky; top: 0;
  float: right;
  margin: 10px 10px 0 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  z-index: 1;
  transition: background 0.15s, color 0.15s;
}
.detail-close-btn:hover { background: var(--border-strong); color: var(--text-main); }

.detail-hero {
  height: 180px;
  display: flex; align-items: center; justify-content: center;
  background: var(--tile-bg, var(--bg-input));
  border-radius: 14px 14px 0 0;
  position: relative;
  overflow: hidden;
}
.detail-icon    { width: 130px; height: 130px; object-fit: contain; }
.detail-icon-ph { font-size: 4rem; opacity: 0.6; }
.detail-new-badge {
  position: absolute; top: 8px; left: 10px;
  background: var(--accent); color: #000;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
}

.detail-body { padding: 14px 18px 20px; }

.detail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.detail-rarity-badge {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.detail-category {
  font-size: 0.72rem; color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 4px; padding: 1px 7px;
}
.detail-set-badge {
  font-size: 0.72rem;
  background: var(--accent-muted);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 4px; padding: 1px 7px;
}

.detail-name {
  font-family: 'Oswald', sans-serif;
  font-size: 1.3rem; font-weight: 700;
  color: var(--text-main); margin: 0 0 6px;
}
.detail-desc {
  font-size: 0.82rem; color: var(--text-muted);
  line-height: 1.55; margin: 0 0 14px;
}

.detail-section { margin-top: 14px; }
.detail-section-title {
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); margin: 0 0 8px;
}

.detail-stats { display: flex; flex-direction: column; gap: 6px; }
.detail-stat-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
}
.detail-stat-icon  { text-align: center; }
.detail-stat-label { color: var(--text-muted); }
.detail-stat-val   { font-family: 'JetBrains Mono', monospace; color: var(--text-main); font-weight: 600; }
.detail-stat-bar   {
  grid-column: 1 / -1;
  height: 4px; border-radius: 2px;
  background: var(--bg-input);
  overflow: hidden; margin-top: -2px;
}
.detail-stat-bar-fill { height: 100%; border-radius: 2px; transition: width 0.4s ease; }
.detail-stat-note  { grid-column: 2 / -1; font-size: 0.72rem; color: var(--text-muted); font-style: italic; }

.detail-perk { margin-bottom: 8px; }
.detail-perk-name  { display: block; font-weight: 600; color: var(--accent); font-size: 0.82rem; }
.detail-perk-desc  { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }

.detail-craft-station {
  font-size: 0.8rem; color: var(--text-main); font-weight: 600; margin-bottom: 6px;
}
.detail-craft-row  { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 3px; }
.detail-craft-row span { color: var(--text-main); }

.detail-sources { display: flex; flex-wrap: wrap; gap: 5px; }
.source-tag {
  padding: 2px 8px; border-radius: 4px; font-size: 0.72rem;
  background: var(--bg-input); border: 1px solid var(--border-soft);
  color: var(--text-muted); text-transform: capitalize;
}
.source-boss { border-color: rgba(224,85,85,0.4); color: #e05555; }
.source-silo { border-color: rgba(91,164,191,0.4); color: #5ba4bf; }

.detail-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.btn-toggle-owned.owned-active {
  background: var(--accent-muted); border-color: var(--accent); color: var(--accent);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .item-browser    { flex-direction: column; height: auto; }
  .browser-sidebar { width: 100%; height: auto; max-height: 40vh; border-right: none; border-bottom: 1px solid var(--border-soft); }
  .browser-main    { height: calc(100vh - 40vh - 56px); }
}

