/* =========================================================================
   FREEEXILE MODERN ARPG HUD: DUAL ORBS & SKILL BAR STYLESHEET (2026.1)
   Standard: <= 350 lines (Soft Cap), Grimdark Aesthetics, 120 FPS Radial Sweeps
   ========================================================================= */

/* --- DUAL FLUID ORBS CONTAINER --- */
#hud-orbs-container {
  position: absolute; inset-inline: 0; bottom: 0; pointer-events: none; z-index: 24;
  display: flex; justify-content: space-between; align-items: flex-end; padding: 0 12px 10px 12px;
}
.orb-wrapper { position: relative; pointer-events: auto; cursor: pointer; user-select: none; touch-action: manipulation; }
.orb-globe {
  position: relative; width: 86px; height: 86px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 50%, #09090b 40%, #000000 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.95), 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(39, 39, 42, 0.6), inset 0 0 16px rgba(0, 0, 0, 0.9);
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
}
.orb-wrapper:hover .orb-globe { transform: scale(1.04); }
.orb-wrapper:active .orb-globe { transform: scale(0.96); }

.orb-life {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.95), 0 0 14px rgba(185, 28, 28, 0.25), 0 0 0 1px rgba(127, 29, 29, 0.5), inset 0 0 16px rgba(0, 0, 0, 0.9);
}
.orb-mana {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.95), 0 0 14px rgba(37, 99, 235, 0.25), 0 0 0 1px rgba(30, 58, 138, 0.5), inset 0 0 16px rgba(0, 0, 0, 0.9);
}
.orb-canvas { width: 100%; height: 100%; border-radius: 50%; display: block; pointer-events: none; }
.orb-sheen {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.06) 35%, rgba(255, 255, 255, 0) 65%);
  pointer-events: none;
}
.orb-bezel { position: absolute; inset: -1px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.08); pointer-events: none; }
.orb-label-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1.5px;
  pointer-events: none; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 5px rgba(0, 0, 0, 0.9); z-index: 2;
}
.orb-life .orb-cur-val { color: #fee2e2; }
.orb-mana .orb-cur-val { color: #e0f2fe; }
.orb-divider { color: rgba(161, 161, 170, 0.55); font-size: 10px; margin: 0 0.5px; }
.orb-max-val { color: rgba(161, 161, 170, 0.85); font-size: 10px; }
.orb-type-tag {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  font-family: ui-monospace, monospace; font-size: 7.5px; font-weight: 800; letter-spacing: 0.08em;
  padding: 0 4px; border-radius: 3px; background: rgba(0, 0, 0, 0.65); border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a1a1aa; pointer-events: none; z-index: 3;
}
.orb-pulse-warning {
  position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(239, 68, 68, 0.85);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.65); animation: crimsonHeartbeat 1.0s cubic-bezier(0.25, 1, 0.5, 1) infinite;
  pointer-events: none;
}
.orb-low-pulse { animation: crimsonHeartbeat 1.0s cubic-bezier(0.25, 1, 0.5, 1) infinite; }

@keyframes crimsonHeartbeat {
  0% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(220, 38, 38, 0.5)); }
  15% { transform: scale(1.07); filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.95)); }
  30% { transform: scale(1.02); filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.6)); }
  45% { transform: scale(1.05); filter: drop-shadow(0 0 14px rgba(239, 68, 68, 0.9)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(220, 38, 38, 0.5)); }
}

#hud-low-hp-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 22;
  box-shadow: inset 0 0 80px rgba(185, 28, 28, 0.65), inset 0 0 140px rgba(127, 29, 29, 0.45);
  animation: vignettePulse 1.0s ease-in-out infinite alternate;
}
@keyframes vignettePulse { 0% { opacity: 0.5; } 100% { opacity: 1.0; } }

/* --- DOCKED ACTION BAR & COOLDOWN SWEEPS --- */
.hud-skill-bar {
  position: absolute; right: 14px; bottom: 12px; z-index: 25;
  display: flex; align-items: flex-end; gap: 8px; padding: 6px 10px; border-radius: 18px;
  background: rgba(5, 5, 8, 0.72); border: 1px solid rgba(82, 82, 91, 0.35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  pointer-events: auto; user-select: none; -webkit-user-select: none;
}
.hud-skill-divider {
  width: 1px; height: 28px; align-self: center;
  background: linear-gradient(180deg, transparent, rgba(120, 113, 108, 0.4), transparent);
}
.skill-slot {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; margin: 0; border-radius: 50%;
  border: 1.5px solid rgba(120, 113, 108, 0.45);
  background: radial-gradient(circle at 35% 25%, #27272a 0%, #09090b 70%, #000000 100%);
  color: #e4e4e7; cursor: pointer; outline: none; touch-action: manipulation;
  transition: transform 0.08s ease-out, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.75), inset 0 1px 2px rgba(255, 255, 255, 0.12);
}
.skill-slot:hover {
  border-color: rgba(217, 119, 6, 0.75);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.85), 0 0 10px rgba(217, 119, 6, 0.35);
}
.skill-slot:active, .skill-slot.is-pressed {
  transform: scale(0.92); border-color: rgba(245, 158, 11, 0.95);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.95), 0 0 12px rgba(245, 158, 11, 0.45); filter: brightness(0.92);
}

.skill-slot-primary {
  width: 52px; height: 52px; border-color: rgba(217, 119, 6, 0.65);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.85), 0 0 8px rgba(217, 119, 6, 0.25);
}
.skill-slot-dodge {
  width: 50px; height: 50px; border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.85), 0 0 8px rgba(168, 85, 247, 0.25);
}
.skill-slot-flask {
  width: 38px; height: 38px; border-color: rgba(220, 38, 38, 0.55); border-radius: 12px;
}
.skill-icon-wrap {
  position: relative; width: 100%; height: 100%; border-radius: inherit;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.skill-icon { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.skill-icon.icon-atlas {
  background-image: url('../assets/skills/martial_skills_atlas.png');
  background-size: 400% 400%;
  background-position: calc(var(--atlas-col, 0) * 33.3333%) calc(var(--atlas-row, 0) * 33.3333%);
}
.skill-icon.icon-flask, .skill-icon.icon-dodge { display: flex; align-items: center; justify-content: center; }

/* 360° Clockwise Conic Radial Cooldown Sweep */
.cooldown-overlay {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent var(--cooldown-sweep, 0deg),
    rgba(251, 191, 36, 0.95) var(--cooldown-sweep, 0deg),
    rgba(251, 191, 36, 0.95) calc(var(--cooldown-sweep, 0deg) + 2deg),
    rgba(5, 5, 8, 0.82) calc(var(--cooldown-sweep, 0deg) + 2deg),
    rgba(5, 5, 8, 0.82) 360deg
  );
  opacity: 0; transition: opacity 0.12s ease; z-index: 5;
}
.skill-slot.is-on-cooldown .cooldown-overlay { opacity: 1; }
.cooldown-counter {
  font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; font-weight: 800;
  color: #fbbf24; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.9); pointer-events: none;
}

/* 0.25s Luminous Ready Flash Pulse */
.ready-flash-emitter { position: absolute; inset: -4px; border-radius: inherit; pointer-events: none; opacity: 0; z-index: 6; }
.skill-slot.is-ready-pulse .ready-flash-emitter {
  animation: skill-ready-pulse 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes skill-ready-pulse {
  0% { opacity: 0; transform: scale(0.9); box-shadow: 0 0 0 rgba(251, 191, 36, 0); }
  35% { opacity: 1; transform: scale(1.18); box-shadow: 0 0 22px 4px rgba(251, 191, 36, 0.85); filter: brightness(1.75); }
  100% { opacity: 0; transform: scale(1.28); box-shadow: 0 0 32px 8px rgba(251, 191, 36, 0); }
}

/* Blocked Cooldown Shake */
.skill-slot.is-cooldown-blocked {
  animation: skill-blocked-shake 0.18s ease-in-out;
  border-color: rgba(239, 68, 68, 0.95) !important;
}
@keyframes skill-blocked-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px) rotate(-1.5deg); }
  75% { transform: translateX(3px) rotate(1.5deg); }
}

.skill-keybind-badge {
  position: absolute; bottom: -4px; right: -2px; padding: 0 4px; min-width: 14px; height: 13px; line-height: 13px;
  text-align: center; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 8px; font-weight: 800;
  color: #f4f4f5; background: rgba(9, 9, 11, 0.92); border: 1px solid rgba(82, 82, 91, 0.55);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.7); pointer-events: none; z-index: 7;
}

.skill-charges-badge {
  position: absolute; top: -3px; left: -2px; padding: 0 4px; height: 13px; line-height: 13px; border-radius: 4px;
  font-family: ui-monospace, monospace; font-size: 8px; font-weight: 800; color: #38bdf8;
  background: rgba(8, 23, 53, 0.92); border: 1px solid rgba(56, 189, 248, 0.45); pointer-events: none; z-index: 7;
}
.skill-charges-badge.is-depleted {
  color: #71717a; background: rgba(24, 24, 27, 0.85); border-color: rgba(82, 82, 91, 0.35);
}

/* Mobile Ergonomics */
@media (max-width: 640px) {
  .orb-globe { width: 74px; height: 74px; }
  .hud-skill-bar { right: 8px; bottom: 8px; gap: 5px; padding: 4px 6px; }
  .skill-slot { width: 38px; height: 38px; }
  .skill-slot-primary { width: 46px; height: 46px; }
  .skill-slot-dodge { width: 42px; height: 42px; }
  .skill-slot-flask { width: 32px; height: 32px; }
}

/* Desktop Widescreen PC ARPG Ergonomics (PoE2 Centered Action Bar & Click-to-Move) */
@media (min-width: 768px) {
  .hud-skill-bar {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: 14px;
    z-index: 45;
    gap: 9px;
    padding: 6px 14px;
    border-radius: 22px;
    box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(245, 158, 11, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
  .skill-slot { width: 48px; height: 48px; }
  .skill-slot-primary { width: 56px; height: 56px; }
  .skill-slot-dodge { width: 50px; height: 50px; }
  .skill-slot-flask { width: 42px; height: 42px; }
  .orb-globe { width: 96px; height: 96px; }
}

@media (pointer: fine) and (min-width: 768px) {
  #joystick-zone {
    pointer-events: none;
  }
}

