/* ============================================
   OVERLAY STYLES
   Twitch RPG Bot - Visual styling for overlay
   ============================================ */

/* ============================================
   SECTION 1: BASE STYLES
   ============================================ */

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: transparent;
    font-family: Arial, sans-serif;
}

#game-canvas {
    /* Now positioned inside world-wrapper, no need for width/height/position here */
    filter: contrast(1.06) saturate(1.05);
}

#debug {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.8);
    color: #0f0;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    max-width: 400px;
}

#channel-camp-visuals {
    position: absolute;
    right: 24px;
    bottom: 72px;
    width: 190px;
    height: 280px;
    pointer-events: none;
    z-index: 3;
}

.channel-banner-layer {
    position: absolute;
    object-fit: contain;
    pointer-events: none;
}

.channel-banner-pole {
    inset: 0;
    width: 190px;
    height: 280px;
}

.channel-banner-field {
    left: 42px;
    top: 31px;
    width: 106px;
    height: 205px;
}

.channel-banner-crest {
    left: 68px;
    top: 82px;
    width: 54px;
    height: 58px;
}

.channel-test-pet {
    position: absolute;
    bottom: 0;
    width: 48px;
    height: 48px;
    object-fit: contain;
    pointer-events: none;
    transform-origin: center bottom;
    z-index: 6;
}
/* Pending Bits / intervention receipts. These stay deliberately quiet so the
   actual combat effect remains the visual focus when it resolves. */
#external-action-queue {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 270px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
    z-index: 120;
}

.external-action-queue-entry {
    box-sizing: border-box;
    min-height: 25px;
    padding: 5px 8px;
    border-left: 2px solid rgba(255, 204, 70, 0.8);
    background: rgba(8, 7, 6, 0.8);
    color: #eadfc8;
    font: 700 11px/1.2 Arial, sans-serif;
    text-shadow: 1px 1px 0 #000;
    opacity: 1;
    transform: translateX(0);
    transition: transform 220ms ease, opacity 220ms ease;
}

.external-action-queue-entry.is-settling {
    opacity: 0;
    transform: translateX(-32px);
}

/* ============================================
   FISHING CHALLENGE PROTOTYPE
   ============================================ */

.fishing-mode {
    position: absolute;
    left: -1000px;
    bottom: 0;
    width: 800px;
    height: 500px;
    overflow: hidden;
    background: transparent;
}

.fishing-water {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 112px;
    height: 76px;
    background-image: url('/sprites_v2/fishing%20props/WaterV2.png');
    background-repeat: repeat-x;
    background-size: auto 100%;
    animation: fishing-water-drift 240s linear infinite;
}

@keyframes fishing-water-drift {
    from { background-position: 0 0; }
    to   { background-position: 2246px 0; }
}

/* Dock = DockV2 base (behind anglers, in world) + pillar-top overlay (in #fishing-layer, above anglers).
   Both containers carry the same state classes; overlay only exists during a fishing scene. */
.fishing-dock {
    position: absolute;
    width: 300px;
    height: 96px;
    background-image: url('/sprites_v2/fishing%20props/DockV2.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    transition: transform 1.2s ease-in-out, opacity 0.25s ease;
}

.fishing-dock-overlays {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 800px;
    height: 500px;
    overflow: hidden;
    pointer-events: none;
    z-index: 6;
}

.fishing-dock-overlays .fishing-dock {
    background-image: url('/sprites_v2/fishing%20props/DockV2_pillar_overlay.png');
}

.fishing-dock-left {
    left: -63px;
    bottom: 134px;
}

.fishing-dock-right {
    right: -63px;
    bottom: 134px;
    transform: scaleX(-1);
}

.fishing-docks-offscreen .fishing-dock-left {
    transform: translateX(-380px);
}

.fishing-docks-offscreen .fishing-dock-right {
    transform: translateX(380px) scaleX(-1);
}

.fishing-solo-active .fishing-dock-right {
    opacity: 0;
    transform: translateX(380px) scaleX(-1);
}

.fishing-title {
    display: none;
    position: absolute;
    top: 82px;
    left: 401px;
    transform: translateX(-50%);
    padding: 4px 18px;
    border: 1px solid rgba(255, 215, 0, 0.42);
    border-radius: 3px;
    background: rgba(12, 10, 8, 0.72);
    color: #ffd700;
    font: 700 13px/1.1 Georgia, serif;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    text-shadow: 1px 1px 0 #000;
}

.fishing-result-banner {
    display: none;
    position: absolute;
    left: 407px;
    top: 192px;
    transform: translateX(-50%);
    min-width: 220px;
    padding: 7px 14px;
    border: 1px solid rgba(255, 215, 0, 0.48);
    border-radius: 4px;
    background: rgba(9, 8, 7, 0.84);
    color: #e8dcc4;
    font: 700 13px/1.2 Arial, sans-serif;
    text-align: center;
    text-shadow: 1px 1px 0 #000;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.fishing-result-banner.visible {
    opacity: 1;
}

.fishing-fish-card {
    --fish-rarity: #f2eee5;
    --fish-reveal-scale: 1;
    --fish-art-scale: 1;
    --fish-layout-scale: 1;
    --fish-card-left: 50%;
    --fish-card-top: -102px;
    --fish-card-width: 176px;
    --fish-card-height: 174px;
    --fish-edge-size: 112px;
    --fish-edge-top: 5px;
    --fish-star-size: 106px;
    --fish-star-top: 8px;
    --fish-sprite-width: 104px;
    --fish-sprite-max-height: 88px;
    --fish-sprite-top: 6px;
    --fish-plate-top: 120px;
    --fish-plate-width: 152px;
    --fish-name-font-size: 10px;
    --fish-meta-font-size: 8px;
    --fish-plate-padding-x: 8px;
    --fish-plate-padding-top: 5px;
    --fish-plate-padding-bottom: 6px;
    --fish-motion-opacity: 0.34;
    --fish-foil-base-tone: none;
    position: absolute;
    left: var(--fish-card-left);
    top: var(--fish-card-top);
    width: var(--fish-card-width);
    height: var(--fish-card-height);
    min-height: var(--fish-card-height);
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    opacity: 0;
    text-align: center;
    transform: translateX(-50%) translateY(14px) scale(calc(var(--fish-reveal-scale) * var(--fish-layout-scale) * 0.92));
    transform-origin: 50% 80%;
    pointer-events: none;
}

.fishing-fish-card.left {
    --fish-card-left: calc(50% + 108px);
    --fish-card-top: -34px;
}

.fishing-fish-card.right {
    --fish-card-left: calc(50% - 108px);
    --fish-card-top: -34px;
}

.fishing-fish-card.above {
    --fish-card-left: 50%;
    --fish-card-top: -102px;
}

.fishing-fish-card.visible {
    animation: fishing-card-enter 760ms cubic-bezier(.2,.92,.24,1) forwards;
}

.fishing-card-art {
    position: absolute;
    left: 50%;
    top: 0;
    width: var(--fish-card-width);
    height: 112px;
    transform: translateX(-50%) scale(var(--fish-art-scale));
    transform-origin: 50% 52px;
    pointer-events: none;
}

.fishing-card-edge,
.fishing-card-star,
.fishing-influence-field {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.fishing-card-edge {
    top: var(--fish-edge-top);
    width: var(--fish-edge-size);
    height: var(--fish-edge-size);
    z-index: 1;
    background: #0a0806;
    clip-path: var(--fish-burst-clip, circle(50% at 50% 50%));
    animation: fishing-burst-spin var(--fish-burst-speed, 8s) linear infinite;
}

.fishing-card-star {
    top: var(--fish-star-top);
    width: var(--fish-star-size);
    height: var(--fish-star-size);
    z-index: 2;
    background: var(--fish-rarity);
    clip-path: var(--fish-burst-clip, circle(50% at 50% 50%));
    animation: fishing-burst-spin var(--fish-burst-speed, 8s) linear infinite;
}

.fishing-influence-field {
    top: -5px;
    width: 142px;
    height: 142px;
    z-index: 3;
    opacity: 0;
    background: transparent;
    border-radius: 50%;
    mix-blend-mode: screen;
}

.fishing-fish-sprite-wrap {
    position: absolute;
    left: 50%;
    top: var(--fish-sprite-top);
    width: var(--fish-card-width);
    height: 112px;
    transform: translateX(-50%);
    display: grid;
    place-items: center;
    animation: fishing-fish-pop 1100ms ease-out both;
    isolation: isolate;
    z-index: 4;
}

.fishing-fish-sprite-wrap img {
    width: var(--fish-sprite-width);
    height: var(--fish-sprite-max-height);
    max-width: none;
    max-height: none;
    image-rendering: auto;
    object-fit: contain;
    filter:
        var(--fish-foil-base-tone)
        drop-shadow(0 2px 2px rgba(0,0,0,0.45));
}

.fishing-fish-card.fish-foiled {
    /* Let the moving Hard Light layer supply the vivid color change. */
    --fish-foil-base-tone: grayscale(0.18) saturate(0.84);
}

.fishing-fish-motion {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--fish-sprite-width);
    height: var(--fish-sprite-max-height);
    transform: translate(-50%, -50%);
      z-index: 6;
    opacity: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 30%, rgba(255,255,255,0.95) 0 1px, transparent 2px),
        radial-gradient(circle at 70% 25%, rgba(255,255,255,0.75) 0 1px, transparent 2px),
        radial-gradient(circle at 44% 74%, rgba(255,255,255,0.85) 0 1px, transparent 2px);
    background-size: 52px 52px;
    mix-blend-mode: plus-lighter;
    -webkit-mask-image: var(--fish-icon-mask);
    mask-image: var(--fish-icon-mask);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    animation: fishing-foil-motion 6s linear infinite;
}

  .fishing-fish-card.fish-foiled .fishing-fish-motion {
      opacity: var(--fish-motion-opacity);
  }

  .fishing-fish-foil-scroll {
      position: absolute;
      left: 50%;
      top: 50%;
      width: var(--fish-sprite-width);
      height: var(--fish-sprite-max-height);
      transform: translate(-50%, -50%);
      z-index: 5;
      opacity: 0;
      pointer-events: none;
      background: var(--fish-foil-gradient);
      background-position: 0 50%;
      background-repeat: repeat-x;
      background-size: 200% 100%;
      mix-blend-mode: hard-light;
      -webkit-mask-image: var(--fish-icon-mask);
      mask-image: var(--fish-icon-mask);
      -webkit-mask-position: center;
      mask-position: center;
      -webkit-mask-repeat: no-repeat;
      mask-repeat: no-repeat;
      -webkit-mask-size: contain;
      mask-size: contain;
      animation: fishing-foil-scroll 5.5s linear infinite;
  }

  .fishing-fish-card.fish-foiled .fishing-fish-foil-scroll {
      opacity: 0.78;
  }

.fishing-fish-label-strip {
    position: absolute;
    left: 50%;
    top: var(--fish-plate-top);
    transform: translateX(-50%);
    width: var(--fish-plate-width);
    padding: var(--fish-plate-padding-top) var(--fish-plate-padding-x) var(--fish-plate-padding-bottom);
    border: 1px solid color-mix(in srgb, var(--fish-rarity) 75%, #17120d);
    background: rgba(9, 7, 6, 0.94);
    box-shadow: 0 6px 14px rgba(0,0,0,0.42);
    color: #e8dcc4;
    font: 700 var(--fish-meta-font-size)/1.15 Arial, sans-serif;
    text-align: center;
    text-shadow: 1px 1px 0 #000;
    overflow: hidden;
    isolation: isolate;
}

.fishing-fish-name {
    display: block;
    color: var(--fish-rarity);
    font-size: var(--fish-name-font-size);
    line-height: 1.1;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    max-height: 2.2em;
    overflow-wrap: normal;
    position: relative;
    z-index: 2;
}

.fishing-fish-meta {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 2px;
    font-size: var(--fish-meta-font-size);
    position: relative;
    z-index: 2;
}

.fishing-fish-score {
    color: #fff0b7;
    font-weight: 700;
}

.fishing-fish-card.winner {
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--fish-rarity) 54%, transparent));
}

.fishing-fx-layer {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 800px;
    height: 500px;
    overflow: hidden;
    pointer-events: none;
    z-index: 12;
}

.fishing-travel-fish {
    position: absolute;
    left: 0;
    top: 0;
    width: 94px;
    height: 56px;
    display: grid;
    place-items: center;
    opacity: 0;
    offset-path: path(var(--fish-path));
    offset-rotate: 0deg;
    transform: translate(-50%, -50%) scale(0.55) rotate(-18deg);
    filter:
        drop-shadow(0 5px 0 rgba(0,0,0,0.65))
        drop-shadow(0 0 8px color-mix(in srgb, var(--fish-rarity) 45%, transparent));
    animation: fishing-fish-reel-path 2400ms cubic-bezier(.12,.7,.16,1) forwards;
    z-index: 8;
}

.fishing-travel-fish img {
    width: 32px;
    height: 32px;
    image-rendering: auto;
    object-fit: contain;
}

@keyframes fishing-card-enter {
    0% { opacity: 0; transform: translateX(-50%) translateY(14px) scale(calc(var(--fish-reveal-scale) * var(--fish-layout-scale) * 0.92)); }
    70% { opacity: 1; transform: translateX(-50%) translateY(-3px) scale(calc(var(--fish-reveal-scale) * var(--fish-layout-scale) * 1.03)); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(calc(var(--fish-reveal-scale) * var(--fish-layout-scale))); }
}

@keyframes fishing-burst-spin {
    from { transform: translateX(-50%) rotate(0deg); }
    to { transform: translateX(-50%) rotate(360deg); }
}

@keyframes fishing-foil-motion {
    from { background-position: 0 0; }
    to { background-position: 52px 34px; }
}

@keyframes fishing-foil-scroll {
    from { background-position: 0 50%; }
    to { background-position: 200% 50%; }
}

@keyframes fishing-fish-pop {
    0% { opacity: 0; transform: translateX(-50%) translateY(18px) scale(0.5) rotate(-8deg); }
    58% { opacity: 1; transform: translateX(-50%) translateY(-5px) scale(1.16) rotate(3deg); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1) rotate(0deg); }
}

@keyframes fishing-fish-reel-path {
    0% {
        opacity: 0;
        offset-distance: 0%;
        transform: translate(-50%, -50%) scale(0.42) rotate(-22deg);
    }
    16% {
        opacity: 1;
        offset-distance: 13%;
        transform: translate(-50%, -50%) scale(0.74) rotate(12deg);
    }
    58% {
        opacity: 1;
        offset-distance: 70%;
        transform: translate(-50%, -50%) scale(1.06) rotate(-6deg);
    }
    84% {
        opacity: 1;
        offset-distance: 84%;
        transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 0;
        offset-distance: 100%;
        transform: translate(-50%, -50%) scale(1.2) rotate(0deg);
    }
}

/* ============================================
   SECTION 2: PARTY & CHARACTER STYLES
   ============================================ */

.party {
    position: absolute;
    bottom: 150px;  /* Match camp character height (camp-area 50px + camp-characters 100px) */
    display: flex;
    gap: 0px;
    align-items: flex-end;
    padding-left: 40px;  /* Compensate for negative margins */
}

/* Consistent negative margin on ALL characters */
.character {
    margin-left: -40px;
}

/* Party animation states */
.party.entering {
    left: -200px;
    animation: party-walk-in 2s ease-out forwards;
}

.party.ready {
    left: 120px;  /* 15% of 800px adventure zone */
    transition: left 0.5s ease-out;
}

.party.in-combat {
    left: 160px;  /* 20% of 800px adventure zone */
    transition: left 0.5s ease-out;
}

@keyframes party-walk-in {
    from { left: -200px; }
    to { left: 120px; }  /* Match ready position */
}

/* Character container */
.character {
    position: relative;  /* ADDED - needed for absolute positioned children */
    width: auto;
    height: 128px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.combat-state-debug {
    position: absolute;
    left: 50%;
    top: 162px;
    transform: translateX(-50%);
    z-index: 40;
    pointer-events: none;
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid rgba(255, 215, 0, 0.5);
    background: rgba(12, 10, 8, 0.82);
    color: #ffd700;
    font: 700 9px/1.1 Arial, sans-serif;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 1px 1px 1px #000;
}

.combat-state-debug.fallback {
    border-color: rgba(255, 164, 64, 0.65);
    color: #ffa440;
}

.combat-state-debug.missing {
    border-color: rgba(255, 90, 90, 0.72);
    color: #ff6b6b;
}

/* ============================================
   SECTION 3: MONSTER STYLES
   ============================================ */

.monster {
    position: absolute;
    width: auto;
    height: 128px;
    bottom: 150px;  /* Match camp and party height */
    background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 32px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* ============================================
   SECTION 5: UI ELEMENTS (labels, health bars)
   ============================================ */

.username-label {
    position: absolute;
    top: var(--entity-name-top, 27px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: rgba(0,0,0,0.7);
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 10px;
    color: #fff;
    z-index: 10;
}

/* Fishing hosts sit on raised docks, so the generic combat label offset lands
   on the sprite. Keep the channel name just above the fishing character. */
#fishing-layer .username-label {
    --entity-name-top: -6px;
}

/* Camp labels — positioned by JS sync, not relative to a character div */
.camp-name-label {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
    background: rgba(0,0,0,0.7);
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 10px;
    color: #fff;
    z-index: 20;
    pointer-events: none;
}

.health-bar-container {
    position: absolute;
    top: var(--entity-health-top, -10px);
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 4px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: visible; /* HP text and the shield tail sit above the bar. */
    z-index: 10;
}

.hp-text {
    position: absolute;
    top: -14px;
    left: 0;
    font-size: 10px;
    color: white;
    text-shadow: 1px 1px 2px black;
    font-weight: bold;
    white-space: nowrap;
    z-index: 11;
}

.health-bar {
    position: absolute;
    inset: 0 auto 0 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #4ade80, #22c55e);
    transition: width 0.3s ease;
    z-index: 1;
}

.health-bar.low {
    background: linear-gradient(to bottom, #facc15, #eab308);
}

.health-bar.critical {
    background: linear-gradient(to bottom, #f87171, #ef4444);
}

.rage-bar-container {
    position: absolute;
    top: var(--entity-resource-top, -2px);
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 2px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(255, 156, 56, 0.35);
    border-radius: 2px;
    overflow: visible;
    z-index: 10;
}

.magic-shield-overlay {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
    z-index: 2;
}

.magic-shield-overlay .shield-bar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, #e8fbff 0%, #75d9ff 16%, #2c8ee5 58%, #164baf 100%);
    box-shadow: inset 0 0 4px rgba(202, 247, 255, 0.9), 0 0 5px rgba(86, 201, 255, 0.85);
    transition: width 0.25s ease;
}

.magic-shield-overlay .shield-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 8px;
    height: 12px;
    transform: translate(-18%, -50%);
    background: #effdff;
    clip-path: polygon(0 50%, 55% 0, 100% 20%, 100% 80%, 55% 100%);
    box-shadow: 0 0 5px rgba(220, 250, 255, 0.95);
}

.magic-shield-overlay:not(.active) .shield-bar {
    display: none;
}

.magic-shield-overlay.active .shield-bar {
    box-shadow: 0 0 8px rgba(84, 200, 255, 0.75);
}

.magic-shield-overlay.pulse {
    animation: shield-bar-pulse 0.7s ease-out;
}

@keyframes shield-bar-pulse {
    0% { filter: brightness(1); }
    35% { filter: brightness(1.75); }
    100% { filter: brightness(1); }
}

.rage-bar {
    width: 0%;
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(to right, #9f2d13, #f47c1f, #ffd166);
    box-shadow: 0 0 5px rgba(244, 124, 31, 0.35);
    transition: width 0.25s ease;
}

.rage-text {
    display: none;
}

.rage-bar-container.ready .rage-bar {
    box-shadow: 0 0 8px rgba(255, 209, 102, 0.75);
}

.rage-bar-container.pulse {
    animation: rage-bar-pulse 0.7s ease-out;
}

@keyframes rage-bar-pulse {
    0% { filter: brightness(1); transform: translateX(-50%) scaleX(1); }
    35% { filter: brightness(1.8); transform: translateX(-50%) scaleX(1.08); }
    100% { filter: brightness(1); transform: translateX(-50%) scaleX(1); }
}

/* Shared combat presentation lanes. New combat text is positioned by the
   presenter instead of each event handler choosing an unrelated offset. */
.combat-text-presentation,
.combat-text-lane {
    position: absolute;
    inset: 0;
    overflow: visible;
    pointer-events: none;
}

.combat-text-lane {
    z-index: 26;
}

.combat-text-item {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-height: 14px;
    color: var(--combat-text-color, #ff4444);
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    text-shadow: var(--combat-text-shadow, 1px 1px 3px rgba(0, 0, 0, 0.95));
    --combat-text-origin: translateX(0);
    opacity: 0;
    transition: top 120ms ease-out;
    animation: combat-text-rise var(--combat-text-duration-ms, 1800ms) ease-out forwards;
    font-size: var(--combat-text-font-size, 14px);
}

.combat-text-icon-slot {
    display: inline-flex;
    width: 12px;
    height: 12px;
    align-items: center;
    justify-content: center;
    flex: 0 0 12px;
}

.combat-text-icon {
    width: 12px;
    height: 12px;
    object-fit: contain;
    image-rendering: auto;
}

.combat-text-lane-damage .combat-text-item {
    top: calc(var(--entity-health-top, -30px) - 18px - var(--combat-text-stack-px, 0px));
    left: calc(50% - 8px);
    /* Keep the item center, rather than its inner edge, mirrored against
       recovery text. Icons and positive signs no longer make one lane drift. */
    --combat-text-origin: translateX(calc(-50% - 24px));
}

.combat-text-lane-recovery .combat-text-item {
    top: calc(var(--entity-health-top, -30px) - 18px - var(--combat-text-stack-px, 0px));
    left: calc(50% - 8px);
    --combat-text-origin: translateX(calc(-50% + 24px));
    color: var(--combat-text-color, #4f8);
}

.combat-text-lane-status .combat-text-item {
    top: calc(var(--entity-health-top, -30px) - 36px - var(--combat-text-stack-px, 0px));
    left: 50%;
    --combat-text-origin: translateX(-50%);
    color: var(--combat-text-color, #d7e7ff);
}

.combat-text-lane-entity .combat-text-item {
    bottom: calc(4px + var(--combat-text-stack-px, 0px));
    left: 50%;
    --combat-text-origin: translateX(-50%);
    padding: 2px 4px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(8, 8, 12, 0.72);
    color: var(--combat-text-color, #ffd36a);
}

.combat-text-damage-periodic {
    color: var(--combat-text-color, #ff9040);
    font-size: 14px;
}

.combat-text-shield-resource {
    color: var(--combat-text-color, #92e6ff);
    font-size: 14px;
}

.combat-text-critical {
    font-size: 1.5em;
    color: var(--combat-text-color, #ff5a5a);
    text-shadow: 0 0 10px #ff0000, 1px 1px 0 #000;
}

.combat-text-rage-triggered {
    color: var(--combat-text-color, #ff5050);
    border-color: rgba(235, 70, 50, 0.72);
    text-shadow: 0 0 7px #cc1010, 1px 1px 0 #000;
}

@keyframes combat-text-rise {
    0% {
        opacity: 0;
        transform: var(--combat-text-origin) translateY(0) scale(0.88);
    }
    10%, 70% {
        opacity: 1;
        transform: var(--combat-text-origin) translateY(calc(var(--combat-text-rise-px, 32px) * -0.35)) scale(1);
    }
    100% {
        opacity: 0;
        transform: var(--combat-text-origin) translateY(calc(var(--combat-text-rise-px, 32px) * -1)) scale(0.96);
    }
}

/* ============================================
   SECTION 6: CELEBRATION EFFECTS
   ============================================ */

.character.level-up-glow {
    animation: levelUpGlow 2s ease-out;
}

@keyframes levelUpGlow {
    0% { filter: drop-shadow(0 0 0px rgba(255, 215, 0, 0)); }
    30% { filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8)); }
    100% { filter: drop-shadow(0 0 0px rgba(255, 215, 0, 0)); }
}

.celebration-text {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    pointer-events: none;
    z-index: 100;
    animation: celebrationFloat 2.5s ease-out forwards;
    white-space: nowrap;
}

.celebration-text.level-up {
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9), 0 0 6px rgba(255, 215, 0, 0.8);
}

@keyframes celebrationFloat {
    0% { opacity: 0; transform: translateX(-50%) translateY(0) scale(0.5); }
    20% { opacity: 1; transform: translateX(-50%) translateY(-6px) scale(1.2); }
    80% { opacity: 1; transform: translateX(-50%) translateY(-18px) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-24px) scale(0.8); }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99;
}

.particle.level-up {
    background: radial-gradient(circle, #ffd700 0%, #ffed4e 50%, transparent 100%);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}

@keyframes particleBurst {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: var(--particle-trajectory) scale(0.3); }
}

.particle.loot-win {
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, gold, orange);
    border-radius: 50%;
    position: absolute;
}

/* ============================================
   SECTION 7: DEATH ANIMATIONS
   ============================================ */

.character.dying,
.monster.dying,
.dying {
    animation: fade-out 1.5s ease-out forwards;
}

.enemy-death-dissolve .username-label,
.enemy-death-dissolve .health-bar-container,
.enemy-death-dissolve .status-pip-row,
.enemy-death-dissolve .entity-ui-layer {
    animation: enemy-death-ui-fade 0.32s ease-out forwards;
}

.enemy-death-mark {
    position: absolute;
    width: 28px;
    height: 28px;
    transform: translate(-50%, 50%);
    background-image: url('/sprites_v2/effects/death_mark/death_mark.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    filter: drop-shadow(0 1px 0 #000)
        drop-shadow(0 0 5px rgba(0, 0, 0, 0.95))
        drop-shadow(0 0 8px rgba(230, 205, 160, 0.35));
    pointer-events: none;
    z-index: 90;
    animation: enemy-death-mark-pop 1.2s ease-out forwards;
}

.player-corpse {
    animation: none;
    opacity: 1;
    visibility: visible;
}

.player-corpse .username-label,
.player-corpse .health-bar-container {
    opacity: 0.72;
}

@keyframes fade-out {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes enemy-death-ui-fade {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes enemy-death-mark-pop {
    0% {
        opacity: 0;
        transform: translate(-50%, 50%) scale(0.2) rotate(-8deg);
        filter: brightness(1.6);
    }
    12% {
        opacity: 1;
        transform: translate(-50%, 50%) scale(1.18) rotate(4deg);
        filter: brightness(1.15);
    }
    58% {
        opacity: 1;
        transform: translate(-50%, 45%) scale(1) rotate(0deg);
        filter: brightness(0.95);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, 34%) scale(0.78) rotate(0deg);
        filter: brightness(0.55);
    }
}

/* ============================================
   SECTION 8: CAMP ANIMATIONS
   ============================================ */

@keyframes flicker {
    from { 
        opacity: 0.8; 
        transform: translateX(-50%) scale(1); 
        filter: brightness(0.9);
    }
    to { 
        opacity: 1; 
        transform: translateX(-50%) scale(1.05); 
        filter: brightness(1.1);
    }
}

/* Loot icon floating animation */
@keyframes loot-float {
    0%, 100% { transform: translate(-50%, -50%) translateY(0px); }
    50% { transform: translate(-50%, -50%) translateY(-8px); }
}

}

/* --- Sprite flashes for retaliation/control events --- */

@keyframes sprite-flash-retaliation {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 8px #ffb020) brightness(1.3); }
}
@keyframes sprite-flash-counter {
    0% { filter: none; }
    30% { filter: drop-shadow(0 0 10px #77ddff) brightness(1.5); }
    100% { filter: none; }
}
@keyframes sprite-flash-marked-consumed {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 10px #ff3030); }
}
@keyframes sprite-flash-stun {
    0%, 100% { filter: none; }
    50% { filter: saturate(0) brightness(1.2); }
}
@keyframes sprite-flash-pacify {
    0%, 100% { filter: none; }
    50% { filter: hue-rotate(60deg) saturate(0.5); }
}
@keyframes sprite-flash-retaliate-source {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 6px #ff7a00); }
}
@keyframes sprite-flash-active-cue {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 8px #ffd36a) brightness(1.25); }
}
@keyframes sprite-flash-shield-regen {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 9px #338cff) brightness(1.2); }
}
@keyframes sprite-flash-bulwark {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 10px #8eb0ff) brightness(1.25); }
}
@keyframes sprite-flash-taunt {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 8px #ff9a00) brightness(1.25); }
}
@keyframes sprite-flash-rage {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 10px #ff3030) brightness(1.3); }
}
@keyframes sprite-flash-overkill {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 10px #ff5a00) brightness(1.35); }
}

.sprite-flash-retaliation { animation: sprite-flash-retaliation 0.4s ease-out; }
.sprite-flash-counter { animation: sprite-flash-counter 0.5s ease-out; }
.sprite-flash-marked-consumed { animation: sprite-flash-marked-consumed 0.4s ease-out; }
.sprite-flash-stun { animation: sprite-flash-stun 0.6s ease-in-out; }
.sprite-flash-pacify { animation: sprite-flash-pacify 0.6s ease-in-out; }
.sprite-flash-retaliate-source { animation: sprite-flash-retaliate-source 0.3s ease-out; }
.sprite-flash-active-cue { animation: sprite-flash-active-cue 0.4s ease-out; }
.sprite-flash-shield-regen { animation: sprite-flash-shield-regen 0.45s ease-out; }
.sprite-flash-bulwark { animation: sprite-flash-bulwark 0.5s ease-out; }
.sprite-flash-taunt { animation: sprite-flash-taunt 0.5s ease-out; }
.sprite-flash-rage { animation: sprite-flash-rage 0.6s ease-out; }
.sprite-flash-overkill { animation: sprite-flash-overkill 0.45s ease-out; }

.boss-hunt-weakness-mark {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 78px;
    height: 78px;
    border: 2px solid rgba(255, 36, 36, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 14px rgba(255, 0, 0, 0.72), inset 0 0 18px rgba(255, 0, 0, 0.16);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 190;
    animation: boss-hunt-weakness-mark 1150ms ease-out forwards;
}

.boss-hunt-weakness-mark::before,
.boss-hunt-weakness-mark::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    background: rgba(255, 55, 55, 0.95);
    transform: translate(-50%, -50%);
}

.boss-hunt-weakness-mark::before {
    width: 92px;
    height: 2px;
}

.boss-hunt-weakness-mark::after {
    width: 2px;
    height: 92px;
}

@keyframes boss-hunt-weakness-mark {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.62) rotate(-12deg);
    }
    24% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.18) rotate(8deg);
    }
}

/* ========== STATUS PIPS ========== */

.status-pip-tray {
    position: absolute;
    top: var(--entity-status-top, 12px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    pointer-events: none;
    z-index: 18;
}

.entity-state-rail {
    position: relative;
    display: flex;
    flex-direction: row;
    gap: 0;
    align-items: center;
    justify-content: center;
    min-height: 18px;
}

.status-pip-tray:has(.player-reactions, .enemy-reactions) {
    width: 70px;
}

.entity-state-rail.player-reactions {
    justify-content: flex-start;
}

.entity-state-rail.enemy-reactions {
    justify-content: flex-end;
}

.entity-state-rail.enemy-reactions .reaction-pip-tray { flex-shrink: 0; }

.entity-state-rail.player-reactions .reaction-pip-tray { order: 0; flex-shrink: 0; }
.entity-state-rail.player-reactions .state-rail-divider { order: 1; }
.entity-state-rail.player-reactions .status-pip-row { order: 2; }
.entity-state-rail.enemy-reactions .status-pip-row { order: 0; }
.entity-state-rail.enemy-reactions .state-rail-divider { order: 1; }
.entity-state-rail.enemy-reactions .reaction-pip-tray { order: 2; }

.state-rail-divider {
    width: 2px;
    height: 16px;
    margin: 0 3px;
    flex: 0 0 auto;
    background: #c8912e;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    box-shadow: 0 0 4px rgba(255, 184, 50, 0.55);
}

.entity-state-rail.player-reactions .state-rail-divider {
    background: #75d9ff;
    box-shadow: 0 0 4px rgba(117, 217, 255, 0.65);
}

.reaction-pip-tray {
    display: flex;
    min-width: 0;
    gap: 2px;
    align-items: center;
    justify-content: center;
}

.reaction-pip {
    width: 8px;
    height: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 176, 32, 0.8);
    border-radius: 50%;
    box-sizing: border-box;
}

.reaction-pip-tray.enemy .reaction-pip.ready {
    background: #ffb020;
    box-shadow: 0 0 6px rgba(255, 145, 0, 0.82), inset 0 0 0 1px rgba(255, 239, 184, 0.65);
}

.reaction-pip-tray.enemy .reaction-pip.spent {
    background: rgba(54, 38, 19, 0.78);
    border-color: rgba(255, 176, 32, 0.3);
}

.reaction-pip-tray.player .reaction-pip { border-color: rgba(117, 217, 255, 0.9); }
.reaction-pip-tray.player .reaction-pip.ready {
    background: #75d9ff;
    box-shadow: 0 0 6px rgba(86, 201, 255, 0.86), inset 0 0 0 1px rgba(232, 251, 255, 0.75);
}

.reaction-pip-tray.player .reaction-pip.spent {
    background: rgba(18, 47, 71, 0.8);
    border-color: rgba(117, 217, 255, 0.32);
}

.status-pip-row {
    position: relative;
    display: flex;
    flex-direction: row;
    gap: 3px;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    width: max-content;
}

.status-pip {
    position: relative;
    width: 18px;
    height: 18px;
    border: 1.5px solid #888;
    border-radius: 3px;
    background: rgba(22, 22, 28, 0.85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.status-pip.has-icon {
    background: transparent;
    border: 0;
    box-shadow: none;
    text-shadow: none;
}

.status-pip.has-icon .status-icon-img {
    filter: none;
}

.pip-glyph {
    line-height: 1;
}

.status-icon-img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    image-rendering: auto;
    pointer-events: none;
}

.pip-stacks {
    position: absolute;
    top: -5px;
    left: -5px;
    font-size: 9px;
    color: #fff;
    background: #222;
    border: 1px solid #666;
    border-radius: 2px;
    padding: 0 2px;
    line-height: 1;
}

.pip-rounds {
    position: absolute;
    bottom: -5px;
    right: -5px;
    font-size: 9px;
    color: #ffdd66;
    background: #222;
    border: 1px solid #666;
    border-radius: 50%;
    width: 11px;
    height: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.status-pip.has-icon .pip-stacks,
.status-pip.has-icon .pip-rounds {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #fff;
    text-shadow: 1px 1px 1px #000, 0 0 3px #000;
}

/* Category-based default pip coloring (overridden inline by status.color) */
.status-pip.pip-dot { border-color: #6fe66f; }
.status-pip.pip-control { border-color: #ffe866; }
.status-pip.pip-modifier { border-color: #88ccff; }
.status-pip.pip-consumable { border-color: #ff6060; }
.status-pip.pip-protection { border-color: #88ff88; }
.status-pip.pip-generic { border-color: #aaaaaa; }

.status-pip.pip-overflow {
    border-color: #666;
    font-size: 10px;
    color: #ccc;
}

.enemy-barrier-host .summoned-barrier-placeholder {
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: 58px;
    height: 86px;
    transform: translateX(-50%);
    border: 3px solid rgba(219, 224, 231, 0.88);
    border-radius: 6px 6px 3px 3px;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.18) 0 3px, transparent 3px 12px),
        linear-gradient(180deg, #6d7482 0%, #444a55 48%, #2f343d 100%);
    box-shadow:
        inset 0 0 0 2px rgba(20, 22, 28, 0.55),
        0 0 0 1px rgba(0, 0, 0, 0.35),
        0 10px 16px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 3;
}

.enemy-barrier-host .summoned-barrier-placeholder::before,
.enemy-barrier-host .summoned-barrier-placeholder::after {
    content: '';
    position: absolute;
    left: 7px;
    right: 7px;
    height: 4px;
    background: rgba(235, 238, 242, 0.8);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.enemy-barrier-host .summoned-barrier-placeholder::before {
    top: 23px;
}

.enemy-barrier-host .summoned-barrier-placeholder::after {
    top: 55px;
}

.enemy-barrier-host .summoned-barricade-sprite {
    position: absolute;
    left: 50%;
    bottom: -2px;
    width: 96px;
    height: 131px;
    transform: translateX(-50%);
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.42));
    pointer-events: none;
    z-index: 3;
}

.enemy-cage-host .summoned-cage-sprite {
    position: absolute;
    left: 50%;
    /* Cage art includes transparent space below its feet. */
    bottom: -7px;
    width: 68px;
    height: 101px;
    transform: translateX(-50%);
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.42));
    pointer-events: none;
    z-index: 3;
}

.capture-smoke-puff {
    position: absolute;
    left: 50%;
    bottom: 24px;
    width: 48px;
    height: 30px;
    transform: translateX(-50%) scale(0.55);
    opacity: 0;
    background:
        radial-gradient(ellipse at 24% 68%, rgba(210, 198, 180, 0.75) 0 17%, transparent 19%),
        radial-gradient(ellipse at 52% 42%, rgba(178, 164, 146, 0.80) 0 22%, transparent 24%),
        radial-gradient(ellipse at 79% 66%, rgba(142, 130, 116, 0.72) 0 18%, transparent 20%);
    filter: blur(1px);
    animation: capture-smoke-puff 400ms ease-out forwards;
    pointer-events: none;
    z-index: 16;
}

@keyframes capture-smoke-puff {
    0% { opacity: 0; transform: translateX(-50%) translateY(4px) scale(0.5); }
    18% { opacity: 0.9; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-22px) scale(1.35); }
}

.enemy-cage-host.cage-state-pulse .summoned-cage-sprite {
    animation: cage-state-pulse 460ms ease-out;
}

/* Generic combat fallbacks used when an ability has no authored sprite effect. */
.combat-fx {
    position: absolute;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.combat-turn-marker-layer {
    position: absolute;
    inset: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 13;
}

.combat-turn-marker {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 82px;
    height: auto;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: left 320ms cubic-bezier(0.22, 0.8, 0.25, 1), bottom 320ms cubic-bezier(0.22, 0.8, 0.25, 1), opacity 120ms ease;
}

.combat-turn-marker.is-wide {
    width: 111px;
}

.combat-turn-marker.is-visible {
    opacity: 0.94;
    visibility: visible;
}

.combat-fx-impact-ring {
    width: 84px;
    height: 84px;
    border: 3px solid rgba(244, 185, 66, 0.86);
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(244, 185, 66, 0.55), inset 0 0 16px rgba(244, 185, 66, 0.18);
    animation: combat-fx-impact-ring 560ms ease-out forwards;
}

.combat-fx-toxic-cloud {
    width: 94px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 55%, rgba(102, 255, 106, 0.34), transparent 48%),
        radial-gradient(circle at 62% 38%, rgba(174, 255, 78, 0.24), transparent 50%),
        radial-gradient(circle at 48% 50%, rgba(45, 116, 43, 0.38), transparent 72%);
    filter: blur(0.5px) drop-shadow(0 0 10px rgba(114, 255, 100, 0.45));
    animation: combat-fx-toxic-cloud 950ms ease-out forwards;
}

.combat-fx-shadow-pulse {
    width: 100px;
    height: 100px;
    border: 1px solid rgba(112, 200, 255, 0.35);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(71, 215, 255, 0.22), rgba(44, 22, 72, 0.28) 45%, transparent 70%);
    animation: combat-fx-shadow-pulse 900ms ease-out forwards;
}

.combat-fx-sacrifice-burst {
    width: 82px;
    height: 92px;
    border-radius: 45%;
    background: radial-gradient(ellipse at center, rgba(196, 45, 255, 0.38), rgba(178, 22, 52, 0.22) 48%, transparent 76%);
    box-shadow: 0 0 18px rgba(196, 45, 255, 0.45);
    animation: combat-fx-sacrifice-burst 780ms ease-out forwards;
}

.combat-fx-warcry-glow {
    width: 72px;
    height: 88px;
    border-radius: 45% 45% 50% 50%;
    background: radial-gradient(ellipse at center, rgba(255, 68, 58, 0.30), rgba(255, 40, 30, 0.12) 45%, transparent 72%);
    animation: combat-fx-warcry-glow 850ms ease-out forwards;
}

.combat-fx-summon-portal {
    width: 74px;
    height: 34px;
    border: 2px solid rgba(128, 255, 147, 0.8);
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(113, 255, 128, 0.55), rgba(76, 174, 88, 0.20) 45%, transparent 72%);
    box-shadow: 0 0 18px rgba(82, 255, 98, 0.6);
    animation: combat-fx-summon-portal 900ms ease-out forwards;
}

.combat-fx-summon-column {
    width: 70px;
    height: 110px;
    background: linear-gradient(to top, transparent, rgba(93, 255, 126, 0.34), rgba(255, 255, 200, 0.08), transparent);
    filter: blur(1px);
    animation: combat-fx-summon-column 820ms ease-out forwards;
}

.combat-fx-cleave-slash {
    width: 96px;
    height: 24px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255, 245, 230, 0.95), rgba(190, 14, 14, 0.95), transparent);
    box-shadow: 0 0 12px rgba(255, 40, 40, 0.65);
    animation: combat-fx-cleave-slash 420ms ease-out forwards;
}

.combat-fx-blood-splash {
    width: 62px;
    height: 52px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 28% 35%, rgba(255, 35, 35, 0.95) 0 8%, transparent 10%),
        radial-gradient(circle at 55% 30%, rgba(172, 0, 0, 0.9) 0 12%, transparent 14%),
        radial-gradient(circle at 65% 62%, rgba(255, 64, 64, 0.8) 0 7%, transparent 9%),
        radial-gradient(circle at 38% 70%, rgba(120, 0, 0, 0.7) 0 9%, transparent 11%);
    filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.7));
    animation: combat-fx-blood-splash 620ms ease-out forwards;
}

/* Bone Shaman ritual (ability_visuals.json css on orc_boss_2_ritual / orc_boss_2_hex): step = glow + motes (+ sigil on candle 1); cast = ground
   shockwave + burst on him + hex mark over each hero. */
.combat-fx-ritual-glow {
    width: 104px;
    height: 128px;
    border-radius: 45% 45% 50% 50%;
    background: radial-gradient(ellipse at center, rgba(197, 139, 255, 0.42), rgba(120, 40, 200, 0.16) 48%, transparent 72%);
    animation: combat-fx-warcry-glow 900ms ease-out forwards;
}

.combat-fx-ritual-motes {
    width: 84px;
    height: 140px;
    background:
        radial-gradient(circle at 30% 80%, rgba(230, 200, 255, 0.9) 0 2px, transparent 3px),
        radial-gradient(circle at 62% 64%, rgba(197, 139, 255, 0.9) 0 2px, transparent 3px),
        radial-gradient(circle at 45% 44%, rgba(230, 200, 255, 0.8) 0 1.5px, transparent 3px),
        radial-gradient(circle at 72% 30%, rgba(197, 139, 255, 0.8) 0 2px, transparent 3px),
        linear-gradient(to top, transparent, rgba(160, 90, 255, 0.22), transparent);
    animation: combat-fx-ritual-motes 1000ms ease-out forwards;
}

.combat-fx-ritual-sigil {
    width: 150px;
    height: 34px;
    border: 2px solid rgba(197, 139, 255, 0.85);
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(178, 91, 255, 0.40), rgba(90, 30, 150, 0.15) 50%, transparent 72%);
    box-shadow: 0 0 20px rgba(178, 91, 255, 0.65);
    animation: combat-fx-summon-portal 1000ms ease-out forwards;
}

.combat-fx-ritual-cast {
    width: 160px;
    height: 40px;
    border: 3px solid rgba(220, 180, 255, 0.95);
    border-radius: 50%;
    box-shadow: 0 0 26px rgba(178, 91, 255, 0.9), inset 0 0 18px rgba(178, 91, 255, 0.5);
    animation: combat-fx-ritual-cast 1100ms ease-out forwards;
}

.combat-fx-ritual-burst {
    width: 130px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255, 240, 255, 0.85), rgba(178, 91, 255, 0.55) 30%, rgba(90, 20, 160, 0.2) 55%, transparent 72%);
    animation: combat-fx-ritual-burst 900ms ease-out forwards;
}

.combat-fx-hex-mark {
    width: 64px;
    height: 64px;
    border: 2px solid rgba(197, 139, 255, 0.95);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(197, 139, 255, 0.45), rgba(90, 20, 160, 0.25) 50%, transparent 70%);
    box-shadow: 0 0 16px rgba(178, 91, 255, 0.85);
    animation: combat-fx-summon-portal 900ms ease-out forwards;
}

@keyframes combat-fx-ritual-motes {
    0% { opacity: 0; transform: translate(-50%, -30%) scaleY(0.6); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -75%) scaleY(1.1); }
}

@keyframes combat-fx-ritual-cast {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(4.2); }
}

@keyframes combat-fx-ritual-burst {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
    25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, -55%) scale(1.5); }
}

@keyframes combat-fx-impact-ring {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.35); }
    35% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.35); }
}

@keyframes combat-fx-toxic-cloud {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -62%) scale(1.2); }
}

@keyframes combat-fx-shadow-pulse {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}

@keyframes combat-fx-sacrifice-burst {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.55) rotate(-8deg); }
    35% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -70%) scale(1.2) rotate(18deg); }
}

@keyframes combat-fx-warcry-glow {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    35% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.12); }
}

@keyframes combat-fx-summon-portal {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.25) rotate(0deg); }
    35% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.65) rotate(160deg); }
}

@keyframes combat-fx-summon-column {
    0% { opacity: 0; transform: translate(-50%, -50%) scaleY(0.2); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scaleY(1.1); }
}

@keyframes combat-fx-cleave-slash {
    0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--combat-fx-angle, -18deg)) scaleX(0.2); }
    35% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--combat-fx-angle, -18deg)) scaleX(1.35) translateX(36px); }
}

@keyframes combat-fx-blood-splash {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.35) rotate(-8deg); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2) rotate(18deg); }
}

@keyframes cage-state-pulse {
    0% {
        opacity: 0.45;
        transform: translateX(-50%) scale(0.88);
        filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.42)) brightness(1.65);
    }
    55% {
        opacity: 1;
        transform: translateX(-50%) scale(1.05);
        filter: drop-shadow(0 10px 17px rgba(0, 0, 0, 0.5)) brightness(1.22);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
        filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.42));
    }
}

/* ============================================
   SECTION 11: COMBAT ENTITY STATES
   (moved from combat_processor.js COMBAT_STYLES)
   ============================================ */

.reviving {
    animation: revive-glow 1s ease-out;
}

.sturdy-proc {
    animation: sturdy-flash 0.5s ease-out;
}

.buffed {
    filter: brightness(1.2);
}

@keyframes revive-glow {
    0% { filter: brightness(2) saturate(0); }
    50% { filter: brightness(1.5) saturate(1.5); }
    100% { filter: brightness(1) saturate(1); }
}

@keyframes sturdy-flash {
    0%, 100% { filter: brightness(1); }
    25%, 75% { filter: brightness(2) sepia(1); }
}

/* Channel deed plaque (deed_plaque.js): bottom edge sits just above the party HP bars. */
.deed-plaque {
    position: fixed;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 420px;
    padding: 10px 16px 10px 10px;
    border: 2px solid #c9a14a;
    border-radius: 6px;
    background: linear-gradient(180deg, #3a2c18 0%, #241a0e 100%);
    box-shadow: 0 0 0 1px #000, 0 6px 18px rgba(0, 0, 0, 0.7), inset 0 0 12px rgba(255, 210, 120, 0.12);
    color: #f3e3bf;
    font-family: Arial, sans-serif;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, calc(-100% + 24px)) scale(0.96);
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.deed-plaque.in { opacity: 1; transform: translate(-50%, -100%) scale(1); }
.deed-plaque.out { opacity: 0; transform: translate(-50%, calc(-100% - 12px)) scale(0.98); transition-duration: 0.4s; }
.deed-plaque-art {
    flex: 0 0 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(201, 161, 74, 0.6);
    border-radius: 4px;
    background: radial-gradient(circle, rgba(255, 214, 128, 0.25), rgba(0, 0, 0, 0.35));
}
.deed-plaque-icon { max-width: 52px; max-height: 52px; image-rendering: auto; }
.deed-plaque-glyph { font-size: 30px; color: #ffd36a; text-shadow: 0 0 8px rgba(255, 190, 80, 0.8); }
.deed-plaque-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.deed-plaque-label { font-size: 10px; font-weight: bold; letter-spacing: 2px; color: #c9a14a; }
.deed-plaque-name { font-size: 19px; font-weight: bold; color: #ffe7a8; text-shadow: 0 2px 2px #000; }
.deed-plaque-desc { font-size: 12px; color: #d8c7a2; line-height: 1.25; }
.deed-plaque.deed-infamy { border-color: #a8321f; background: linear-gradient(180deg, #3b1510 0%, #1f0906 100%); }
.deed-plaque.deed-infamy .deed-plaque-label { color: #e0583e; }
.deed-plaque.deed-infamy .deed-plaque-name { color: #ffb199; }
.deed-plaque.deed-infamy .deed-plaque-glyph { color: #ff7a5c; text-shadow: 0 0 8px rgba(255, 80, 40, 0.8); }
.deed-plaque.deed-secret { border-color: #8a6bd1; background: linear-gradient(180deg, #221a38 0%, #120d20 100%); }
.deed-plaque.deed-secret .deed-plaque-label { color: #b59cf0; }
.deed-plaque.deed-secret .deed-plaque-name { color: #e2d6ff; transition: transform 0.35s ease; }
.deed-plaque.deed-secret.revealed .deed-plaque-name { animation: deedReveal 0.5s ease; }
@keyframes deedReveal { 0% { transform: rotateX(90deg); } 100% { transform: rotateX(0deg); } }

/* Fish specimen stars on the catch plate (2026-10-08); Perfect = purple */
.fishing-fish-stars { display: inline-flex; gap: 1px; line-height: 1; }
.fishing-fish-stars i { font-style: normal; display: inline-block; color: #ffe08a; }
.fishing-fish-stars i.off { color: rgba(255, 255, 255, 0.22); }
.fishing-fish-stars.perfect i.on { color: #e6b8ff; text-shadow: 0 0 4px #b04dff, 1px 1px 0 #000; }

@keyframes campfire-burn {
    0% { background-position: 0px 0px; }
    2.5% { background-position: -32px 0px; }
    5% { background-position: -64px 0px; }
    7.5% { background-position: -96px 0px; }
    10% { background-position: -128px 0px; }
    12.5% { background-position: 0px -32px; }
    15% { background-position: -32px -32px; }
    17.5% { background-position: -64px -32px; }
    20% { background-position: -96px -32px; }
    22.5% { background-position: -128px -32px; }
    25% { background-position: 0px -64px; }
    27.5% { background-position: -32px -64px; }
    30% { background-position: -64px -64px; }
    32.5% { background-position: -96px -64px; }
    35% { background-position: -128px -64px; }
    37.5% { background-position: 0px -96px; }
    40% { background-position: -32px -96px; }
    42.5% { background-position: -64px -96px; }
    45% { background-position: -96px -96px; }
    47.5% { background-position: -128px -96px; }
    50% { background-position: 0px -128px; }
    52.5% { background-position: -32px -128px; }
    55% { background-position: -64px -128px; }
    57.5% { background-position: -96px -128px; }
    60% { background-position: -128px -128px; }
    62.5% { background-position: 0px -160px; }
    65% { background-position: -32px -160px; }
    67.5% { background-position: -64px -160px; }
    70% { background-position: -96px -160px; }
    72.5% { background-position: -128px -160px; }
    75% { background-position: 0px -192px; }
    77.5% { background-position: -32px -192px; }
    80% { background-position: -64px -192px; }
    82.5% { background-position: -96px -192px; }
    85% { background-position: -128px -192px; }
    87.5% { background-position: 0px -224px; }
    90% { background-position: -32px -224px; }
    92.5% { background-position: -64px -224px; }
    95% { background-position: -96px -224px; }
    97.5% { background-position: -128px -224px; }
    100% { background-position: 0px 0px; }
}
