/* Overrides for large CSS files */
.tooltip-box {
    pointer-events: auto !important;
}

#mode-selector {
    flex-wrap: wrap !important;
}

#damage-metric {
    color: #ff5555;
    font-size: 1rem;
    /* Slightly smaller than level/room */
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 4px;
    margin-top: 4px;
    letter-spacing: 0px !important;
    /* Keep it compact */
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.4);
}

/* New HUD Layout */
#hud-top-left {
    position: absolute !important;
    top: 15px !important;
    left: 15px !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 15px !important;
    transform: scale(var(--ui-scale)) !important;
    transform-origin: top left !important;
    pointer-events: none !important;
    z-index: 2000 !important;
}

#dungeon-metrics {
    position: static !important;
    transform: none !important;
    margin: 0 !important;
    top: auto !important;
    left: auto !important;
    pointer-events: none !important;
}

.hud-btn {
    pointer-events: auto !important;
    padding: 12px 24px !important;
    font-size: 1.2rem !important;
    border: 2px solid #ffaa00 !important;
    color: #ffaa00 !important;
    white-space: nowrap !important;
    height: fit-content !important;
    display: none;
    /* Controlled by JS */
    background: rgba(0, 0, 0, 0.85) !important;
    font-family: 'Special Elite', cursive !important;
    cursor: pointer !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255, 170, 0, 0.1) !important;
}

.hud-btn:hover {
    background: #ffaa00 !important;
    color: #000 !important;
    transform: scale(1.05) !important;
}

/* Evolution Overlay Styles - Redesigned to Typewriter Aesthetic (Dark Mode) */
#evolution-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 8, 5, 0.9);
    /* Dark ink/old room feel */
    backdrop-filter: blur(12px);
    transition: background 2s ease-in-out;
}

#evolution-overlay.pulse-bg {
    background: rgba(40, 30, 10, 0.95);
}

.evolution-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 4rem;
    background: #1a1a1a;
    /* Dark parchment/inkwell charcoal */
    border: 3px solid #ffcc00;
    /* Gold highlight */
    border-radius: 8px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(255, 204, 0, 0.05);
    transform: scale(var(--ui-scale));
    max-width: 90%;
    animation: evo-entrance 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes evo-entrance {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(var(--ui-scale));
        opacity: 1;
    }
}

#evo-message-top {
    font-family: 'Special Elite', cursive;
    font-size: 2.6rem;
    color: #ffcc00;
    /* Scholastic gold */
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.3);
    margin-bottom: 2rem;
    letter-spacing: 0.3rem;
    border-bottom: 2px solid rgba(255, 204, 0, 0.4);
    padding-bottom: 0.8rem;
    width: 100%;
}

.evo-display-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
}

.evo-item-name {
    font-family: 'Special Elite', cursive;
    font-size: 1.8rem;
    color: #ffffff;
    white-space: nowrap;
    display: block;
    margin-top: 15px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.evo-item-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.evo-icon {
    width: 170px;
    height: 170px;
    background: #333;
    /* Dark contrast for white items like Manuscript */
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #444;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(0, 0, 0, 0.5);
}

.evo-icon img {
    max-width: 85%;
    max-height: 85%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

.evo-arrow {
    font-size: 4rem;
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
    animation: arrow-bounce-new 1s infinite alternate ease-in-out;
}

@keyframes arrow-bounce-new {
    from {
        transform: translateX(-10px);
    }

    to {
        transform: translateX(10px);
    }
}

#evo-subtext {
    font-family: 'Special Elite', cursive;
    font-size: 1.35rem;
    color: #b0b0b0;
    margin-bottom: 3.5rem;
    max-width: 550px;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 25px;
    border-left: 4px solid #ffcc00;
    border-radius: 0 4px 4px 0;
}

#evo-continue-btn {
    min-width: 320px;
    font-size: 1.6rem !important;
    padding: 1.1rem 3.5rem !important;
    border-radius: 6px !important;
    border: 2px solid #ffcc00 !important;
    background: #ffcc00 !important;
    color: #111 !important;
    text-transform: uppercase;
    letter-spacing: 0.5rem !important;
    font-family: 'Special Elite', cursive !important;
    cursor: pointer;
    box-shadow: 0 4px 0 #b38f00;
    transition: all 0.1s ease;
}

#evo-continue-btn:hover {
    background: #ffe066 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #b38f00, 0 8px 20px rgba(255, 204, 0, 0.15);
}

#evo-continue-btn:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 #b38f00;
}

/* Mode Selection Locks */
.mode-btn.locked {
    opacity: 0.4 !important;
    pointer-events: none !important;
    position: relative !important;
    overflow: hidden !important;
}

.mode-btn.locked::after {
    content: "LOCKED" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) rotate(-15deg) !important;
    background: rgba(220, 20, 20, 0.9) !important;
    color: white !important;
    padding: 2px 8px !important;
    border: 1px solid white !important;
    border-radius: 4px !important;
    font-size: 0.8rem !important;
    font-family: 'Permanent Marker', cursive !important;
    font-weight: bold !important;
    pointer-events: none !important;
    white-space: nowrap !important;
    z-index: 10 !important;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5) !important;
}