
/* System Sections Visibility */
.system-section {
  display: none;
}
.system-section.active {
  display: block;
}

:root {
  --bg-main: #0a0d14;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 56, 0.9);
  --bg-glass: rgba(14, 19, 30, 0.65);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 170, 50, 0.35);

  --accent-gold: #ffaa33;
  --accent-orange: #ff7733;
  --accent-cyan: #38bdf8;
  --accent-purple: #c084fc;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --rarity-rare: #3b82f6;
  --rarity-epic: #a855f7;
  --rarity-legendary: #f59e0b;
  --rarity-mythic: #ef4444;
  --rarity-immortal: #ff3399;
  --rarity-arcana: #38bdf8;
  --rarity-transcend: #c084fc;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-lg: 0 12px 36px -6px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 170, 50, 0.06);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(255, 170, 50, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(56, 189, 248, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(192, 132, 252, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

code, pre {
  font-family: 'JetBrains Mono', monospace;
}

.app-layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.75rem 2rem 4rem;
}

/* Header */
.app-header {
  margin-bottom: 2rem;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand-icon {
  font-size: 2.75rem;
  background: linear-gradient(135deg, rgba(255, 170, 50, 0.2), rgba(255, 119, 51, 0.1));
  border: 1px solid rgba(255, 170, 50, 0.3);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-md);
  box-shadow: 0 0 24px rgba(255, 170, 50, 0.25);
}

.brand h1 {
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge-accent {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.15rem;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-select {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.lang-select option {
  background: var(--bg-main);
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  color: #111;
  box-shadow: 0 4px 15px rgba(255, 170, 50, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 170, 50, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-outline:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

/* 4 Stats Cards */












/* Controls Card */
.controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}

/* Main Category Tabs */
.category-tabs-container {
  display: flex;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.65rem 1.2rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cat-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.cat-tab.active {
  background: linear-gradient(135deg, rgba(255, 170, 50, 0.2), rgba(255, 119, 51, 0.1));
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 0 16px rgba(255, 170, 50, 0.15);
}

.cat-badge {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
}

.cat-tab.active .cat-badge {
  background: var(--accent-gold);
  color: #111;
  font-weight: 800;
}

/* Filter Controls */
.filter-controls {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 280px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 2.75rem 0.75rem 2.75rem;
  background: rgba(10, 14, 22, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(255, 170, 50, 0.2);
}

.btn-clear {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
}

/* Dynamic Tier & Rarity Filter Pills */
.tier-filters,
.tier-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tier-filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}

.tier-pill {
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  min-height: 34px;
  box-sizing: border-box;
  padding: 0 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  white-space: nowrap;
  line-height: 1;
}

.tier-pill .nav-img-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  margin: 0;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Inactive Rarity Colored Pill: Subtle Tint & Border */
.tier-pill[style*="--tier-color"] {
  color: var(--tier-color);
  background: color-mix(in srgb, var(--tier-color) 12%, rgba(0,0,0,0.3));
  border-color: color-mix(in srgb, var(--tier-color) 35%, transparent);
}

.tier-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateY(-1px);
}

.tier-pill[style*="--tier-color"]:hover {
  background: color-mix(in srgb, var(--tier-color) 22%, rgba(0,0,0,0.4));
  border-color: var(--tier-color);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--tier-color) 30%, transparent);
}

/* Active State: Vibrant Solid Background */
.tier-pill.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.tier-pill.active[style*="--tier-color"] {
  color: #ffffff !important;
  background: var(--tier-color) !important;
  border-color: var(--tier-color) !important;
  box-shadow: 0 0 16px color-mix(in srgb, var(--tier-color) 55%, transparent);
}

/* Filter Status Bar */
.filter-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.result-count {
  font-weight: 600;
}

/* Collectible Cards Grid */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.card,
.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.card::before,
.item-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent-gold));
  box-shadow: 0 0 12px var(--card-accent, var(--accent-gold));
}

.card:hover,
.item-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--bg-card-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--card-glow, rgba(255, 170, 50, 0.1));
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.card-title-group {
  flex: 1;
}

.card-category-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  display: block;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}

.card-id-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.rarity-pill {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Stats Badges */
.card-stats-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.stat-pill {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

.stat-pill.max-stat {
  background: rgba(255, 170, 50, 0.08);
  border-color: rgba(255, 170, 50, 0.25);
  color: var(--accent-gold);
}

/* Skill Teaser */
.card-skill-box {
  background: rgba(192, 132, 252, 0.08);
  border-left: 3px solid var(--accent-purple);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.card-skill-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-purple);
}

.card-skill-desc {
  font-size: 0.76rem;
  color: #cbd5e1;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Suit Tag */
.card-suit-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-gold);
  background: rgba(255, 170, 50, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* Card Footer */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-glass);
  margin-top: auto;
}

.card-costs {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.card-costs strong {
  color: #e2e8f0;
}

.btn-detail {
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-detail:hover {
  background: var(--accent-gold);
  color: #111;
  border-color: var(--accent-gold);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal.active {
  display: flex !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(12px);
}

.modal-dialog {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1260px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.modal-content {
  background: #0f1422;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 170, 50, 0.1);
}

.modal-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.02);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.entity-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  color: var(--text-secondary);
}

.modal-title-group h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

.modal-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-close {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
}

/* Modal Ascension Table */
.ascension-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: rgba(8, 11, 18, 0.7);
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
}

.ascension-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.ascension-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-glass);
}

.ascension-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.ascension-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.decoded-attr-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(34, 197, 94, 0.09);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: #4ade80;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  margin-right: 0.35rem;
  margin-bottom: 0.3rem;
}

.decoded-attr-pill.special {
  background: rgba(56, 189, 248, 0.09);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

.raw-stat-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  margin-right: 0.3rem;
  margin-bottom: 0.25rem;
}

.raw-stat-pill strong {
  color: #fff;
}

.raw-stat-pill.special {
  background: rgba(245, 158, 11, 0.09);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.raw-stat-pill.special strong {
  color: #fef08a;
}

.perk-box {
  background: rgba(192, 132, 252, 0.08);
  border-left: 3px solid var(--accent-purple);
  padding: 0.45rem 0.7rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}

.perk-box-title {
  font-weight: 700;
  color: var(--accent-purple);
  font-size: 0.82rem;
  margin-bottom: 0.15rem;
}

.perk-box-desc {
  font-size: 0.79rem;
  line-height: 1.45;
  color: #e2e8f0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-lg);
  margin-top: 2rem;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Progress Overlay */
.progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 15, 0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(16px);
}

.progress-box {
  background: #111625;
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  box-shadow: 0 0 50px rgba(255, 170, 50, 0.25);
  max-width: 450px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 170, 50, 0.2);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .app-layout {
    padding: 1rem;
  }
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .grid-container {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   PAGE NAVIGATION: group row + the current group's pages (nav.js buildNav)
======================================================== */
.system-nav {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.nav-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-glass);
}

.nav-group {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.6rem 1.1rem 0.55rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-group:hover {
  color: var(--text-primary);
  border-bottom-color: rgba(255, 255, 255, 0.25);
}

.nav-group.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.nav-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 0 1rem;
}

.sys-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.sys-tab[hidden] {
  display: none;
}

.sys-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
}

.sys-tab.active {
  background: linear-gradient(135deg, rgba(255, 170, 50, 0.2), rgba(255, 110, 0, 0.1));
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.sys-tab .nav-img-icon {
  width: 20px;
  height: 20px;
  margin-right: 0;
}

.sys-badge {
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
}

.sys-tab.active .sys-badge {
  background: rgba(255, 170, 50, 0.3);
  color: #fff;
}

/* Mobile: the open page, a tap opens the drawer */
.mobile-page-bar {
  display: none;
}

/* ========================================================
   CAPY TOOL POOL DASHBOARD & INSPECTOR
======================================================== */
.capy-tool-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: fadeIn 0.3s ease;
}

.capy-tool-card {
  background: linear-gradient(145deg, #181d2e, #111524);
  border: 1px solid rgba(255, 170, 50, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 170, 50, 0.1);
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.capy-tool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

.level-stepper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.select-level-dropdown {
  background: #0d111d;
  color: var(--accent-gold);
  border: 1px solid rgba(255, 170, 50, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.select-level-dropdown:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(255, 170, 50, 0.4);
}

.capy-compare-header {
  display: flex;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.compare-col-title.current {
  color: #fff;
}

.compare-col-title.next {
  color: var(--accent-gold);
}

.capy-tiers-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.capy-tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(13, 17, 29, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}

.capy-tier-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.tier-name-badge {
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tier-rates-compare {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.05rem;
}

.rate-val.cur {
  color: #fff;
  min-width: 65px;
  text-align: right;
}

.rate-val.next {
  color: var(--accent-gold);
  min-width: 65px;
  text-align: right;
}

.rate-arrow {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.capy-tool-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.upgrade-cost-pill, .cum-cost-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.95rem;
}

.upgrade-cost-pill strong, .cum-cost-pill strong {
  color: var(--accent-gold);
  font-family: 'JetBrains Mono', monospace;
}

.full-progression-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-glass);
}








.legacy-card {
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.legacy-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-gold);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.15);
}

.legacy-skill-tier-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.legacy-skill-tier-item .skill-tier-tag {
  font-weight: 800;
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  display: inline-block;
  margin-right: 0.35rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.summon-category-box {
  background: rgba(13, 17, 29, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.summon-category-header {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summon-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.summon-item-row:last-child {
  margin-bottom: 0;
}




/* ==========================================================================
   MOBILE & MULTI-PAGE ROUTING ENHANCEMENTS
   ========================================================================== */

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastSlideIn 0.3s ease, toastFadeOut 0.3s ease 2.7s forwards;
  pointer-events: auto;
}

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

@keyframes toastFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Share Button in Modals */
.btn-share {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-share:hover {
  background: rgba(56, 189, 248, 0.3);
  color: #fff;
  border-color: #38bdf8;
}

/* System Nav Scroll for Mobile */



.category-tabs-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}

.category-tabs-container::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  flex-shrink: 0;
  white-space: nowrap;
}

.tier-filters, .tier-filter-bar {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tier-filters::-webkit-scrollbar, .tier-filter-bar::-webkit-scrollbar {
  display: none;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .app-layout {
    padding: 1.25rem 1.25rem 3rem;
  }
  
}

@media (max-width: 768px) {
  .app-layout {
    padding: 1rem 0.75rem 3rem;
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .brand h1 {
    font-size: 1.4rem;
  }

  .brand-icon {
    font-size: 2rem;
    padding: 0.3rem 0.45rem;
  }

  .header-actions {
    justify-content: stretch;
  }

  .header-actions .btn {
    flex: 1;
    justify-content: center;
  }


  .grid-container {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-dialog {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    margin: 1.5rem auto !important;
    padding: 1.25rem 0.9rem !important;
    border-radius: var(--radius-md) !important;
  }

  .modal-header h2 {
    font-size: 1.25rem;
  }

  .modal-item-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .capy-tool-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .capy-compare-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .capy-tier-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .capy-tier-name {
    grid-column: 1 / -1;
  }

  .capy-tool-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .ascension-table {
    font-size: 0.8rem;
  }

  .ascension-table th, .ascension-table td {
    padding: 0.5rem 0.4rem;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

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

@media (max-width: 480px) {
  .brand h1 {
    font-size: 1.25rem;
  }

  .subtitle {
    font-size: 0.8rem;
  }

}


/* Controls Card & Search Box Styling */
.controls-card, .controls-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-glass);
}

.search-box, .search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: rgba(10, 13, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.search-box:focus-within, .search-wrap:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.search-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input, .search-wrap input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.85rem 2.8rem 0.85rem 2.85rem;
}

.search-box input::placeholder, .search-wrap input::placeholder {
  color: var(--text-muted);
}

.btn-clear, .search-clear {
  position: absolute;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  font-size: 0.85rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-clear:hover, .search-clear:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #fff;
}

.nav-img-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 6px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Unified Filter Status Bar & Reset Buttons */
.filter-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 1rem;
  margin-bottom: 0;
}

.result-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-reset-filters,
.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  font-family: inherit;
}

.btn-reset-filters:hover,
.btn-text:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-reset-filters:active,
.btn-text:active {
  transform: translateY(0);
}


/* ========================================================
   MOBILE HAMBURGER & SLIDING SIDE DRAWER NAVIGATION
======================================================== */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 44px;
  height: 44px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  z-index: 1001;
  transition: all 0.25s ease;
}

.mobile-menu-btn:hover, .mobile-menu-btn:focus-visible {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--accent-gold);
}

.hamburger-bar {
  display: block;
  width: 100%;
  height: 2.5px;
  background: #f1f5f9;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hamburger to 'X' animation when active */
.mobile-menu-btn.active .hamburger-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
  background: var(--accent-gold);
}

.mobile-menu-btn.active .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-btn.active .hamburger-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  background: var(--accent-gold);
}

/* Mobile Drawer Backdrop */
.mobile-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 15, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Sliding Drawer Container */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: #0b0f19;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 10px 0 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(251, 191, 36, 0.05);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.mobile-nav-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-brand-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.drawer-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.drawer-subtitle {
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-weight: 600;
}

.drawer-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drawer-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.drawer-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.8rem 0.4rem 0.45rem;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  cursor: pointer;
}

.drawer-section-title:hover {
  color: var(--text-primary);
}

.drawer-chevron::before {
  content: '';
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.drawer-group.open .drawer-chevron::before {
  transform: rotate(45deg);
}

.drawer-group-pages {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 0.35rem;
}

.drawer-group.open .drawer-group-pages {
  display: flex;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0.85rem 0.75rem;
  flex: 1;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.drawer-nav-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-nav-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.drawer-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.08);
}

.drawer-nav-item.active {
  background: rgba(251, 191, 36, 0.12);
  color: #fff;
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.1);
}

.drawer-nav-item.active .drawer-nav-label {
  color: var(--accent-gold);
}

.drawer-footer {
  padding: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ========================================================
   RESPONSIVE OVERHAUL (Mobile & Tablet Breakpoints)
======================================================== */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .header-content {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .system-nav {
    display: none !important; /* Replaced by sliding side drawer on mobile */
  }

  .mobile-page-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.6rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }

  .mobile-page-group {
    color: var(--text-muted);
    white-space: nowrap;
  }

  .mobile-page-sep {
    color: var(--text-muted);
  }

  .mobile-page-name {
    color: var(--accent-gold);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  .mobile-page-more {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
  }

  /* Horizontal swipeable filter bars */
  .cat-tabs, .tier-filters, .capymon-subnav, .capymon-faction-filters {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding-bottom: 0.4rem;
    gap: 0.4rem;
  }

  .cat-tabs::-webkit-scrollbar,
  .tier-filters::-webkit-scrollbar,
  .capymon-subnav::-webkit-scrollbar,
  .capymon-faction-filters::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
  }

  .cat-tab, .tier-pill {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0.45rem 0.75rem;
  }

  /* Controls Panel Stack */
  .controls-panel, .controls-card {
    padding: 0.85rem;
  }

  /* Modal Optimization for Mobile */
  .modal.active {
    padding: 0.5rem !important;
  }

  .modal-dialog {
    max-height: 94vh !important;
    width: 98% !important;
  }

  .modal-header {
    padding: 0.85rem 1rem !important;
  }

  .modal-body {
    padding: 0.85rem 1rem !important;
  }

  /* Tables inside Modals */
  .ascension-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .ascension-table {
    min-width: 500px;
  }
}

@media (max-width: 480px) {
  .app-layout {
    padding: 0.75rem 0.5rem 2.5rem !important;
  }

  .brand h1 {
    font-size: 1.15rem !important;
  }

  .author-badge {
    font-size: 0.7rem !important;
    padding: 0.15rem 0.45rem !important;
  }

  .card {
    padding: 0.85rem !important;
  }
}


/* ========================================================
   COSMETICS SECTION STYLING
======================================================== */
.cosmetics-subnav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.cosmetic-sub-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cosmetic-sub-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.cosmetic-sub-tab.active {
  background: rgba(251, 191, 36, 0.12);
  color: var(--accent-gold);
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.1);
}

.sub-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.cosmetic-sub-tab.active .sub-badge {
  background: rgba(251, 191, 36, 0.25);
  color: #fff;
}

.cosmetic-card-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cosmetic-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.frame-preview-box {
  width: 56px;
  height: 56px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.frame-inner-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.frame-overlay-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* 2-Level Cosmetics Navigation */







/* ==========================================================================
   DOCKYARD (AVALONDOCK) SYSTEM STYLING
   ========================================================================== */

.dockyard-hero-banner {
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.75) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px -10px rgba(14, 116, 144, 0.3);
  position: relative;
  overflow: hidden;
}

.dockyard-hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.dockyard-hero-main {
  margin-bottom: 1.25rem;
}

.dockyard-hero-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.dockyard-hero-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: rgba(8, 145, 178, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
}

.dockyard-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.dockyard-desc {
  white-space: pre-line;
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
  max-width: 900px;
}

/* Page Switcher Tabs */
.dockyard-nav-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.dock-page-tab {
  flex: 1;
  min-width: 260px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all 0.25s ease;
  text-align: left;
}

.dock-page-tab:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.dock-page-tab.active {
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.8) 0%, rgba(14, 116, 144, 0.2) 100%);
  border-color: #38bdf8;
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.2);
}

.dock-page-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.dock-page-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.2rem;
}

.dock-page-tab.active .dock-page-title {
  color: #38bdf8;
}

.dock-page-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Controls Bar */










/* Tech Cards Grid */
.dockyard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.dock-card {
  background: linear-gradient(180deg, rgba(20, 27, 45, 0.85) 0%, rgba(13, 17, 29, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.dock-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.15);
}

.dock-card-header {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.dock-card-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(8, 145, 178, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dock-card-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.dock-card-title-group {
  flex: 1;
  min-width: 0;
}

.dock-card-meta {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.25rem;
}

.dock-badge-id {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.dock-badge-maxlvl {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.dock-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Requirements Box */
.dock-req-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  color: #94a3b8;
}

.dock-req-badge {
  display: inline-block;
  font-weight: 700;
  color: #38bdf8;
}

/* Stats Comparison Box */
.dock-stats-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dock-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  gap: 0.5rem;
}

.dock-stat-label {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.dock-stat-val-base {
  color: #cbd5e1;
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

.dock-stat-val-max {
  color: #38bdf8;
  font-weight: 800;
  text-align: right;
  word-break: break-word;
  background: rgba(56, 189, 248, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* Lore Quote */
.dock-lore-quote {
  font-size: 0.76rem;
  color: #64748b;
  font-style: italic;
  line-height: 1.45;
  margin-top: auto;
  border-left: 2px solid rgba(56, 189, 248, 0.4);
  padding-left: 0.6rem;
}

/* Modal Table Styling */
.dock-modal-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
}

.dock-modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.dock-modal-table th {
  background: rgba(15, 23, 42, 0.9);
  color: #38bdf8;
  font-weight: 800;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.dock-modal-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
}

.dock-modal-table tr:hover {
  background: rgba(56, 189, 248, 0.06);
}

.dock-cost-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.78rem;
}

/* ==========================================================================
   DOCKYARD TREE GRAPH VIEW STYLING
   ========================================================================== */





.dockyard-tree-wrap {
  background: rgba(10, 15, 29, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
  position: relative;
}

.dockyard-tree-header-legend {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  justify-content: center;
}

.dock-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dock-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dock-legend-dot.root { background: #38bdf8; box-shadow: 0 0 8px #38bdf8; }
.dock-legend-dot.branch { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.dock-legend-dot.capstone { background: #10b981; box-shadow: 0 0 8px #10b981; }

.dock-legend-line {
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  display: inline-block;
}

.dockyard-tree-scrollbox {
  overflow-x: auto;
  overflow-y: visible;
  padding: 1rem 0.5rem 2rem 0.5rem;
  display: flex;
  justify-content: center;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.3) rgba(15, 23, 42, 0.6);
}

.dockyard-tree-scrollbox::-webkit-scrollbar {
  height: 8px;
}

.dockyard-tree-scrollbox::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}

.dockyard-tree-scrollbox::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 4px;
}

.dockyard-tree-canvas {
  position: relative;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}

.dockyard-tree-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.dock-honeycomb-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  padding: 2rem 1rem 3rem 1rem;
}

.dock-honey-row {
  display: flex;
  justify-content: center;
  gap: 56px;
  position: relative;
  margin-bottom: 52px;
  width: 100%;
}

.dock-honey-row:last-child {
  margin-bottom: 0;
}

/* Honeycomb Icon Node */
.dock-honey-node {
  width: 72px;
  height: 72px;
  background: radial-gradient(circle at 35% 35%, #1e293b 0%, #0a0f1d 100%);
  border: 2px solid rgba(56, 189, 248, 0.45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(56, 189, 248, 0.15);
}

.dock-honey-node:hover {
  transform: scale(1.18);
  border-color: #f59e0b;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.7), inset 0 0 15px rgba(245, 158, 11, 0.3);
  z-index: 50;
}

.dock-honey-node.node-root {
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.6), inset 0 0 12px rgba(56, 189, 248, 0.3);
}

.dock-honey-node.node-capstone {
  border-color: #10b981;
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.65), inset 0 0 12px rgba(16, 185, 129, 0.35);
}

.dock-honey-node.node-dimmed {
  opacity: 0.22;
  filter: grayscale(90%);
}

.dock-honey-node.node-dimmed:hover {
  opacity: 0.95;
  filter: grayscale(0%);
}

.dock-honey-node.node-parent-glow {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.9), inset 0 0 15px rgba(56, 189, 248, 0.5) !important;
  transform: scale(1.15);
}

.dock-honey-node.node-child-glow {
  border-color: #10b981 !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.9), inset 0 0 15px rgba(16, 185, 129, 0.5) !important;
  transform: scale(1.15);
}

.dock-honey-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
  transition: transform 0.2s ease;
}

.dock-honey-node:hover .dock-honey-icon {
  transform: scale(1.08);
}

.dock-honey-badge-lvl {
  position: absolute;
  bottom: -8px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #f59e0b;
  background: #090d16;
  border: 1px solid rgba(245, 158, 11, 0.6);
  border-radius: 10px;
  padding: 1px 7px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

.dock-honey-badge-id {
  position: absolute;
  top: -8px;
  font-size: 0.58rem;
  font-weight: 700;
  color: #94a3b8;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0 5px;
  white-space: nowrap;
}

/* Floating Interactive Tooltip */
.dock-node-tooltip {
  position: absolute;
  width: 320px;
  background: rgba(13, 19, 33, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.25);
  z-index: 999;
  pointer-events: none;
  backdrop-filter: blur(12px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.dock-tip-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dock-tip-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 4px;
  flex-shrink: 0;
}

.dock-tip-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.dock-tip-badges {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.dock-tip-stat-box {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.55rem;
}

.dock-tip-stat-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.dock-tip-stat-val {
  font-size: 0.82rem;
  color: #f1f5f9;
  line-height: 1.35;
}

.dock-tip-cost-row, .dock-tip-req-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  margin-bottom: 0.35rem;
}

.dock-tip-cost-lbl, .dock-tip-req-lbl {
  color: var(--text-secondary);
  font-weight: 600;
}

.dock-tip-cost-val {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: #f59e0b;
  font-weight: 800;
}

.dock-tip-req-val {
  color: #cbd5e1;
  font-weight: 700;
}

.dock-tip-footer {
  margin-top: 0.65rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  color: #38bdf8;
  font-weight: 700;
  text-align: center;
}

.dock-intel-icon-sm {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
}

.dock-cost-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-weight: 700;
  color: #f59e0b;
  font-size: 0.85rem;
}

/* SVG Line Connections */
.tree-edge {
  stroke: rgba(56, 189, 248, 0.25);
  stroke-width: 2.2;
  fill: none;
  transition: stroke 0.25s ease, stroke-width 0.25s ease, filter 0.25s ease;
}

.tree-edge.edge-parent-active {
  stroke: #38bdf8 !important;
  stroke-width: 3.5 !important;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.8));
}

.tree-edge.edge-child-active {
  stroke: #10b981 !important;
  stroke-width: 3.5 !important;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.8));
}

/* ==========================================================================
   Mythic Treasure Equippable Types (Core, Guardian, Totem)
   ========================================================================== */
.card-icon-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.treasure-type-badge-overlay {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 22px;
  height: 22px;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  cursor: help;
}

.card:hover .treasure-type-badge-overlay {
  transform: scale(1.18);
}

.modal-icon-container {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.modal-kind-badge-overlay {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 26px;
  height: 26px;
  z-index: 3;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.9));
  pointer-events: auto;
  cursor: help;
}

.treasure-kind-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.treasure-kind-pill img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.treasure-kind-pill.kind-core {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.treasure-kind-pill.kind-guardian {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.45);
}

.treasure-kind-pill.kind-totem {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.45);
}

/* Inline game sprite next to text (gameIcon() in js/core.js) */
.game-icon {
  display: inline-block;
  object-fit: contain;
  vertical-align: -0.2em;
}


/* ---------- Server Ranges ---------- */
.sr-lookup:not(:empty) { margin-top: 1rem; }
.sr-guild-box { width: 100%; max-width: 100%; margin-top: 0.6rem; }
.sr-mode-name { font-weight: 700; }
.sr-mode-via { display: block; margin-top: 0.15rem; }
.sr-row-modes { margin-bottom: 0.35rem; color: #38bdf8; }
/* columns with a known game mode: sky blue, apart from the gold active tab */
.cat-tab.sr-tab-mode { border-color: rgba(56, 189, 248, 0.55); background: rgba(56, 189, 248, 0.08); }
.cat-tab.sr-tab-mode.active { border-color: var(--accent-gold); }
.sr-tab-modes { color: #38bdf8; font-weight: 600; }
.sr-tab-modes::before { content: '· '; }
.sr-mode-known, .sr-mode-name { color: #38bdf8; }
.sr-mode-known { font-size: 0.8rem; font-weight: 600; }
.sr-sub { font-weight: 700; font-size: 0.9rem; margin: 1rem 0 0.5rem; color: var(--text-secondary); }
.sr-lookup-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.6rem; }
.sr-muted { color: var(--text-muted); font-weight: 400; font-size: 0.85rem; }
.sr-miss { color: #f59e0b; font-size: 0.9rem; }
.sr-table-wrap { background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-lg); overflow-x: auto; box-shadow: var(--shadow-glass); }
.sr-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.9rem; table-layout: fixed; }
.sr-table td, .sr-table th { overflow-wrap: anywhere; }
.sr-col-name { width: 190px; }
.sr-col-group { width: 80px; }
.sr-lookup, #section-servers .controls-card { min-width: 0; }
.sr-table th { padding: 0.75rem 1rem; font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); background: rgba(255, 255, 255, 0.04); border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.sr-table td { padding: 0.6rem 1rem; border-top: 1px solid var(--border-glass); vertical-align: top; }
.sr-table td.sr-servers { line-height: 1.55; word-break: break-word; }
.sr-table tr.sr-hl td { background: rgba(255, 170, 51, 0.1); }
.sr-table tr.sr-hl td:first-child { box-shadow: inset 3px 0 0 var(--accent-gold); }
.sr-table tr.sr-wz-group td { background: rgba(255, 170, 51, 0.04); }
.sr-table tr.sr-wz-group td:first-child { box-shadow: inset 3px 0 0 rgba(255, 170, 51, 0.45); }
.sr-empty { text-align: center; padding: 2.5rem; color: var(--text-secondary); }
.sr-link { background: none; border: 0; padding: 0; color: var(--accent-gold); font: inherit; cursor: pointer; text-align: left; }
.sr-link:hover { text-decoration: underline; }
#section-servers .category-tabs-container { margin: 1rem 0; }
.sr-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sr-pill { --c: #94a3b8; display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.sr-pill.sr-pill-hit { background: var(--c); color: #111; border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 35%, transparent); }
.sr-z0 { --c: #fb7185; } .sr-z1 { --c: #38bdf8; } .sr-z2 { --c: #fbbf24; } .sr-z3 { --c: #34d399; }
.sr-z4 { --c: #a78bfa; } .sr-z5 { --c: #94a3b8; } .sr-z6 { --c: #f472b6; } .sr-z7 { --c: #2dd4bf; } .sr-zx { --c: #64748b; }
.sr-wz-line { margin: 0.3rem 0; line-height: 1.5; }
.sr-wz-rating { color: var(--accent-gold); font-size: 1.05rem; }
.sr-wz-verdict { font-weight: 600; color: #38bdf8; }
.sr-wz-note { margin: 0.5rem 0; }
.wz-explain { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.75rem; margin-bottom: 0.5rem; }
.wz-card { background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-lg); padding: 0.8rem 1rem; }
.wz-card-title { font-weight: 700; margin-bottom: 0.4rem; color: var(--accent-gold); }
.wz-card p { margin: 0 0 0.45rem; font-size: 0.88rem; line-height: 1.55; color: var(--text-secondary); }
.wz-card p:last-child { margin-bottom: 0; }
.sr-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.9rem; }
/* 24 columns: wrap onto several rows instead of the shared horizontal scroll */
#servers-feature-tabs { flex-wrap: wrap; overflow-x: visible; gap: 0.5rem; }
#servers-feature-tabs .cat-tab { flex-shrink: 1; padding: 0.45rem 0.8rem; font-size: 0.85rem; }
/* Capymon / Grand Voyage sub nav: 7 tabs, wrap instead of scrolling */
#section-capymon > .category-tabs-container { flex-wrap: wrap; overflow-x: visible; gap: 0.5rem; }
@media (max-width: 640px) {
  .sr-col-name { width: 112px; }
  .sr-col-group { width: 72px; }
  .sr-table { font-size: 0.82rem; }
  .sr-table th, .sr-table td { padding: 0.5rem 0.6rem; }
}


/* ---------- Guild Trade Ship ---------- */
.ts-controls { display: flex; flex-direction: column; gap: 0.8rem; position: relative; padding-right: 6rem; }
.ts-ship-art { position: absolute; top: 1rem; right: 1.5rem; bottom: 1rem; height: calc(100% - 2rem); width: auto; object-fit: contain; }
.ts-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.ts-label { width: 120px; flex-shrink: 0; font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.ts-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; min-width: 0; }
.ts-chips .cat-tab { padding: 0.45rem 0.8rem; font-size: 0.88rem; }
.ts-cost { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.cat-tab.active .ts-cost { color: inherit; }
.cat-tab.ts-zero:not(.active) { opacity: 0.45; }
.ts-note { margin: 0.2rem 0 0; font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.ts-note code { font-size: 0.78rem; color: var(--text-secondary); }

.ts-cabin { background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); min-width: 0; }
.ts-cabin-captain { margin-bottom: 1.5rem; border-color: var(--border-highlight); }
.ts-cabin-head { padding: 0.9rem 1.1rem; background: rgba(255, 255, 255, 0.04) center / cover no-repeat; border-bottom: 1px solid var(--border-glass); }
.ts-cabin-title { font-weight: 800; font-size: 1.1rem; color: var(--text-primary); }
.ts-cabin-sub { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.15rem; }
.ts-cabin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }
.ts-slots { padding: 0.6rem 1.1rem 1rem; display: flex; flex-direction: column; gap: 0.9rem; }
.ts-cabin-captain .ts-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ts-slot-head { font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 0.35rem; }
.ts-slot-big .ts-slot-head { color: var(--accent-gold); }
.ts-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.ts-item { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; min-width: 0; }
.ts-item-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(255, 255, 255, 0.05) center / 100% 100% no-repeat; border-radius: 6px; vertical-align: middle; }
.ts-item-icon img { width: 82%; height: 82%; object-fit: contain; }
.ts-item-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.ts-item-count { color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; white-space: nowrap; }
.ts-item-rate { width: 3.6rem; text-align: right; font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; font-weight: 700; color: var(--accent-cyan); white-space: nowrap; }
.ts-calc { margin-top: 1.5rem; margin-bottom: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.ts-calc-title { font-weight: 800; font-size: 1.1rem; }
.ts-row-top { align-items: flex-start; }
.ts-row-top .ts-label { padding-top: 0.5rem; }
.ts-pick { gap: 0.4rem; }
.ts-calc-table { table-layout: auto; }
.ts-calc-table th, .ts-calc-table td { white-space: nowrap; }
.ts-calc-table td:not(:first-child), .ts-calc-table th:not(:first-child) { text-align: right; font-family: 'JetBrains Mono', monospace; }
.ts-calc-table th:not(:first-child) { font-family: inherit; }
.ts-calc-mean td { color: var(--text-secondary); font-style: italic; }
.ts-calc-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.ts-calc-foot .ts-note { margin: 0; }
.ts-calc-foot .cat-tab { flex-shrink: 0; }
@media (max-width: 640px) {
  .ts-label { width: 100%; }
  .ts-row-top .ts-label { padding-top: 0; }
  .ts-calc-foot { flex-direction: column; }
  .ts-controls { padding-right: 4.5rem; }
  .ts-ship-art { right: 1rem; }
  .ts-cabin-grid { grid-template-columns: 1fr; }
  .ts-slots { padding: 0.5rem 0.8rem 0.9rem; }
}

/* ---------- Battle Skills ---------- */
.bs-icon { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background-size: 100% 100%; border-radius: 8px; }
.bs-icon img { width: 82%; height: 82%; object-fit: contain; }
.bs-card .pt-name { font-size: 0.98rem; }
.bs-preview { flex-basis: 100%; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bs-card[open] .bs-preview { display: none; }
.bs-levels, .bs-pick { font-size: 0.75rem; color: var(--text-muted); }
.bs-boss { font-size: 0.72rem; font-weight: 700; color: var(--accent-gold); border: 1px solid color-mix(in srgb, var(--accent-gold) 45%, transparent); border-radius: 999px; padding: 0.05rem 0.45rem; }
.bs-level-name { font-weight: 700; margin-bottom: 0.15rem; }
.bs-upgrade { margin-top: 0.3rem; font-size: 0.8rem; color: var(--text-secondary); }
.bs-upgrade::before { content: '▲ '; color: var(--accent-gold); }
.bs-full { margin-top: 0.35rem; padding-top: 0.35rem; border-top: 1px dashed var(--border-glass); font-size: 0.8rem; color: var(--text-secondary); }
.bs-apex { margin-top: 0.6rem; padding: 0.45rem 0.6rem; border-radius: var(--radius-sm); background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.3); font-size: 0.82rem; line-height: 1.5; }
.bs-apex-tag { color: #38bdf8; border-color: rgba(56, 189, 248, 0.45); }
.bs-apex-mark { margin-left: 0.2rem; color: #38bdf8; font-weight: 800; }
.bs-raw-wrap { margin-top: 0.4rem; }
.bs-raw-wrap > summary { cursor: pointer; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }
.bs-num { color: #4ade80; font-weight: 700; }
.bs-buff { margin: 0.1rem 0 0.35rem; }
.bs-buff-head { font-size: 0.72rem; font-weight: 700; color: var(--accent-gold); }
.bs-raw { width: 100%; border-collapse: collapse; font-size: 0.78rem; table-layout: fixed; margin-top: 0.3rem; }
.bs-raw td { padding: 0.12rem 0.3rem; border-top: 1px solid var(--border-glass); vertical-align: top; overflow-wrap: anywhere; }
.bs-raw td:first-child { width: 92px; color: var(--text-muted); font-weight: 600; }
.bs-raw code { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; }
.bs-count { display: block; margin: 0.25rem 0 0.75rem; }
.bs-sets { display: flex; flex-direction: column; gap: 0.6rem; }
.bs-set { --c: var(--accent-gold); }
.bs-tiers td:first-child { width: 120px; }
.bs-chip { cursor: default; }
.bs-chip.bs-hit { background: color-mix(in srgb, var(--c) 30%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent); }
@media (max-width: 600px) { .bs-tiers td:first-child { width: 84px; } }

/* ---------- Weapons ---------- */
.wp-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; min-width: 0; }
.wp-card { cursor: pointer; display: flex; flex-direction: column; }
.wp-icon { width: 64px; height: 64px; flex-shrink: 0; border-radius: 12px; background: rgba(0, 0, 0, 0.5); border: 1px solid; padding: 4px; display: flex; align-items: center; justify-content: center; }
.wp-icon img { width: 100%; height: 100%; object-fit: contain; }
.wp-tags { display: flex; gap: 0.35rem; align-items: center; margin-bottom: 0.2rem; flex-wrap: wrap; }
.wp-kind { font-size: 0.72rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.wp-rank { font-size: 0.72rem; font-weight: 800; padding: 0.05rem 0.5rem; border-radius: 999px; }
.wp-rank-3 { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.5); }
.wp-rank-2 { background: rgba(245, 158, 11, 0.16); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.45); }
.wp-stats { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.75rem 0 0.4rem; }
.wp-stats span { font-size: 0.78rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.wp-from { font-size: 0.8rem; color: var(--text-secondary); margin: 0.2rem 0 0.5rem; }
.wp-from strong { color: var(--text-primary); }
.wp-skill-preview { background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: var(--radius-sm); padding: 0.65rem 0.75rem; margin: 0.4rem 0 0.75rem; font-size: 0.8rem; color: #e2e8f0; line-height: 1.4; flex: 1; }
.wp-skill-tier { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; margin-bottom: 0.3rem; }
.wp-open { margin-top: auto; }
.wp-table td { vertical-align: top; }
.wp-tier { display: inline-block; white-space: nowrap; font-size: 0.8rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 6px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.wp-stat-cell { font-size: 0.82rem; color: var(--text-secondary); white-space: nowrap; }
.wp-skill { font-size: 0.84rem; color: #e2e8f0; line-height: 1.45; }
.wp-skill + .wp-skill { margin-top: 0.4rem; }
.wp-row-skill td { background: rgba(255, 255, 255, 0.025); }
@media (max-width: 640px) {
  .wp-stat-cell { white-space: normal; }
}
.wp-level-bar input[type="range"] { flex: 1; min-width: 140px; max-width: 360px; accent-color: var(--accent-gold); }
.wp-level-input { width: 4.5rem; padding: 0.35rem 0.5rem; border-radius: var(--radius-sm); border: 1px solid var(--border-glass); background: rgba(255, 255, 255, 0.05); color: var(--text-primary); font: inherit; font-weight: 700; }
.wp-level-note { font-size: 0.78rem; color: var(--text-muted); }
.wp-main-head { font-size: 0.75rem; font-weight: 800; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.35rem; }
.wp-skill-main { color: var(--accent-gold); font-weight: 700; }

/* Capy Grand Voyage islands (Capymon > Islands) */
.vi-filters { display: flex; flex-direction: column; gap: 0.6rem; margin: 1rem 0; }
.vi-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.vi-label { width: 4.5rem; flex-shrink: 0; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.vi-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.vi-search { margin-left: auto; min-width: 220px; padding: 0.45rem 0.7rem; border-radius: var(--radius-sm); border: 1px solid var(--border-glass); background: var(--bg-card); color: var(--text-primary); font: inherit; }
.vi-count { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 0.5rem; }
.vi-table td { vertical-align: top; padding: 0.6rem 0.75rem; border-top: 1px solid var(--border-glass); }
.vi-table th { padding: 0.6rem 0.75rem; }
.vi-col-island { width: 210px; }
.vi-col-cost { width: 90px; }
.vi-col-rewards { width: 300px; }
.vi-level { display: inline-block; min-width: 2.8rem; text-align: center; padding: 0.1rem 0.4rem; border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; font-weight: 700; color: var(--accent-gold); background: rgba(255, 170, 50, 0.12); border: 1px solid rgba(255, 170, 50, 0.35); }
.vi-kind { font-weight: 700; }
.vi-monster { display: flex; gap: 0.6rem; align-items: flex-start; }
.vi-monster + .vi-monster { margin-top: 0.5rem; }
.vi-monster-icon { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.vi-monster-body { min-width: 0; }
.vi-monster-name { font-weight: 700; }
.vi-power { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; font-weight: 700; color: var(--accent-gold); margin-left: 0.25rem; }
.vi-info summary { cursor: pointer; font-size: 0.76rem; font-weight: 700; color: #94a3b8; }
.vi-info div { margin-top: 0.3rem; font-size: 0.82rem; line-height: 1.5; color: #e2e8f0; }
.vi-rewards { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; }
.vi-item { display: inline-flex; align-items: center; gap: 0.3rem; }
@media (max-width: 800px) { .vi-col-island { width: 130px; } .vi-col-rewards { width: 150px; } .vi-search { margin-left: 0; width: 100%; } }

/* Pets tab */
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 0.8rem; align-items: start; }
.pt-card { background: var(--bg-card); border: 1px solid var(--border-glass); border-left: 3px solid var(--c); border-radius: var(--radius-lg); }
.pt-card summary { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.9rem; cursor: pointer; list-style: none; }
.pt-card summary::-webkit-details-marker { display: none; }
.pt-card summary::after { content: '▸'; margin-left: auto; color: var(--text-muted); }
.pt-card[open] summary::after { content: '▾'; }
.pt-icon { width: 52px; height: 52px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.pt-icon img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; min-width: 0; }
.pt-name { font-weight: 800; font-size: 1.02rem; color: var(--c); }
.pt-skill { flex-basis: 100%; font-size: 0.82rem; color: var(--text-secondary); }
.pt-detail { padding: 0 0.9rem 0.9rem; font-size: 0.85rem; line-height: 1.5; }
.pt-tile { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.7rem 0.9rem; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.pt-tile:hover { background: var(--bg-card-hover); }
.pt-modal { padding: 0; }
.tl-unofficial { display: inline-block; margin-right: 0.35em; padding: 0 0.35em; border: 1px dashed rgba(255, 255, 255, 0.35); border-radius: 4px; color: var(--text-muted); font-size: 0.65rem; font-weight: 600; line-height: 1.5; letter-spacing: 0.02em; vertical-align: 0.15em; text-transform: uppercase; cursor: help; }
.pt-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--accent-gold); margin: 0.9rem 0 0.4rem; }
.pt-table { width: 100%; border-collapse: collapse; }
.pt-table td { vertical-align: top; padding: 0.35rem 0.4rem; border-top: 1px solid var(--border-glass); }
.pt-unlock { white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; font-weight: 700; color: var(--accent-gold); }
.pt-effects { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 1rem; }
.pt-effects li { break-inside: avoid; padding: 0.1rem 0; }
.pt-odds td, .pt-odds th { text-align: center; }
.pt-line { font-weight: 700; }
.pt-range { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--accent-gold); margin-left: 0.3rem; }
@media (max-width: 600px) { .pt-effects { columns: 1; } }
.pt-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pt-chip { --c: #94a3b8; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.55rem 0.15rem 0.3rem; border-radius: 999px; font-size: 0.82rem; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.pt-chip img { width: 22px; height: 22px; object-fit: contain; }
.pt-rate { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-secondary); }
.pt-lock { font-size: 0.78rem; color: var(--text-muted); }
.pt-gear-skill { margin: 0.25rem 0; }
.pt-gear-desc { margin-top: 0.6rem; color: var(--text-secondary); font-size: 0.82rem; }
.pt-gear-stages td, .pt-gear-stages th { font-size: 0.8rem; }
.pt-starcost { margin-top: 0.25rem; font-size: 0.78rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.35rem; }
.pt-levels td { vertical-align: middle; }
.pt-bond { border-left-color: var(--accent-gold); }
.vi-lineup-power { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.35rem; }
.vi-lineup { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.vi-capymon { --c: #94a3b8; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.6rem 0.2rem 0.3rem; border-radius: 10px; background: color-mix(in srgb, var(--c) 10%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.vi-capymon img { width: 30px; height: 30px; object-fit: contain; }
.vi-capymon-name { display: block; font-size: 0.8rem; font-weight: 700; color: var(--c); line-height: 1.2; }
.vi-capymon-sub { display: block; font-size: 0.72rem; color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; }
.vi-needs { margin: 0; padding-left: 1.1rem; font-size: 0.85rem; line-height: 1.6; }

/* Capymon > Lineup and Capy Tools */
.cl-root { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1rem; animation: fadeIn 0.3s ease; }
.cl-card { background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); padding: 1.25rem; min-width: 0; }
.cl-h2 { font-size: 1.2rem; font-weight: 800; color: #fff; margin: 0 0 0.6rem; }
.wn-h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); margin: 1.1rem 0 0; }
.ev-item[data-item], [data-item] { cursor: pointer; }
.ev-item[data-item] { border-radius: 6px; transition: background 0.15s; }
.ev-item[data-item] .ev-item-name { text-decoration: underline dotted rgba(255, 255, 255, 0.4); text-underline-offset: 3px; }
.ev-item[data-item]:hover { background: rgba(255, 170, 51, 0.12); }
.ev-item[data-item]:hover .ev-item-name, .ep-shop-name[data-item]:hover { color: var(--accent-gold) !important; text-decoration-color: var(--accent-gold); }
.ep-shop-name[data-item] { text-decoration: underline dotted rgba(255, 255, 255, 0.35); text-underline-offset: 3px; }
.cl-h3 { font-size: 0.8rem; font-weight: 800; color: var(--accent-gold); text-transform: uppercase; letter-spacing: 0.04em; margin: 1rem 0 0.4rem; }
.cl-muted { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.5; }
.cl-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.5rem 1.5rem; }
.cl-two .cl-h3 { margin-top: 0.25rem; }
.cl-list { margin: 0; padding-left: 1.1rem; font-size: 0.88rem; line-height: 1.6; }
.cl-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; }
.cl-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.55rem; border-radius: 999px; border: 1px solid var(--border-glass); background: rgba(255, 255, 255, 0.04); font-size: 0.8rem; }
.cl-sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-top: 0.75rem; }
.cl-side { border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 0.85rem; min-width: 0; }
.cl-side-active { border-color: var(--border-highlight); box-shadow: 0 0 0 1px rgba(255, 170, 50, 0.15); }
.cl-side-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.cl-side-btn { font: inherit; font-weight: 700; color: var(--accent-gold); background: rgba(255, 170, 50, 0.1); border: 1px solid rgba(255, 170, 50, 0.35); border-radius: var(--radius-sm); padding: 0.3rem 0.7rem; cursor: pointer; }
.cl-link { font: inherit; font-size: 0.8rem; color: var(--text-secondary); background: none; border: none; cursor: pointer; text-decoration: underline; }
.cl-slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.35rem; }
.cl-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; min-height: 78px; padding: 0.25rem; border-radius: var(--radius-sm); border: 1px solid var(--q, var(--border-glass)); background: rgba(0, 0, 0, 0.25); color: var(--text-primary); font: inherit; cursor: pointer; min-width: 0; }
.cl-slot img { width: 36px; height: 36px; object-fit: contain; }
.cl-slot small { font-size: 0.65rem; line-height: 1.15; text-align: center; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.cl-slot-empty { border-style: dashed; color: var(--text-muted); cursor: default; font-size: 0.75rem; }
.cl-bond-on { margin: 0.4rem 0; font-size: 0.88rem; line-height: 1.5; }
.cl-tools-in { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center; margin-top: 0.6rem; font-size: 0.82rem; }
.cl-tools-in input { width: 4.2rem; padding: 0.2rem 0.4rem; border-radius: 6px; border: 1px solid var(--border-glass); background: rgba(255, 255, 255, 0.05); color: var(--text-primary); font: inherit; }
.cl-result { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin: 1rem 0 0.5rem; font-size: 0.95rem; }
.cl-mult { font-family: 'JetBrains Mono', monospace; color: var(--accent-gold); font-size: 1.1rem; }
.cl-note { color: #fca5a5; font-size: 0.85rem; margin: 0.25rem 0; }
.cl-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 0.4rem; margin-top: 0.75rem; }
.cl-pick { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; padding: 0.4rem 0.25rem; border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--q) 45%, transparent); background: rgba(255, 255, 255, 0.03); color: var(--text-primary); font: inherit; cursor: pointer; min-width: 0; }
.cl-pick:hover { background: var(--bg-card-hover); }
.cl-picked { border-color: var(--q); background: color-mix(in srgb, var(--q) 18%, transparent); }
.cl-pick img { width: 44px; height: 44px; object-fit: contain; }
.cl-pick-name { font-size: 0.72rem; line-height: 1.15; text-align: center; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.cl-pick-meta { display: flex; gap: 0.2rem; }
.cl-table td, .cl-table th { padding: 0.5rem 0.65rem; vertical-align: top; font-size: 0.85rem; }
.cl-details { border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; margin-top: 0.5rem; }
.cl-details summary { cursor: pointer; }
.cl-calc { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin: 0.75rem 0; font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); }
.cl-calc label { display: flex; align-items: center; gap: 0.45rem; }
.cl-calc-out { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.9rem; }
.cost-calc { border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; margin-top: 0.75rem; }
.cost-calc-title { font-weight: 800; font-size: 0.9rem; }
.cost-calc .cl-calc { margin: 0.5rem 0; }
.cl-tool { display: flex; align-items: center; gap: 0.5rem; }
.cl-main b { color: var(--accent-gold); }
.cl-fams { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.6rem; }
.cl-fam { border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 0.55rem 0.7rem; font-size: 0.84rem; line-height: 1.6; }
.cl-fam-head { font-weight: 800; color: var(--accent-cyan); font-size: 0.75rem; text-transform: uppercase; }
.cl-sets { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.75rem; }
.cl-set { border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 0.75rem; font-size: 0.85rem; line-height: 1.5; min-width: 0; }
.cl-set-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.cl-set-lv + .cl-set-lv { margin-top: 0.35rem; }
.cl-lv { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 700; color: var(--accent-gold); background: rgba(255, 170, 50, 0.12); border: 1px solid rgba(255, 170, 50, 0.35); border-radius: 6px; padding: 0 0.35rem; margin-right: 0.25rem; }
.cl-set-roll { margin-top: 0.5rem; font-size: 0.78rem; }
.tl-lvl { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--accent-gold); }

/* Events */
.ev-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.6rem; }
.ev-card { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border-radius: var(--radius-sm); border: 1px solid var(--border-glass); border-left: 3px solid var(--c); background: rgba(255, 255, 255, 0.03); min-width: 0; }
.ev-card-icon { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.ev-card-body { flex: 1; min-width: 0; font-size: 0.82rem; }
.ev-card-title { font-weight: 700; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; margin-bottom: 0.6rem; }
.ev-scroll { overflow-x: auto; border: 1px solid var(--border-glass); border-radius: var(--radius-sm); }
.ev-grid { min-width: 1100px; }
.ev-line { display: grid; grid-template-columns: 190px 1fr; border-top: 1px solid var(--border-glass); }
.ev-head { border-top: none; position: sticky; top: 0; background: var(--bg-card); }
.ev-label { display: flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.5rem; font-size: 0.8rem; position: sticky; left: 0; background: #121826; z-index: 1; min-width: 0; }
.ev-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-track { position: relative; min-height: 30px; background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent calc(100% / 42)); }
.ev-days { display: grid; grid-template-columns: repeat(42, 1fr); background-image: none; }
.ev-day { font-size: 0.62rem; color: var(--text-muted); text-align: center; padding: 0.4rem 0; white-space: nowrap; }
.ev-day-week { color: var(--text-secondary); font-weight: 700; border-left: 1px solid var(--border-glass); }
.ev-bar { position: absolute; top: 7px; height: 16px; border-radius: 5px; background: color-mix(in srgb, var(--c) 70%, transparent); border: 1px solid var(--c); }
.ev-today { position: absolute; top: 0; bottom: -2000px; width: 2px; background: var(--accent-gold); pointer-events: none; z-index: 2; }
.ev-grid { position: relative; overflow: hidden; }
.ev-archive { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.5rem; font-size: 0.84rem; }
.ev-arch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.ev-link { cursor: pointer; }
.ev-card.ev-link:hover { background: var(--bg-card-hover); }
.ev-arch-row.ev-link:hover b { color: var(--accent-gold); }
.ev-bar.ev-link:hover { filter: brightness(1.25); }
.ev-item { display: inline-flex; align-items: center; gap: 0.15rem; margin: 0 0.5rem 0.15rem 0; font-size: 0.82rem; white-space: nowrap; }
.ev-note { font-size: 0.88rem; line-height: 1.7; padding: 0.6rem 0.8rem; border: 1px solid var(--border-glass); border-radius: var(--radius-sm); }
.ev-item-name { margin: 0 0.15rem 0 0.2rem; }
.ev-item b { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; }
@media (max-width: 600px) {
  .cl-card { padding: 0.9rem; }
  .cl-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ========================================================
   SHARED ENTITY CARD (entityCardHtml in core.js): every entity grid
======================================================== */
.grid-container { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.ecard { padding: 1rem; gap: 0.7rem; }
.ecard-open { cursor: pointer; }
.ecard-open:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.ecard-head { display: flex; gap: 0.75rem; align-items: center; min-width: 0; }
.ecard-icon { position: relative; width: 56px; height: 56px; flex-shrink: 0; border-radius: 12px; padding: 4px;
  background: rgba(0, 0, 0, 0.45); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  display: flex; align-items: center; justify-content: center; }
.ecard-icon > img:first-child { width: 100%; height: 100%; object-fit: contain; }
.ecard-corner { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; object-fit: contain; filter: drop-shadow(0 1px 2px #000); }
.ecard-title { flex: 1; min-width: 0; }
.ecard-title .card-title { margin: 0.15rem 0 0; font-size: 1rem; overflow-wrap: anywhere; }
.ecard-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.ecard-pill, .ecard-tag { font-size: 0.66rem; font-weight: 800; padding: 0.12rem 0.5rem; border-radius: 999px; white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.03em; display: inline-flex; align-items: center; gap: 0.25rem; }
.ecard-pill { color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.ecard-tag { color: var(--tag, var(--text-secondary)); background: color-mix(in srgb, var(--tag, #94a3b8) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tag, #94a3b8) 30%, transparent); }
.ecard-tag img { width: 1em; height: 1em; object-fit: contain; }
.ecard-summary { background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: var(--radius-sm); padding: 0.55rem 0.7rem; }
.ecard-summary-title { font-size: 0.68rem; font-weight: 800; color: var(--c); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.25rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ecard-summary-text { font-size: 0.8rem; color: #e2e8f0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ecard-summary-text br { display: none; }
.ecard-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06); font-size: 0.74rem; }
.ecard-meta { color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ecard-more { color: #38bdf8; font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) {
  .grid-container { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 0.6rem !important; }
  .ecard { padding: 0.65rem !important; gap: 0.5rem; }
  .ecard-head { flex-direction: column; align-items: flex-start; gap: 0.45rem; }
  .ecard-icon { width: 48px; height: 48px; }
  .ecard-title .card-title { font-size: 0.9rem; }
  .ecard-summary { padding: 0.45rem 0.5rem; }
  .ecard-summary-text { font-size: 0.74rem; -webkit-line-clamp: 4; }
  .ecard-more { font-size: 0.7rem; }
  .ecard-meta { display: none; }
}

/* Shared detail-modal blocks (mdBox / mdGrid / mdSection in core.js) */
.md-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.md-box { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius-sm); padding: 0.8rem 0.9rem; min-width: 0; overflow-wrap: anywhere; }
.md-box-title { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.4rem; }
.md-text { font-size: 0.84rem; color: #e2e8f0; line-height: 1.5; margin-top: 0.4rem; }
.md-art { display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at center, rgba(30, 41, 59, 0.6), rgba(8, 12, 22, 0.95)); }
.md-art img { max-height: 200px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.7)); }
.md-section { font-size: 0.8rem; font-weight: 800; color: var(--accent-gold); text-transform: uppercase; letter-spacing: 0.04em; margin: 1.1rem 0 0.5rem; }
.ecard-big .ecard-icon { width: 88px; height: 88px; }
.ecard-corner-live { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #ef4444; background: rgba(0, 0, 0, 0.6); }
@media (max-width: 640px) { .ecard-big .ecard-icon { width: 72px; height: 72px; } }

/* ========================================================
   PHONE LAYOUT (last, so it wins over the older per-page overrides above)
======================================================== */
@media (max-width: 640px) {
  /* detail modal: full screen, buttons on their own row above the title */
  .modal { padding: 0 !important; }
  .modal-dialog { width: 100vw !important; max-width: 100vw !important; height: 100dvh; max-height: 100dvh !important;
    margin: 0 !important; padding: 0 !important; border-radius: 0 !important; }
  .modal-content { height: 100%; border-radius: 0; border: none; }
  .modal-header { flex-direction: column-reverse; align-items: stretch; gap: 0.6rem; padding: 0.75rem 0.9rem !important; }
  .modal-header > div:last-child { justify-content: flex-end; gap: 0.4rem !important; }
  .modal-header .btn-share { padding: 0.35rem 0.65rem; font-size: 0.75rem; }
  .modal-title-group { gap: 0.7rem !important; flex-wrap: nowrap; min-width: 0; }
  .modal-title-group > div:last-child { min-width: 0; }
  #modal-icon { width: 44px !important; height: 44px !important; }
  .modal-title-group h2, #modal-title { font-size: 1.15rem !important; overflow-wrap: anywhere; }
  .modal-body { padding: 0.75rem 0.8rem 1.5rem !important; }
  .modal-body div:has(> .tier-pill) { flex-wrap: wrap; }

  /* wide tables scroll sideways instead of being cut off */
  .modal-body table, .system-section table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .ascension-table { min-width: 0; }

  /* Guild Trade Ship: the ship picture goes under the controls instead of over them */
  .ts-controls { padding-right: 0; }
  .ts-ship-art { position: static; height: 160px; align-self: center; }
  .ts-label { width: auto; flex-basis: 100%; }
}

/* Game keys (gk in core.js): hidden unless the header switch is on */
.gk { display: none; }
body.show-keys .gk { display: block; font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: #7dd3fc; opacity: 0.85;
  margin-top: 0.15rem; overflow-wrap: anywhere; line-height: 1.35; font-weight: 400; text-transform: none; letter-spacing: 0; }
.gk-toggle.active { border-color: #38bdf8; color: #38bdf8; background: rgba(56, 189, 248, 0.12); }

/* Event planner (js/event-planner.js) */
.ep-root { display: flex; flex-direction: column; gap: 1rem; }
.ep-root[hidden] { display: none; }
.ep-head { display: flex; flex-direction: column; gap: 0.7rem; }
.ep-h2 { margin: 0; font-size: 1.3rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.ep-h3 { margin: 0.8rem 0 0; font-size: 1.05rem; color: var(--text-primary); }
.ep-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; }
.ep-row[hidden], .ep-muted[hidden] { display: none; }
.ep-step-h { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); margin-top: 0.3rem; }
.ep-seg { display: inline-flex; gap: 0.3rem; }
.ep-adv summary { cursor: pointer; font-size: 0.8rem; color: var(--text-muted); }
.ep-adv label { display: block; margin-top: 0.4rem; font-size: 0.85rem; }
.ep-label { font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 0.3rem; }
.ep-root input[type=number], .ep-root select { background: var(--bg-glass); color: var(--text-primary); border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 0.35rem 0.5rem; font: inherit; }
.ep-root input[type=number] { width: 9rem; }
.ep-muted { color: var(--text-muted); font-size: 0.8rem; }
.ep-r { text-align: right; }
.ep-gold { color: var(--accent-gold); }
.ep-purple { color: var(--accent-purple); }
#ep-msg, #ew-msg { white-space: pre-line; }
#ep-msg .ep-mini, #ew-msg .ep-mini { white-space: normal; border-collapse: collapse; margin-top: 0.6rem; font-size: 0.84rem; min-width: 16rem; }
#ep-msg .ep-mini caption, #ew-msg .ep-mini caption { text-align: left; font-weight: 700; padding-bottom: 0.25rem; white-space: nowrap; }
#ep-msg .ep-mini th, #ep-msg .ep-mini td, #ew-msg .ep-mini th, #ew-msg .ep-mini td { padding: 0.2rem 0.6rem 0.2rem 0; border-top: 1px solid var(--border-glass); text-align: left; }
#ep-msg .ep-mini th, #ew-msg .ep-mini th { color: var(--text-muted); font-weight: 600; border-top: none; }
#ep-msg .ep-mini .ep-r, #ew-msg .ep-mini .ep-r { text-align: right; }
#ep-msg .ep-mini tr.ep-hl td, #ew-msg .ep-mini tr.ep-hl td { font-weight: 700; color: var(--text-primary); }
.ep-note { padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-glass); font-size: 0.88rem; line-height: 1.5; }
.ep-note.ok { border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.08); }
.ep-note.bad { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.08); }
.ep-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.8rem; }
.ep-tile { background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); padding: 0.8rem 1rem; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.ep-lbl { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); display: flex; align-items: center; gap: 0.3rem; }
.ep-big { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ep-sub { font-size: 0.8rem; color: var(--text-secondary); }
.ep-pill { display: inline-block; border-radius: 99px; padding: 0 0.5rem; font-weight: 700; }
.ep-pill.ok { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.ep-pill.bad { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.ep-meter { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; margin-top: 0.2rem; }
.ep-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-purple), var(--accent-gold)); }
.ep-table-wrap { overflow-x: auto; background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); }
.ep-table { border-collapse: collapse; width: 100%; min-width: 960px; font-size: 0.85rem; }
.ep-table th, .ep-table td { padding: 0.5rem 0.6rem; border-top: 1px solid var(--border-glass); vertical-align: middle; text-align: left; }
.ep-table th { border-top: 0; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); background: rgba(255, 255, 255, 0.03); }
.ep-table th.ep-r, .ep-table td.ep-r { text-align: right; font-variant-numeric: tabular-nums; }
.ep-table tr.ep-quiet td { background: rgba(255, 255, 255, 0.02); }
.ep-do { font-size: 0.78rem; line-height: 1.35; max-width: 260px; color: var(--text-secondary); }
.ep-do b { display: block; font-size: 0.85rem; color: var(--text-primary); }
.ep-do.save b { color: var(--text-muted); }
.ep-do.push b { color: var(--accent-gold); }
.ep-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; max-width: 300px; }
.ep-root > .ep-chips, .ep-picker { max-width: none; }
.ep-picker:empty { display: none; }
.ep-picker { margin-bottom: 1rem; align-items: center; }
.ep-picker select { background: var(--bg-glass); color: var(--text-primary); border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 0.35rem 0.5rem; color-scheme: dark; max-width: 100%; }
.ep-picker select option { background: #121826; color: var(--text-primary); }
/* capsule / board / fishing / pachinko (ep-fish, ep-plinko: the capsule's engine; ep-fish-too / ep-plinko-too keep a
   capsule- or board-only part) */
.ep-root.ep-board .ep-capsule-only, .ep-root:not(.ep-board):not(.ep-fish):not(.ep-plinko) .ep-board-only,
.ep-root.ep-fish .ep-capsule-only:not(.ep-fish-too), .ep-root.ep-fish .ep-board-only:not(.ep-fish-too),
.ep-root.ep-plinko .ep-capsule-only:not(.ep-plinko-too), .ep-root.ep-plinko .ep-board-only:not(.ep-plinko-too),
.ep-root.ep-fish .ep-nofish, .ep-root:not(.ep-fish) .ep-fish-only, .ep-root:not(.ep-plinko) .ep-plinko-only { display: none !important; }
/* Voucher wheel (event-planner-wheel.js) */
.ew-prizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; }
.ew-prize { background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); padding: 0.6rem 0.8rem; display: flex; flex-direction: column; gap: 0.3rem; }
.ew-prize.ult { border-color: rgba(255, 170, 51, 0.5); }
.ep-table.ew-order { min-width: 560px; }
#ew-order > p { margin: 0.5rem 0.8rem; }
.ew-dist { display: grid; grid-template-columns: auto 1fr auto; gap: 0.25rem 0.6rem; align-items: center; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.ew-dist i { display: block; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--accent-purple), var(--accent-gold)); }
.ep-chip { border: 1px solid var(--border-glass); background: var(--bg-glass); color: var(--text-muted); border-radius: 99px; padding: 0.1rem 0.55rem; font-size: 0.72rem; font-weight: 600; cursor: pointer; }
.ep-chip.on { border-color: var(--accent-gold); color: var(--text-primary); background: rgba(255, 170, 51, 0.12); }
.ep-chip:disabled { opacity: 0.35; cursor: not-allowed; }
.ep-bar { position: relative; height: 8px; width: 170px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); margin-bottom: 0.2rem; }
.ep-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent-purple), var(--accent-gold)); }
.ep-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-muted); }
.ep-warn { color: #f87171; font-weight: 700; }
.ep-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.7rem; }
.ep-field { background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); padding: 0.7rem 0.9rem; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.85rem; font-weight: 600; }
.ep-field > span:first-child { display: inline-flex; align-items: center; gap: 0.3rem; }
.ep-shops { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0.8rem; }
.ep-shop { background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); overflow: hidden; min-width: 0; }
.ep-shop-head { display: flex; align-items: center; gap: 0.4rem; padding: 0.6rem 0.9rem; font-weight: 800; border-bottom: 1px solid var(--border-glass); }
.ep-shop-head .ep-muted { margin-left: auto; }
.ep-shop-gold .ep-shop-head { background: rgba(255, 170, 51, 0.08); }
.ep-shop-purple .ep-shop-head { background: rgba(192, 132, 252, 0.08); }
.ep-shop ul { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; }
.ep-shop li { display: grid; grid-template-columns: 1fr auto auto; gap: 0.6rem; align-items: center; padding: 0.35rem 0.9rem; border-top: 1px solid var(--border-glass); font-size: 0.85rem; }
.ep-shop li.on { background: rgba(255, 255, 255, 0.04); }
.ep-shop-name { min-width: 0; font-weight: 600; display: flex; align-items: center; gap: 0.35rem; }
.ep-step { display: inline-flex; align-items: center; border: 1px solid var(--border-glass); border-radius: var(--radius-sm); overflow: hidden; }
.ep-step button { width: 24px; height: 24px; border: 0; background: rgba(255, 255, 255, 0.06); color: var(--text-primary); cursor: pointer; font-weight: 700; }
.ep-step b { min-width: 48px; padding: 0 4px; text-align: center; white-space: nowrap; }
.ep-step .ep-lim { font-weight: 400; font-size: 0.8em; color: var(--text-muted); }
.ep-step button:disabled { opacity: 0.35; cursor: default; }
.ep-how { background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-md); padding: 0.6rem 0.9rem; font-size: 0.85rem; }
.ep-how summary { cursor: pointer; font-weight: 700; }
.ep-how li { margin: 0.3rem 0; color: var(--text-secondary); line-height: 1.5; }
.ep-root select.ep-add { font-size: 0.72rem; padding: 0.1rem 0.3rem; color: var(--text-muted); max-width: 150px; }
.ep-root select { color-scheme: dark; }
.ep-root select option { background: #121826; color: var(--text-primary); }
.ep-root select.ep-add { color: var(--text-secondary); background: rgba(255, 255, 255, 0.06); }

/* ===== Specialization tree (web/js/specialization.js: TalentApexCtrl layout) ===== */
.sp-summary { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; align-items: center; color: var(--text-secondary); font-size: 0.88rem; }
.sp-cost { display: inline-flex; align-items: center; gap: 0.2rem; margin-right: 0.5rem; white-space: nowrap; cursor: pointer; }
.sp-card { padding: 0.5rem; }
.sp-viewport {
  position: relative; height: min(72vh, 760px); min-height: 360px; overflow: hidden; border-radius: var(--radius-md);
  background: radial-gradient(ellipse at center, #1c2540 0%, #0d1220 70%); touch-action: none; cursor: grab; user-select: none;
}
.sp-viewport:active { cursor: grabbing; }
.sp-content { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-origin: 0 0; }
.sp-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.sp-lines line { stroke: rgba(148, 163, 184, 0.55); stroke-width: 10; stroke-linecap: round; }
.sp-node { position: absolute; width: 0; height: 0; }
.sp-node > img { position: absolute; left: 0; top: 0; max-width: none; pointer-events: none; }
.sp-node .sp-icon { transform: translate(-50%, -50%); }
.sp-node[data-sp-node] .sp-bg { pointer-events: auto; cursor: pointer; }
.sp-node[data-sp-node]:hover .sp-bg, .sp-node[data-sp-node]:focus-visible .sp-bg { filter: brightness(1.25) drop-shadow(0 0 18px rgba(56, 189, 248, 0.7)); }
.sp-node:focus-visible { outline: none; }
.sp-lv {
  position: absolute; left: 0; top: 64px; transform: translateX(-50%); padding: 2px 14px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.65); color: #f8fafc; font: 700 30px 'Outfit', sans-serif; white-space: nowrap; pointer-events: none;
}
.sp-controls { position: absolute; right: 0.6rem; top: 0.6rem; display: flex; flex-direction: column; gap: 0.35rem; }
.sp-controls button {
  width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border-glass); background: var(--bg-glass);
  color: var(--text-primary); font-size: 1.1rem; font-weight: 700; cursor: pointer;
}
.sp-controls button:hover { background: var(--bg-card-hover); }
.sp-hint { margin: 0.5rem 0.25rem 0.1rem; font-size: 0.8rem; }
.sp-req { margin-bottom: 0.35rem; color: var(--text-secondary); }
.sp-req a { color: var(--accent-cyan); }
.sp-skill { display: flex; gap: 0.5rem; align-items: flex-start; cursor: pointer; padding: 0.15rem 0; }
.sp-skill + .sp-skill { border-top: 1px solid var(--border-glass); margin-top: 0.3rem; padding-top: 0.4rem; }
.sp-skill-title { font-weight: 700; }

/* Honor Arena (honor-arena.js) */
.ha-body { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
#ha-intro { margin-bottom: 1rem; }
.ha-title { display: flex; align-items: center; gap: 0.5rem; }
.ha-title img { width: 36px; height: 36px; object-fit: contain; }
.ha-attrs { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; font-size: 0.85rem; color: var(--text-secondary); }
.ha-attrs b { color: var(--text-primary); }
.ha-text { font-size: 0.85rem; line-height: 1.5; margin-top: 0.35rem; padding-left: 0.5rem; border-left: 2px solid var(--border-glass); }
.ha-starts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.5rem; }
.ha-start { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.5rem; text-align: center; font: inherit; font-size: 0.82rem;
  color: var(--text-primary); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-glass); border-radius: var(--radius-sm); cursor: pointer; }
.ha-hero { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; }
.ha-hero img { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; }
.ha-levels td { font-size: 0.85rem; }
.ha-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }
.ha-good { display: flex; flex-direction: column; gap: 0.4rem; text-align: left; font: inherit; color: var(--text-primary); cursor: pointer; border-color: color-mix(in srgb, var(--q) 40%, transparent); }
.ha-good-head { display: flex; align-items: center; gap: 0.6rem; }
.ha-good-name { font-weight: 800; }
.ha-good-head .ha-shape { margin-left: auto; }
.ha-shape { display: grid; gap: 2px; flex-shrink: 0; }
.ha-shape span { width: 12px; height: 12px; font-size: 9px; line-height: 12px; text-align: center; border-radius: 2px; }
.ha-shape .ha-cell { background: var(--accent-gold); }
.ha-shape .ha-star { color: var(--accent-gold); background: rgba(255, 255, 255, 0.06); }
.ha-stack { display: inline-flex; align-items: center; gap: 0.3rem; margin-right: 0.6rem; cursor: pointer; }
.ha-stack img { width: 24px; height: 24px; object-fit: contain; }
.ha-q { border-left: 3px solid; padding: 0.4rem 0 0.4rem 0.7rem; margin-bottom: 0.7rem; }
.ha-q-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.ha-q-head .ha-shape { margin-left: auto; }
.ha-rules summary { cursor: pointer; margin-top: 0.8rem; font-weight: 700; color: var(--accent-gold); }
/* Game screens drawn from a prefab layout (game-screen.js): canvas for images, HTML for texts */
.gs-screen { position: relative; width: 100%; max-width: 100%; overflow: hidden; border-radius: 12px; border: 2px solid var(--border-glass); background: #262833; }
.gs-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gs-texts { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.gs-text { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: visible; line-height: 1.15; font-family: inherit; }
.gs-text span { display: block; }
.gs-clip { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; }
.ha-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 0.8rem; }
.ha-step { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.ha-step .cl-h3 { margin: 0.4rem 0 0; }
.ha-step p { margin: 0; font-size: 0.85rem; line-height: 1.5; }
.ha-sandbox { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.6rem; }
.ha-bwrap { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.ha-bleft { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.ha-board { display: grid; gap: 3px; padding: 6px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-glass); }
.ha-bcell { aspect-ratio: 1; border: 0; padding: 0; border-radius: 3px; background: rgba(255, 255, 255, 0.09); cursor: pointer; }
.ha-bcell.locked { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 4px, rgba(255, 255, 255, 0.07) 4px 8px); cursor: not-allowed; }
.ha-bpiece { position: relative; z-index: 1; border: 0; padding: 0; border-radius: 3px; cursor: pointer;
  background: color-mix(in srgb, var(--q) 45%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--q) 80%, transparent); }
.ha-bpiece.sel { background: color-mix(in srgb, var(--q) 70%, transparent); box-shadow: inset 0 0 0 2px var(--accent-gold); }
.ha-bpiece:focus-visible, .ha-bcell:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 1px; }
.ha-bicon { z-index: 2; display: grid; place-items: center; pointer-events: none; }
.ha-bicon img { width: 80%; height: 80%; max-width: 72px; max-height: 72px; object-fit: contain; }
.ha-bstar { z-index: 3; display: grid; place-items: center; pointer-events: none; color: var(--accent-gold); font-size: clamp(11px, 2.6vw, 18px);
  border: 2px dashed var(--accent-gold); border-radius: 4px; text-shadow: 0 0 3px #000; }
.ha-bstar.on { color: #fff; border: 2px solid #4ade80; background: rgba(74, 222, 128, 0.35); }
.ha-btools { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ha-btools .cat-tab[disabled] { opacity: 0.4; cursor: default; }
.ha-bpick { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.ha-bpick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.45rem; }
.ha-btile { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-width: 0; padding: 0.5rem 0.35rem; cursor: pointer;
  border-radius: 10px; border: 1px solid var(--border-glass); background: rgba(255, 255, 255, 0.03); color: var(--text-primary); font: inherit; }
.ha-btile:hover { border-color: color-mix(in srgb, var(--q) 70%, transparent); background: color-mix(in srgb, var(--q) 10%, transparent); }
.ha-btile:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 1px; }
.ha-btile-name { font-size: 0.75rem; line-height: 1.2; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ha-bmsg { font-size: 0.85rem; }
.ha-bpanel { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; padding: 0.8rem; border-radius: 10px; border: 1px solid var(--border-glass); background: rgba(255, 255, 255, 0.03); }
.ha-links { margin: 0; padding-left: 1.1rem; font-size: 0.88rem; display: flex; flex-direction: column; gap: 0.25rem; }
.ha-rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; margin-top: 0.6rem; }
.ha-rule { padding: 0.7rem 0.8rem; border-radius: 10px; border: 1px solid var(--border-glass); min-width: 0; }
.ha-rule p { margin: 0.25rem 0 0; font-size: 0.85rem; line-height: 1.5; }
@media (max-width: 900px) {
  .ha-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ha-bwrap { grid-template-columns: minmax(0, 1fr); }
  .ha-board { max-width: 380px; }
}
@media (max-width: 560px) { .ha-rules-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .ha-levels thead { display: none; }
  .ha-levels, .ha-levels tbody { display: block; }
  .ha-levels tr { display: grid; grid-template-columns: 2.5rem 4.5rem 1fr; border-top: 1px solid var(--border-glass); }
  .ha-levels td { border-top: none; padding: 0.5rem; }
  .ha-levels td:nth-child(2)::before { content: 'EXP '; color: var(--text-secondary); font-size: 0.75rem; }
  .ha-levels td:nth-child(4) { grid-column: 1 / -1; padding-top: 0; }
}

/* Unlocks (web/js/unlocks.js) */
.ul-controls { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; margin-top: 0.75rem; }
.ul-check { display: inline-flex; gap: 0.4rem; align-items: center; font-size: 0.85rem; color: var(--text-secondary); cursor: pointer; }
.ul-note { margin-top: 0.5rem; font-size: 0.8rem; }
.ul-chname { font-size: 0.85rem; font-weight: 600; }
.ul-row { display: grid; grid-template-columns: 2.2em minmax(9rem, 14rem) 1fr; gap: 0.6rem; align-items: center; padding: 0.4rem 0; border-top: 1px solid var(--border-glass); }
.ul-row:first-of-type { border-top: none; }
.ul-icon { display: flex; justify-content: center; }
.ul-name { font-weight: 700; color: #fff; }
.ul-tip { font-size: 0.85rem; color: var(--text-secondary); }
.ul-day { display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.45rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; color: var(--accent-gold); border: 1px solid var(--accent-gold); white-space: nowrap; cursor: help; }
@media (max-width: 640px) {
  .ul-row { grid-template-columns: 2.2em 1fr; }
  .ul-tip { grid-column: 2; }
}
