/* Source: battle-effects-needs.css — split from consolidated CSS */

/* Bro Rogue - Battle: Needs Panel
   Split from battle-effects.css */

/* ================================
   HIT FLASH OVERLAY
   ================================ */
.hit-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    border-radius: inherit;
    animation: hitFlashAnim 0.35s ease-out forwards;
}

@keyframes hitFlashAnim {
    0% {
        background: rgb(255 255 255 / 65%);
        box-shadow: inset 0 0 60px rgb(255 255 255 / 50%);
    }

    30% {
        background: rgb(255 255 255 / 35%);
        box-shadow: inset 0 0 40px rgb(255 255 255 / 30%);
    }

    100% {
        background: transparent;
        box-shadow: none;
    }
}

/* Critical hit flash variant — more intense gold/white */
.hit-flash.critical-flash {
    animation: hitFlashCritical 0.45s ease-out forwards;
}

@keyframes hitFlashCritical {
    0% {
        background: rgb(255 215 0 / 70%);
        box-shadow: inset 0 0 80px rgb(255 215 0 / 60%);
    }

    25% {
        background: rgb(255 255 255 / 50%);
        box-shadow: inset 0 0 50px rgb(255 215 0 / 40%);
    }

    100% {
        background: transparent;
        box-shadow: none;
    }
}

/* ================================
   ELEMENTAL PARTICLES
   ================================ */

.elemental-particle {
    position: absolute;
    pointer-events: none;
    z-index: 60;
    border-radius: 50%;
}

/* --- Water: blue droplets arcing outward --- */
@keyframes particleWater {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx, -40px), var(--dy, -60px)) scale(0.3);
    }
}

.particle-water {
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #74b9ff, #3498db);
    border-radius: 50% 50% 50% 0;
    animation: particleWater 0.8s ease-out forwards;
}

/* --- Fire: orange/red bursts rising --- */
@keyframes particleFire {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translate(var(--dx, 0), var(--dy, -50px)) scale(1.4);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx, 0), var(--dy, -90px)) scale(0.4);
    }
}

.particle-fire {
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #ffeaa7, #e74c3c);
    box-shadow: 0 0 8px rgb(231 76 60 / 80%);
    animation: particleFire 0.7s ease-out forwards;
}

/* --- Ice: white/blue shards flying outward --- */
@keyframes particleIce {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx, -50px), var(--dy, -40px)) scale(0.2) rotate(180deg);
    }
}

.particle-ice {
    width: 6px;
    height: 14px;
    background: linear-gradient(to bottom, #dfe6e9, #74b9ff);
    border-radius: 2px;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation: particleIce 0.9s ease-out forwards;
}

/* --- Thunder: yellow zigzag lines --- */
@keyframes particleThunder {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    20% {
        opacity: 1;
        transform: translate(var(--dx, 20px), var(--dy, -20px)) scale(1.3) rotate(45deg);
    }

    40% {
        opacity: 0.6;
        transform: translate(var(--dx, -10px), var(--dy, -40px)) scale(1) rotate(90deg);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx, -30px), var(--dy, -70px)) scale(0.3) rotate(180deg);
    }
}

.particle-thunder {
    width: 4px;
    height: 16px;
    background: #f1c40f;
    box-shadow:
        0 0 10px #f1c40f,
        0 0 20px #f39c12;
    clip-path: polygon(40% 0%, 60% 0%, 50% 40%, 100% 40%, 30% 100%, 50% 50%, 0% 50%);
    animation: particleThunder 0.6s ease-out forwards;
}

/* --- Light: golden sparkles radiating outward --- */
@keyframes particleLight {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0);
    }

    30% {
        opacity: 1;
        transform: translate(var(--dx, -30px), var(--dy, -30px)) scale(1.5);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx, -60px), var(--dy, -60px)) scale(0.3);
    }
}

.particle-light {
    width: 6px;
    height: 6px;
    background: #fff59d;
    box-shadow:
        0 0 12px #fff59d,
        0 0 24px #ffd700;
    border-radius: 50%;
    animation: particleLight 0.8s ease-out forwards;
}

/* --- Dark: purple wisps floating up --- */
@keyframes particleDark {
    0% {
        opacity: 0.9;
        transform: translate(0, 0) scale(1);
    }

    50% {
        opacity: 0.5;
        transform: translate(var(--dx, -15px), var(--dy, -40px)) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx, -30px), var(--dy, -80px)) scale(0.2);
    }
}

.particle-dark {
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #6c5ce7, #2c3e50);
    filter: blur(2px);
    border-radius: 50%;
    animation: particleDark 1s ease-out forwards;
}

/* --- Gravity: deep purple imploding circles --- */
@keyframes particleGravity {
    0% {
        opacity: 0.8;
        transform: translate(0, 0) scale(0.5);
    }

    30% {
        opacity: 0.9;
        transform: translate(var(--dx, -20px), var(--dy, -20px)) scale(1.8);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx, -10px), var(--dy, -10px)) scale(0.2);
    }
}

.particle-gravity {
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, #9b59b6, #6c3483);
    border: 2px solid rgb(155 89 182 / 50%);
    border-radius: 50%;
    animation: particleGravity 0.9s ease-out forwards;
}

/* --- Void: dark circles expanding outward --- */
@keyframes particleVoid {
    0% {
        opacity: 0.7;
        transform: translate(0, 0) scale(0.3);
    }

    40% {
        opacity: 0.9;
        transform: translate(var(--dx, -40px), var(--dy, -30px)) scale(1.5);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx, -70px), var(--dy, -50px)) scale(0.1);
    }
}

.particle-void {
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #2d3436, #34495e);
    border: 1px solid rgb(100 100 120 / 40%);
    border-radius: 50%;
    animation: particleVoid 0.8s ease-out forwards;
}

/* --- Nature: green leaf-like shapes spinning outward --- */
@keyframes particleNature {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx, -35px), var(--dy, -45px)) scale(0.3) rotate(360deg);
    }
}

.particle-nature {
    width: 10px;
    height: 6px;
    background: radial-gradient(circle at 30% 50%, #2ecc71, #27ae60);
    border-radius: 50% 0;
    animation: particleNature 0.9s ease-out forwards;
}

/* --- Poison: green/purple bubbles floating up --- */
@keyframes particlePoison {
    0% {
        opacity: 0.8;
        transform: translate(0, 0) scale(0.8);
    }

    50% {
        opacity: 0.6;
        transform: translate(var(--dx, -10px), var(--dy, -30px)) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx, -20px), var(--dy, -60px)) scale(0.4);
    }
}

.particle-poison {
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #a29bfe, #8e44ad);
    border-radius: 50%;
    filter: blur(1px);
    animation: particlePoison 0.9s ease-out forwards;
}

/* --- Earth: brown rectangles falling --- */
@keyframes particleEarth {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx, -20px), var(--dy, 40px)) rotate(180deg);
    }
}

.particle-earth {
    width: 12px;
    height: 5px;
    background: linear-gradient(90deg, #7f8c8d, #5d6d7e);
    border-radius: 2px;
    animation: particleEarth 0.7s ease-out forwards;
}

/* --- Wind: cyan streaks moving horizontally --- */
@keyframes particleWind {
    0% {
        opacity: 0.7;
        transform: translate(0, 0) scaleX(0.3);
    }

    30% {
        opacity: 0.9;
        transform: translate(var(--dx, -20px), var(--dy, -10px)) scaleX(1.5);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx, -60px), var(--dy, -20px)) scaleX(0.5);
    }
}

.particle-wind {
    width: 18px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00bcd4, transparent);
    border-radius: 3px;
    animation: particleWind 0.6s ease-out forwards;
}

/* Default particle for non-elemental attacks */
@keyframes particleDefault {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx, -30px), var(--dy, -40px)) scale(0.2);
    }
}

.particle-default {
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
    animation: particleDefault 0.6s ease-out forwards;
}

/* ================================
   Needs Panel (Option A - Slide-in)
   ================================ */
.needsPanel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 300px;
    background: rgb(0 0 0 / 92%);
    border-left: 2px solid var(--primary-color);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    box-sizing: border-box;
    overflow-y: auto;
}

.needsPanel.active {
    transform: translateX(0);
}

.needsPanelHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgb(255 255 255 / 15%);
}

.needsPanelTitle {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.needsPanelBody {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.needsPanelChar {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.6rem;
    background: rgb(255 255 255 / 6%);
    border-radius: 6px;
    text-align: center;
}

.needsPanelName {
    font-size: 1rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.needsPanelMood {
    font-size: 0.9rem;
    color: var(--primary-color);
}

.needsPanelBars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.needRow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: rgb(255 255 255 / 4%);
    border-radius: 4px;
}

.needRowIcon {
    font-size: 0.9rem;
    width: 1.4rem;
    text-align: center;
    flex-shrink: 0;
}

.needRowLabel {
    font-size: 0.75rem;
    color: #ccc;
    min-width: 3.2rem;
    flex-shrink: 0;
    font-weight: bold;
}

.needRowBarContainer {
    flex: 1;
    height: 6px;
    background-color: rgb(255 255 255 / 10%);
    border-radius: 3px;
    overflow: hidden;
    min-width: 0;
}

.needRowValue {
    font-size: 0.75rem;
    color: #aaa;
    min-width: 2rem;
    text-align: right;
    font-weight: bold;
    flex-shrink: 0;
}

/* Critical need flash */
.needRow .needBar.low {
    box-shadow: 0 0 6px rgb(255 0 0 / 50%);
}

/* ═══════════════════════════════════════════════════════════
   BATTLE LOG — Compact scrollable combat log in right panel
   ═══════════════════════════════════════════════════════════ */

.battleLogContainer {
    width: 100%;
    flex: 1;
    min-height: 0;
    max-height: 280px;
    display: flex;
    flex-direction: column;
    background-color: rgb(0 0 0 / 50%);
    border-radius: 6px;
    border: 1px solid rgb(255 255 255 / 10%);
    border-left: 3px solid #888;
    overflow: hidden;
}

.battleLogHeader {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #888;
    font-weight: bold;
    padding: 0.25rem 0.5rem 0.15rem;
    border-bottom: 1px solid rgb(255 255 255 / 8%);
    flex-shrink: 0;
}

.battleLogEntries {
    flex: 1;
    overflow-y: auto;
    padding: 0.2rem 0.4rem;
    font-size: 0.6rem;
    line-height: 1.3;
    scrollbar-width: thin;
    scrollbar-color: rgb(255 255 255 / 15%) transparent;
}

.battleLogEntries::-webkit-scrollbar {
    width: 4px;
}

.battleLogEntries::-webkit-scrollbar-thumb {
    background: rgb(255 255 255 / 15%);
    border-radius: 2px;
}

.battleLogEntry {
    padding: 2px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 3px solid transparent;
    transition:
        opacity 0.3s ease,
        border-color 0.3s ease;
    margin-bottom: 1px;
}

/* Zebra striping */
.battleLogEntry:nth-child(even) {
    background: rgb(255 255 255 / 3%);
}

/* Left-border color coding per entry type */
.battle-log-damage {
    color: #ff6b6b;
    border-left-color: #ff6b6b;
}

.battle-log-enemy {
    color: #ff9f9f;
    border-left-color: #ff9f9f;
}

.battle-log-heal {
    color: #51cf66;
    border-left-color: #51cf66;
}

.battle-log-crit {
    color: #ffd700;
    font-weight: bold;
    border-left-color: #ffd700;
}

.battle-log-super {
    color: #cc66ff;
    font-weight: bold;
    border-left-color: #cc66ff;
}

.battle-log-miss {
    color: #888;
    font-style: italic;
    border-left-color: #888;
}

.battle-log-info {
    color: #ccc;
    border-left-color: #555;
}

.battle-log-levelup {
    background: linear-gradient(135deg, rgb(255 215 0 / 20%), rgb(255 237 78 / 10%));
    color: #ffd700;
    font-weight: bold;
    border-radius: 3px;
    padding: 2px 6px;
    margin: 2px 0;
    border-left-color: #ffd700;
}

.battle-log-fr {
    color: #ff66ff;
    font-weight: bold;
    border-left-color: #ff66ff;
}

/* Fade older entries via data-fade-level */
.battleLogEntry[data-fade='low'] {
    opacity: 0.45;
}

.battleLogEntry[data-fade='mid'] {
    opacity: 0.68;
}

.battleLogEntry[data-fade='none'] {
    opacity: 1;
}

/* Turn-header entries separating turns */
.battle-log-turn {
    text-align: center;
    color: #666;
    font-size: 0.5rem;
    letter-spacing: 1px;
    padding: 3px 0;
    border-bottom: 1px solid rgb(255 255 255 / 6%);
    margin: 3px 0;
    border-left-color: transparent !important;
    background: none !important;
}
