/* === Battle Arena === */
.battle-arena {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    flex: 1;
}

/* === Boss Area === */
.boss-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    gap: 8px;
    background: linear-gradient(180deg, rgba(255,0,0,0.1) 0%, transparent 100%);
}

.boss-info {
    text-align: center;
}

.boss-emoji {
    animation: bossIdle 2s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(255, 82, 82, 0.5));
    line-height: 1;
}

.boss-img {
    width: 200px;
    height: 200px;
    object-fit: contain;
}

.tug-boss-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

@keyframes bossIdle {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.08); }
}

.boss--hit {
    animation: bossHit 0.5s ease-in-out !important;
}

@keyframes bossHit {
    0% { transform: translateX(0) scale(1); filter: brightness(2); }
    20% { transform: translateX(-25px) scale(0.9); }
    40% { transform: translateX(25px) scale(0.9); }
    60% { transform: translateX(-12px) scale(0.95); }
    80% { transform: translateX(12px) scale(0.95); }
    100% { transform: translateX(0) scale(1); filter: brightness(1); }
}

.boss--attacking {
    animation: bossAttack 0.5s ease-in-out !important;
}

@keyframes bossAttack {
    0% { transform: scale(1) rotate(0deg); }
    20% { transform: scale(1.4) rotate(-3deg); }
    40% { transform: scale(1.4) rotate(3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.boss-name {
    font-size: var(--font-size-xl);
    font-weight: bold;
    color: var(--error);
    text-shadow: 0 0 10px rgba(255, 82, 82, 0.5);
}

.boss-taunt {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    max-width: 280px;
    text-align: center;
}

/* === Tug-of-War Bar === */
.tug-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 360px;
    padding: 8px 0;
}

.tug-label {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.tug-label img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.tug-track {
    flex: 1;
    height: 20px;
    background: var(--bg-card);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

/* Boss fill — grows from left (red) */
.tug-fill--boss {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--error) 0%, rgba(255, 82, 82, 0.3) 100%);
    border-radius: 10px 0 0 10px;
    transition: width 0.4s ease;
}

/* Player fill — grows from right (purple/gold) */
.tug-fill--player {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(270deg, var(--gold) 0%, rgba(123, 47, 190, 0.4) 100%);
    border-radius: 0 10px 10px 0;
    transition: width 0.4s ease;
}

/* Center marker (sword) */
.tug-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: left 0.4s ease;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

.tug-marker-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.tug-marker--danger {
    animation: tugDanger 0.3s ease-in-out infinite;
}

@keyframes tugDanger {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* === Battle Task Area === */
.battle-task-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    gap: 16px;
}

/* === Player Area === */
.player-area {
    display: flex;
    justify-content: center;
    padding: 12px;
}

.player-character {
    animation: playerIdle 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(123, 47, 190, 0.6));
    line-height: 1;
}

.player-character img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

@keyframes playerIdle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* === Victory Overlay === */
.victory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 300;
    gap: 16px;
    text-align: center;
    padding: 24px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.victory-title {
    font-size: var(--font-size-2xl);
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.victory-emoji {
    font-size: 4rem;
}

.victory-message {
    color: var(--text-light);
    font-size: var(--font-size-lg);
    font-style: italic;
}

.victory-reward {
    font-size: var(--font-size-xl);
    color: var(--gold);
    font-weight: bold;
}
