/* ═══════════════════════════════════════════════════
   CZARY — Dark Fantasy + efekty profesji
   ═══════════════════════════════════════════════════ */

.lbn-spells {
  --sorc: #9b6cff;
  --druid: #4ec9a0;
  --pally: #e0c35a;
  --knight: #e07070;
}

/* ── Hero aura ── */
.lbn-spells .spells-hero {
  position: relative;
  overflow: hidden;
}

.spells-hero__aura {
  position: absolute;
  inset: -30% -20%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(155, 108, 255, 0.14), transparent 45%),
    radial-gradient(ellipse at 70% 50%, rgba(78, 201, 160, 0.12), transparent 42%),
    radial-gradient(ellipse at 50% 90%, rgba(212, 175, 55, 0.1), transparent 50%);
  animation: spells-aura-drift 8s ease-in-out infinite;
}

.spells-hero__spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  box-shadow: 0 0 10px currentColor;
}

.spells-hero__spark--a {
  top: 22%;
  left: 14%;
  color: #c9a4ff;
  background: #c9a4ff;
  animation: spells-spark 3.2s ease-in-out infinite;
}

.spells-hero__spark--b {
  top: 58%;
  right: 16%;
  color: #7ee0b8;
  background: #7ee0b8;
  animation: spells-spark 2.7s ease-in-out infinite 0.6s;
}

.lbn-spells .spells-hero > * {
  position: relative;
  z-index: 1;
}

.lbn-spells--sorc .spells-hero__aura {
  background: radial-gradient(ellipse at 50% 40%, rgba(155, 108, 255, 0.22), transparent 55%);
}
.lbn-spells--druid .spells-hero__aura {
  background: radial-gradient(ellipse at 50% 40%, rgba(78, 201, 160, 0.2), transparent 55%);
}
.lbn-spells--pally .spells-hero__aura {
  background: radial-gradient(ellipse at 50% 40%, rgba(224, 195, 90, 0.2), transparent 55%);
}
.lbn-spells--knight .spells-hero__aura {
  background: radial-gradient(ellipse at 50% 40%, rgba(224, 112, 112, 0.2), transparent 55%);
}

@keyframes spells-aura-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
  50% { transform: translate3d(2%, -2%, 0) scale(1.05); opacity: 1; }
}

@keyframes spells-spark {
  0%, 100% { transform: translateY(0) scale(0.8); opacity: 0.25; }
  50% { transform: translateY(-8px) scale(1.25); opacity: 0.85; }
}

/* ── Vocation picker ── */
.spells-voc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 12px;
}

.spells-voc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 12px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(138, 106, 26, 0.4);
  background:
    linear-gradient(180deg, rgba(40, 30, 20, 0.75), rgba(10, 8, 6, 0.85));
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.spells-voc-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}

.spells-voc-card.is-active {
  border-color: var(--gold-bright);
  box-shadow:
    0 0 0 1px rgba(255, 215, 0, 0.25),
    0 8px 20px rgba(0, 0, 0, 0.45);
}

.spells-voc-card__glow {
  position: absolute;
  inset: auto 10% -40% 10%;
  height: 70%;
  pointer-events: none;
  opacity: 0.35;
  filter: blur(18px);
  transition: opacity 0.2s ease;
}

.spells-voc-card--sorc .spells-voc-card__glow { background: var(--sorc); }
.spells-voc-card--druid .spells-voc-card__glow { background: var(--druid); }
.spells-voc-card--pally .spells-voc-card__glow { background: var(--pally); }
.spells-voc-card--knight .spells-voc-card__glow { background: var(--knight); }

.spells-voc-card:hover .spells-voc-card__glow,
.spells-voc-card.is-active .spells-voc-card__glow {
  opacity: 0.65;
  animation: spells-glow-pulse 2s ease-in-out infinite;
}

@keyframes spells-glow-pulse {
  0%, 100% { opacity: 0.45; transform: scaleX(1); }
  50% { opacity: 0.8; transform: scaleX(1.08); }
}

.spells-voc-card__outfit {
  position: relative;
  z-index: 1;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(138, 106, 26, 0.45);
  background:
    radial-gradient(ellipse at 50% 60%, rgba(212, 175, 55, 0.14), transparent 70%),
    rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.spells-voc-card.is-active .spells-voc-card__outfit {
  animation: spells-outfit-stage 2.2s ease-in-out infinite;
}

.spells-voc-card__outfit img {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
  object-position: center center;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5));
}

@keyframes spells-outfit-stage {
  0%, 100% {
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(212, 175, 55, 0.1);
  }
  50% {
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45), 0 0 12px rgba(255, 215, 0, 0.28);
  }
}

.spells-voc-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.spells-voc-card__name {
  font-family: "Cinzel", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f2e6c0;
}

.spells-voc-card__role {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.spells-voc-card__sig {
  margin-top: 4px;
  padding: 2px 8px;
  font-family: "Cinzel", serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid rgba(138, 106, 26, 0.5);
  background: rgba(0, 0, 0, 0.4);
}

.spells-voc-card--sorc .spells-voc-card__sig {
  color: #d4b8ff;
  border-color: rgba(155, 108, 255, 0.45);
  animation: spells-tag-pulse 2.2s ease-in-out infinite;
}
.spells-voc-card--druid .spells-voc-card__sig {
  color: #9ef0d0;
  border-color: rgba(78, 201, 160, 0.45);
  animation: spells-tag-pulse 2.4s ease-in-out infinite;
}
.spells-voc-card--pally .spells-voc-card__sig {
  color: #ffe08a;
  border-color: rgba(224, 195, 90, 0.5);
  animation: spells-tag-pulse 2.3s ease-in-out infinite;
}
.spells-voc-card--knight .spells-voc-card__sig {
  color: #ffb0b0;
  border-color: rgba(224, 112, 112, 0.5);
  animation: spells-tag-pulse 1.9s ease-in-out infinite;
}

@keyframes spells-tag-pulse {
  0%, 100% { filter: brightness(1); box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
  50% { filter: brightness(1.2); box-shadow: 0 0 10px rgba(255, 215, 0, 0.15); }
}

/* ── Focus panel (selected voc) ── */
.spells-focus {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 0;
  align-items: stretch;
  margin-bottom: 12px;
  overflow: hidden;
}

.spells-focus__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  border-right: 1px solid rgba(138, 106, 26, 0.35);
  background:
    radial-gradient(ellipse at 50% 55%, rgba(212, 175, 55, 0.12), transparent 65%),
    rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.spells-focus__ring {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.25);
  animation: spells-ring-spin 6s linear infinite;
}

.spells-focus__ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 215, 0, 0.2);
  animation: spells-ring-spin 9s linear infinite reverse;
}

.spells-focus__ring--sorc { box-shadow: 0 0 24px rgba(155, 108, 255, 0.25); }
.spells-focus__ring--druid { box-shadow: 0 0 24px rgba(78, 201, 160, 0.25); }
.spells-focus__ring--pally { box-shadow: 0 0 24px rgba(224, 195, 90, 0.25); }
.spells-focus__ring--knight { box-shadow: 0 0 24px rgba(224, 112, 112, 0.25); }

@keyframes spells-ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spells-focus__outfit {
  position: relative;
  z-index: 1;
  display: block;
  width: 128px;
  height: 128px;
  object-fit: contain;
  object-position: center center;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.5));
  animation: spells-outfit-bob 2.4s ease-in-out infinite;
}

@keyframes spells-outfit-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.spells-focus__info {
  padding: 0 0 10px;
  min-width: 0;
}

.spells-focus__info .char-glow-panel__head {
  margin-bottom: 0;
}

.spells-focus__desc {
  margin: 8px 14px 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.spells-focus__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px;
}

.spells-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border: 1px solid rgba(138, 106, 26, 0.45);
  background: rgba(0, 0, 0, 0.35);
  font-family: "Cinzel", serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
}

.spells-badge strong {
  color: var(--gold-bright);
  font-weight: 800;
}

.spells-badge--sig {
  color: var(--gold-bright);
  border-color: rgba(255, 215, 0, 0.45);
  animation: spells-tag-pulse 2s ease-in-out infinite;
}

.spells-badge--link {
  color: #9ec8e0;
  border-color: rgba(90, 160, 210, 0.4);
}

.spells-badge--link:hover {
  border-color: #9ec8e0;
  color: #c8e4f5;
}

/* ── Spell table ── */
.spells-panel {
  margin-bottom: 10px;
}

.spells-panel .char-glow-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.spells-panel__count {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid rgba(138, 106, 26, 0.35);
  padding: 1px 7px;
}

.spells-table {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.spells-head {
  display: grid;
  grid-template-columns: 1.3fr 1fr 96px 72px;
  gap: 8px;
  align-items: center;
  padding: 4px 8px 6px;
  font-family: "Cinzel", serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid rgba(138, 106, 26, 0.4);
}

.spells-head__ml {
  text-align: center;
}

.spells-head__mana {
  text-align: right;
}

.spells-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 96px 72px;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid rgba(138, 106, 26, 0.28);
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(6px);
  animation: spells-row-in 0.35s ease forwards;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.spells-row:hover {
  border-color: var(--gold);
  background: rgba(40, 30, 16, 0.45);
}

.spells-row--top {
  border-color: rgba(255, 215, 0, 0.45);
  background:
    linear-gradient(90deg, rgba(212, 175, 55, 0.12), rgba(0, 0, 0, 0.3));
}

@keyframes spells-row-in {
  to { opacity: 1; transform: translateY(0); }
}

.spells-row__name {
  font-size: 13px;
  font-weight: 600;
  color: #f2e6c0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spells-row__words code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 7px;
  border: 1px solid rgba(138, 106, 26, 0.4);
  background: rgba(0, 0, 0, 0.35);
  color: #ffd76a;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.spells-row--top .spells-row__words code {
  color: var(--gold-bright);
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.12);
}

.spells-row__ml,
.spells-row__mana {
  font-family: "Cinzel", serif;
  font-size: 12px;
  font-weight: 700;
}

.spells-row__ml {
  color: #9ec8e0;
  text-align: center;
  line-height: 1.2;
}

.spells-row__ml--reborn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.spells-row__ml--reborn strong {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.spells-row__ml--reborn small {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
  white-space: nowrap;
  color: #9ec8e0;
  opacity: 0.9;
}

.spells-row__mana {
  color: var(--gold-bright);
  text-align: right;
}

.spells-tip {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(138, 106, 26, 0.4);
  border-left: 3px solid var(--gold);
  background: rgba(0, 0, 0, 0.3);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.spells-tip em {
  color: var(--gold);
  font-style: normal;
  font-weight: 600;
}

.spells-tip a {
  color: #9ec8e0;
  text-decoration: none;
  border-bottom: 1px solid rgba(158, 200, 224, 0.35);
}

.spells-tip a:hover {
  color: #c8e4f5;
  border-bottom-color: #c8e4f5;
}

@media (max-width: 720px) {
  .spells-voc-grid {
    grid-template-columns: 1fr 1fr;
  }

  .spells-focus {
    grid-template-columns: 1fr;
  }

  .spells-focus__stage {
    border-right: 0;
    border-bottom: 1px solid rgba(138, 106, 26, 0.35);
    min-height: 130px;
  }

  .spells-head,
  .spells-row {
    grid-template-columns: 1.1fr 0.9fr 78px 58px;
    gap: 5px;
    padding: 6px;
  }

  .spells-row__name { font-size: 12px; }
  .spells-row__words code { font-size: 11px; padding: 2px 5px; }
  .spells-row__ml,
  .spells-row__mana { font-size: 11px; }
  .spells-row__ml--reborn small { font-size: 7px; }
}

@media (max-width: 420px) {
  .spells-voc-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spells-hero__aura,
  .spells-hero__spark,
  .spells-voc-card__glow,
  .spells-voc-card.is-active .spells-voc-card__outfit,
  .spells-focus__ring,
  .spells-focus__ring::before,
  .spells-focus__outfit,
  .spells-voc-card__sig,
  .spells-badge--sig,
  .spells-row {
    animation: none !important;
  }

  .spells-row {
    opacity: 1;
    transform: none;
  }
}
