/**
 * WoW-style experience rail — sits under the avatar portrait card.
 */
.live-xp-rail {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  padding: 0.35rem 0.2rem 0.15rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-family: "Courier New", Courier, monospace;
}

.live-xp-rail.is-portrait {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(0, 255, 136, 0.15);
}

.live-xp-level {
  flex: 0 0 auto;
  min-width: 1.5rem;
  height: 1.35rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 200, 80, 0.55);
  background: linear-gradient(180deg, #3a2a08, #1a1204);
  color: #ffd86a;
  font-size: 0.72rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 0 8px rgba(255, 180, 40, 0.25);
}

.live-xp-track {
  position: relative;
  flex: 1 1 auto;
  height: 0.95rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(0, 255, 136, 0.28);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.live-xp-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    #1a6b3a 0%,
    #00aa55 40%,
    #00ff88 78%,
    #b8ffd0 100%
  );
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.35);
  transition: width 0.35s ease;
  z-index: 1;
}

.live-xp-fill.is-gaining {
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.65), 0 0 4px #fff;
}

.live-xp-glow {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.18),
    transparent 55%
  );
  border-radius: inherit;
}

/* cur / max on top of the bar */
.live-bar-val,
.live-xp-track .live-xp-label,
.live-hp-track .live-hp-label {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #f2fff6;
  text-shadow:
    0 0 2px #000,
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 5px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
  line-height: 1;
}

.live-hp-track {
  position: relative;
  flex: 1 1 auto;
  height: 0.95rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 100, 100, 0.3);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.live-hp-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6b1a1a 0%, #cc3333 50%, #ff6a6a 100%);
  transition: width 0.35s ease;
  z-index: 1;
}

.live-hp-track .live-hp-label {
  color: #fff0f0;
}

/* legacy meta (hidden when vals sit on bar) */
.live-xp-meta {
  display: none;
}

.live-xp-label {
  font-size: 0.58rem;
  color: #f2fff6;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.live-xp-rest {
  font-size: 0.55rem;
  color: #5a8a6a;
  letter-spacing: 0.03em;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.live-xp-rail.is-levelup .live-xp-level {
  animation: live-xp-lvl 0.9s ease 2;
  border-color: #ffe08a;
  color: #fff3c0;
}

.live-xp-rail.is-levelup .live-xp-fill {
  background: linear-gradient(90deg, #c9a227, #ffe08a, #fff8d0);
}

@keyframes live-xp-lvl {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 16px rgba(255, 220, 100, 0.7);
  }
}

/* Hide when guest / empty optional — still fine to show zeros */
body.is-practice-mode .live-xp-rail {
  opacity: 0.85;
}
