:root {
  --bg-panel: rgba(12, 17, 20, 0.78);
  --bg-panel-strong: rgba(10, 14, 18, 0.9);
  --border-gold: rgba(217, 174, 96, 0.38);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --gold: #f5c362;
  --gold-bright: #ffe69b;
  --rage-orange: #ff7b24;
  --rage-glow: #ffae34;
  --hp-green: #38c97a;
  --hp-red: #e5484d;
  --cyan: #38bdf8;
  --text-main: #f3f5f7;
  --text-dim: #9aa7b2;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b1410;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text-main);
}

#canvas-container {
  position: fixed;
  inset: 0;
  cursor: crosshair;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* World-projected UI (damage numbers, enemy HP bars) */
#world-ui-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

/* Screen vignette for low HP / hit flash / whirlwind aura */
#screen-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  transition: box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.45);
}

#screen-vignette.hit-flash {
  box-shadow: inset 0 0 110px rgba(229, 57, 53, 0.65);
}

#screen-vignette.low-hp {
  box-shadow: inset 0 0 120px rgba(190, 28, 36, 0.55);
}

#screen-vignette.whirlwind-aura {
  box-shadow: inset 0 0 100px rgba(255, 138, 30, 0.45);
}

/* HUD Root */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.3s ease;
}

#hud.hud-hidden {
  opacity: 0;
}

/* Top Left */
.hud-top-left {
  position: absolute;
  top: 14px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 248px;
}

.wave-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  width: fit-content;
  white-space: nowrap;
}

.wave-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.wave-sep {
  opacity: 0.35;
}

#enemy-count {
  color: var(--gold-bright);
}

.hero-hp-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  width: 238px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.hero-emblem {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(245, 195, 98, 0.25), rgba(30, 58, 95, 0.45));
  border: 1px solid rgba(245, 195, 98, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-bright);
  flex-shrink: 0;
}

.hero-emblem svg {
  width: 24px;
  height: 24px;
}

.hero-hp-right {
  flex: 1;
}

.hp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.hero-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hp-value {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.bar-track {
  position: relative;
  width: 100%;
  height: 11px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bar-trail {
  position: absolute;
  inset: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.72);
  transition: width 0.35s ease;
}

.hp-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  background: linear-gradient(90deg, #1f9d5e, #3ee088);
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(62, 224, 136, 0.4);
}

.hp-fill.danger {
  background: linear-gradient(90deg, #b91c1c, #f43f5e);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.6);
}

.buff-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  min-height: 18px;
}

.buff-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
}

.buff-chip.shield {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.55);
  color: #bae6fd;
}

/* Top Center: Boss Bar */
.boss-bar-wrap {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100vw - 540px));
  min-width: 240px;
  padding: 9px 14px;
  background: linear-gradient(180deg, rgba(24, 12, 14, 0.88), rgba(14, 10, 12, 0.82));
  border: 1px solid rgba(239, 68, 68, 0.48);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55), 0 0 24px rgba(185, 28, 28, 0.22);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.boss-bar-wrap.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-16px);
  pointer-events: none;
}

.boss-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.boss-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.boss-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #dc2626;
  color: #fff;
}

.boss-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #fecaca;
}

.boss-phase-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: linear-gradient(90deg, #ea580c, #dc2626);
  color: #fff7ed;
  animation: pulseGlow 1.1s infinite;
}

.boss-phase-tag.hidden {
  display: none;
}

.boss-hp-text {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #fca5a5;
}

.boss-bar-track {
  position: relative;
  height: 13px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(254, 202, 202, 0.2);
  overflow: hidden;
}

.boss-bar-trail {
  position: absolute;
  inset: 0;
  width: 100%;
  background: rgba(254, 215, 170, 0.78);
  transition: width 0.4s ease;
}

.boss-bar-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  background: linear-gradient(90deg, #991b1b, #ef4444, #f97316);
  transition: width 0.1s linear;
}

.boss-phase-marker {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 6px #fff;
}

.boss-action-banner {
  margin-top: 5px;
  min-height: 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

/* Top Right */
.hud-top-right {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.util-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--bg-panel);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.util-btn:hover {
  background: rgba(34, 45, 54, 0.92);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.util-btn.accent {
  border-color: rgba(239, 68, 68, 0.55);
  color: #fecaca;
}

.util-btn.accent:hover {
  background: rgba(153, 27, 27, 0.65);
  border-color: #f87171;
}

/* Center Banner */
.center-banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.center-banner.hidden {
  opacity: 0;
  transform: translateX(-50%) scale(0.94);
}

.banner-sub {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
  margin-bottom: 4px;
}

.banner-title {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.9), 0 0 24px rgba(245, 195, 98, 0.5);
}

/* Bottom Center: Rage Core + Skill Bar */
.hud-bottom-center {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.rage-panel {
  width: 390px;
  padding: 10px 16px 11px;
  background: linear-gradient(180deg, rgba(16, 18, 24, 0.86), rgba(10, 12, 16, 0.92));
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.rage-pips-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.rage-pips-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gold);
}

.pips-container {
  display: flex;
  align-items: center;
  gap: 18px;
}

.rage-pip {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pip-gem {
  width: 18px;
  height: 18px;
  transform: rotate(45deg);
  border-radius: 3px;
  background: rgba(30, 35, 44, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.8);
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.pip-ring {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  pointer-events: none;
}

.rage-pip.active .pip-gem {
  background: linear-gradient(135deg, #fff6b8, #ffb02e 45%, #f95316);
  border-color: #fff3c4;
  box-shadow: 0 0 14px #ff9224, 0 0 28px rgba(255, 136, 0, 0.7), inset 0 0 6px #fff;
  transform: rotate(45deg) scale(1.12);
}

.rage-pip.ignite .pip-ring {
  animation: pipIgnite 0.55s ease-out forwards;
}

@keyframes pipIgnite {
  0% {
    transform: scale(0.7);
    border-color: #ffe08a;
    opacity: 1;
  }
  100% {
    transform: scale(2.1);
    border-color: rgba(255, 145, 36, 0);
    opacity: 0;
  }
}

.rage-pips-count {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold-bright);
  min-width: 34px;
  text-align: right;
}

.rage-bar-wrap {
  position: relative;
}

.rage-bar-track {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 180, 70, 0.26);
  overflow: hidden;
}

.rage-bar-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, #b45309, #f59e0b, #fde047);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.65);
  transition: width 0.08s linear;
}

.rage-bar-fill.max-pips {
  width: 100% !important;
  background: linear-gradient(90deg, #ea580c, #f59e0b, #fef08a, #f59e0b);
  background-size: 200% 100%;
  animation: shimmerFlow 1.8s linear infinite;
}

.rage-bar-fill.flash {
  filter: brightness(2.1);
}

@keyframes shimmerFlow {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.rage-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

/* Action & Skill Bar */
.action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.action-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-divider {
  width: 1px;
  height: 48px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 2px;
}

.mini-action {
  position: relative;
  width: 52px;
  height: 58px;
  border-radius: 9px;
  background: rgba(20, 26, 33, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.12s;
}

.mini-action.active {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(245, 195, 98, 0.45);
  transform: scale(0.96);
}

.mini-key {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-bright);
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.mini-name {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

.mini-cd-mask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: rgba(0, 0, 0, 0.68);
  pointer-events: none;
}

/* Skill Slots */
.skill-slot {
  position: relative;
  width: 82px;
  height: 76px;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(28, 34, 44, 0.92), rgba(14, 18, 24, 0.95));
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: transform 0.14s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.skill-slot:hover .skill-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.skill-slot.locked {
  opacity: 0.5;
  filter: saturate(0.35);
}

.skill-slot.ready {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(245, 195, 98, 0.35), inset 0 0 14px rgba(251, 191, 36, 0.15);
}

.skill-slot.ready[data-skill="2"] {
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4), inset 0 0 14px rgba(56, 189, 248, 0.16);
}

.skill-slot.ready[data-skill="3"] {
  border-color: #fb923c;
  box-shadow: 0 0 20px rgba(251, 146, 60, 0.55), inset 0 0 16px rgba(251, 146, 60, 0.22);
  animation: skillUltPulse 1.6s infinite;
}

@keyframes skillUltPulse {
  0%, 100% { box-shadow: 0 0 18px rgba(251, 146, 60, 0.45), inset 0 0 14px rgba(251, 146, 60, 0.2); }
  50% { box-shadow: 0 0 28px rgba(251, 146, 60, 0.85), inset 0 0 20px rgba(253, 224, 71, 0.32); }
}

.skill-slot.ready:hover {
  transform: translateY(-2px);
}

.skill-slot.active-cast {
  transform: scale(0.95);
  border-color: #fff;
}

.skill-hotkey {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 10px;
  font-weight: 800;
  color: var(--gold-bright);
  opacity: 0.9;
}

.skill-icon {
  width: 30px;
  height: 30px;
  margin-top: 4px;
  color: #fde68a;
}

.skill-slot[data-skill="2"] .skill-icon {
  color: #7dd3fc;
}

.skill-slot[data-skill="3"] .skill-icon {
  color: #fdba74;
}

.skill-name {
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
  letter-spacing: 0.3px;
}

.skill-cost {
  display: flex;
  gap: 4px;
  margin-top: 3px;
}

.cost-dot {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #fff2a6, #f97316);
  box-shadow: 0 0 5px #f97316;
}

.skill-slot.locked .cost-dot {
  background: #64748b;
  box-shadow: none;
}

.skill-cd-overlay {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: rgba(6, 9, 13, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.skill-cd-overlay.on-cd {
  display: flex;
}

.skill-tooltip {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 230px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(9, 13, 18, 0.96);
  border: 1px solid var(--border-gold);
  color: #dbe4ec;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.65);
  z-index: 40;
}

.skill-tooltip strong {
  color: var(--gold-bright);
}

/* World-space Floating Damage & Enemy HP */
.enemy-hp-bar {
  position: absolute;
  transform: translate(-50%, -100%);
  width: 64px;
  pointer-events: none;
  will-change: left, top;
}

.enemy-hp-tag {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #e2e8f0;
  text-shadow: 0 1px 3px #000;
  margin-bottom: 2px;
  white-space: nowrap;
}

.enemy-hp-tag.stunned {
  color: #fde047;
}

.enemy-hp-track {
  height: 6px;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.enemy-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #f87171);
  transition: width 0.08s linear;
}

.float-text {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 18px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
  pointer-events: none;
  white-space: nowrap;
  animation: floatUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.float-text.normal { color: #f8fafc; font-size: 17px; }
.float-text.heavy { color: #fde047; font-size: 22px; }
.float-text.skill { color: #38bdf8; font-size: 23px; text-shadow: 0 0 10px rgba(56, 189, 248, 0.8), 0 2px 6px #000; }
.float-text.ult { color: #fb923c; font-size: 22px; text-shadow: 0 0 10px rgba(251, 146, 60, 0.85), 0 2px 6px #000; }
.float-text.player-hit { color: #fb7185; font-size: 19px; }
.float-text.heal { color: #4ade80; font-size: 17px; }
.float-text.parry { color: #fde68a; font-size: 21px; letter-spacing: 1px; text-shadow: 0 0 14px #f59e0b, 0 2px 6px #000; }
.float-text.pip { color: #ffcf5c; font-size: 20px; letter-spacing: 1px; text-shadow: 0 0 16px #f97316, 0 2px 6px #000; }
.float-text.stun { color: #fef08a; font-size: 16px; }

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.7); }
  18% { opacity: 1; transform: translate(-50%, -65%) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -185%) scale(0.92); }
}

/* Overlays */
.overlay-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(10, 18, 15, 0.55), rgba(4, 8, 7, 0.86));
  backdrop-filter: blur(5px);
  padding: 20px;
  transition: opacity 0.28s ease;
}

.overlay-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  padding: 24px 28px;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(16, 23, 22, 0.94), rgba(10, 14, 17, 0.96));
  border: 1px solid var(--border-gold);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
}

.overlay-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gold-bright);
  background: rgba(245, 195, 98, 0.14);
  border: 1px solid rgba(245, 195, 98, 0.4);
  margin-bottom: 10px;
}

.overlay-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #fffdf5, #f5c362);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.overlay-subtitle {
  font-size: 14px;
  color: #b5c3ce;
  margin-bottom: 20px;
}

.mechanic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
  text-align: left;
}

.mech-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.mech-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-bright);
  margin-bottom: 5px;
}

.mech-card p {
  font-size: 12px;
  line-height: 1.55;
  color: #cbd5e1;
}

.mech-card b {
  color: #fff;
}

.pip-mini {
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #fff3b0, #f97316);
  box-shadow: 0 0 8px #f97316;
  display: inline-block;
}

.key-pill {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(245, 195, 98, 0.18);
  border: 1px solid rgba(245, 195, 98, 0.45);
  color: #fde68a;
}

.controls-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 20px;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  margin-right: 4px;
}

.overlay-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.primary-btn, .secondary-btn {
  padding: 11px 26px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.primary-btn {
  border: none;
  color: #1a1204;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.42);
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.6);
}

.primary-btn:disabled, .secondary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.secondary-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.13);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.loading-status {
  margin-top: 12px;
  font-size: 12px;
  color: #86efac;
  min-height: 18px;
}

.loading-status.error {
  color: #fca5a5;
}

/* Result Card & Help Card */
.result-card {
  width: min(480px, 100%);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 22px;
}

.stat-box {
  padding: 12px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.stat-val {
  font-size: 22px;
  font-weight: 900;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}

.help-card {
  width: min(560px, 100%);
  text-align: left;
}

.help-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13px;
  line-height: 1.6;
  color: #d5dee6;
}

.help-list b {
  color: var(--gold-bright);
}

.help-list code {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

@keyframes pulseGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.35); }
}

@media (max-width: 860px) {
  .boss-bar-wrap { top: 122px; width: min(400px, calc(100vw - 32px)); }
}

@media (max-width: 780px) {
  .mechanic-grid { grid-template-columns: 1fr; }
  .rage-panel { width: 320px; }
  .skill-slot { width: 68px; height: 68px; }
  .mini-action { width: 44px; height: 52px; }
}
