/* Duris Cards - Game Styles (board, hand, turn, combat, animations) */
/* Game Board - Grid with combat log on left */
.game-board {
    display: none;
    grid-template-columns: var(--combat-log-width) 1fr;
    grid-template-areas: "log main";
    gap: var(--gap-md);
    min-height: var(--board-min-height);
    align-items: stretch;
    user-select: none;
    -webkit-user-select: none;
}
.game-board.active {
    display: grid !important;
}
.game-board-main {
    grid-area: main;
    display: grid;
    grid-template-rows: auto 1fr auto 1fr auto;
    gap: var(--gap-sm);
    min-width: 0; /* Prevent grid blowout */
    position: relative;
}
.game-combat-log {
    grid-area: log;
    background: linear-gradient(180deg, rgba(20,15,10,0.95) 0%, rgba(10,8,5,0.98) 100%);
    border: var(--border-width) solid var(--border-bronze);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
    min-height: 100%;
    max-height: var(--board-min-height);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}
.game-combat-log h3 {
    padding: var(--padding-sm) var(--padding-md);
    margin: 0;
    background: linear-gradient(180deg, #3a2a1a 0%, #2a1a0a 100%);
    color: var(--gold);
    font-size: var(--font-size-md);
    border-bottom: var(--border-width) solid var(--border-bronze);
    flex-shrink: 0;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.game-combat-log .combat-log-entries {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--padding-sm);
    font-size: var(--font-size-sm);
    line-height: 1.4;
}
.game-combat-log .log-entry {
    padding: var(--padding-xs) var(--padding-sm);
    border-bottom: 1px solid rgba(100,80,50,0.3);
    margin-bottom: 2px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.game-combat-log .log-entry:last-child {
    border-bottom: none;
}
.player-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--gap-md);
    padding: var(--padding-sm);
    background: linear-gradient(180deg, rgba(45,36,24,0.6) 0%, rgba(26,20,16,0.8) 100%);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 30px rgba(0,0,0,0.3);
    position: relative;
}
.player-area.drop-target {
    border-color: rgba(201,162,39,0.7);
    box-shadow:
        inset 0 0 30px rgba(0,0,0,0.3),
        0 0 18px rgba(201,162,39,0.25);
}
.player-area.drop-active {
    border-color: rgba(201,162,39,0.95);
    box-shadow:
        inset 0 0 30px rgba(0,0,0,0.3),
        0 0 22px rgba(201,162,39,0.4);
}
.hero {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--gap-sm);
    cursor: pointer;
    padding: var(--padding-xs);
    user-select: none;
    -webkit-user-select: none;
}
.hero.targetable .hero-avatar { border-color: var(--health-red); box-shadow: 0 0 15px var(--health-red); }
.hero-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    text-align: right;
    min-width: 60px;
}
.hero-info .ai-level {
    font-size: 11px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.hero-avatar {
    width: var(--hero-width);
    height: var(--hero-height);
    background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-medium) 100%);
    border: var(--border-width-thick) solid var(--gold);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glow-gold), inset 0 0 20px rgba(0,0,0,0.3);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-avatar.class-icon-fallback {
    font-size: 48px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.hero .health {
    font-family: var(--font-family-display);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--health-red);
    text-shadow: var(--shadow-glow-health);
    line-height: 1;
}
.hero .armor {
    font-size: var(--font-size-sm);
    color: #4fc3f7;
    font-weight: var(--font-weight-bold);
}
.hero .name {
    font-family: var(--font-family-display);
    font-size: var(--font-size-sm);
    color: var(--gold);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    white-space: nowrap;
    line-height: 1.2;
}
.hero .hero-class {
    font-size: 10px;
    color: #aaa;
    text-transform: uppercase;
    font-weight: bold;
    line-height: 1.2;
}
.mana-display {
    font-family: var(--font-family-display);
    font-size: var(--font-size-xl);
    color: var(--mana-light);
    font-weight: var(--font-weight-bold);
    background: linear-gradient(180deg, rgba(107,63,160,0.3) 0%, rgba(60,30,100,0.5) 100%);
    padding: var(--padding-sm) var(--padding-md);
    border-radius: var(--radius-md);
    border: var(--border-width) solid var(--mana-purple);
    text-shadow: 0 0 10px var(--mana-purple);
    box-shadow: var(--shadow-glow-mana), inset 0 0 15px rgba(107,63,160,0.2);
}
.weapon-slot {
    width: 60px;
    height: 70px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(80,60,40,0.9) 0%, rgba(50,35,25,0.95) 100%);
    border: var(--border-width-thick) solid #654;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-md);
    user-select: none;
    -webkit-user-select: none;
}
.weapon-slot.has-weapon {
    display: flex;
    border-color: var(--gold);
    animation: weaponGlow 2s ease-in-out infinite;
}
.weapon-slot.can-attack {
    border-color: #4CAF50;
    box-shadow: 0 0 15px rgba(76,175,80,0.5);
}
.weapon-slot.weapon-attacked {
    border-color: #444;
    box-shadow: none;
    filter: grayscale(70%) brightness(0.8);
    opacity: 0.7;
}
@keyframes weaponGlow {
    0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,0.5), 0 0 10px rgba(212,175,55,0.3); }
    50% { box-shadow: 0 4px 12px rgba(0,0,0,0.5), 0 0 20px rgba(212,175,55,0.5); }
}
.weapon-slot .weapon-name {
    font-size: 8px;
    color: var(--gold);
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.weapon-slot .weapon-stats {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 5px;
}
.weapon-slot .weapon-attack {
    color: #f44;
    font-weight: bold;
    font-size: 14px;
}
.weapon-slot .weapon-durability {
    color: #888;
    font-weight: bold;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.weapon-slot .weapon-durability .durability-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    position: relative;
}
.weapon-slot .weapon-durability .durability-icon::before {
    content: '🛡️';
    position: absolute;
    inset: 0;
    font-size: 14px;
    line-height: 14px;
}
.weapon-slot .weapon-durability .durability-icon::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background: rgba(255, 120, 80, 0.9);
    top: 6px;
    left: -1px;
    transform: rotate(-35deg);
    border-radius: 2px;
    box-shadow: 0 0 4px rgba(255, 120, 80, 0.8);
}
.weapon-slot .weapon-icon {
    font-size: 24px;
}
.hero-power-btn {
    width: 55px;
    height: 55px;
    border-radius: var(--radius-round);
    background: linear-gradient(180deg, rgba(75,55,150,0.95) 0%, rgba(50,35,100,0.98) 100%);
    border: var(--border-width-thick) solid var(--gold);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-md), inset 0 0 15px rgba(100,149,237,0.3);
    transition: all var(--transition-normal) ease;
}
.hero-power-display {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(100,60,60,0.95) 0%, rgba(70,40,40,0.98) 100%);
    border: 2px solid #a66;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0.8;
}
.hero-power-btn:hover:not(.disabled) {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(201,162,39,0.6), 0 4px 15px rgba(0,0,0,0.5);
    border-color: var(--gold-light);
}
.hero-power-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(50%);
}
.hero-power-btn #heroPowerIcon {
    font-size: 26px;
    line-height: 1;
}
.hero-power-btn .hero-power-cost {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 26px;
    height: 26px;
    background: linear-gradient(180deg, #6b8cff 0%, #4a6cd4 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    border: 2px solid #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.hero-power-tooltip {
    background: linear-gradient(180deg, rgba(60,40,100,0.98) 0%, rgba(40,25,70,0.98) 100%);
    border: var(--border-width) solid var(--gold);
    border-radius: var(--radius-lg);
    padding: var(--padding-sm) var(--padding-md);
    color: white;
    font-family: var(--font-family-display);
    font-size: var(--font-size-md);
    white-space: nowrap;
    z-index: var(--z-tooltip);
    box-shadow: var(--shadow-lg), var(--shadow-glow-gold);
    opacity: 0;
    transform: translate(-50%, -100%) scale(0.8);
    transition: opacity var(--transition-slow) ease, transform var(--transition-slow) ease;
    pointer-events: none;
}
.hero-power-tooltip.show {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
}
.hero-power-tooltip .hp-tooltip-icon {
    font-size: 18px;
    margin-right: 8px;
}
.deck-display {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--padding-sm);
    background: rgba(139, 90, 43, 0.9);
    border: var(--border-width-thick) solid #654321;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}
.deck-display.opponent-deck { top: 10px; right: 20px; }
.deck-display.your-deck { bottom: 10px; right: 20px; }
.deck-icon { font-size: 28px; }
.deck-display span {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
}
.hand-count {
    font-size: 14px;
    color: #aaa;
    margin-top: 5px;
}

/* Board Area - Mystical Battlefield */
.board-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--gap-sm);
    min-height: var(--board-area-min-height);
    padding: var(--padding-sm);
    background:
        radial-gradient(ellipse at center, rgba(107,63,160,0.08) 0%, transparent 70%),
        linear-gradient(180deg, rgba(26,20,16,0.5) 0%, rgba(13,10,7,0.7) 100%);
    border: var(--border-width) solid rgba(139,115,85,0.4);
    border-radius: var(--radius-md);
    box-shadow:
        inset 0 0 60px rgba(0,0,0,0.5),
        inset 0 0 30px rgba(107,63,160,0.05);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}
.board-area.drop-target {
    border-color: rgba(201,162,39,0.7);
    box-shadow:
        inset 0 0 60px rgba(0,0,0,0.5),
        0 0 18px rgba(201,162,39,0.35);
}
.board-area.drop-active {
    border-color: rgba(201,162,39,0.95);
    box-shadow:
        inset 0 0 60px rgba(0,0,0,0.5),
        0 0 22px rgba(201,162,39,0.55);
}
/* Mystical rune marks on battlefield */
.board-area::before {
    content: '⚔';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    opacity: 0.06;
    color: var(--gold);
    pointer-events: none;
}
/* Subtle magical glow at center */
.board-area::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(201,162,39,0.1) 0%, transparent 70%);
    pointer-events: none;
    animation: battlefieldGlow 4s ease-in-out infinite;
}
@keyframes battlefieldGlow {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.2); }
}


/* Hand */
.hand {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--gap-sm);
    padding: var(--padding-sm);
    min-height: var(--hand-min-height);
}
.hand .card {
    transition: transform 0.2s;
}
.hand .card.dragging {
    opacity: 0.85;
    transform: translateY(-8px) scale(1.02);
}
.card.drag-ghost {
    position: fixed;
    z-index: 1200;
    pointer-events: none;
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(1.02);
    box-shadow: 0 8px 18px rgba(0,0,0,0.45);
    will-change: transform;
}

/* Turn indicator */
.turn-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 8px;
    padding: 6px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}
.turn-indicator {
    text-align: center;
    padding: 8px 14px;
    font-size: 15px;
    font-weight: bold;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    width: 100%;
}
.turn-indicator.your-turn { color: #00ff00; border: 2px solid #00ff00; }
.turn-indicator.opponent-turn { color: #ff4444; border: 2px solid #ff4444; }

.attack-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 50;
}
.attack-line {
    position: absolute;
    height: 3px;
    background: linear-gradient(90deg, rgba(255,220,150,0.9), rgba(255,120,80,0.9));
    box-shadow: 0 0 12px rgba(255,160,90,0.8);
    border-radius: 999px;
    transform-origin: left center;
    transform: rotate(var(--angle, 0deg));
    animation: attackSlash 0.6s ease-out forwards;
}
.attack-impact {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,120,80,0.7);
    box-shadow: 0 0 18px rgba(255,120,80,0.8);
    transform: translate(-50%, -50%);
    animation: attackImpact 0.75s ease-out forwards;
}
.spell-impact {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 214, 128, 0.9);
    background: radial-gradient(circle, rgba(255, 214, 128, 0.5) 0%, rgba(255, 120, 80, 0.1) 70%, transparent 100%);
    box-shadow: 0 0 18px rgba(255, 190, 120, 0.9);
    transform: translate(-50%, -50%);
    animation: spellImpact 0.7s ease-out forwards;
}
.spell-impact.heal {
    border-color: rgba(120, 255, 190, 0.9);
    background: radial-gradient(circle, rgba(120, 255, 190, 0.55) 0%, rgba(60, 180, 120, 0.1) 70%, transparent 100%);
    box-shadow: 0 0 18px rgba(120, 255, 190, 0.9);
}
.attack-hit {
    animation: attackHit 0.375s ease-in-out;
}
@keyframes attackSlash {
    0% { opacity: 0; transform: rotate(var(--angle, 0deg)) scaleX(0.2) translateY(-2px); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: rotate(var(--angle, 0deg)) scaleX(1) translateY(0); }
}
@keyframes attackImpact {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
}
@keyframes attackHit {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-3px); }
    100% { transform: translateX(0); }
}
@keyframes spellImpact {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    35% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}

.turn-timer {
    display: none;
}
@keyframes timerPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 80, 60, 0.4); }
    50% { box-shadow: 0 0 18px rgba(255, 80, 60, 0.8); }
}

/* Turn arrows */
.turn-arrow {
    position: absolute;
    font-size: 32px;
    font-weight: bold;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
}
.turn-arrow.active {
    opacity: 1;
    animation: arrowPulse 0.9s ease-in-out infinite;
}
.turn-arrow.your-arrow {
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
}
.turn-arrow.opponent-arrow {
    color: #ff4444;
    text-shadow: 0 0 10px #ff4444, 0 0 20px #ff4444;
}
@keyframes arrowPulse {
    0% { opacity: 0.2; transform: translate(-10px, -50%) scale(0.9); }
    40% { opacity: 1; transform: translate(8px, -50%) scale(1.15); }
    100% { opacity: 0.2; transform: translate(18px, -50%) scale(0.95); }
}
.turn-swap-line {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 950;
}
.turn-swap-line line {
    stroke-width: 3;
    fill: none;
}
@keyframes turnSwapDraw {
    0% { opacity: 0.9; stroke-dashoffset: var(--line-length, 0); }
    100% { opacity: 0; stroke-dashoffset: 0; }
}

.end-turn-btn {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: bold;
    width: 100%;
    border: 2px solid rgba(255, 215, 0, 0.6);
    background: linear-gradient(90deg, rgba(44, 210, 110, 0.55) var(--turn-progress, 0%), rgba(0,0,0,0.35) var(--turn-progress, 0%)) !important;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
    transition: background 0.2s ease;
}
.end-turn-btn:hover,
.end-turn-btn.btn-success:hover,
.end-turn-btn.btn:hover {
    background: linear-gradient(90deg, rgba(44, 210, 110, 0.65) var(--turn-progress, 0%), rgba(0,0,0,0.4) var(--turn-progress, 0%)) !important;
}
.end-turn-btn.warning {
    border-color: rgba(255, 120, 60, 0.8);
    color: #ffb070;
}
.end-turn-btn.urgent {
    border-color: rgba(255, 80, 60, 0.9);
    color: #ff6b5e;
    animation: timerPulse 0.8s ease-in-out infinite;
}
.concede-btn {
    min-width: 140px;
    align-self: center;
}
.concede-btn-top {
    position: absolute;
    left: calc(50% + (var(--combat-log-width) / 2));
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

/* Attack animation */
.card.attacking {
    animation: attackAnim 0.4s ease-out;
    z-index: 100;
}
@keyframes attackAnim {
    0% { transform: scale(1); }
    30% { transform: scale(1.2) translateY(-20px); }
    60% { transform: scale(1.1) translateY(10px); }
    100% { transform: scale(1); }
}
.card.attacked {
    animation: hitAnim 0.3s ease-out;
}
@keyframes hitAnim {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(0.9); filter: brightness(2) sepia(1); }
    100% { transform: scale(1); filter: brightness(1); }
}

/* Already attacked indicator */
.card.has-attacked {
    border-color: #666 !important;
    box-shadow: none !important;
}
.card.has-attacked::before {
    content: '✓';
    position: absolute;
    bottom: -8px;
    right: -8px;
    font-size: 14px;
    background: #444;
    border: 2px solid #666;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    z-index: 5;
}


/* ============== GAME ANIMATIONS ============== */

/* Card Play Animation - Magical Burst */
.card.card-played {
    animation: cardPlay 0.6s ease-out forwards;
}
@keyframes cardPlay {
    0% {
        transform: scale(1.2) translateY(-20px);
        box-shadow: 0 0 40px rgba(201,162,39,0.8), 0 0 80px rgba(201,162,39,0.4);
        filter: brightness(1.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 60px rgba(201,162,39,0.6), 0 0 100px rgba(201,162,39,0.3);
    }
    100% {
        transform: scale(1) translateY(0);
        box-shadow: 0 4px 8px rgba(0,0,0,0.4);
        filter: brightness(1);
    }
}

/* Card Summon - Fade in from below */
.card.card-summoned {
    animation: cardSummon 0.5s ease-out forwards;
}
@keyframes cardSummon {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
        filter: blur(4px);
    }
    60% {
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* Damage Flash */
.card.damage-taken,
.hero.damage-taken {
    animation: damageFlash 0.4s ease-out;
}
@keyframes damageFlash {
    0%, 100% { filter: brightness(1); }
    25% { filter: brightness(2) sepia(1) hue-rotate(-30deg); }
    50% { filter: brightness(0.8); transform: scale(0.95); }
    75% { filter: brightness(1.5) sepia(0.5) hue-rotate(-20deg); }
}

/* Heal Effect */
.card.heal-received,
.hero.heal-received {
    animation: healEffect 0.5s ease-out;
}
@keyframes healEffect {
    0% { filter: brightness(1); }
    50% {
        filter: brightness(1.4) sepia(0.3) hue-rotate(80deg);
        box-shadow: 0 0 30px rgba(45,180,39,0.6);
    }
    100% { filter: brightness(1); }
}

/* Card Death Animation */
.card.card-dying {
    animation: cardDeath 0.6s ease-in forwards;
    pointer-events: none;
}
@keyframes cardDeath {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    30% {
        filter: brightness(0.5) grayscale(0.5);
        transform: scale(1.05) rotate(-2deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.6) rotate(10deg) translateY(20px);
        filter: brightness(0) grayscale(1);
    }
}

/* Floating Damage Numbers */
.damage-number {
    position: absolute;
    font-family: 'Cinzel', serif;
    font-size: 28px;
    font-weight: bold;
    color: var(--health-red);
    text-shadow:
        0 0 10px rgba(198,40,40,0.8),
        2px 2px 0 #000,
        -1px -1px 0 #000;
    pointer-events: none;
    z-index: 100;
    animation: floatUp 1s ease-out forwards;
}
.damage-number.heal {
    color: #4caf50;
    text-shadow:
        0 0 10px rgba(76,175,80,0.8),
        2px 2px 0 #000,
        -1px -1px 0 #000;
}
@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    20% {
        transform: translateY(-10px) scale(1.3);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
}

/* Attack Animation */
.card.attacking {
    animation: attackLunge 0.3s ease-in-out;
}
@keyframes attackLunge {
    0% { transform: translateY(0); }
    50% { transform: translateY(-30px) scale(1.1); }
    100% { transform: translateY(0); }
}

/* Spell Cast Effect */
.spell-effect {
    position: fixed;
    pointer-events: none;
    z-index: 150;
}
.spell-effect.arcane-burst {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(107,63,160,0.8) 0%, rgba(107,63,160,0) 70%);
    border-radius: 50%;
    animation: arcaneBurst 0.6s ease-out forwards;
}
@keyframes arcaneBurst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Turn Indicator */
.turn-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Cinzel', serif;
    font-size: 42px;
    font-weight: bold;
    color: var(--gold);
    text-shadow:
        0 0 20px rgba(201,162,39,0.8),
        0 0 40px rgba(201,162,39,0.4),
        2px 2px 4px rgba(0,0,0,0.8);
    z-index: 250;
    animation: turnAnnounce 1.5s ease-out forwards;
    pointer-events: none;
}
@keyframes turnAnnounce {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Card Hover Sparkle Effect */
.card:hover::before {
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.3) 0%, transparent 30%),
        transparent;
    animation: sparkleMove 2s ease-in-out infinite;
}
@keyframes sparkleMove {
    0%, 100% {
        background-position: 20% 20%;
    }
    50% {
        background-position: 80% 80%;
    }
}

/* Victory/Defeat Overlay */
.game-end-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
    animation: overlayFadeIn 0.5s ease-out;
}
.game-end-overlay.victory {
    background: radial-gradient(ellipse at center, rgba(201,162,39,0.3) 0%, rgba(0,0,0,0.9) 100%);
}
.game-end-overlay.defeat {
    background: radial-gradient(ellipse at center, rgba(139,26,26,0.3) 0%, rgba(0,0,0,0.9) 100%);
}
.game-end-text {
    font-family: 'Cinzel', serif;
    font-size: 72px;
    font-weight: bold;
    text-shadow: 0 0 30px currentColor, 0 4px 8px rgba(0,0,0,0.8);
    animation: victoryPulse 2s ease-in-out infinite;
}
.game-end-overlay.victory .game-end-text {
    color: var(--gold);
}
.game-end-overlay.defeat .game-end-text {
    color: var(--health-red);
}
@keyframes victoryPulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.05); filter: brightness(1.2); }
}
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* Divine Shield Glow */
.card.has-divine-shield {
    box-shadow: 0 0 20px rgba(255,215,0,0.6), inset 0 0 15px rgba(255,215,0,0.2);
}
.card.has-divine-shield::before {
    border-color: rgba(255,215,0,0.8) !important;
}

/* Spell Targeting Mode */
.card.targeting-source {
    transform: translateY(-20px) scale(1.1);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.4);
    z-index: 100;
    border-color: #ffd700 !important;
}

/* Valid target highlight - pulse animation */
.valid-target {
    animation: targetPulse 1s ease-in-out infinite !important;
    cursor: crosshair !important;
    position: relative;
}

@keyframes targetPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 1), 0 0 50px rgba(255, 215, 0, 0.5); }
}

/* Hover on valid target - brighter glow */
.valid-target:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(255, 215, 0, 1), 0 0 60px rgba(255, 215, 0, 0.7) !important;
    animation: none !important;
}

/* Hero valid target */
.hero.valid-target .hero-avatar {
    animation: heroTargetPulse 1s ease-in-out infinite;
}

@keyframes heroTargetPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), var(--shadow-glow-gold); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 1), 0 0 60px rgba(255, 215, 0, 0.5); }
}


/* Combat Log - Verbose MUD-style */
/* Old combat-log styles removed - now using .game-combat-log inside game board */
.log-entry {
    padding: 4px 8px;
    border-bottom: 1px solid rgba(100,80,50,0.2);
    animation: logFade 0.3s;
    font-size: 13px;
    line-height: 1.5;
}
.log-entry:last-child { border-bottom: none; }

/* Entry type backgrounds */
.log-attack { background: rgba(255,100,100,0.08); }
.log-critical { background: rgba(255,50,50,0.15) !important; }
.log-spell { background: rgba(138,43,226,0.1); }
.log-spell-cast { background: rgba(138,43,226,0.08); }
.log-damage-detail { color: #ccc; font-size: 12px; }
.log-hp-status { color: #999; font-size: 12px; font-style: italic; }
.log-death { background: rgba(139,0,0,0.15); }
.log-heal { background: rgba(50,205,50,0.1); }
.log-play { background: rgba(100,149,237,0.08); }
.log-buff { background: rgba(50,205,50,0.08); }
.log-debuff { background: rgba(255,100,0,0.1); }
.log-summon { background: rgba(255,215,0,0.1); }
.log-elite { background: rgba(255,215,0,0.15); }
.log-evasion { background: rgba(100,200,255,0.15); }
.log-freeze { background: rgba(135,206,250,0.15); }
.log-silence { background: rgba(128,128,128,0.15); }
.log-destroy { background: rgba(255,0,0,0.15); }
.log-poison { background: rgba(50,205,50,0.15); }
.log-weapon { background: rgba(192,192,192,0.1); }
.log-weapon-break { background: rgba(139,69,19,0.15); }
.log-hero-power { background: rgba(138,43,226,0.1); }
.log-hp-detail { color: #b8a0d0; font-size: 12px; }
.log-draw { color: #aaa; font-size: 12px; }
.log-return { background: rgba(100,149,237,0.1); }
.log-lifesteal { background: rgba(139,0,0,0.1); }
.log-shield { background: rgba(255,215,0,0.1); }
.log-error { background: rgba(255,0,0,0.2); }
.log-info { color: #aaa; font-style: italic; }

/* Turn dividers */
.log-divider { text-align: center; }
.log-turn-divider { color: #666; letter-spacing: 2px; }
.log-turn-start { background: rgba(255,215,0,0.1); font-weight: bold; }
.log-turn-end { color: #888; }
.log-turn-player { color: #ffd700; }
.log-game-over { color: #ffd700; font-size: 16px; font-weight: bold; text-shadow: 0 0 10px rgba(255,215,0,0.5); }

/* Text color classes */
.log-attacker { color: #ff6b6b; font-weight: bold; }
.log-defender { color: #6bafff; font-weight: bold; }
.log-dmg { color: #ff4444; font-weight: bold; }
.log-crit { color: #ff0000; font-weight: bold; font-size: 15px; text-shadow: 0 0 5px rgba(255,0,0,0.5); }
.log-spell-dmg { color: #da70d6; font-weight: bold; }
.log-heal-value { color: #44ff44; font-weight: bold; }
.log-heal-target { color: #90ee90; }
.log-buff-target { color: #98fb98; }
.log-buff-value { color: #44ff44; font-weight: bold; }
.log-atk-buff { color: #ff6b6b; }
.log-hp-buff { color: #44ff44; }
.log-debuff-target { color: #ffa500; }
.log-debuff-value { color: #ff4500; font-weight: bold; }
.log-death-name { color: #ff4444; font-weight: bold; }
.log-elite { color: #ffd700; font-weight: bold; }
.log-evasion { color: #00ffff; font-weight: bold; text-shadow: 0 0 5px rgba(0,255,255,0.5); }
.log-frozen { color: #87ceeb; font-weight: bold; text-shadow: 0 0 5px rgba(135,206,235,0.5); }
.log-silenced { color: #888; font-weight: bold; }
.log-destroyed { color: #ff0000; font-weight: bold; }
.log-poison { color: #32cd32; font-weight: bold; }
.log-keyword { color: #daa520; }
.log-keywords { color: #888; font-size: 11px; }
.log-mana { color: #6b8cff; font-size: 12px; }
.log-spell-text { color: #b8a0d0; font-size: 12px; font-style: italic; }
.log-friendly-hero { color: #44ff44; font-weight: bold; }
.log-enemy-hero { color: #ff6b6b; font-weight: bold; }
.log-ai { color: #ff8c00; font-weight: bold; }
.log-weapon-break { color: #8b4513; }
.log-shield-break { color: #ffd700; }
.log-hero-power { color: #da70d6; font-weight: bold; }
.log-hp-effect { color: #b8a0d0; }
.log-lifesteal { color: #8b0000; font-weight: bold; }
.log-freeze-target { color: #87ceeb; }
.log-silence-target { color: #a0a0a0; }
.log-destroy-target { color: #ff6b6b; }
.log-poison-target { color: #32cd32; }
.log-return-target { color: #6495ed; }
.log-shield-target { color: #ffd700; }

@keyframes logFade {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Combat Animation */
.card.attacking {
    animation: attackPulse 0.3s ease-out;
}
.card.damaged {
    animation: damagePulse 0.4s ease-out;
}
@keyframes attackPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1) translateY(-5px); box-shadow: 0 0 20px #ff0; }
    100% { transform: scale(1); }
}
@keyframes damagePulse {
    0% { transform: scale(1); }
    25% { transform: scale(0.95); filter: brightness(2) saturate(0); }
    50% { transform: scale(1.05); filter: brightness(1.5); }
    100% { transform: scale(1); filter: brightness(1); }
}
