/* css/heat.css
   Heat HUD — a compact flame meter docked near #ui-toolbar. Hidden until the
   first tier-up ever (.unlocked), pulses on tier-up, cools on tier-down. */

.heat-hud {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(20, 10, 4, 0.72);
    border: 1px solid rgba(255, 138, 61, 0.35);
    cursor: pointer;
    position: relative;
    font-family: 'Segoe UI', Arial, sans-serif;
    -webkit-user-select: none;
    user-select: none;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.15s ease;
}

.heat-hud.unlocked { display: inline-flex; }

.heat-hud-flame {
    font-size: 16px;
    line-height: 1;
    filter: drop-shadow(0 0 4px rgba(255, 120, 40, 0.6));
}

.heat-hud-pips {
    display: inline-flex;
    gap: 3px;
}

.heat-hud-pip {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
.heat-hud-pip.lit {
    background: #ff8a3d;
    box-shadow: 0 0 6px #ff8a3d;
}

.heat-hud-mult {
    font-size: 13px;
    font-weight: 800;
    color: #ffb877;
    min-width: 22px;
    text-align: center;
    letter-spacing: 0.02em;
}

/* Tier theming — the meter warms toward gold-white at MAX. */
.heat-hud.heat-tier-1 { border-color: rgba(255, 138, 61, 0.5); }
.heat-hud.heat-tier-2 {
    border-color: rgba(255, 106, 26, 0.6);
    box-shadow: 0 0 10px rgba(255, 106, 26, 0.3);
}
.heat-hud.heat-tier-2 .heat-hud-pip.lit { background: #ff6a1a; box-shadow: 0 0 6px #ff6a1a; }
.heat-hud.heat-tier-3 {
    border-color: rgba(255, 61, 26, 0.7);
    box-shadow: 0 0 14px rgba(255, 61, 26, 0.4);
}
.heat-hud.heat-tier-3 .heat-hud-pip.lit { background: #ff3d1a; box-shadow: 0 0 7px #ff3d1a; }
.heat-hud.heat-tier-3 .heat-hud-mult { color: #ff8a5a; }

/* MAX HEAT — glorious. */
.heat-hud.heat-tier-4 {
    border-color: #ffca28;
    background: rgba(60, 30, 4, 0.85);
    box-shadow: 0 0 20px rgba(255, 202, 40, 0.7), inset 0 0 12px rgba(255, 160, 40, 0.4);
    animation: heat-max-glow 1.4s ease-in-out infinite;
}
.heat-hud.heat-tier-4 .heat-hud-pip.lit {
    background: #ffca28;
    box-shadow: 0 0 9px #ffca28, 0 0 16px #ff8a3d;
}
.heat-hud.heat-tier-4 .heat-hud-flame {
    animation: heat-flame-flicker 0.4s ease-in-out infinite alternate;
}
.heat-hud.heat-tier-4 .heat-hud-mult {
    color: #ffe08a;
    text-shadow: 0 0 8px rgba(255, 202, 40, 0.8);
}

@keyframes heat-max-glow {
    0%, 100% { box-shadow: 0 0 18px rgba(255, 202, 40, 0.55), inset 0 0 10px rgba(255, 160, 40, 0.35); }
    50%      { box-shadow: 0 0 30px rgba(255, 202, 40, 0.9), inset 0 0 16px rgba(255, 180, 60, 0.55); }
}

@keyframes heat-flame-flicker {
    from { transform: scale(1) rotate(-3deg); filter: drop-shadow(0 0 4px rgba(255, 160, 40, 0.7)); }
    to   { transform: scale(1.18) rotate(4deg); filter: drop-shadow(0 0 9px rgba(255, 200, 60, 0.9)); }
}

/* Transitions. */
.heat-hud.pulsing { animation: heat-pulse 0.6s ease-out; }
@keyframes heat-pulse {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.28); }
    100% { transform: scale(1); }
}

.heat-hud.cooling { animation: heat-cool 0.6s ease-out; }
@keyframes heat-cool {
    0%   { filter: saturate(1.4) brightness(1.2); }
    100% { filter: saturate(0.7) brightness(0.85); }
}

/* ── Popover ── */
.heat-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    padding: 12px 14px;
    background: rgba(16, 10, 6, 0.97);
    border: 1px solid rgba(255, 138, 61, 0.5);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 9000;
    cursor: default;
    animation: heat-popover-in 0.18s ease-out;
}
.heat-popover::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 16px;
    width: 10px;
    height: 10px;
    background: rgba(16, 10, 6, 0.97);
    border-left: 1px solid rgba(255, 138, 61, 0.5);
    border-top: 1px solid rgba(255, 138, 61, 0.5);
    transform: rotate(45deg);
}
.heat-popover-title {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #ffca28;
    margin-bottom: 6px;
}
.heat-popover-body {
    font-size: 0.8rem;
    line-height: 1.45;
    color: #d8c4b0;
    font-style: italic;
}

@keyframes heat-popover-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .heat-hud { padding: 3px 8px; gap: 4px; }
    .heat-hud-mult { font-size: 12px; }
    .heat-popover { width: 200px; }
}

@media (prefers-reduced-motion: reduce) {
    .heat-hud.heat-tier-4,
    .heat-hud.heat-tier-4 .heat-hud-flame,
    .heat-hud.pulsing,
    .heat-hud.cooling { animation: none; }
}
