/* ==========================================================================
   Munchkin Web Game — Combat Arena & Clash Visuals
   ========================================================================== */

/* Combat Encounter Grid: Control panel on the left + Big Monster Card on the right */
.combat-encounter-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 24px;
    width: auto;
    max-width: 840px;
    margin: 0 auto;
}

.combat-arena-panel {
    background: linear-gradient(180deg, rgba(30, 15, 20, 0.95), rgba(15, 10, 15, 0.98));
    border: 2px solid rgba(239, 68, 68, 0.4);
    border-radius: 20px;
    padding: 20px 24px;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.25), var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 480px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Monster Full Card on the Right */
.combat-monster-card-dock {
    width: 235px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.combat-monster-full-card {
    width: 235px;
    min-height: 355px;
    background: #f8edd1; /* Creamy Door parchment */
    border: 6px solid #3c1e14;
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85), 0 0 30px rgba(239, 68, 68, 0.35), inset 0 0 15px rgba(180, 130, 60, 0.2);
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    position: relative;
    color: #2b140a;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    animation: monsterCardGlow 3s ease-in-out infinite alternate;
}

.combat-monster-full-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.95), 0 0 45px rgba(239, 68, 68, 0.55);
}

@keyframes monsterCardGlow {
    0% { box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85), 0 0 25px rgba(239, 68, 68, 0.25); }
    100% { box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85), 0 0 45px rgba(245, 158, 11, 0.45); }
}

.monster-card-top-level {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 900;
    color: #b91c1c;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 2px;
    text-align: center;
}

.monster-card-name {
    font-family: var(--font-medieval);
    font-size: 18px;
    font-weight: 900;
    color: #1a0802;
    text-align: center;
    line-height: 1.18;
    margin-bottom: 8px;
    text-transform: uppercase;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.monster-card-art-box {
    width: 100%;
    height: 140px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, rgba(20, 10, 5, 0.06) 70%);
    border-radius: 12px;
    border: 1.5px solid rgba(60, 30, 20, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.monster-card-art-emoji {
    font-size: 76px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease;
}

.monster-card-art-box:hover .monster-card-art-emoji {
    transform: scale(1.15);
}

.monster-card-body-text {
    font-family: var(--font-sans);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
    color: #1a0802;
    flex: 1;
    margin-bottom: 8px;
    text-align: left;
}

.monster-card-bad-stuff {
    margin-top: 5px;
    color: #991b1b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
}

.monster-card-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1.5px solid rgba(60, 30, 20, 0.2);
    padding-top: 6px;
    font-size: 11.5px;
    font-weight: 800;
    color: #3c1e14;
}

/* Combat Header */
.combat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
}

.combat-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 900;
    color: #fca5a5;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* VS Clash Meter */
.clash-meter {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 16px 20px;
    border: 1px solid var(--border-subtle);
}

.clash-side {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.clash-side.player-side {
    align-items: flex-start;
}

.clash-side.monster-side {
    align-items: flex-end;
}

.clash-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.clash-power {
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 900;
    line-height: 1;
}

.player-side .clash-power {
    color: #34d399;
    text-shadow: 0 0 16px rgba(52, 211, 153, 0.4);
}

.monster-side .clash-power {
    color: #f87171;
    text-shadow: 0 0 16px rgba(248, 113, 113, 0.4);
}

.clash-vs-emblem {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 900;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
    animation: pulse 1.5s infinite;
}

/* Power Comparison Status Bar */
.power-comparison-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    display: flex;
}

.power-fill-player {
    background: var(--emerald-gradient);
    transition: width var(--transition-normal);
}

.power-fill-monster {
    background: var(--crimson-gradient);
    transition: width var(--transition-normal);
}

/* Power Breakdown Details Popover / Box */
.power-breakdown-box {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.breakdown-row.total {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 6px;
    font-weight: 700;
    color: var(--text-primary);
}

.breakdown-value.positive {
    color: #34d399;
    font-weight: 700;
}

/* Monster Bad Stuff Box */
.bad-stuff-box {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    color: #fca5a5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.bad-stuff-icon {
    font-size: 16px;
}

/* Combat Action Controls */
.combat-actions-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 12px;
}

/* Dice Roller 3D Component */
.dice-roller-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    gap: 16px;
    animation: fadeIn 0.2s ease;
}

.dice-cube {
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #1e1b18;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5), var(--shadow-lg);
    animation: diceRoll 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes diceRoll {
    0% { transform: rotate(0deg) scale(0.5); }
    50% { transform: rotate(360deg) scale(1.3); }
    100% { transform: rotate(720deg) scale(1); }
}

.dice-result-text {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}
