/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: #08050f;
  color: #d4cfe8;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Background ───────────────────────────────────────────────── */
.bg-layer {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 120% 80% at 50% -10%, #1a0a2e 0%, #08050f 60%);
  pointer-events: none;
}
.bg-glow {
  position: fixed; border-radius: 50%; filter: blur(120px);
  pointer-events: none; z-index: 0; opacity: 0.15;
}
.bg-glow.g1 { width: 700px; height: 500px; top: -100px; left: -100px; background: #7c3aed; }
.bg-glow.g2 { width: 600px; height: 400px; bottom: 0; right: -100px; background: #4f46e5; }
.bg-grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, header, footer { position: relative; z-index: 2; }

/* ── Typography ───────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: 'Cinzel', serif; line-height: 1.2; }
.gradient-text {
  background: linear-gradient(135deg, #ffd86b 0%, #f59e0b 40%, #a855f7 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  padding-bottom: 0.15em; display: inline-block;
}
.accent { color: #a855f7; }
.eyebrow {
  display: inline-block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: #a855f7; font-weight: 600; margin-bottom: .5rem;
}
.lede { color: #9ca3af; font-size: 1.05rem; max-width: 60ch; margin-left: auto; margin-right: auto; text-align: center; }
.rex { color: #ffd86b; font-weight: 700; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.4rem; border-radius: .4rem; font-size: .9rem; font-weight: 600;
  text-decoration: none; transition: all .2s; cursor: pointer; border: none;
}
.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff; box-shadow: 0 0 20px rgba(124,58,237,.3);
}
.btn-primary:hover { box-shadow: 0 0 30px rgba(124,58,237,.5); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: #d4cfe8;
  border: 1px solid rgba(255,255,255,.15);
}
.btn-ghost:hover { border-color: rgba(168,85,247,.5); color: #fff; }

/* ── Nav ──────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(8,5,15,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; }
.brand-mark {
  width: 24px; height: 24px; display: inline-block;
  background: radial-gradient(circle, #ffd86b, #a855f7 60%, transparent);
  border-radius: 50%; opacity: .9;
}
.brand-text { font-family: 'Cinzel', serif; font-size: 1.1rem; font-weight: 700; color: #fff; letter-spacing: .05em; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: #9ca3af; text-decoration: none; font-size: .875rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: #fff; }
.nav-discord {
  display: flex; align-items: center; gap: .4rem;
  color: #7c3aed !important; border: 1px solid rgba(124,58,237,.4);
  padding: .4rem .9rem; border-radius: .35rem; transition: all .2s !important;
}
.nav-discord:hover { background: rgba(124,58,237,.15) !important; border-color: #7c3aed !important; }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 6rem 2rem 4rem; text-align: center; position: relative; overflow: hidden;
}
.hero-rift {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 600px; height: 600px; pointer-events: none;
}
.rift-core {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 120px; height: 180px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(168,85,247,.5) 0%, rgba(79,70,229,.2) 50%, transparent 80%);
  animation: pulse 3s ease-in-out infinite;
}
.rift-rings span {
  position: absolute; top: 50%; left: 50%; border-radius: 50%;
  border: 1px solid rgba(168,85,247,.15);
  animation: expand 4s ease-out infinite;
}
.rift-rings span:nth-child(1) { width: 200px; height: 200px; margin: -100px; animation-delay: 0s; }
.rift-rings span:nth-child(2) { width: 350px; height: 350px; margin: -175px; animation-delay: 1s; }
.rift-rings span:nth-child(3) { width: 500px; height: 500px; margin: -250px; animation-delay: 2s; }
.rift-beams span {
  position: absolute; top: 50%; left: 50%; width: 2px; height: 200px;
  background: linear-gradient(to bottom, rgba(168,85,247,.3), transparent);
  transform-origin: top center;
  animation: beam-fade 3s ease-in-out infinite;
}
.rift-beams span:nth-child(1) { transform: rotate(0deg) translateX(-1px); }
.rift-beams span:nth-child(2) { transform: rotate(90deg) translateX(-1px); animation-delay: .75s; }
.rift-beams span:nth-child(3) { transform: rotate(180deg) translateX(-1px); animation-delay: 1.5s; }
.rift-beams span:nth-child(4) { transform: rotate(270deg) translateX(-1px); animation-delay: 2.25s; }
@keyframes pulse { 0%,100% { opacity: .6; transform: translate(-50%,-50%) scale(1); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.1); } }
@keyframes expand { 0% { opacity: .4; transform: translate(-50%,-50%) scale(.5); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1); } }
@keyframes beam-fade { 0%,100% { opacity: .2; } 50% { opacity: .6; } }

.hero-inner { max-width: 720px; position: relative; z-index: 1; }
.hero-tag {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
  color: #a855f7; border: 1px solid rgba(168,85,247,.3);
  padding: .3rem .8rem; border-radius: 999px; margin-bottom: 1.5rem;
}
.tag-dot { width: 6px; height: 6px; border-radius: 50%; background: #a855f7; animation: pulse 2s infinite; }
h1.hero-title { font-size: clamp(2.5rem, 7vw, 5rem); color: #fff; margin-bottom: 1.25rem; }
.hero-sub { font-size: 1.1rem; color: #9ca3af; margin-bottom: 2rem; max-width: 52ch; margin-left: auto; margin-right: auto; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 3rem; }
.hero-stats {
  display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.08); padding-top: 2rem;
}
.hero-stats div { display: flex; flex-direction: column; align-items: center; }
.hero-stats strong { font-size: 1.4rem; font-family: 'Cinzel', serif; color: #fff; }
.hero-stats span { font-size: .75rem; color: #6b7280; text-transform: uppercase; letter-spacing: .08em; }

/* ── Sections ─────────────────────────────────────────────────── */
.section { padding: 5rem 2rem; max-width: 1200px; margin: 0 auto; }
.section.alt { max-width: 100%; padding: 5rem 2rem; background: rgba(255,255,255,.02); }
.section.alt > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.section-head { text-align: center; margin-bottom: 3rem; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); color: #fff; margin-bottom: .75rem; }

/* ── Builds ───────────────────────────────────────────────────── */
.builds-toolbar { display: flex; justify-content: center; margin-bottom: 2.5rem; }
.filter-tabs { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.ftab {
  padding: .45rem 1.1rem; border-radius: .35rem; font-size: .85rem; font-weight: 600;
  cursor: pointer; border: 1px solid rgba(255,255,255,.1);
  background: transparent; color: #9ca3af; transition: all .2s;
}
.ftab:hover, .ftab.active { color: #fff; }
.ftab.active { background: rgba(124,58,237,.25); border-color: rgba(124,58,237,.5); }
.ftab.warrior.active  { background: rgba(231,76,60,.2); border-color: #e74c3c; }
.ftab.rogue.active    { background: rgba(241,196,15,.15); border-color: #f1c40f; }
.ftab.mage.active     { background: rgba(155,89,182,.25); border-color: #9b59b6; }
.ftab.cleric.active   { background: rgba(46,204,113,.15); border-color: #2ecc71; }
.ftab.primalist.active{ background: rgba(52,152,219,.2); border-color: #3498db; }

.builds-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem;
}
.build-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: .75rem; padding: 1.5rem; transition: all .2s;
  border-left: 3px solid transparent;
}
.build-card:hover { background: rgba(255,255,255,.07); transform: translateY(-2px); }
.build-card.warrior  { border-left-color: #e74c3c; }
.build-card.rogue    { border-left-color: #f1c40f; }
.build-card.mage     { border-left-color: #9b59b6; }
.build-card.cleric   { border-left-color: #2ecc71; }
.build-card.primalist{ border-left-color: #3498db; }

.build-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.build-name { font-family: 'Cinzel', serif; font-size: 1rem; color: #fff; }
.build-tier {
  font-size: .7rem; font-weight: 700; padding: .2rem .5rem; border-radius: .25rem; letter-spacing: .05em;
}
.tier-S { background: rgba(255,216,107,.15); color: #ffd86b; border: 1px solid rgba(255,216,107,.3); }
.tier-A { background: rgba(168,85,247,.15); color: #c084fc; border: 1px solid rgba(168,85,247,.3); }
.tier-B { background: rgba(107,114,128,.15); color: #9ca3af; border: 1px solid rgba(107,114,128,.3); }

.build-souls { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.soul-tag {
  font-size: .72rem; padding: .2rem .55rem; border-radius: .25rem;
  background: rgba(255,255,255,.07); color: #d4cfe8; border: 1px solid rgba(255,255,255,.1);
}
.build-role { font-size: .75rem; color: #6b7280; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .5rem; }
.build-desc { font-size: .875rem; color: #9ca3af; line-height: 1.5; }
.build-loading { color: #6b7280; text-align: center; padding: 3rem; grid-column: 1/-1; }

/* ── Leaderboard ──────────────────────────────────────────────── */
.lb-wrap { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: .75rem; overflow: hidden; }
.lb-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.06);
  flex-wrap: wrap; gap: .75rem;
}
.lb-updated { font-size: .8rem; color: #6b7280; }
.lb-filters { display: flex; gap: .5rem; }
.chip {
  padding: .35rem .85rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  cursor: pointer; border: 1px solid rgba(255,255,255,.1);
  background: transparent; color: #9ca3af; transition: all .2s;
}
.chip.active { background: rgba(124,58,237,.2); border-color: rgba(124,58,237,.5); color: #fff; }
.leaderboard { list-style: none; }
.lb-row {
  display: grid; grid-template-columns: 3rem 1fr auto;
  align-items: center; padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.04); transition: background .15s;
}
.lb-row:hover { background: rgba(255,255,255,.03); }
.lb-row.rank-1 .lb-rank { color: #ffd86b; }
.lb-row.rank-2 .lb-rank { color: #c0c0c0; }
.lb-row.rank-3 .lb-rank { color: #cd7f32; }
.lb-rank { font-family: 'Cinzel', serif; font-size: 1.1rem; color: #4b5563; font-weight: 700; }
.lb-name { font-weight: 600; color: #fff; }
.lb-sub { font-size: .8rem; color: #6b7280; display: flex; gap: .5rem; align-items: center; margin-top: .15rem; }
.lb-faction-tag { font-size: .65rem; padding: .15rem .45rem; border-radius: .2rem; font-weight: 700; text-transform: uppercase; }
.lb-faction-tag.guardian { background: rgba(241,196,15,.15); color: #f1c40f; }
.lb-faction-tag.defiant  { background: rgba(155,89,182,.15); color: #c084fc; }
.lb-kills strong { font-family: 'Cinzel', serif; font-size: 1.2rem; color: #fff; }
.lb-kills span { font-size: .75rem; color: #6b7280; margin-left: .25rem; }
.lb-empty { padding: 3rem; text-align: center; color: #6b7280; list-style: none; }

/* ── Clips ────────────────────────────────────────────────────── */
.clips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.clip-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: .75rem; overflow: hidden; transition: all .2s;
}
.clip-card:hover { transform: translateY(-2px); border-color: rgba(168,85,247,.3); }
.clip-card img { width: 100%; height: 180px; object-fit: cover; }
.clip-body { padding: 1rem; }
.clip-author { font-size: .8rem; color: #a855f7; font-weight: 600; margin-bottom: .25rem; }
.clip-note { font-size: .875rem; color: #9ca3af; }
.clips-empty { grid-column: 1/-1; text-align: center; padding: 4rem 2rem; color: #6b7280; }
.clips-empty p { margin-bottom: 1.5rem; }

/* ── Event ────────────────────────────────────────────────────── */
.event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.event-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: .75rem; padding: 1.75rem;
}
.event-card h3 { font-family: 'Cinzel', serif; color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.countdown { display: flex; align-items: center; gap: .5rem; }
.c-cell { display: flex; flex-direction: column; align-items: center; }
.c-cell span { font-family: 'Cinzel', serif; font-size: 2rem; font-weight: 700; color: #fff; line-height: 1; }
.c-cell label { font-size: .65rem; color: #6b7280; text-transform: uppercase; letter-spacing: .08em; margin-top: .25rem; }
.c-sep { font-family: 'Cinzel', serif; font-size: 1.5rem; color: #4b5563; margin-bottom: .5rem; }
.event-steps { list-style: none; counter-reset: steps; }
.event-steps li { counter-increment: steps; padding: .5rem 0; padding-left: 2rem; position: relative; font-size: .9rem; color: #9ca3af; border-bottom: 1px solid rgba(255,255,255,.05); }
.event-steps li::before { content: counter(steps); position: absolute; left: 0; color: #a855f7; font-weight: 700; font-family: 'Cinzel', serif; }
.event-steps li:last-child { border: none; }
.event-steps a { color: #a855f7; }
.rex-prize { font-size: 2.5rem; margin: 1rem 0; }

/* ── Community ────────────────────────────────────────────────── */
.community-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.community-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: .75rem; padding: 2rem; transition: all .2s;
}
.discord-card { text-decoration: none; display: flex; flex-direction: column; gap: 1rem; }
.discord-card:hover { border-color: rgba(124,58,237,.5); background: rgba(124,58,237,.08); transform: translateY(-2px); }
.discord-icon { width: 48px; height: 48px; background: rgba(124,58,237,.2); border-radius: .5rem; display: flex; align-items: center; justify-content: center; }
.discord-icon svg { width: 28px; height: 28px; color: #7c3aed; }
.community-card h3 { font-family: 'Cinzel', serif; color: #fff; font-size: 1.1rem; }
.community-card p { color: #9ca3af; font-size: .9rem; }
.community-tag { font-size: .75rem; color: #a855f7; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .5rem !important; }

/* ── Footer ───────────────────────────────────────────────────── */
.foot { border-top: 1px solid rgba(255,255,255,.06); padding: 3rem 2rem 2rem; }
.foot-inner { max-width: 1200px; margin: 0 auto; display: flex; gap: 3rem; flex-wrap: wrap; justify-content: space-between; margin-bottom: 2rem; }
.foot-tag { color: #6b7280; font-size: .85rem; margin-top: .5rem; max-width: 28ch; }
.foot-cols { display: flex; gap: 3rem; flex-wrap: wrap; }
.foot-cols > div { display: flex; flex-direction: column; gap: .5rem; }
.foot-cols h4 { font-family: 'Cinzel', serif; font-size: .8rem; color: #fff; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .25rem; }
.foot-cols a { color: #6b7280; text-decoration: none; font-size: .875rem; transition: color .2s; }
.foot-cols a:hover { color: #fff; }
.fine { color: #4b5563; font-size: .78rem; max-width: 22ch; line-height: 1.5; }
.foot-bottom {
  max-width: 1200px; margin: 0 auto; padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.05);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  font-size: .8rem; color: #4b5563;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav { padding: 1rem; }
  .nav-links { gap: .75rem; }
  .nav-links a:not(.nav-discord):not([href="#builds"]):not([href="#leaderboard"]) { display: none; }
  .hero { padding: 5rem 1rem 3rem; }
  .hero-rift { width: 300px; height: 300px; }
  .section { padding: 3rem 1rem; }
  .foot-inner { flex-direction: column; gap: 2rem; }
}

/* ── Build card clickable link wrapper ────────────────────────── */
.build-card-link {
  display: block;
  text-decoration: none;
  border-radius: .75rem;
  /* Focus style for keyboard navigation */
}
.build-card-link:focus-visible {
  outline: 2px solid #a855f7;
  outline-offset: 2px;
}
/* Let the inner .build-card handle all visual states */
.build-card-link .build-card { cursor: pointer; }

/* ════════════════════════════════════════════════════════════════
   Build Detail Page  (build.html + build-detail.js)
   ════════════════════════════════════════════════════════════════ */

/* ── Loading / Error states ───────────────────────────────────── */
.bd-loading {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: #6b7280;
  letter-spacing: .04em;
}

.bd-error[hidden], .bd-loading[hidden], #bd-root[hidden] { display: none !important; }

.bd-error {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  text-align: center;
}

.bd-error-inner {
  max-width: 420px;
}

.bd-error-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #ffd86b;
}

.bd-error-title {
  font-family: 'Cinzel', serif;
  font-size: 1.75rem;
  color: #fff;
  margin-bottom: .75rem;
}

.bd-error-msg {
  color: #9ca3af;
  font-size: .95rem;
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

/* ── Hero band ────────────────────────────────────────────────── */
.bd-hero {
  position: relative;
  overflow: hidden;
  padding: 7rem 2rem 3.5rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  /* Calling-color left accent (same pattern as .build-card) */
  border-left: 3px solid var(--calling-color, #a855f7);
}

.bd-hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bd-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
}

.bd-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  font-weight: 600;
  color: #9ca3af;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .09em;
  margin-bottom: 1.75rem;
  transition: color .2s;
}

.bd-back:hover { color: #fff; }
.bd-back:focus-visible { outline: 2px solid #a855f7; outline-offset: 3px; border-radius: 3px; }

.bd-meta-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.bd-souls-hero {
  /* Inherits .build-souls from index styles — just needs display override */
  margin-bottom: 0 !important;
}

.bd-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  color: #fff;
  line-height: 1.15;
  margin-bottom: .75rem;
  letter-spacing: .01em;
}

.bd-contrib {
  font-size: .875rem;
  color: #6b7280;
}

.bd-contrib strong { color: #a855f7; font-weight: 600; }

/* ── Two-column layout ────────────────────────────────────────── */
.bd-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 2.5rem auto 4rem;
  padding: 0 2rem;
  align-items: start;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.bd-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Main content ─────────────────────────────────────────────── */
.bd-right {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Panel (shared card style) ────────────────────────────────── */
.bd-panel {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: .75rem;
  padding: 1.5rem;
}

.bd-panel-title {
  font-family: 'Cinzel', serif;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 1.1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

/* ── Soul bars ────────────────────────────────────────────────── */
.bd-soul-bars {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.soul-bar-row {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.soul-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .8rem;
  font-weight: 600;
  color: #d4cfe8;
}

.soul-bar-pts {
  font-size: .72rem;
  color: #6b7280;
  font-weight: 400;
}

.soul-bar-track {
  height: 7px;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  overflow: hidden;
}

.soul-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--calling-color, #a855f7), color-mix(in srgb, var(--calling-color, #a855f7) 60%, #ffd86b));
  border-radius: 999px;
  transition: width .7s cubic-bezier(.25,.46,.45,.94);
  /* fallback for browsers without color-mix — handled below */
  background: linear-gradient(90deg, var(--calling-color, #a855f7) 0%, #ffd86b 100%);
  opacity: .85;
}

/* ── Mastery list ─────────────────────────────────────────────── */
.bd-mastery-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.bd-mastery-item {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.bd-mastery-lvl {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  font-family: 'Cinzel', serif;
  color: #ffd86b;
  background: rgba(255,216,107,.1);
  border: 1px solid rgba(255,216,107,.25);
  border-radius: .25rem;
  padding: .15rem .4rem;
  letter-spacing: .04em;
  min-width: 2.4rem;
  text-align: center;
}

.bd-mastery-name {
  font-size: .875rem;
  color: #d4cfe8;
}

/* ── Buff tags ────────────────────────────────────────────────── */
.bd-buffs {
  /* container */
}

.bd-buffs-inner {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.buff-tag {
  display: inline-flex;
  align-items: center;
  font-size: .78rem;
  font-weight: 600;
  padding: .3rem .75rem;
  border-radius: 999px;
  background: rgba(255,216,107,.1);
  color: #ffd86b;
  border: 1px solid rgba(255,216,107,.28);
  letter-spacing: .02em;
}

/* ── Magelo button panel ──────────────────────────────────────── */
.bd-panel-magelo {
  padding: 1rem 1.5rem;
}

.bd-magelo-btn {
  width: 100%;
  justify-content: center;
}

/* ── Overview description ─────────────────────────────────────── */
.bd-desc {
  font-size: .95rem;
  color: #9ca3af;
  line-height: 1.75;
}

/* ── Macros ───────────────────────────────────────────────────── */
.bd-macros {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.macro-block {
  border-radius: .5rem;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
}

.macro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem 1rem;
  background: rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-wrap: wrap;
}

.macro-name {
  font-family: 'Cinzel', serif;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.macro-trigger {
  font-family: 'Courier New', Courier, monospace;
  font-size: .75rem;
  color: #a855f7;
  background: rgba(168,85,247,.1);
  border: 1px solid rgba(168,85,247,.2);
  border-radius: .2rem;
  padding: .15rem .45rem;
}

.macro-body {
  font-family: 'Courier New', Courier, monospace;
  font-size: .82rem;
  line-height: 1.8;
  color: #d4cfe8;
  background: rgba(0,0,0,.4);
  padding: 1rem 1.1rem;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

/* ── Build detail responsive ──────────────────────────────────── */
@media (max-width: 900px) {
  .bd-grid {
    grid-template-columns: 1fr;
    padding: 0 1.25rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
  }

  .bd-left {
    /* sidebar renders above content on mobile */
    order: 2;
  }

  .bd-right {
    order: 1;
  }
}

@media (max-width: 640px) {
  .bd-hero {
    padding: 6rem 1rem 2.5rem;
    border-left-width: 2px;
  }

  .bd-title {
    font-size: 1.75rem;
  }

  .bd-grid {
    padding: 0 1rem;
    gap: 1rem;
  }

  .bd-panel {
    padding: 1.1rem;
  }

  .macro-body {
    font-size: .78rem;
    padding: .85rem .9rem;
  }
}

/* ── Rotation / Abilities / Tips ───────────────────────────────── */
.bd-rotation {
  font-size: .925rem; color: #9ca3af; line-height: 1.75;
}

.bd-abilities-list {
  list-style: none; display: flex; flex-direction: column; gap: .85rem;
}
.bd-ability-item {
  display: grid; grid-template-columns: 9rem 1fr; gap: .75rem;
  font-size: .875rem; align-items: baseline;
  padding-bottom: .85rem; border-bottom: 1px solid rgba(255,255,255,.05);
}
.bd-ability-item:last-child { border-bottom: none; padding-bottom: 0; }
.bd-ability-name {
  font-weight: 700; color: #d4cfe8; white-space: nowrap;
}
.bd-ability-note { color: #9ca3af; line-height: 1.5; }

.bd-tips-list {
  list-style: none; display: flex; flex-direction: column; gap: .6rem;
}
.bd-tip-item {
  font-size: .875rem; color: #9ca3af; line-height: 1.55;
  padding-left: 1.25rem; position: relative;
}
.bd-tip-item::before {
  content: '›'; position: absolute; left: 0;
  color: #a855f7; font-weight: 700; font-size: 1rem;
}

@media (max-width: 640px) {
  .bd-ability-item { grid-template-columns: 1fr; gap: .25rem; }
  .bd-ability-name { font-size: .8rem; }
}
