/**
 * Dark Realms - Combat Styles
 * Style specyficzne dla ekranu walki
 */

/* =============================================
   MAIN LAYOUT
============================================= */
html, body { 
    height: 100%; 
    overflow: hidden; 
}

.battle-container {
    display: grid;
    grid-template-rows: auto auto 1fr auto auto;
    height: 100vh;
    background: 
        radial-gradient(ellipse 120% 60% at 50% 100%, rgba(139, 30, 30, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(30, 60, 120, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, var(--void) 0%, var(--obsidian) 50%, #08080c 100%);
    position: relative;
}

/* Custom background image */
.battle-container[data-bg] {
    background: var(--void);
}

.battle-container[data-bg]::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: var(--battle-bg);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    filter: brightness(0.65) saturate(0.9);
}

.battle-container::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
}

/* Ensure sections are above background */
.turn-order-bar, 
.turn-announcement, 
.battlefield, 
.action-bar, 
.combat-log-container { 
    position: relative; 
    z-index: 2; 
}

/* =============================================
   TURN ORDER BAR
============================================= */
.turn-order-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 32px;
    background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    position: relative;
    z-index: 10;
}

.turn-order {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 24px;
    background: linear-gradient(180deg, rgba(20,20,28,0.9) 0%, rgba(12,12,18,0.9) 100%);
    border: 1px solid rgba(201,162,39,0.12);
    border-radius: 100px;
}

.turn-token {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--slate);
    border: 2px solid rgba(255,255,255,0.15);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.turn-token img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    object-position: 50% 20%; 
}

.turn-token.active { 
    transform: scale(1.25); 
    border-color: var(--gold); 
    box-shadow: 0 0 20px rgba(201,162,39,0.6); 
    z-index: 10;
}

.turn-token.enemy.active { 
    border-color: var(--blood-bright); 
    box-shadow: 0 0 15px rgba(139,30,30,0.4); 
}

.turn-divider { 
    width: 10px; 
    height: 2px; 
    background: rgba(255,255,255,0.1); 
}

/* Turn counter - hidden in turn-order-bar, shown under VS */
.turn-order-bar .turn-counter { 
    display: none; /* Hide from turn order bar */
}

/* =============================================
   TURN ANNOUNCEMENT
============================================= */
.turn-announcement { 
    text-align: center; 
    padding: 10px; 
    z-index: 5; 
}

.turn-announcement h1 {
    font-family: 'Cinzel', serif; 
    font-size: 2rem; 
    color: var(--gold);
    text-shadow: 0 0 30px rgba(201,162,39,0.3); 
    margin: 0;
}

.turn-announcement h1.enemy-turn { 
    color: var(--blood-bright); 
    text-shadow: 0 0 30px rgba(139,30,30,0.3); 
}

.action-callout {
    display: inline-block; 
    padding: 4px 16px; 
    margin-top: 4px;
    background: rgba(30,50,80,0.4); 
    border-radius: 20px;
    font-family: 'Cinzel', serif; 
    color: #a0c0e0;
    opacity: 0; 
    transform: translateY(-5px); 
    transition: all 0.3s ease;
}

.action-callout.visible { 
    opacity: 1; 
    transform: translateY(0); 
}

/* =============================================
   BATTLEFIELD
============================================= */
.battlefield {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 40px;
    max-width: 1800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    perspective: 1000px;
    box-sizing: border-box;
}

/* VS Divider */
.vs-divider {
    position: absolute;
    top: 50%;
    left: calc(50% - 25px);
    transform: translate(-50%, -50%);
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-style: italic;
    font-size: 5.5rem;
    background: linear-gradient(180deg, #ffd700 0%, #c9a227 40%, #8b6c16 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)) drop-shadow(0 0 20px rgba(201,162,39,0.2));
    z-index: 10;
    pointer-events: none;
    user-select: none;
    letter-spacing: 6px;
    animation: vsPulse 4s ease-in-out infinite;
    opacity: 0.85;
}

@keyframes vsPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.85; }
    50% { transform: translate(-50%, -50%) scale(1.03); opacity: 0.95; }
}

/* Turn counter - hidden from battlefield, shown in action bar */
.battlefield .turn-counter {
    display: none;
}

/* Players Team (Left) */
.team.players {
    flex: 0 0 50%;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-end;
    padding-right: 140px;
    box-sizing: border-box;
}

.team.players .team-label { display: none; }

.team.players .char-card {
    width: 220px;
    height: 380px;
    flex-shrink: 0; 
}

/* Enemies Team (Right - Grid) */
.team.enemies {
    flex: 0 0 50%;
    display: grid;
    grid-template-columns: repeat(4, 175px);
    grid-auto-rows: 180px;
    gap: 20px;
    justify-content: start;
    padding-left: 140px;
    box-sizing: border-box;
}

/* =============================================
   CHARACTER CARD
============================================= */
.char-card {
    position: relative;
    border-radius: 12px;
    background: #15151a;
    border: 2px solid #2a2a38;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* Size Classes */
.char-card.size-small { grid-column: span 1; grid-row: span 1; }
.char-card.size-tall  { grid-column: span 1; grid-row: span 2; }
.char-card.size-wide  { grid-column: span 2; grid-row: span 1; }
.char-card.size-boss  { grid-column: span 2; grid-row: span 2; }

/* Card Background Art */
.card-bg-art {
    position: absolute; 
    inset: 0; 
    width: 100%; 
    height: 100%;
    object-fit: cover; 
    object-position: center 15%;
    transition: transform 0.5s ease; 
    z-index: 0;
}

.char-card:hover .card-bg-art { transform: scale(1.08); }
.char-card:hover { 
    border-color: rgba(201,162,39,0.5); 
    transform: translateY(-5px); 
    z-index: 10; 
}
.char-card.active { 
    border-color: var(--gold); 
    box-shadow: 0 0 20px rgba(201,162,39,0.3); 
    z-index: 5; 
}
.char-card.dead { 
    filter: grayscale(1) brightness(0.4); 
    pointer-events: none; 
    border-color: #333; 
}

/* Card Overlay */
.card-overlay {
    position: absolute; 
    inset: 0; 
    z-index: 1;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 60%, rgba(5,5,8,0.75) 85%, rgba(0,0,0,0.95) 100%);
    display: flex; 
    flex-direction: column; 
    justify-content: flex-end; 
    padding: 8px;
}

/* Small Card Adjustments */
.char-card.size-small .card-overlay {
    padding: 8px;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.5) 65%, rgba(0,0,0,0.95) 100%);
}

/* Target Effects */
.char-card.targetable { animation: pulseTarget 1.5s infinite; }
.char-card.targetable .card-overlay { background: rgba(139,30,30,0.25); }
.char-card.targetable.ally .card-overlay { background: rgba(46,125,50,0.25); }

@keyframes pulseTarget { 
    50% { border-color: var(--blood-bright); box-shadow: 0 0 25px rgba(139,30,30,0.5); } 
}

/* Card Info */
.card-info { 
    position: relative; 
    z-index: 2; 
    display: flex; 
    flex-direction: column; 
    gap: 2px; 
}

.char-name {
    font-family: 'Cinzel', serif; 
    font-size: 0.9rem; 
    font-weight: 700;
    color: #fff; 
    text-align: center; 
    line-height: 1; 
    text-shadow: 0 2px 4px #000;
    margin-bottom: 3px;
}

.stats-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.level-badge {
    width: 24px;
    height: 24px;
    background: linear-gradient(145deg, rgba(201,162,39,0.95) 0%, rgba(139,108,22,1) 100%);
    border: 1px solid rgba(255,215,0,0.7);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1a1a1a;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
    box-shadow: 
        0 2px 6px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.char-class {
    display: none;
}

/* =============================================
   BADGES (Position & Element)
============================================= */
.position-badge {
    position: absolute; 
    top: 8px; 
    left: 8px; 
    width: 22px; 
    height: 22px;
    background: rgba(0,0,0,0.7); 
    border: 1px solid rgba(255,255,255,0.2); 
    border-radius: 4px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-family: 'Cinzel', serif; 
    font-size: 0.75rem; 
    color: var(--gold); 
    z-index: 5;
    transition: all 0.2s ease;
}

/* Highlight number badge when card is targetable */
.char-card.targetable .position-badge {
    background: rgba(139,30,30,0.9);
    border-color: #ff6b6b;
    color: #fff;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255,107,107,0.5);
    animation: targetPulse 1s ease-in-out infinite;
}

.char-card.targetable.ally .position-badge {
    background: rgba(46,125,50,0.9);
    border-color: #4caf50;
    box-shadow: 0 0 10px rgba(76,175,80,0.5);
}

@keyframes targetPulse {
    0%, 100% { transform: scale(1.2); }
    50% { transform: scale(1.3); }
}

.element-badge-float {
    position: absolute; 
    top: 8px; 
    right: 8px;
    padding: 3px 8px; 
    border-radius: 6px;
    background: rgba(20,20,25,0.8); 
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(4px); 
    font-size: 0.65rem; 
    font-weight: 700;
    text-transform: uppercase; 
    display: flex; 
    align-items: center; 
    gap: 4px;
    color: #ddd; 
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.char-card.size-small .element-badge-float {
    top: 5px; 
    right: 5px;
    font-size: 0.55rem; 
    padding: 2px 6px;
}

/* =============================================
   RESOURCE BARS (HP/MP)
============================================= */
.resource-bars { 
    display: flex; 
    flex-direction: column; 
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.resource-row { 
    display: flex; 
    align-items: center; 
}

.resource-track {
    flex: 1; 
    height: 8px; 
    background: rgba(0,0,0,0.7);
    border-radius: 4px; 
    overflow: hidden; 
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.resource-fill {
    height: 100%; 
    transition: width 0.4s ease;
}

.resource-fill.hp { 
    background: linear-gradient(180deg, #e53935 0%, #c62828 50%, #a11515 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}

.resource-fill.mp { 
    background: linear-gradient(180deg, #42a5f5 0%, #1e88e5 50%, #1565c0 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}

.resource-value { 
    font-size: 0.65rem; 
    color: #aaa; 
    min-width: 45px; 
    text-align: right;
    font-family: 'Cinzel', serif;
}

/* Alias for backwards compatibility */
.resource-bar {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* =============================================
   STATUS EFFECTS SYSTEM
============================================= */
.status-container {
    position: absolute;
    bottom: 75px;
    left: 6px;
    z-index: 15;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px 6px;
    background: linear-gradient(135deg, rgba(30,30,40,0.95), rgba(20,20,25,0.98));
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.status-badge:hover {
    border-color: rgba(201,162,39,0.5);
    transform: scale(1.05);
}

.status-badge .status-icons {
    display: flex;
    gap: 1px;
}

.status-badge .status-mini-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border-radius: 4px;
    position: relative;
}

.status-badge .status-count {
    font-size: 0.65rem;
    color: #888;
    margin-left: 2px;
    font-weight: bold;
}

/* Status Panel (Expanded) */
.status-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: linear-gradient(145deg, rgba(25,25,35,0.98), rgba(15,15,20,0.99));
    border: 1px solid rgba(201,162,39,0.3);
    border-radius: 10px;
    padding: 8px;
    min-width: 180px;
    max-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.2s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 20px rgba(201,162,39,0.1);
    z-index: 100;
}

.status-container:hover .status-panel,
.status-panel.pinned {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.status-panel-header {
    font-size: 0.65rem;
    color: var(--gold-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-family: 'Cinzel', serif;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    margin: 3px 0;
    border-radius: 6px;
    background: rgba(0,0,0,0.3);
    transition: background 0.15s;
}

.status-item:hover {
    background: rgba(255,255,255,0.05);
}

.status-item-icon {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.status-item-icon.dot { background: linear-gradient(135deg, #8b1e1e, #c62828); }
.status-item-icon.hot { background: linear-gradient(135deg, #1b5e20, #4caf50); }
.status-item-icon.cc { background: linear-gradient(135deg, #4a148c, #7b1fa2); }
.status-item-icon.buff { background: linear-gradient(135deg, #1565c0, #42a5f5); }
.status-item-icon.debuff { background: linear-gradient(135deg, #4e342e, #795548); }

.status-item-info {
    flex: 1;
    min-width: 0;
}

.status-item-name {
    font-size: 0.75rem;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-item-meta {
    font-size: 0.6rem;
    color: #888;
    display: flex;
    gap: 8px;
}

.status-item-duration {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(0,0,0,0.4);
    border-radius: 50%;
    font-size: 0.65rem;
    color: var(--gold);
    font-weight: bold;
    flex-shrink: 0;
}

/* Status mini icon colors */
.status-mini-icon.dot { background: linear-gradient(135deg, #8b1e1e, #c62828); }
.status-mini-icon.hot { background: linear-gradient(135deg, #1b5e20, #4caf50); }
.status-mini-icon.cc { background: linear-gradient(135deg, #4a148c, #7b1fa2); }
.status-mini-icon.buff { background: linear-gradient(135deg, #1565c0, #42a5f5); }
.status-mini-icon.debuff { background: linear-gradient(135deg, #4e342e, #795548); }

/* Small card status adjustments */
.char-card.size-small .status-container {
    bottom: 55px;
    left: 4px;
}

.char-card.size-small .status-badge {
    padding: 2px 4px;
}

.char-card.size-small .status-badge .status-mini-icon {
    width: 14px;
    height: 14px;
    font-size: 0.6rem;
}

@keyframes statusAppear {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.status-item.new {
    animation: statusAppear 0.3s ease-out;
}

/* =============================================
   SKILL ANIMATIONS - Simple Flash Effects
============================================= */

/* Base flash animation */
@keyframes skillFlash {
    0% { opacity: 0; }
    30% { opacity: 0.8; }
    100% { opacity: 0; }
}

.skill-effect {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    border-radius: 8px;
    animation: skillFlash 0.4s ease-out;
}

/* Physical - white/gold flash */
.skill-effect.physical {
    background: radial-gradient(circle, rgba(255,255,255,0.6) 0%, rgba(255,215,0,0.3) 50%, transparent 70%);
    box-shadow: inset 0 0 20px rgba(255,255,255,0.5);
}

/* Fire - orange/red flash */
.skill-effect.fire {
    background: radial-gradient(circle, rgba(255,150,50,0.7) 0%, rgba(255,50,0,0.4) 50%, transparent 70%);
    box-shadow: inset 0 0 30px rgba(255,100,0,0.6);
}

/* Ice - blue/white flash */
.skill-effect.ice {
    background: radial-gradient(circle, rgba(200,240,255,0.7) 0%, rgba(100,180,255,0.4) 50%, transparent 70%);
    box-shadow: inset 0 0 30px rgba(150,220,255,0.6);
}

/* Lightning - yellow/white flash */
.skill-effect.lightning {
    background: radial-gradient(circle, rgba(255,255,200,0.8) 0%, rgba(255,255,100,0.5) 50%, transparent 70%);
    box-shadow: inset 0 0 40px rgba(255,255,150,0.7);
}

/* Nature - green flash */
.skill-effect.nature {
    background: radial-gradient(circle, rgba(150,255,100,0.6) 0%, rgba(50,200,50,0.3) 50%, transparent 70%);
    box-shadow: inset 0 0 25px rgba(100,255,50,0.5);
}

/* Poison - purple flash */
.skill-effect.poison {
    background: radial-gradient(circle, rgba(200,100,255,0.6) 0%, rgba(150,50,200,0.3) 50%, transparent 70%);
    box-shadow: inset 0 0 25px rgba(180,50,255,0.5);
}

/* Holy - golden/white flash */
.skill-effect.holy {
    background: radial-gradient(circle, rgba(255,255,220,0.8) 0%, rgba(255,215,0,0.4) 50%, transparent 70%);
    box-shadow: inset 0 0 35px rgba(255,255,200,0.7);
}

/* Dark - purple/black flash */
.skill-effect.dark {
    background: radial-gradient(circle, rgba(150,50,200,0.6) 0%, rgba(80,0,120,0.3) 50%, transparent 70%);
    box-shadow: inset 0 0 30px rgba(100,0,150,0.5);
}

/* Heal - green glow */
.skill-effect.heal {
    background: radial-gradient(circle, rgba(100,255,150,0.6) 0%, rgba(50,220,100,0.3) 50%, transparent 70%);
    box-shadow: inset 0 0 30px rgba(100,255,150,0.5);
}

/* Buff - gold glow */
.skill-effect.buff {
    background: radial-gradient(circle, rgba(255,220,100,0.5) 0%, rgba(255,180,50,0.3) 50%, transparent 70%);
    box-shadow: inset 0 0 25px rgba(255,200,50,0.4);
}

/* Debuff - red glow */
.skill-effect.debuff {
    background: radial-gradient(circle, rgba(255,80,80,0.5) 0%, rgba(200,30,30,0.3) 50%, transparent 70%);
    box-shadow: inset 0 0 25px rgba(255,50,50,0.4);
}

/* Arcane - blue/purple flash */
.skill-effect.arcane {
    background: radial-gradient(circle, rgba(150,100,255,0.6) 0%, rgba(100,50,200,0.3) 50%, transparent 70%);
    box-shadow: inset 0 0 30px rgba(130,80,255,0.5);
}


/* =============================================
   ENEMY ZOOM POPUP
============================================= */
.enemy-zoom-popup {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    background: linear-gradient(145deg, #12121a 0%, #0a0a0f 100%);
    border: 2px solid var(--gold-dim);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 15px 60px rgba(0,0,0,0.9), 0 0 40px rgba(201,162,39,0.15);
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    width: 320px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
}

.enemy-zoom-popup.visible { 
    opacity: 1; 
    transform: scale(1) translateY(0); 
}

.enemy-zoom-popup .zoom-portrait {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    border-radius: 10px 10px 0 0;
    background: #0a0a0f;
}

.enemy-zoom-popup .zoom-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 10px 10px 0 0;
}

.enemy-zoom-popup .zoom-portrait::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 50px;
    background: linear-gradient(to top, #0a0a0f, transparent);
    pointer-events: none;
}

.enemy-zoom-popup .zoom-header {
    padding: 12px 16px;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(201,162,39,0.2);
}

.enemy-zoom-popup .zoom-name { 
    color: var(--gold); 
    font-size: 1.3rem; 
    font-family: 'Cinzel', serif;
    margin: 0;
}

.enemy-zoom-popup .zoom-meta { 
    color: var(--smoke); 
    font-size: 0.85rem; 
    margin-top: 4px;
}

.enemy-zoom-popup .zoom-body { 
    padding: 12px 16px; 
}

.enemy-zoom-popup .zoom-section {
    margin-bottom: 12px;
}

.enemy-zoom-popup .zoom-section:last-child { 
    margin-bottom: 0; 
}

.enemy-zoom-popup .zoom-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.enemy-zoom-popup .zoom-resistances,
.enemy-zoom-popup .zoom-drops,
.enemy-zoom-popup .zoom-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.enemy-zoom-popup .resist-tag,
.enemy-zoom-popup .drop-tag,
.enemy-zoom-popup .skill-tag {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
}

.enemy-zoom-popup .resist-tag.resistant { color: #4fc3f7; border-color: rgba(79,195,247,0.3); }
.enemy-zoom-popup .resist-tag.vulnerable { color: #ef5350; border-color: rgba(239,83,80,0.3); }
.enemy-zoom-popup .resist-tag.immune { color: #ab47bc; border-color: rgba(171,71,188,0.3); }

.enemy-zoom-popup .drop-tag { color: #aaa; }
.enemy-zoom-popup .drop-tag.rare { color: #64b5f6; }
.enemy-zoom-popup .drop-tag.epic { color: #ba68c8; }

.enemy-zoom-popup .skill-tag {
    background: rgba(201,162,39,0.1);
    border: 1px solid rgba(201,162,39,0.3);
    color: var(--gold);
}

/* =============================================
   ACTION BAR
============================================= */
.action-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 100%);
    border-top: 1px solid rgba(255,255,255,0.03);
}

/* Turn counter in action bar - inline with buttons */
.action-bar .turn-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin-right: 40px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(201,162,39,0.3);
    border-radius: 20px;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: rgba(201,162,39,0.8);
    letter-spacing: 0.1em;
}

.action-bar .turn-badge .turn-label {
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.action-bar .turn-badge .turn-number {
    color: var(--gold);
    font-weight: 700;
    font-size: 1rem;
}

.action-btn {
    padding: 14px 28px;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 2px solid;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-btn.attack {
    background: linear-gradient(180deg, var(--blood) 0%, #5a1212 100%);
    border-color: var(--blood-bright);
    color: #ffcccc;
}

.action-btn.attack:hover:not(:disabled) {
    background: linear-gradient(180deg, var(--blood-bright) 0%, var(--blood) 100%);
    box-shadow: 0 0 20px rgba(198,40,40,0.4);
    transform: translateY(-2px);
}

.action-btn.skill {
    background: linear-gradient(180deg, var(--mana-blue) 0%, #0d47a1 100%);
    border-color: var(--mana-bright);
    color: #bbdefb;
}

.action-btn.skill:hover:not(:disabled) {
    background: linear-gradient(180deg, var(--mana-bright) 0%, var(--mana-blue) 100%);
    box-shadow: 0 0 20px rgba(66,165,245,0.4);
    transform: translateY(-2px);
}

.action-btn.defend {
    background: linear-gradient(180deg, var(--gold-dim) 0%, #4a3708 100%);
    border-color: var(--gold);
    color: var(--gold-bright);
}

.action-btn.defend:hover:not(:disabled) {
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dim) 100%);
    box-shadow: 0 0 20px rgba(201,162,39,0.4);
    transform: translateY(-2px);
}

.action-btn.flee {
    background: linear-gradient(180deg, #424242 0%, #212121 100%);
    border-color: #616161;
    color: #bdbdbd;
}

.action-btn.flee:hover:not(:disabled) {
    background: linear-gradient(180deg, #616161 0%, #424242 100%);
    transform: translateY(-2px);
}

/* =============================================
   COMBAT LOG
============================================= */
.combat-log-container {
    height: 160px; /* Fixed height for 5 lines (~32px each) */
    min-height: 160px;
    max-height: 160px;
    background: rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.combat-log-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 1rem;
    height: 100%;
    overflow-y: auto;
}

.combat-log {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 100%; /* Ensure log fills container even when empty */
}

.log-entry {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 4px;
    background: rgba(255,255,255,0.03);
    border-left: 3px solid transparent;
}

.log-entry.damage { 
    border-left-color: var(--blood-bright); 
    color: #ffcccc; 
}

.log-entry.heal { 
    border-left-color: var(--health-bright); 
    color: #c8e6c9; 
}

.log-entry.system { 
    border-left-color: var(--gold); 
    color: var(--gold-bright); 
}

.log-entry.crit { 
    border-left-color: #ff9800; 
    color: #ffe0b2; 
    font-weight: bold; 
}

.log-entry.death { 
    border-left-color: #9c27b0; 
    color: #e1bee7; 
}

/* =============================================
   SKILL MODAL
============================================= */
.skill-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.skill-modal.visible {
    opacity: 1;
    visibility: visible;
}

.skill-panel {
    background: linear-gradient(145deg, #14141c 0%, #0a0a0f 100%);
    border: 2px solid rgba(201,162,39,0.3);
    border-radius: 16px;
    padding: 24px;
    min-width: 400px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.skill-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.skill-panel-title {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--gold);
}

.skill-panel-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.skill-panel-close:hover {
    color: #fff;
}

.skill-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.skill-item:hover:not(.disabled) {
    background: rgba(201,162,39,0.1);
    border-color: rgba(201,162,39,0.3);
}

.skill-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.skill-item.on-cooldown {
    opacity: 0.5;
}

.skill-icon-box {
    width: 48px;
    height: 48px;
    background: rgba(0,0,0,0.4);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.skill-info {
    flex: 1;
}

.skill-name {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 4px;
}

.skill-desc {
    font-size: 0.8rem;
    color: #888;
}

.skill-cost {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--mana-bright);
}

.skill-cooldown {
    font-size: 0.75rem;
    color: #f97316;
}

/* =============================================
   TARGET INDICATOR
============================================= */
.target-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(139,30,30,0.9);
    padding: 12px 24px;
    border-radius: 30px;
    font-family: 'Cinzel', serif;
    color: #fff;
    z-index: 60;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.target-indicator.visible {
    display: flex;
}

/* =============================================
   DEFEAT MESSAGE
============================================= */
.defeat-message {
    padding: 15px 25px;
    text-align: center;
}

.defeat-message p {
    color: #888;
    margin: 5px 0;
}

.defeat-message .penalty {
    color: var(--blood-bright);
    font-size: 0.9rem;
}

/* =============================================
   ZONE INFO BANNER (from World Map)
============================================= */
.zone-info-banner {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 24px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: 20px;
    z-index: 5;
    backdrop-filter: blur(4px);
}

.zone-info-banner .zone-region {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.zone-info-banner .zone-name {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--gold);
    font-weight: 600;
}

