/**
 * Blissfulife Civilization Design System — additive tokens + utilities.
 * Opt-in classes only. Does not reset body, navbar, Coach, or realm palettes.
 */
:root {
  --civ-obsidian: #0a0d14;
  --civ-deep: #0f1420;
  --civ-glass: rgba(18, 24, 38, 0.75);
  --civ-glass-hover: rgba(26, 35, 54, 0.85);
  --civ-border: rgba(255, 255, 255, 0.08);
  --civ-border-gold: rgba(212, 175, 55, 0.35);
  --civ-gold: #d4af37;
  --civ-gold-hi: #ffb800;
  --civ-cyan: #00f2fe;
  --civ-cyan-deep: #4facfe;
  --civ-green: #10b981;
  --civ-red: #ef4444;
  --civ-purple: #8b5cf6;
  --civ-wood: #22c55e;
  --civ-fire: #f97316;
  --civ-earth: #eab308;
  --civ-metal: #94a3b8;
  --civ-water: #38bdf8;
  --civ-blur: blur(16px);
  --civ-radius: 12px;
  --civ-font-ui: Inter, "Noto Sans HK", "Segoe UI", system-ui, sans-serif;
  --civ-font-heading: Cinzel, "Noto Serif HK", Georgia, serif;
  --civ-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --civ-shadow-gold: 0 0 20px rgba(212, 175, 55, 0.25);
  --civ-shadow-cyan: 0 0 20px rgba(0, 242, 254, 0.25);
}

html.civ-cds,
body.civ-cds {
  --font-sans: var(--civ-font-ui);
  --font-heading: var(--civ-font-heading);
}

.civ-card {
  background: var(--civ-glass);
  backdrop-filter: var(--civ-blur);
  -webkit-backdrop-filter: var(--civ-blur);
  border: 1px solid var(--civ-border);
  border-radius: var(--civ-radius);
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: border-color 0.3s var(--civ-ease), box-shadow 0.3s var(--civ-ease);
}
.civ-card:hover {
  border-color: var(--civ-border-gold);
  box-shadow: var(--civ-shadow-gold);
}

.civ-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.2s var(--civ-ease), filter 0.2s ease;
}
.civ-btn-primary {
  background: linear-gradient(135deg, var(--civ-gold), var(--civ-gold-hi));
  color: #05070a;
  box-shadow: var(--civ-shadow-gold);
}
.civ-btn-cyber {
  background: linear-gradient(135deg, var(--civ-cyan), var(--civ-cyan-deep));
  color: #05070a;
  box-shadow: var(--civ-shadow-cyan);
}
.civ-btn-outline {
  background: transparent;
  border-color: var(--civ-border);
  color: #e2e8f0;
}
.civ-btn-outline:hover {
  border-color: var(--civ-gold);
  color: var(--civ-gold);
}

.civ-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.civ-badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--civ-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.civ-badge-gold {
  background: rgba(212, 175, 55, 0.15);
  color: var(--civ-gold-hi);
  border: 1px solid rgba(212, 175, 55, 0.3);
}
.civ-badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--civ-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.civ-badge-cyan {
  background: rgba(0, 242, 254, 0.12);
  color: var(--civ-cyan);
  border: 1px solid rgba(0, 242, 254, 0.28);
}

.civ-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.civ-delta-up {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.civ-delta-down {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.civ-split-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px minmax(0, 1fr);
  gap: 0;
  min-height: 0;
}
.civ-split-view > .esp-resizer {
  cursor: col-resize;
  background: linear-gradient(180deg, transparent, rgba(212, 175, 55, 0.35), transparent);
  border: 0;
  padding: 0;
  min-width: 10px;
}
@media (max-width: 900px) {
  .civ-split-view {
    grid-template-columns: 1fr;
  }
  .civ-split-view > .esp-resizer {
    display: none;
  }
}

.civ-radar {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.civ-radar polygon {
  fill: rgba(0, 242, 254, 0.18);
  stroke: var(--civ-cyan);
  stroke-width: 1.4;
  transition: all 0.45s var(--civ-ease);
}
.civ-radar text {
  fill: #cbd5e1;
  font-size: 9px;
  font-family: var(--civ-font-ui);
}

.civ-qimen-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}
.civ-palace {
  position: relative;
  border-radius: 12px;
  min-height: 6.2rem;
  padding: 0.55rem;
  border: 1px solid var(--civ-border);
  background: rgba(8, 10, 18, 0.55);
  backdrop-filter: var(--civ-blur);
}
.civ-palace[data-el="wood"] { box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.35); }
.civ-palace[data-el="fire"] { box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.4); }
.civ-palace[data-el="earth"] { box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.35); }
.civ-palace[data-el="metal"] { box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.4); }
.civ-palace[data-el="water"] { box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.4); }
.civ-palace-dir {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--civ-gold);
  margin-bottom: 0.2rem;
}

.bazi-pillar.civ-el-wood { border-color: rgba(34, 197, 94, 0.45) !important; }
.bazi-pillar.civ-el-fire { border-color: rgba(249, 115, 22, 0.45) !important; }
.bazi-pillar.civ-el-earth { border-color: rgba(234, 179, 8, 0.45) !important; }
.bazi-pillar.civ-el-metal { border-color: rgba(148, 163, 184, 0.45) !important; }
.bazi-pillar.civ-el-water { border-color: rgba(56, 189, 248, 0.45) !important; }

.civ-phase {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
}
.civ-phase-chip {
  min-height: 36px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--civ-border);
  background: rgba(18, 24, 38, 0.55);
  color: #94a3b8;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.civ-phase-chip.is-on {
  border-color: var(--civ-border-gold);
  color: var(--civ-gold-hi);
  box-shadow: var(--civ-shadow-gold);
}

.civ-learn-chip {
  margin: 0.6rem 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 242, 254, 0.28);
  background: rgba(0, 242, 254, 0.08);
  color: #e2e8f0;
  font-size: 0.85rem;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .civ-card,
  .civ-btn,
  .civ-radar polygon {
    transition: none;
  }
}
