/* ══════════════════════════════════════════════════════
   Dragon Energy System — CSS
   Compact floating badge + segmented bar component
══════════════════════════════════════════════════════ */

/* ── Global floating badge (fixed position, bottom-right near dragon controls) ── */
#dragon-energy-badge {
    position: fixed;
    bottom: 72px;
    right: 10px;
    z-index: 850;
    pointer-events: auto;
}

.de-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.75);
    border: 1.5px solid rgba(0, 210, 255, 0.35);
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(0, 210, 255, 0.15), 0 0 0 1px rgba(255,255,255,0.05);
    transition: all 0.2s ease;
    animation: deFloatIn 0.4s ease-out;
    min-width: 110px;
}

.de-badge:hover {
    border-color: rgba(0, 210, 255, 0.7);
    box-shadow: 0 4px 18px rgba(0, 210, 255, 0.35);
    transform: translateY(-1px);
}

.de-badge-icon {
    font-size: 0.85rem;
    animation: dePulse 2s ease-in-out infinite;
}

.de-badge-bar-wrap {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    min-width: 50px;
}

.de-badge-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease, background 0.3s ease;
}

.de-badge-count {
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
    transition: color 0.3s ease;
    min-width: 28px;
    text-align: right;
}

/* ── Inline bar (inside Dragon Den modal or world map) ── */
.de-bar-container {
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.06), rgba(0, 100, 180, 0.04));
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 12px;
    margin-bottom: 10px;
}

.de-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.de-bar-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #00d2ff;
    letter-spacing: 0.5px;
}

.de-bar-count {
    font-size: 0.75rem;
    font-weight: 800;
    min-width: 30px;
    text-align: right;
}

.de-bar-track {
    display: flex;
    gap: 2px;
    margin-bottom: 5px;
}

.de-bar-cell {
    flex: 1;
    height: 10px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.de-bar-cell.filled {
    animation: deCellIn 0.3s ease-out;
}

.de-bar-cell.empty {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.de-cost-hints {
    display: flex;
    gap: 8px;
    font-size: 0.58rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 3px;
}

.de-buy-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 210, 255, 0.4);
    background: rgba(0, 210, 255, 0.1);
    color: #00d2ff;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.15s;
    flex-shrink: 0;
}

.de-buy-btn:hover {
    background: rgba(0, 210, 255, 0.25);
    border-color: rgba(0, 210, 255, 0.8);
    transform: scale(1.1);
}

/* ── Animations ── */
@keyframes deFloatIn {
    from { opacity: 0; transform: translateY(10px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.15); opacity: 0.8; }
}

@keyframes deCellIn {
    from { transform: scaleY(0); opacity: 0; }
    to   { transform: scaleY(1); opacity: 1; }
}

/* ── Low-energy warning pulse on the badge ── */
.de-badge.de-low {
    border-color: rgba(231, 76, 60, 0.6);
    animation: deFloatIn 0.4s ease-out, deLowPulse 1.5s ease-in-out infinite;
}

@keyframes deLowPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(231,76,60,0.2); }
    50%       { box-shadow: 0 2px 18px rgba(231,76,60,0.55); }
}

/* ── Mobile responsive: move badge up on smaller screens ── */
@media (max-width: 480px) {
    #dragon-energy-badge {
        bottom: 64px;
        right: 8px;
    }
    .de-badge {
        padding: 4px 8px;
        min-width: 90px;
    }
    .de-badge-bar-wrap {
        min-width: 36px;
    }
}
