/* Territory Theme Engine — 세력별 색채 토큰 */

body[data-territory] {
  transition: background-color 0.8s ease, color 0.8s ease;
}

[data-territory="yongsan"] {
  --accent: #E8D49A;
  --accent-2: #1E2A4A;
  --accent-3: #0A0A0A;
  --territory-tex: linear-gradient(135deg, rgba(232, 212, 154, 0.03) 0%, transparent 40%);
}

[data-territory="arcadia"] {
  --accent: #E8EEF5;
  --accent-2: #C0C6D0;
  --accent-3: #0A0A0A;
  --territory-tex:
    linear-gradient(135deg, rgba(232, 238, 245, 0.05) 0%, transparent 40%),
    repeating-linear-gradient(90deg, transparent 0px, transparent 80px, rgba(255,255,255,0.02) 80px, rgba(255,255,255,0.02) 81px);
}

[data-territory="heukryeon"] {
  --accent: #D4A857;
  --accent-2: #6B2D2D;
  --accent-3: #1A1410;
  --territory-tex:
    conic-gradient(from 45deg at 30% 40%, rgba(212, 168, 87, 0.04), transparent, rgba(212, 168, 87, 0.04)),
    conic-gradient(from 180deg at 70% 60%, rgba(107, 45, 45, 0.04), transparent, rgba(107, 45, 45, 0.04));
}

[data-territory="cheolya"] {
  --accent: #C66B2D;
  --accent-2: #4A4A4A;
  --accent-3: #2A2A2A;
  --territory-tex:
    repeating-linear-gradient(45deg, transparent 0px, transparent 10px, rgba(74, 74, 74, 0.04) 10px, rgba(74, 74, 74, 0.04) 11px),
    radial-gradient(circle at 50% 0%, rgba(198, 107, 45, 0.06), transparent 50%);
}

[data-territory="yasha"] {
  --accent: #FF2D87;
  --accent-2: #8B2DFF;
  --accent-3: #0A0A0A;
  --territory-tex:
    radial-gradient(ellipse at 20% 100%, rgba(255, 45, 135, 0.10), transparent 50%),
    radial-gradient(ellipse at 80% 0%, rgba(139, 45, 255, 0.10), transparent 50%),
    repeating-linear-gradient(45deg, transparent 0px, transparent 4px, rgba(255,45,135,0.015) 4px, rgba(255,45,135,0.015) 5px);
}

[data-territory="cheonmyeong"] {
  --accent: #D4AF37;
  --accent-2: #6B2D8C;
  --accent-3: #8B0000;
  --territory-tex: radial-gradient(circle at 50% 30%, rgba(212, 175, 55, 0.06), transparent 60%);
}

[data-territory="muso"] {
  --accent: #C8102E;
  --accent-2: #0A0A0A;
  --accent-3: #DC143C;
  --territory-tex:
    repeating-linear-gradient(60deg, transparent 0px, transparent 30px, rgba(200, 16, 46, 0.03) 30px, rgba(200, 16, 46, 0.03) 31px);
}

[data-territory="abyss"] {
  --accent: #6B7280;
  --accent-2: #0A0F1F;
  --accent-3: #F0F4F8;
  --territory-tex:
    radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(0,0,0,0.4) 100%);
}

/* Faction badge / chip colors */
.faction-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  backdrop-filter: blur(8px);
}

.faction-badge[data-faction="yongsan"]    { color: #E8D49A; background: rgba(232, 212, 154, 0.08); }
.faction-badge[data-faction="arcadia"]    { color: #E8EEF5; background: rgba(232, 238, 245, 0.10); }
.faction-badge[data-faction="heukryeon"]  { color: #D4A857; background: rgba(212, 168, 87, 0.08); }
.faction-badge[data-faction="cheolya"]    { color: #C66B2D; background: rgba(198, 107, 45, 0.08); }
.faction-badge[data-faction="yasha"]      { color: #FF2D87; background: rgba(255, 45, 135, 0.08); }
.faction-badge[data-faction="cheonmyeong"]{ color: #D4AF37; background: rgba(212, 175, 55, 0.08); }
.faction-badge[data-faction="muso"]       { color: #C8102E; background: rgba(200, 16, 46, 0.10); }
.faction-badge[data-faction="abyss"]      { color: #9CA3AF; background: rgba(156, 163, 175, 0.06); }

/* Rank Badge */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 2px solid currentColor;
  background: rgba(0,0,0,0.4);
  position: relative;
}

.rank-badge[data-rank^="F"] { color: var(--rank-f); }
.rank-badge[data-rank^="E"] { color: var(--rank-e); }
.rank-badge[data-rank^="D"] { color: var(--rank-d); }
.rank-badge[data-rank^="C"] { color: var(--rank-c); }
.rank-badge[data-rank^="B"] { color: var(--rank-b); }
.rank-badge[data-rank^="A"] { color: var(--rank-a); box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
.rank-badge[data-rank^="S"]:not([data-rank^="SS"]) { color: var(--rank-s); box-shadow: 0 0 12px rgba(239, 68, 68, 0.4); }
.rank-badge[data-rank^="SS"] {
  color: var(--rank-ss);
  box-shadow: 0 0 16px rgba(255,255,255,0.4), 0 0 32px rgba(124, 58, 237, 0.3);
}
.rank-badge[data-rank^="SSS"] {
  background: var(--rank-sss);
  color: white;
  border-color: white;
}
