/*
 * Battle HUD frame around the hero's life/mana orbs + skill hotbar. A
 * proper game-HUD treatment (dark gradient panel, top hairline, safe-area
 * padding for the iOS home indicator) instead of a bare flex row floating
 * unframed over the battle scene -- same "item card" / accent-token
 * language as the skill tooltip below and the enemy panel
 * (TopMenuContext/Battle/styles.css) so both ends of the HUD read as one
 * system.
 */
.battle-hud {
  width: 100%;
  padding: 10px clamp(8px, 3vw, 20px) calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(
    180deg,
    color-mix(in oklch, var(--color-base-100) 0%, transparent),
    color-mix(in oklch, var(--color-base-100) 92%, transparent) 35%,
    var(--color-base-100) 100%
  );
  border-top: 1px solid var(--color-base-300);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
}

.orbs-container {
  gap: clamp(4px, 2vw, 16px);
}

.orb-container {
  width: clamp(64px, 20vw, 100px);
  height: clamp(64px, 20vw, 100px);
}

/* Skill hotbar buttons: comfortable touch target on mobile (min ~52px)
 * that grows a bit on larger screens. Now that the skill row is one
 * connected bar (no gap/radius between buttons -- see index.tsx), each
 * button needs a bit more room than the old spaced-out pill layout so the
 * icon/mana-cost/info badge inside don't read as crammed. */
.skill-btn {
  width: clamp(52px, 15vw, 64px);
  height: clamp(52px, 15vw, 64px);
}

.skill-btn__icon {
  font-size: clamp(1.5rem, 6.5vw, 2.4rem);
}
.orb {
  cursor: pointer;
  user-select: none;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  /* // position: relative; */
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid #fff;
  /* Subtle rim + inner shadow to sell a glass sphere */
  box-shadow:
    inset 0 6px 10px rgba(255, 255, 255, 0.35),
    inset 0 -10px 16px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  filter: drop-shadow();
}

.water {
  position: relative;
  width: 100%;
  height: 100%;
  background: white;
  /* box-shadow: inset 0 0 0 5px #000000; */
  border-radius: 30px;
  border-top-left-radius: 0px;
  border-top-right-radius: 0px;
  /* //overflow: hidden; */
}

/*
 * Liquid fill, Diablo 2 orb style: a mostly-flat pool of liquid with a
 * single subtle ripple riding the surface, not a multi-layer animated
 * blob. `--height` is the fill's top offset as a % of the orb (0 = full,
 * 100 = empty), so it's set directly from health/mana and just transitions
 * smoothly when it changes. The one ripple layer is a gentle rock
 * (`transform` only), and a thin highlight sells the surface/meniscus.
 */
.wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: var(--height);
  transition: top 0.6s ease-out;
  background: linear-gradient(45deg, #520000, #780000, #990000);
  overflow: hidden;
  /* Subtle meniscus: a bright sliver hugging the liquid's top edge */
  box-shadow: inset 0 3px 4px rgba(255, 255, 255, 0.35);
}

.wave:before {
  content: '';
  position: absolute;
  left: -25%;
  width: 150%;
  height: 16px;
  top: -8px;
  border-radius: 45%;
  background: rgba(255, 0, 0, 0.45);
  transform-origin: 50% 50%;
  will-change: transform;
  animation: sway 5s ease-in-out infinite;
}

.wave.mana {
  background: linear-gradient(45deg, #040052, #020065, #00067e);
}

.wave.mana:before {
  background: rgba(4, 0, 255, 0.45);
}

/* Gentle rock: small rotation + horizontal drift, no full spins */
@keyframes sway {
  0% {
    transform: translateX(-1.5%) rotate(-1deg);
  }
  50% {
    transform: translateX(1.5%) rotate(1deg);
  }
  100% {
    transform: translateX(-1.5%) rotate(-1deg);
  }
}

.glass-streak {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
  color: #000;
  top: 0%;
  left: 0%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 25% 25%,
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0) 60%
  );

  pointer-events: none; /* To make sure it doesn't interfere with any interactions */
}

/* Skill tooltip: a small "item card" -- accent-colored header matching the
 * skill's damage type, and a stat grid, instead of a plain stack of
 * unstyled text rows. Mirrors packages/ui/Hero/Tree/tree.css's tooltip. */
.skill-tooltip {
  padding: 0 !important;
  overflow: hidden;
  border-color: color-mix(in oklch, var(--accent, var(--color-secondary)) 45%, var(--color-base-300)) !important;
}

.skill-tooltip__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.skill-tooltip__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -10px -10px 0;
  padding: 10px;
  background: linear-gradient(
    135deg,
    color-mix(in oklch, var(--accent) 22%, var(--color-base-100)),
    var(--color-base-100)
  );
  border-bottom: 1px solid color-mix(in oklch, var(--accent) 35%, var(--color-base-300));
}

.skill-tooltip__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 1.2rem;
  border-radius: 0.65rem;
  background: color-mix(in oklch, var(--accent) 20%, var(--color-base-100));
  box-shadow: inset 0 0 0 1.5px color-mix(in oklch, var(--accent) 55%, transparent);
}

.skill-tooltip__name {
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.15;
  white-space: nowrap;
}

.skill-tooltip__type {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: color-mix(in oklch, var(--accent) 75%, var(--color-base-content));
}

.skill-tooltip__stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.skill-tooltip__stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.skill-tooltip__stat-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-base-content);
  opacity: 0.55;
}

.skill-tooltip__stat-value {
  font-size: 0.8rem;
  font-weight: 700;
}

.skill-tooltip__note {
  font-size: 0.72rem;
  border-radius: 0.5rem;
  padding: 5px 7px;
}

.skill-tooltip__dot {
  font-size: 0.72rem;
  color: color-mix(in oklch, var(--accent) 85%, var(--color-base-content));
  background: color-mix(in oklch, var(--accent) 10%, transparent);
  border-radius: 0.5rem;
  padding: 5px 7px;
}

