/* butcher.css */

.tool-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background-color: var(--bg-primary);
}

.tool-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Game Area */
.game-area {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Boss */
.boss-container {
    text-align: center;
    margin-bottom: 30px;
}

.boss-sprite {
    font-size: 80px;
    line-height: 1;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
    transform-origin: bottom center;
}

.boss-sprite.attack {
    animation: bossAttack 0.3s ease-out;
}

.boss-name {
    font-family: inherit;
    font-weight: 700;
    color: var(--text-color);
    font-size: 1.1rem;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

/* HP Bar */
.hp-container {
    width: 100%;
    margin-bottom: 20px;
}

.hp-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-color);
}

.hp-bar-bg {
    width: 100%;
    height: 24px;
    background-color: #333;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.hp-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff4d4d, #ff9999);
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s;
    transform-origin: left;
}

.hp-bar-fill.warning {
    background: linear-gradient(90deg, #ffcc00, #ffe680);
}

.hp-bar-fill.danger {
    background: linear-gradient(90deg, #cc0000, #ff4d4d);
    animation: pulseDanger 1s infinite alternate;
}

/* Damage Text Container */
.damage-text-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through */
    z-index: 10;
}

.damage-text {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: 900;
    color: #ff4d4d;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    animation: damageFloatUp 1s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    white-space: nowrap;
}

.damage-text.heal {
    color: #00cc66;
}

.damage-text.miss {
    color: #aaaaaa;
    font-size: 1.5rem;
}

/* Input Area */
.input-area {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
}

.input-prompt {
    margin-bottom: 10px;
    font-weight: 600;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#task-input {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-color);
    font-size: 1rem;
}

#task-input:focus {
    outline: none;
    border-color: #ff4d4d;
}

.input-shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

/* Battle Log */
.battle-log {
    background: #111;
    color: #00ff00;
    /* Terminal green */
    font-family: 'Courier New', Courier, monospace;
    border-radius: 8px;
    padding: 15px;
    height: 150px;
    overflow-y: auto;
    font-size: 0.9rem;
    border: 1px solid #333;
}

.battle-log h3 {
    margin-top: 0;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    border-bottom: 1px dashed #555;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

#log-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#log-list li {
    margin-bottom: 5px;
    border-bottom: 1px solid #222;
    padding-bottom: 5px;
}

.log-damage {
    color: #ff4d4d;
}

.log-heal {
    color: #00cc66;
}

.log-info {
    color: #aaaaaa;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    background-color: var(--bg-primary);
    margin: 10vh auto;
    padding: 40px 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    position: relative;
    animation: modalPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    color: var(--text-dim);
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #fff;
}

#result-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.result-emoji {
    font-size: 70px;
    margin: 15px 0 25px 0;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.result-desc {
    font-size: 1.05rem;
    margin-bottom: 30px;
    line-height: 1.6;
    color: var(--text-color);
    word-break: keep-all;
}

.prescription-box {
    background: rgba(0, 204, 102, 0.08);
    border: 1px solid rgba(0, 204, 102, 0.3);
    padding: 20px;
    margin-bottom: 30px;
    text-align: left;
    border-radius: 12px;
}

.prescription-box h3 {
    margin-top: 0;
    font-size: 1.05rem;
    color: #00e676;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#result-prescription {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.9);
    word-break: keep-all;
}


/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes damageFloatUp {
    0% {
        opacity: 0;
        transform: translate(-50%, 0) scale(0.5);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -20px) scale(1.2);
    }

    80% {
        opacity: 1;
        transform: translate(-50%, -60px) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -80px) scale(1);
    }
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

@keyframes bossAttack {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3) translateY(10px);
    }

    100% {
        transform: scale(1) translateY(0);
    }
}

@keyframes pulseDanger {
    0% {
        box-shadow: 0 0 5px #cc0000;
    }

    100% {
        box-shadow: 0 0 15px #ff4d4d;
    }
}

@keyframes modalPopIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}