/* Combat HUD — modern flat RPG: dark charcoal base, warm gold accent,
   capsule/pill container language applied consistently. */

/* --- Scene vignettes: gradient frames around the HUD --- */
#scene-overlay-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 130px;
    pointer-events: none;
    z-index: 25;
    background: linear-gradient(
        to bottom,
        rgba(4, 4, 8, 0.85) 0%,
        rgba(4, 4, 8, 0.55) 50%,
        rgba(4, 4, 8, 0)    100%
    );
}
#scene-overlay-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 320px;
    pointer-events: none;
    z-index: 25;
    background: linear-gradient(
        to top,
        rgba(4, 4, 8, 0.96) 0%,
        rgba(4, 4, 8, 0.88) 25%,
        rgba(4, 4, 8, 0.6)  55%,
        rgba(4, 4, 8, 0.25) 80%,
        rgba(4, 4, 8, 0)    100%
    );
}
body.power-save #scene-overlay-top,
body.power-save #scene-overlay-bottom { display: none; }

/* --- Hero ID panel (top-left): angled plate + diamond portrait --- */
#hero-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
    background: transparent;
    border: none;
    backdrop-filter: none;
    z-index: 30;
    min-width: 260px;
}

.hero-portrait {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3a3024 0%, #c4a35a 55%, #3a3024 100%);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    flex-shrink: 0;
    margin-right: -10px;
    z-index: 2;
    filter: drop-shadow(0 0 6px rgba(196,163,90,0.35));
}
.hero-portrait::before {
    content: '';
    position: absolute;
    width: 46px;
    height: 46px;
    background: radial-gradient(circle at 35% 30%, #2a2418 0%, #0c0b07 75%);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    z-index: 1;
}
.hero-portrait > * {
    position: relative;
    z-index: 2;
    color: #e4d8b0;
    font-size: 20px;
    text-shadow: 0 0 6px rgba(196,163,90,0.5);
}

.hero-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 6px 14px 6px 20px;
    background: linear-gradient(180deg, #1a1813 0%, #0c0a08 100%);
    border: 1px solid #3a3024;
    border-left: none;
    clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

.hero-name {
    font-size: 12px;
    font-weight: 700;
    color: #e4d8b0;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-power {
    font-size: 11px;
    color: #c4a35a;
    display: flex;
    align-items: center;
    gap: 4px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.pw-icon {
    color: #c4a35a;
    font-size: 11px;
}

/* --- Stage banner (top-center): skewed black banner + demon-wing caps --- */
#stage-banner {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: stretch;
    z-index: 30;
    height: 30px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.banner-cap {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}
.banner-cap-l { margin-right: -8px; }
.banner-cap-r { margin-left: -8px; }

.banner-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 22px;
    background: linear-gradient(180deg, #0a0906 0%, #16130e 50%, #0a0906 100%);
    border-top: 1px solid #2e2a20;
    border-bottom: 1px solid #2e2a20;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.stage-text {
    font-size: 13px;
    font-weight: 700;
    color: #e4d8b0;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.boss-chip {
    display: none;
    align-items: center;
    gap: 5px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 3px 10px 3px 8px;
    background: linear-gradient(180deg, #c03030 0%, #6d1a1a 100%);
    color: #fff;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
    box-shadow: 0 0 10px rgba(200,50,50,0.4);
}
#stage-banner.has-boss .boss-chip { display: inline-flex; }

/* --- Currency pills (top-right) --- */
#currency-pills {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    z-index: 30;
}

#mat-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 12px;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(26,24,19,0.9) 0%, rgba(10,9,6,0.9) 100%);
    border: 1px solid #2e2a20;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.6);
    font-variant-numeric: tabular-nums;
}
.mat-chip {
    display: flex;
    align-items: center;
    gap: 4px;
}
.mat-chip-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    -webkit-mask-size: contain;
            mask-size: contain;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
}
.mat-chip-val {
    font-size: 11px;
    font-weight: 700;
    color: #e4d8b0;
}
.mat-chip-sep {
    width: 1px;
    height: 14px;
    background: #2e2a20;
    margin: 0 2px;
}

.pill {
    display: flex;
    align-items: center;
    padding: 3px 16px 3px 3px;
    background: linear-gradient(180deg, #1a1813 0%, #0a0906 100%);
    border: 1px solid #2e2a20;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #e4d8b0;
    font-variant-numeric: tabular-nums;
    min-width: 80px;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.pill-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
}
.pill-badge svg { width: 14px; height: 14px; }
.pill-gold {
    background: radial-gradient(circle at 35% 30%, #ffda6b 0%, #c08820 60%, #6a4a18 100%);
    color: #3a2a10;
}
.pill-kill {
    background: radial-gradient(circle at 35% 30%, #b0aab0 0%, #5a565a 60%, #1a1a1c 100%);
    color: #1a1816;
}

#meta-stats {
    position: absolute;
    top: 52px;
    right: 14px;
    display: flex;
    gap: 10px;
    font-size: 10px;
    color: #7a7060;
    font-variant-numeric: tabular-nums;
    z-index: 30;
}
#meta-stats .fps-display {
    color: #4a4540;
}

/* --- Objective card (left edge, mid-ish) --- */
#objective-card {
    position: absolute;
    top: 90px;
    left: 12px;
    width: 240px;
    padding: 10px 12px;
    background: rgba(14, 14, 18, 0.78);
    border: 1px solid #2e2a20;
    border-left: 3px solid #c4a35a;
    border-radius: 6px;
    z-index: 30;
    backdrop-filter: blur(4px);
}
.obj-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #c4a35a;
    margin-bottom: 4px;
}
.obj-text {
    font-size: 12px;
    color: #e4d8b0;
    margin-bottom: 6px;
}
.obj-bar {
    width: 100%;
    height: 5px;
    background: rgba(40, 36, 28, 0.8);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}
.obj-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7a6a3a 0%, #c4a35a 100%);
    transition: width 0.3s;
    border-radius: 3px;
}
.obj-progress {
    font-size: 10px;
    color: #8a7a5a;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* --- Gold drop side log (left edge, above objective) --- */
#gold-log {
    position: absolute;
    top: 230px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 29;
    pointer-events: none;
    max-height: 220px;
    overflow: hidden;
    min-width: 220px;
}
.gold-log-entry {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: rgba(14, 14, 18, 0.7);
    border: 1px solid #2e2a20;
    border-left: 2px solid #d4a017;
    border-radius: 4px;
    font-size: 11px;
    color: #e4d8b0;
    font-variant-numeric: tabular-nums;
    animation: gold-log-fade 3s forwards;
    backdrop-filter: blur(2px);
}
.gold-log-entry::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffd700, #b8860b);
    border: 1px solid #8b6914;
    flex-shrink: 0;
}

/* Loot rows: silver bullet + slightly wider so the rarity chip fits. */
.gold-log-entry.log-loot {
    border-left-color: #c4a35a;
}
.gold-log-entry.log-loot::before {
    background: radial-gradient(circle at 35% 30%, #e0e0e0, #6a6a6a);
    border-color: #4a4a4a;
}

/* Shard rows: cyan-violet bullet to read as "magical drop". */
.gold-log-entry.log-shard {
    border-left-color: #8a7ab0;
}
.gold-log-entry.log-shard::before {
    background: radial-gradient(circle at 35% 30%, #d0c4ff, #5040a0);
    border-color: #3a2a80;
}

/* Auto-actioned drops: dimmer + suffix tag. */
.gold-log-entry.log-sold       { border-left-color: #d4a017; }
.gold-log-entry.log-dismantled { border-left-color: #a335ee; }
.gold-log-entry.log-sold::before {
    background: radial-gradient(circle at 35% 30%, #ffd700, #b8860b);
    border-color: #8b6914;
}
.gold-log-entry.log-dismantled::before {
    background: radial-gradient(circle at 35% 30%, #c77dff, #7a2ab8);
    border-color: #5a1a90;
}
.gold-log-entry .log-auto {
    color: #8a7a5a;
    font-style: italic;
    font-size: 9px;
    margin-left: 2px;
}
@keyframes gold-log-fade {
    0%   { opacity: 0; transform: translateX(-8px); }
    10%  { opacity: 1; transform: translateX(0); }
    80%  { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(-8px); }
}

/* --- Auto-Action Row (right column, above the AUTO/speed/ECO row) --- */
#auto-action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
}

.auto-seg {
    display: flex;
    background: rgba(0,0,0,0.35);
    border: 1px solid #2e2a20;
    border-radius: 8px;
    overflow: hidden;
}
.auto-seg-btn {
    background: transparent;
    border: none;
    color: #7a7060;
    padding: 5px 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.auto-seg-btn:hover { color: #c4a35a; background: rgba(196,163,90,0.05); }
.auto-seg-btn.active {
    color: #ffe8a8;
    background: rgba(196,163,90,0.18);
    box-shadow: inset 0 -2px 0 #c4a35a;
}
.auto-seg-btn[data-action="sell"].active     { box-shadow: inset 0 -2px 0 #d4a017; }
.auto-seg-btn[data-action="dismantle"].active { box-shadow: inset 0 -2px 0 #b06ad0; }

.auto-rarity-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s;
}
.auto-rarity-wrap.dim { opacity: 0.35; pointer-events: none; }
.auto-rarity-label {
    font-size: 10px;
    color: #7a7060;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.auto-rarity-select {
    background: rgba(0,0,0,0.5);
    border: 1px solid #4a4030;
    border-radius: 6px;
    color: #e4d8b0;
    padding: 4px 26px 4px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23c4a35a' stroke-width='2'><path d='M3 5l3 3 3-3'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px 12px;
}
.auto-rarity-select:hover { border-color: #7a6a3a; }
.auto-rarity-select:focus { outline: none; border-color: #c4a35a; }
.auto-rarity-select option { background: #14120e; color: #e4d8b0; }

/* --- HUD Bar (bottom-center: floating skill tray, sits above the nav) --- */
#hud-bar {
    position: absolute;
    bottom: 130px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(14, 14, 18, 0.76);
    border: 1px solid #2e2a20;
    border-radius: 12px;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 18px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.03);
    z-index: 30;
}

/* Right column inside the skill bar: auto-action row on top, AUTO/speed/ECO on bottom. */
.hud-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
}
.hud-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- Buff Bar (top right) --- */
.buff-bar {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 5px;
    z-index: 30;
}

.buff-icon {
    width: 26px;
    height: 26px;
    border: 2px solid #5a4a2a;
    border-radius: 3px;
    background: rgba(10,10,14,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    position: relative;
    overflow: hidden;
}

.buff-timer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    pointer-events: none;
}

/* --- HP Bar (inside hero panel) --- */
.hp-bar {
    position: relative;
    width: 100%;
    height: 14px;
    background: rgba(60, 18, 18, 0.7);
    border: 1px solid #4a2424;
    border-radius: 7px;
    overflow: hidden;
}
.hp-fill {
    height: 100%;
    background: linear-gradient(180deg, #d04030 0%, #8b1a1a 100%);
    transition: width 0.25s ease;
    border-radius: 6px;
    box-shadow: 0 0 6px rgba(208,64,48,0.35);
}
.hp-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #ffe8d8;
    letter-spacing: 0.3px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}

/* --- Skill Bar --- */
.skill-bar {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    /* Tray sizes to fit the regular skills (54px) — the ultimate (78px)
       overflows upward instead of inflating the tray. */
    height: 54px;
}

.skill-btn {
    width: 54px;
    height: 54px;
    border: none;
    background: linear-gradient(135deg, #3a3024 0%, #7a6a3a 55%, #3a3024 100%);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    color: #c4a35a;
    font-family: 'Cinzel', serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, filter 0.15s;
}

.skill-btn::before {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px;
    background: linear-gradient(180deg, #1a1813 0%, #08070c 100%);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    z-index: 0;
}
.skill-btn > * { position: relative; z-index: 1; }

/* Skill icon — absolutely centered so it doesn't share row space with the
   text node / cooldown overlay / key badge. SVG used as a CSS mask so the
   visible color is just the background-color of the element. */
.skill-btn .skill-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    pointer-events: none;
    background-color: #e4d8b0;
    -webkit-mask: var(--icon) center/contain no-repeat;
            mask: var(--icon) center/contain no-repeat;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7));
    z-index: 1;
}
#skill-r .skill-icon {
    width: 44px;
    height: 44px;
    background-color: #ffe2a8;
    filter: drop-shadow(0 0 4px rgba(208,64,48,0.7))
            drop-shadow(0 1px 3px rgba(0,0,0,0.8));
}

/* Skill slot wrapper: holds the diamond button + an external hotkey label. */
.skill-slot {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Hotkey label sits below + slightly to the right of the button, OUTSIDE
   the diamond clip-path. Hidden on touch / small screens. */
.skill-hotkey {
    position: absolute;
    /* Top of badge anchored to the bottom edge of the slot (where the
       diamond's lower point is), with a small upward overlap so the badge
       hugs the button instead of floating below it. */
    top: 100%;
    right: -4px;
    margin-top: -8px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #c4a35a;
    text-shadow: 0 1px 2px #000;
    pointer-events: none;
    background: rgba(14, 14, 18, 0.92);
    border: 1px solid #4a4030;
    border-radius: 5px;
    padding: 3px 8px;
    line-height: 1;
    min-width: 16px;
    text-align: center;
}
#skill-r + .skill-hotkey {
    color: #ffe8a8;
    font-size: 16px;
    padding: 4px 11px;
    border-color: #7a4040;
    background: rgba(28, 14, 14, 0.92);
    margin-top: -10px;
    right: -6px;
}

@media (hover: none), (max-width: 720px) {
    .skill-hotkey { display: none; }
}

/* When an icon is present, hide the original letter text node by clipping. */
.skill-btn.has-icon { font-size: 0; }

.skill-btn:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 10px rgba(196,163,90,0.4));
    color: #e4d8b0;
}

.skill-btn.on-cooldown {
    color: #555040;
    filter: saturate(0.3) brightness(0.7);
}

/* R = ultimate. Bigger, glowing — bottom edge aligns with other skills,
   top extends above the tray naturally because it's the tallest item and
   .skill-bar uses align-items: flex-end. */
#skill-r {
    width: 78px;
    height: 78px;
    font-size: 19px;
    margin: 0 4px;
    background: linear-gradient(135deg, #5a3030 0%, #d04040 55%, #5a3030 100%);
    color: #ffe8a8;
    filter: drop-shadow(0 0 12px rgba(208,64,48,0.45));
}
#skill-r:hover {
    transform: translateY(-3px);
    filter: drop-shadow(0 0 18px rgba(208,64,48,0.7));
    color: #fff;
}
#skill-r::before {
    background: radial-gradient(circle at 50% 35%, #2a1a14 0%, #0a0604 80%);
    top: 5px; left: 5px; right: 5px; bottom: 5px;
}
/* Allow the ultimate to escape the tray — overflow visible everywhere up the chain */
#hud-bar, .skill-bar { overflow: visible; }

.skill-cd-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: #887860;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: height 0.1s;
    z-index: 2;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.auto-cast-btn {
    min-width: 40px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid #3a3428;
    border-radius: 8px;
    background: rgba(18, 16, 12, 0.9);
    color: #7a7060;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auto-cast-btn:hover {
    border-color: #7a6a3a;
    color: #c4a35a;
    transform: translateY(-1px);
}

.auto-cast-btn.active {
    border-color: #7a6a3a;
    color: #e4d8b0;
    background: rgba(196, 163, 90, 0.14);
    box-shadow: 0 0 10px rgba(196,163,90,0.2);
}

.auto-cast-btn.adv-btn.active {
    border-color: #3a7a3a;
    color: #a8f0a8;
    background: rgba(60, 180, 60, 0.18);
    box-shadow: 0 0 10px rgba(80, 200, 80, 0.28);
}
.auto-cast-btn.adv-btn.active:hover {
    border-color: #5aaa5a;
    color: #d8ffd8;
}

.speed-btn {
    min-width: 34px;
    padding: 0 8px;
    margin-left: 0;
}

/* Vertical divider to group the skill slots from the control buttons */
.skill-bar-sep {
    width: 1px;
    height: 28px;
    background: #2a2520;
    margin: 0 4px;
    flex-shrink: 0;
}

/* (info-area rules removed — meta-stats + currency-pills replaced them) */

/* --- Bottom Nav Bar: diamond tiles with label plates, centered --- */
#nav-bar {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    z-index: 30;
}

.nav-btn {
    width: 80px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border: none;
    background: transparent;
    color: #8a7a5a;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.1s;
}

/* Diamond tile: outer rotated square as a gold-accent frame, inner square
   holding the icon. clip-path gives us the rotated-square shape without
   rotating the icon inside. */
.nav-tile {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3a3024 0%, #7a6a3a 55%, #3a3024 100%);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    position: relative;
}
.nav-tile-inner {
    width: 62px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #14121a 0%, #08070c 100%);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    color: #c4a35a;
    transition: color 0.15s, background 0.15s;
}
.nav-svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7));
}

/* Just text under the tile — no plate, no border */
.nav-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #8a7a5a;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    padding: 0;
    background: none;
    border: none;
}

/* Zigzag rhythm: every second tile lifted so the row reads as a wave */
.nav-btn:nth-child(even) { transform: translateY(-22px); }

.nav-btn:hover                    { transform: translateY(-4px); }
.nav-btn:nth-child(even):hover    { transform: translateY(-26px); }
.nav-btn:hover .nav-tile { background: linear-gradient(135deg, #5a4a2a 0%, #c4a35a 55%, #5a4a2a 100%); }
.nav-btn:hover .nav-tile-inner { color: #e4d8b0; background: linear-gradient(180deg, #1e1b27 0%, #0c0b14 100%); }
.nav-btn:hover .nav-label { color: #e4d8b0; }

.nav-btn.active .nav-tile {
    background: linear-gradient(135deg, #8a7430 0%, #ffd270 55%, #8a7430 100%);
    filter: drop-shadow(0 0 6px rgba(255, 200, 80, 0.45));
}
.nav-btn.active .nav-tile-inner {
    color: #ffe8a8;
    background: linear-gradient(180deg, #26201a 0%, #12100a 100%);
}
.nav-btn.active .nav-label {
    color: #ffe8a8;
    text-shadow: 0 0 6px rgba(196,163,90,0.6), 0 1px 2px rgba(0,0,0,0.8);
}

/* --- Stage Cleared Banner --- */
#stage-cleared {
    display: none;
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cinzel', serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #c4a35a;
    padding: 14px 32px;
    background: linear-gradient(180deg, rgba(30,26,18,0.95), rgba(20,18,12,0.95));
    border: 2px solid #5a4a2a;
    border-radius: 3px;
    box-shadow: 0 0 30px rgba(196,163,90,0.15), inset 0 1px 0 rgba(196,163,90,0.1);
    z-index: 40;
    animation: banner-pop 0.3s ease-out;
}

@keyframes banner-pop {
    from { transform: translateX(-50%) scale(0.8); opacity: 0; }
    to   { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* --- Death Screen --- */
#death-screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(80,0,0,0.3), rgba(20,0,0,0.5));
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 5;
    pointer-events: none;
}

#death-screen h2 {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    font-weight: 700;
    color: #cc2222;
    text-shadow: 0 0 40px rgba(200, 0, 0, 0.4), 0 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 8px;
    text-transform: uppercase;
    pointer-events: none;
}

#respawn-timer {
    font-size: 1.1rem;
    color: #8a7060;
    margin-top: 12px;
    pointer-events: none;
}

/* --- Mob Nameplates (2D projected) --- */
#mob-nameplates {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 12;
}

.mob-nameplate {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -100%);
    pointer-events: none;
}

.mob-np-name {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.6);
    white-space: nowrap;
    margin-bottom: 3px;
}

.mob-np-bar {
    width: 70px;
    height: 6px;
    background: rgba(0,0,0,0.6);
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
}

.mob-np-fill {
    height: 100%;
    background: #c0392b;
    border-radius: 2px;
    transition: width 0.15s;
}

.mob-np-debuffs {
    display: flex;
    gap: 2px;
    justify-content: center;
    margin-top: 1px;
}

.mob-np-debuff {
    font-size: 10px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    color: #c8b0d8;
}

.mob-np-buff {
    font-size: 10px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    color: #e4d8b0;
}

/* --- Boss Health Bar (fixed HUD) --- */
#boss-bar {
    display: none;
    position: absolute;
    top: 64px;                 /* clear of the stage banner */
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 620px;
    z-index: 35;
    text-align: center;
    pointer-events: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.55));
}

#boss-bar.active {
    display: flex;
    animation: boss-bar-in 0.5s ease-out;
}

@keyframes boss-bar-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.boss-crown {
    width: 60px;
    height: 18px;
    margin-bottom: -2px;
}

.boss-bar-name {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 700;
    color: #e8c0c0;
    text-shadow: 0 0 18px rgba(200,30,30,0.55), 0 2px 4px rgba(0,0,0,0.9);
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* Track + caps lined up on the same row. */
.boss-bar-rail {
    display: flex;
    align-items: center;
    width: 100%;
}
.boss-cap     { width: 26px; height: 26px; flex-shrink: 0; }
.boss-cap-l   { margin-right: -4px; }
.boss-cap-r   { margin-left: -4px; }

.boss-bar-track {
    flex: 1;
    position: relative;
    height: 16px;
    background: linear-gradient(180deg, #15080a 0%, #220c0c 100%);
    border-top: 1px solid #5a2828;
    border-bottom: 1px solid #5a2828;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.6), inset 0 2px 6px rgba(0,0,0,0.7);
}

.boss-bar-fill {
    height: 100%;
    background: linear-gradient(180deg, #d04040 0%, #8b1a1a 50%, #a82828 100%);
    transition: width 0.2s;
    box-shadow: 0 0 12px rgba(220,60,60,0.45);
}

.boss-bar-hp {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #ffe0e0;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 4px rgba(0,0,0,0.7);
    font-variant-numeric: tabular-nums;
}

.boss-bar-timer {
    margin-top: 2px;
    margin-bottom: 2px;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #e8c878;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.6);
    transition: color 0.2s;
}
.boss-bar-timer.urgent {
    color: #ff6060;
    text-shadow: 0 0 6px rgba(255,60,60,0.6), 0 1px 2px rgba(0,0,0,0.9);
    animation: boss-timer-pulse 0.9s ease-in-out infinite;
}
@keyframes boss-timer-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.65; }
}

.boss-bar-debuffs {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    min-height: 16px;
}

.boss-bar-debuffs .bd-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    background: rgba(12, 10, 8, 0.7);
    font-size: 12px;
}

.boss-bar-debuffs .bd-icon.debuff {
    border: 1px solid #5a3a6a;
    color: #c8b0d8;
}

.boss-bar-debuffs .bd-icon.buff {
    border: 1px solid #7a6a3a;
    color: #e4d8b0;
}

/* --- Loot Toast Notifications --- */
.loot-toast {
    position: fixed;
    top: 16px;
    right: 16px;
    padding: 10px 18px;
    background: linear-gradient(180deg, #1a1714 0%, #121010 100%);
    border: 1px solid #4a4030;
    border-left: 3px solid #c4a35a;
    border-radius: 3px;
    font-size: 13px;
    color: #c8c0b0;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.loot-toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* --- Power Save mode --- */
#power-save-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    display: none;
    z-index: 400;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
body.power-save #power-save-overlay { display: flex; }
/* Hide everything behind the overlay so it's a true black screen. */
body.power-save #game-canvas,
body.power-save #hud-bar,
body.power-save #nav-bar,
body.power-save #mob-nameplates,
body.power-save #boss-bar,
body.power-save #damage-numbers,
body.power-save #status-panel,
body.power-save #hero-panel,
body.power-save #stage-banner,
body.power-save #currency-pills,
body.power-save #meta-stats,
body.power-save #objective-card,
body.power-save #gold-log,
body.power-save #auto-action-bar {
    display: none !important;
}

.power-save-card {
    background: rgba(14, 14, 18, 0.95);
    border: 1px solid #2a2418;
    border-left: 3px solid #c4a35a;
    padding: 28px 32px;
    border-radius: 4px;
    min-width: 320px;
    max-width: 420px;
    color: #c8c0b0;
}
.power-save-title {
    font-size: 20px;
    font-weight: 600;
    color: #e4d8b0;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.power-save-sub {
    font-size: 12px;
    color: #7a7060;
    margin-bottom: 20px;
}
.power-save-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
}
.power-save-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.power-save-label {
    width: 70px;
    color: #8a7a5a;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}
.power-save-value {
    margin-left: auto;
    color: #e4d8b0;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.power-save-hp {
    flex: 1;
    height: 8px;
    background: rgba(40, 18, 18, 0.8);
    border: 1px solid #5a2a2a;
    border-radius: 2px;
    overflow: hidden;
}
.power-save-hp-fill {
    height: 100%;
    background: linear-gradient(180deg, #cc3333 0%, #8b1a1a 100%);
    transition: width 0.2s;
    width: 100%;
}
.power-save-resume {
    width: 100%;
    padding: 10px;
    background: rgba(196, 163, 90, 0.15);
    border: 1px solid #7a6a3a;
    color: #c4a35a;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s;
}
.power-save-resume:hover {
    background: rgba(196, 163, 90, 0.3);
    color: #e4d8b0;
}

/* ECO button highlighted when active */
#power-save-btn.active {
    border-color: #6a9a4a;
    color: #9acc6a;
    background: rgba(130, 190, 100, 0.1);
}

/* --- Audio modal --- */
.audio-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #2a2418;
}
.audio-controls label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #c8c0b0;
    font-size: 13px;
    min-width: 80px;
}
.audio-controls input[type=range] {
    flex: 1;
    accent-color: #c4a35a;
}
#audio-credits {
    font-size: 12px;
    color: #9a8c7a;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* --- Status Panel (buffs + debuffs, upper-right center) --- */
#status-panel {
    position: absolute;
    top: 82px;
    right: 12px;
    width: 270px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 31;
    pointer-events: none;
    font-family: inherit;
}

.status-section {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    background: rgba(12, 10, 8, 0.82);
    border: 1px solid #3a3428;
    border-radius: 3px;
    font-size: 11px;
    color: #c8c0b0;
    position: relative;
    overflow: hidden;
}

.status-row.buff {
    border-left: 3px solid #c4a35a;
}

.status-row.debuff {
    border-left: 3px solid #7a4a8a;
}

.status-row .status-icon {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.status-row .status-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.status-row .status-name {
    font-weight: 600;
    color: #e4d8b0;
    font-size: 11px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-row .status-desc {
    color: #8a8070;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-row .status-meta {
    flex-shrink: 0;
    font-size: 10px;
    color: #a0907a;
    font-variant-numeric: tabular-nums;
}

.status-row .status-fill {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    background: #c4a35a;
    opacity: 0.7;
    transition: width 0.1s linear;
}

.status-row.debuff .status-fill {
    background: #9a6ab0;
}
