/* ============================================================
   EMBERLORN — Main Styles
   ============================================================ */

:root { --ui-zoom: 1; --ui-zoom-inv: 1; }
* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; -webkit-user-select: none; }
html { overflow: hidden; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body { background: #000; overflow: hidden; cursor: default; }
/* Esconde scrollbar nativa em TODOS os overlays fixos do jogo */
#shop-screen, #transmute-screen, #healer-screen, #book-screen, #altar-screen,
#chest-gacha-screen, #loot-compare-screen {
    scrollbar-width: none;
}
#shop-screen::-webkit-scrollbar, #transmute-screen::-webkit-scrollbar,
#healer-screen::-webkit-scrollbar, #book-screen::-webkit-scrollbar,
#altar-screen::-webkit-scrollbar, #chest-gacha-screen::-webkit-scrollbar,
#loot-compare-screen::-webkit-scrollbar { display: none; }


/* UI Scale — aplica zoom no body, contra-escala canvas, screen-fade e html-labels */
body { zoom: var(--ui-zoom); }
#canvas-wrapper { zoom: var(--ui-zoom-inv); }
#screen-fade { zoom: var(--ui-zoom-inv); }
#html-labels { zoom: var(--ui-zoom-inv); }
body.gp-active, body.gp-active * { cursor: none !important; }
/* kb-nav: keyboard navigating — suppresses hover like gp-active but keeps cursor visible */

/* --- Splash & Studio Screens --- */
#splash-screen {
    position: fixed; inset: 0; z-index: 9999;
    background: #000; display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
#splash-hint {
    color: #333; font-family: 'Almendra', serif; font-size: 20px;
    letter-spacing: 3px; text-transform: uppercase;
    animation: splash-pulse 2s ease-in-out infinite;
}
#splash-version {
    position: fixed; bottom: 12px; right: 60px;
    color: #222; font-family: 'Segoe UI', sans-serif; font-size: 10px;
    letter-spacing: 1px;
}
@keyframes splash-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}
#studio-screen {
    position: fixed; inset: 0; z-index: 9998;
    background: #000; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
#studio-loader {
    display: flex; flex-direction: column; align-items: center; gap: 0;
}
#studio-loader-bar {
    width: 340px; height: 18px; background: #0a0a0a; border-radius: 9px; overflow: hidden;
    border: 1px solid #1a1a2e; box-shadow: 0 0 8px rgba(0,0,0,0.5);
}
@keyframes loader-glow {
    from { box-shadow: 0 0 6px rgba(155,77,255,0.4), 0 0 12px rgba(155,77,255,0.2); }
    to { box-shadow: 0 0 10px rgba(155,77,255,0.8), 0 0 20px rgba(155,77,255,0.4), 0 0 30px rgba(192,132,252,0.2); }
}
#studio-loader-tip {
    color: #444; font-family: 'Segoe UI', sans-serif; font-size: 16px;
    font-style: italic; margin-top: 20px; max-width: 460px; text-align: center;
    min-height: 16px;
    animation: tip-fade 0.5s ease-out;
}
@keyframes tip-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
#studio-loader-progress {
    color: #665c78; font-family: 'Almendra', serif; font-size: 13px;
    letter-spacing: 2px; margin-top: 8px;
}
#studio-logo { text-align: center; }
#studio-cat {
    width: 280px; max-height: calc(40vh * var(--ui-zoom-inv, 1)); height: auto; object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(180, 140, 255, 0.4));
    animation: studio-fade-in 0.8s ease-out;
    margin-bottom: 8px;
}
#studio-name {
    color: #c8b8e0; font-family: 'Almendra', serif; font-size: 22px;
    letter-spacing: 6px; text-transform: uppercase; margin-bottom: 24px;
    text-shadow: 0 0 18px rgba(180, 140, 255, 0.35);
    animation: studio-fade-in 0.6s ease-out 0.2s both;
}
#studio-skip {
    color: #665c78; font-family: 'Almendra', serif; font-size: 14px;
    letter-spacing: 2px; margin-top: 16px;
    animation: splash-pulse 2s ease-in-out infinite;
}
#studio-early {
    color: #554a66; font-family: 'Inter', 'Segoe UI', sans-serif; font-size: 11px;
    letter-spacing: 2px; margin-top: 8px;
}
@keyframes studio-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Auto-hide cursor after idle */
body.cursor-hidden, body.cursor-hidden * { cursor: none !important; }

/* 3D Perspective container */
#canvas-wrapper {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    perspective: 1000px;
    perspective-origin: 50% 50%;
    overflow: hidden;
}
canvas {
    display: block;
    transform-origin: center center;
    image-rendering: pixelated;
    /* transform is set dynamically by camera.js (rotateX + fill scale) */
}

/* ============================================================
   HUD — Party Frames + Combat Info
   ============================================================ */
#ui-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; display: none;
    font-family: 'Inter', 'Segoe UI', sans-serif; color: #e0e0e0; z-index: 10;
}
/* --- Boss Bar (top center) --- */
#boss-bar {
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 480px; pointer-events: none; z-index: 15;
    text-align: center;
}
.boss-bar-track {
    position: relative; width: 100%; height: 32px;
    background: linear-gradient(180deg, #1a1020 0%, #0a0810 100%);
    overflow: hidden;
    border: 1px solid #c0392b50;
    border-radius: 2px;
    box-shadow: 0 0 24px rgba(0,0,0,0.8), inset 0 2px 8px rgba(0,0,0,0.9),
                0 0 50px rgba(231,76,60,0.12);
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
}
.boss-bar-trail {
    position: absolute; top: 0; left: 0; height: 100%; width: 100%;
    background: linear-gradient(180deg, #ffcc66 0%, #e6a030 40%, #cc7722 100%);
    transition: width 0.6s ease-out;
    opacity: 0.7;
}
.boss-bar-fill {
    position: relative; height: 100%; width: 100%;
    background: linear-gradient(180deg, #ff6b4a 0%, #e74c3c 25%, #c0392b 55%, #8b1a1a 100%);
    transition: width 0.15s ease;
    box-shadow: 0 0 16px rgba(231,76,60,0.5);
}
.boss-bar-shine {
    position: absolute; top: 0; left: 0; width: 100%; height: 40%;
    background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, transparent 100%);
    pointer-events: none;
}
.boss-bar-glow {
    position: absolute; top: 0; width: 24px; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,200,100,0.2), transparent);
    pointer-events: none; transition: left 0.2s ease;
}
.boss-bar-name {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: #f5efe6;
    text-shadow: 0 0 10px rgba(0,0,0,1), 0 1px 3px rgba(0,0,0,0.95), 0 0 20px rgba(0,0,0,0.6);
    letter-spacing: 5px; text-transform: uppercase;
    font-family: 'Almendra', serif; z-index: 2;
    pointer-events: none;
}
.boss-bar-text {
    position: absolute; top: 0; right: 16px; height: 100%;
    display: flex; align-items: center;
    font-size: 10px; color: rgba(255,255,255,0.7); font-weight: 700;
    text-shadow: 0 1px 4px rgba(0,0,0,0.95);
    letter-spacing: 0.5px; font-family: 'Almendra', serif;
    transition: opacity 0.3s ease; z-index: 3;
    pointer-events: none;
}
/* Decorative diamond edges */
.boss-bar-edge {
    position: absolute; top: 13px; width: 7px; height: 7px;
    background: #c0392b; transform: rotate(45deg);
    box-shadow: 0 0 8px rgba(200,60,50,0.6);
}
.boss-bar-edge-l { left: -5px; }
.boss-bar-edge-r { right: -5px; }
/* Decorative wing lines */
.boss-bar-wing {
    position: absolute; top: 15px; height: 1px; width: 50px;
}
.boss-bar-wing-l {
    right: 100%; margin-right: 7px;
    background: linear-gradient(90deg, transparent, #c0392b60);
}
.boss-bar-wing-r {
    left: 100%; margin-left: 7px;
    background: linear-gradient(90deg, #c0392b60, transparent);
}

#menu-btn {
    position: fixed; top: 12px; right: 12px;
    width: 44px; height: 44px;
    background: rgba(15, 15, 30, 0.85); border: 1px solid #3a3a5a;
    border-radius: 8px; color: #bbb; font-size: 24px;
    cursor: pointer; pointer-events: all; z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    backdrop-filter: blur(4px);
}
#menu-btn:hover { background: rgba(30, 30, 50, 0.95); color: #e0e0e0; border-color: #e67e22; }

/* --- Menu Badge (red notification dot) --- */
.menu-badge {
    display: none;
    position: absolute; top: -2px; right: -2px;
    width: 10px; height: 10px;
    background: #e74c3c;
    border: 1.5px solid #0f0f1e;
    border-radius: 50%;
    z-index: 9001;
    animation: menu-badge-pulse 1.5s ease-in-out infinite;
}
.menu-badge.show { display: block; }
@keyframes menu-badge-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.7; }
}

/* --- Game Tips (contextual hints) --- */
#game-tip {
    position: fixed; bottom: 100px; right: 16px; z-index: 900;
    max-width: 260px; padding: 10px 14px; border-radius: 8px;
    background: linear-gradient(135deg, rgba(13,13,30,0.95), rgba(10,10,22,0.95));
    border: 1px solid rgba(255,255,255,0.08);
    font-family: 'Segoe UI', sans-serif;
    display: flex; align-items: center; gap: 10px;
    opacity: 0; transform: translateX(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
#game-tip.show { opacity: 1; transform: translateX(0); }
.gt-icon {
    width: 32px; height: 32px; flex-shrink: 0;
    image-rendering: pixelated; object-fit: contain;
}
.gt-body { min-width: 0; }
.gt-title {
    font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.gt-desc {
    font-size: 10px; color: #999; line-height: 1.4;
}

/* --- ESC Menu Hint (first waves) --- */
#menu-esc-hint {
    display: none;
    position: fixed; top: 12px; right: 64px;
    background: rgba(15, 15, 30, 0.85);
    border: 1px solid rgba(26, 188, 156, 0.4);
    border-radius: 6px;
    padding: 4px 10px;
    color: #1abc9c;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: 9000;
    animation: esc-hint-pulse 2s ease-in-out infinite;
    backdrop-filter: blur(4px);
    gap: 5px;
    align-items: center;
}
#menu-esc-hint.show { display: flex; }
#menu-esc-hint .esc-key {
    background: rgba(26, 188, 156, 0.15);
    border: 1px solid rgba(26, 188, 156, 0.5);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 11px;
}
#menu-esc-hint .esc-label {
    font-size: 11px;
    color: #8ecdc0;
}
@keyframes esc-hint-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* --- Party Frames (left column) --- */
/* Legacy party-frames (hidden — replaced by bottom-bar) */
#party-frames { display: none; }

/* ═══ BOTTOM BAR ═══ */
#bottom-bar {
    position: absolute; bottom: 0; left: 0; right: 0;
    display: flex; align-items: flex-end; justify-content: center;
    gap: 12px; padding: 6px 16px 8px;
    background: linear-gradient(to top, rgba(8,8,18,0.88) 0%, rgba(8,8,18,0.6) 70%, transparent 100%);
    pointer-events: all;
    transform: scale(1.3);
    transform-origin: bottom center;
}
.bb-section { display: flex; align-items: center; gap: 4px; }
.bb-potions { gap: 4px; }
.bb-center {
    display: flex; align-items: flex-end; gap: 8px;
    min-width: 200px;
}
.bb-portrait {
    position: relative; flex-shrink: 0;
    width: 48px; height: 48px;
    background: #1a1830; border-radius: 50%;
    overflow: visible;
    display: flex; align-items: center; justify-content: center;
}
.bb-portrait::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 62px; height: 62px;
    transform: translate(-50%, -50%);
    background: url('../assets/ui/portrait_frame.webp') center/contain no-repeat;
    pointer-events: none;
    z-index: 2;
    image-rendering: pixelated;
}
.portrait-xp-fill {
    position: absolute;
    inset: 0;
    clip-path: circle(23px at 50% 50%);
    z-index: 1;
    pointer-events: none;
    background: transparent;
    transition: background 0.5s ease-out;
    will-change: background;
}
.bb-portrait .char-icon,
.bb-portrait .char-portrait-img {
    position: relative; z-index: 1;
    border-radius: 50%; overflow: hidden;
    width: 40px; height: 40px;
}
.bb-portrait .char-icon { font-size: 22px; }
.bb-portrait .char-portrait-img {
    width: 100%; height: 100%; object-fit: cover;
    image-rendering: pixelated;
    transform: scale(var(--p-scale, 1.6));
    transform-origin: var(--p-ox, 46%) var(--p-oy, -12%);
}
.bb-bars { display: flex; flex-direction: column; gap: 2px; min-width: 160px; max-width: 200px; }
.bb-name-row {
    display: flex; align-items: center; gap: 6px;
    font-size: 10px; color: #ccc;
}
.bb-name { font-weight: 700; color: #e0e0e0; }
.bb-level {
    font-size: 9px; color: #f1c40f; background: rgba(241,196,15,0.15);
    padding: 0 4px; border-radius: 3px; font-weight: 600;
}
.bb-gold { font-size: 9px; color: #f1c40f; margin-left: auto; }
.bb-resources { display: flex; gap: 3px; }
.bb-res-bar { flex: 1; transition: flex 0.3s ease; }
.bb-abilities { gap: 5px; }
.bb-sep { width: 1px; height: 30px; background: linear-gradient(180deg, transparent, #3a3a5a, transparent); margin: 0 5px; }
.bb-auto-row { display: flex; gap: 5px; align-items: center; }
.dev-skip-wave-btn {
    width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
    font-size: 14px; cursor: pointer; border-radius: 5px; margin-left: 3px;
    background: rgba(231,76,60,0.2); border: 1px solid rgba(231,76,60,0.4);
    color: #e74c3c; opacity: 0.6; transition: opacity 0.15s, background 0.15s;
    user-select: none;
}
.dev-skip-wave-btn:hover { opacity: 1; background: rgba(231,76,60,0.35); }

/* Portrait circle */
.char-portrait {
    position: relative; flex-shrink: 0;
    width: 42px; height: 42px;
    background: #1a1830;
    border: 2px solid #3a3050;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.char-icon { font-size: 20px; overflow: hidden; border-radius: 50%; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.char-portrait-img {
    width: 100%; height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    transform: scale(var(--p-scale, 1.6));
    transform-origin: var(--p-ox, 46%) var(--p-oy, -12%);
}

/* Portrait tooltip (hover on portrait circle) */
.portrait-tooltip {
    display: none; position: absolute;
    bottom: 50px; left: 0;
    width: 220px; padding: 8px 10px;
    background: rgba(18,18,32,0.95);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px; z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
    pointer-events: none;
}
.bb-portrait:hover .portrait-tooltip { display: block; }
.pt-section { margin-bottom: 6px; }
.pt-section:last-child { margin-bottom: 0; }
.pt-label {
    font-size: 9px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; margin-bottom: 3px;
}
.pt-label-perk { color: #a0724a; }
.pt-label-passive { color: #cc3333; }
.pt-row {
    display: flex; align-items: flex-start; gap: 6px;
}
.pt-icon {
    width: 22px; height: 22px; border-radius: 4px;
    object-fit: contain; flex-shrink: 0;
}
.pt-info { flex: 1; }
.pt-name { font-size: 10px; font-weight: 600; color: #e0e0e0; }
.pt-desc { font-size: 9px; color: #888; margin-top: 1px; }
.pt-status {
    font-size: 9px; font-weight: 700; padding: 1px 4px;
    border-radius: 3px; margin-left: 4px;
}
.pt-active { background: rgba(46,204,113,0.2); color: #2ecc71; }
.pt-locked { background: rgba(142,68,173,0.15); color: #8e44ad; }

/* Lock icon (replaces 🔒 emoji everywhere) */
.lock-icon { width: 16px; height: 16px; vertical-align: middle; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.lock-icon-sm { width: 12px; height: 12px; }
.lock-icon-lg { width: 32px; height: 32px; }
.unlock-icon { filter: hue-rotate(100deg) brightness(1.2) drop-shadow(0 1px 2px rgba(0,0,0,0.5)); transform: rotate(-15deg); }

.char-level-badge {
    background: linear-gradient(135deg, #2a1a40, #1a1a2e);
    border: 1px solid #f1c40f;
    border-radius: 4px;
    padding: 0 5px;
    font-size: 10px; font-weight: bold; color: #f1c40f;
    line-height: 18px; white-space: nowrap;
    text-shadow: 0 0 4px rgba(241,196,15,0.4);
}
.pending-levelups { display: none !important; }
.bb-portrait.has-levelup {
    box-shadow: 0 0 10px 3px rgba(241,196,15,0.6);
    animation: levelup-glow 1.5s ease-in-out infinite;
}
@keyframes levelup-glow {
    0%, 100% { box-shadow: 0 0 8px 2px rgba(241,196,15,0.5); }
    50% { box-shadow: 0 0 16px 5px rgba(241,196,15,0.8); }
}
.bb-portrait.perk-heal-flash {
    animation: perk-heal-pulse 0.5s ease-out;
}
@keyframes perk-heal-pulse {
    0%   { box-shadow: 0 0 14px 6px rgba(50,255,100,0.9); filter: brightness(1.6); }
    40%  { box-shadow: 0 0 10px 3px rgba(50,255,100,0.5); filter: brightness(1.2); }
    100% { box-shadow: none; filter: brightness(1); }
}

/* Name + bars column */
.char-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 3px;
}
.char-name-row {
    display: flex; align-items: center; gap: 8px;
}
.char-name {
    font-size: 12px; font-weight: 600; color: #ddd;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    letter-spacing: 0.5px;
}
.char-gold {
    font-size: 11px; font-weight: 700; color: #f1c40f;
    white-space: nowrap; margin-left: auto;
}

.passive-indicator {
    font-size: 9px; color: #f1c40f; padding: 1px 6px;
    background: rgba(241,196,15,0.15); border-radius: 6px;
    white-space: nowrap; animation: passive-pulse 1.5s ease-in-out infinite;
    margin-bottom: 2px;
}
@keyframes passive-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Stat bars (HP / XP) */
.stat-bar {
    position: relative; width: 100%; height: 12px;
    background: #111120; border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}
.stat-bar-fill {
    height: 100%; width: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}
.stat-bar-text {
    position: absolute; inset: 0; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 600;
    text-shadow: 1px 1px 1px #000;
    letter-spacing: 0.3px;
    line-height: 1;
}
.stat-bar-text.bar-not-full {
    justify-content: flex-start; padding-left: 4px;
}

/* HP bar */
.hp-bar .stat-bar-fill {
    background: linear-gradient(90deg, #8b1a1a, #c0392b 30%, #e74c3c);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 0 4px rgba(231,76,60,0.3);
}
.hp-bar { height: 12px; }
.hp-bar.passive-active .stat-bar-fill {
    background: linear-gradient(90deg, #8b4a00, #e67e22 30%, #f39c12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 0 8px rgba(243,156,18,0.5);
    animation: hp-fury 1s ease-in-out infinite;
}
@keyframes hp-fury {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

/* HP ghost bar — shows previous HP, drains slowly after damage */
.stat-bar-ghost {
    position: absolute; top: 0; left: 0; height: 100%;
    background: rgba(200, 160, 60, 0.5);
    border-radius: 2px;
    pointer-events: none;
    transition: width 0.5s ease-out;
    z-index: 0;
}
.stat-bar-fill { position: relative; z-index: 1; }

/* HP heal flash — green pulse on heal */
.stat-bar-heal-flash {
    position: absolute; top: 0; left: 0; height: 100%;
    background: rgba(46, 204, 113, 0.5);
    border-radius: 2px;
    pointer-events: none;
    opacity: 0;
    z-index: 2;
}
.stat-bar-heal-flash.active {
    animation: heal-pulse 0.35s ease-out forwards;
}
@keyframes heal-pulse {
    0% { opacity: 0.7; }
    100% { opacity: 0; }
}

/* HP regen preview — lighter bar extending from current HP showing regen target */
.stat-bar-regen {
    position: absolute; top: 0; height: 100%;
    border-radius: 2px;
    background: rgba(231, 76, 60, 0.35);
    pointer-events: none;
    transition: width 0.5s ease, left 0.3s ease;
    display: none;
}
.stat-bar-regen.active { display: block; }

/* HP regen label — "+X.X/s" floating right of the bar text */
.hp-regen-label {
    position: absolute; right: 6px; top: 0; bottom: 0;
    display: none; align-items: center;
    font-size: 9px; font-weight: 700; color: #e74c3c;
    text-shadow: 0 0 4px rgba(231,76,60,0.6);
    pointer-events: none;
    animation: regen-pulse 2s ease-in-out infinite;
}
.hp-regen-label.active { display: flex; }

/* Resource regen labels (energia + essencia) */
.res-regen-label {
    position: absolute; right: 6px; top: 0; bottom: 0;
    display: none; align-items: center;
    font-size: 9px; font-weight: 600;
    color: #5dade2; text-shadow: 0 0 3px rgba(93,173,226,0.5);
    pointer-events: none;
    animation: regen-pulse 2s ease-in-out infinite;
}
.res-regen-label.active { display: flex; }
.res-regen-label.boosted { color: #2ecc71; text-shadow: 0 0 4px rgba(46,204,113,0.6); font-size: 9px; font-weight: 700; }
.energia-regen { background: rgba(241,196,15,0.3); }
.essencia-regen { background: rgba(155,89,182,0.3); }

@keyframes regen-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Armor/Shield bar (grey) */
.armor-bar .stat-bar-fill {
    background: linear-gradient(90deg, #4a4a5a, #7f8c8d 30%, #95a5a6);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 4px rgba(149,165,166,0.3);
}
.armor-bar { height: 10px; }
.armor-bar .stat-bar-text { font-size: 9px; color: #bdc3c7; }

/* XP bar — hidden (XP now shown in portrait fill) */
.xp-bar { display: none; }

/* Energia bar (orange) */
.energia-bar .stat-bar-fill {
    background: linear-gradient(90deg, #8b4513, #e67e22 30%, #f39c12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 0 4px rgba(230,126,34,0.3);
}
.energia-bar { height: 10px; }
.energia-bar .stat-bar-text { font-size: 9px; color: #f5cba7; }

/* Essencia bar (purple) */
.essencia-bar .stat-bar-fill {
    background: linear-gradient(90deg, #4a148c, #7b1fa2 30%, #ab47bc);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 4px rgba(156,39,176,0.3);
}
.essencia-bar { height: 10px; }
.essencia-bar .stat-bar-text { font-size: 9px; color: #ce93d8; }

/* Penalty indicator */
.penalty-icon {
    position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
    font-size: 9px; font-weight: bold; color: #e74c3c;
    animation: penaltyPulse 0.8s ease-in-out infinite;
}
@keyframes penaltyPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}


/* --- Status Effects (buffs/debuffs — right of frame) --- */
.status-effects {
    position: fixed; top: 10px; left: 10px;
    display: flex; flex-wrap: wrap; gap: 4px;
    max-width: 300px;
    pointer-events: all;
    z-index: 10;
}
/* When any overlay is open, elevate status icons above the backdrop so they remain visible */
body:has(#player-menu.show) .status-effects,
body:has(#shop-screen.show) .status-effects,
body:has(#transmute-screen.show) .status-effects,
body:has(#healer-screen.show) .status-effects,
body:has(#altar-screen.show) .status-effects,
body:has(#micro-bonus-screen.show) .status-effects {
    position: fixed; z-index: 10002;
}
.status-icon {
    width: 36px; height: 36px; border-radius: 6px; display: flex;
    align-items: center; justify-content: center;
    border: 1.5px solid rgba(255,255,255,0.15); position: relative;
    overflow: hidden; cursor: pointer;
}
.status-icon img {
    width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated;
}
.status-icon.debuff {
    background: rgba(231,76,60,0.25); border-color: rgba(231,76,60,0.4);
    animation: penaltyPulse 0.8s ease-in-out infinite;
}
.status-icon.buff {
    background: rgba(46,204,113,0.25); border-color: rgba(46,204,113,0.4);
}
.status-icon .status-timer {
    position: absolute; bottom: 0; right: 0; font-size: 9px;
    background: rgba(0,0,0,0.75); color: #fff; padding: 1px 3px; border-radius: 3px 0 0 0;
    line-height: 1; font-weight: 700;
}
.status-icon .status-emoji {
    font-size: 18px; line-height: 1;
}
/* Instinto (perk) boxes: marrom */
.perk-instinto { background: rgba(160,114,74,0.25) !important; border-color: rgba(160,114,74,0.5) !important; }
/* Passiva boxes: vermelho */
.perk-passiva { background: rgba(204,51,51,0.25) !important; border-color: rgba(204,51,51,0.5) !important; }
/* Legacy — keep for compatibility */
.perk-berserk { background: rgba(160,114,74,0.25) !important; border-color: rgba(160,114,74,0.5) !important; }
.perk-perfection { background: rgba(160,114,74,0.25) !important; border-color: rgba(160,114,74,0.5) !important; }
.perk-stacks .status-timer { font-size: 9px; font-weight: 700; color: #f1c40f; background: rgba(0,0,0,0.8); }
/* Cooldown overlay (dark sweep from top) */
.status-icon.on-cooldown img { filter: brightness(0.35) saturate(0.4); }
.status-icon.on-cooldown { border-color: rgba(180,40,40,0.5) !important; }
.status-cd-overlay {
    position: absolute; top: 0; left: 0; width: 100%;
    height: var(--cd-pct, 0%);
    background: rgba(120,20,20,0.55);
    pointer-events: none; z-index: 1;
    transition: height 0.15s linear;
}
.status-icon .status-countdown {
    position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
    font-size: 9px; font-weight: 700; color: #3fc; line-height: 1;
    background: rgba(0,0,0,0.8); padding: 1px 3px; border-radius: 0 0 3px 3px;
    text-shadow: 0 0 4px rgba(63,255,204,0.5);
}
.status-icon .status-countdown.urgent {
    color: #e74c3c; animation: countdownPulse 0.5s ease-in-out infinite;
    text-shadow: 0 0 6px rgba(231,76,60,0.7);
}
@keyframes countdownPulse {
    0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.7; transform: translateX(-50%) scale(1.15); }
}

/* --- Ability Bar (bottom center) --- */
/* --- Dash Charges --- */
.dash-row { display: flex; align-items: center; gap: 4px; margin-top: 1px; }
#dash-charges {
    display: flex; gap: 3px;
}
.dash-hint {
    font-size: 9px; font-weight: 600; color: #555; letter-spacing: 0.5px;
    background: rgba(10,10,20,0.8); padding: 1px 4px;
    border-radius: 3px; border: 1px solid rgba(60,60,90,0.3);
    white-space: nowrap;
}
.dash-pip {
    width: 18px; height: 4px; border-radius: 2px;
    background: #222; border: 1px solid #333;
    transition: background 0.2s, box-shadow 0.2s;
}
.dash-pip.ready {
    background: #2ecc71;
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.5);
}
.dash-pip.recharging {
    background: linear-gradient(90deg, var(--dash-color, #2ecc7180) var(--pct), #222 var(--pct));
}

/* Legacy ability-bar (structure replaced by bottom-bar sections) */
#ability-bar { display: none; }
.slot-group { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.slot-label { font-size: 9px; color: #555; text-transform: uppercase; letter-spacing: 1px; }
.slot-row { display: flex; gap: 5px; }
.slot-sep { width: 1px; height: 50px; background: #2a2a3a; margin: 0 6px; align-self: flex-end; }

.ability-slot {
    width: 38px; height: 38px; position: relative;
    background: linear-gradient(145deg, rgba(18,18,35,0.95), rgba(8,8,18,0.95));
    border: 1.5px solid rgba(60,60,90,0.5);
    border-radius: 8px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
    overflow: visible;
}
.ability-slot::before {
    content: ''; position: absolute; inset: 0; border-radius: 7px;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 50%);
    pointer-events: none; z-index: 0;
}

/* ── Active slots — warm glow, subtle pulse when ready ── */
.active-slot {
    border-color: rgba(230,160,60,0.45);
    box-shadow: 0 0 8px rgba(230,126,34,0.3), inset 0 0 8px rgba(230,126,34,0.08);
    animation: activeSlotPulse 2.5s ease-in-out infinite;
}
.active-slot.on-cd { animation: none; }
@keyframes activeSlotPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(230,126,34,0.25), inset 0 0 6px rgba(230,126,34,0.06); }
    50%      { box-shadow: 0 0 12px rgba(230,160,60,0.4), inset 0 0 10px rgba(230,126,34,0.12); }
}

/* ── Auto slots — cool blue/teal, subtle shimmer ── */
.auto-slot {
    border-color: rgba(80,140,180,0.35);
    box-shadow: 0 0 5px rgba(80,140,180,0.15), inset 0 0 6px rgba(80,140,180,0.06);
    animation: autoSlotShimmer 3s ease-in-out infinite;
}
.auto-slot.on-cd { animation: none; }
@keyframes autoSlotShimmer {
    0%, 100% { box-shadow: 0 0 4px rgba(80,140,180,0.12), inset 0 0 5px rgba(80,140,180,0.04); }
    50%      { box-shadow: 0 0 8px rgba(100,170,210,0.25), inset 0 0 8px rgba(80,140,180,0.1); }
}

/* ── Item slots ── */
.item-slot {
    cursor: pointer;
    border-color: rgba(60,60,90,0.4);
}

/* ── On cooldown — dim + colored border ── */
.ability-slot.on-cd {
    border-color: var(--cd-color, #e67e22);
    box-shadow: 0 0 8px var(--cd-glow, rgba(230,126,34,0.3));
    filter: brightness(0.7);
}

.slot-keybind {
    position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
    font-size: 9px; font-weight: 600; color: #777; letter-spacing: 0.5px;
    background: rgba(10,10,20,0.9); padding: 1px 4px;
    border-radius: 3px; border: 1px solid rgba(60,60,90,0.3);
    white-space: nowrap;
}
.slot-keybind-icon { width: 10px; height: 14px; vertical-align: middle; }
.slot-keybind.slot-kb-gp {
    width: 10px; height: 10px; padding: 0;
    border-radius: 50%; font-size: 6px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-sizing: border-box; letter-spacing: 0; line-height: 1;
}
.slot-icon {
    font-size: 18px; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
}
.slot-icon.empty { color: #333; font-size: 12px; filter: none; }
.slot-icon img {
    transition: filter 0.15s ease;
}
.item-icon-img { width: 26px; height: 26px; image-rendering: pixelated; display: block; }
.slot-cost {
    position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
    font-size: 4px; font-weight: 700; color: #ccc;
    white-space: nowrap; z-index: 2;
    text-shadow: 0 0 4px #000, 0 0 6px #000, 0 1px 2px #000;
    pointer-events: none;
    background: rgba(0,0,0,0.5); border-radius: 3px; padding: 0 2px;
    line-height: 1.2;
}
.slot-cost:empty { display: none; }
.slot-cost.unaffordable { color: #ff4444; }
.slot-charges {
    position: absolute; bottom: 1px; right: 1px;
    font-size: 9px; color: #fff; font-weight: 700; z-index: 1;
    background: rgba(0,0,0,0.7); border-radius: 3px; padding: 0 3px;
    line-height: 1.3;
    text-shadow: none;
}
.slot-restricted {
    position: absolute; top: -2px; right: -2px; z-index: 3;
    font-size: 10px; line-height: 1;
    background: rgba(180, 30, 30, 0.85);
    border-radius: 50%; width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.slot-cd {
    position: absolute; inset: 0;
    border-radius: 7px;
    pointer-events: none;
    z-index: 1;
    transition: background 0.1s ease;
}

/* ── Potion pulse glow (low resource warning) ── */
.item-slot.potion-pulse-red    { animation: potionPulseRed    1.2s ease-in-out infinite; }
.item-slot.potion-pulse-orange { animation: potionPulseOrange  1.2s ease-in-out infinite; }
.item-slot.potion-pulse-purple { animation: potionPulsePurple  1.2s ease-in-out infinite; }

@keyframes potionPulseRed {
    0%, 100% { box-shadow: 0 0 4px rgba(255,60,60,0.2); }
    50%      { box-shadow: 0 0 12px rgba(255,60,60,0.7), inset 0 0 6px rgba(255,60,60,0.15); }
}
@keyframes potionPulseOrange {
    0%, 100% { box-shadow: 0 0 4px rgba(255,160,50,0.2); }
    50%      { box-shadow: 0 0 12px rgba(255,160,50,0.7), inset 0 0 6px rgba(255,160,50,0.15); }
}
@keyframes potionPulsePurple {
    0%, 100% { box-shadow: 0 0 4px rgba(180,80,255,0.2); }
    50%      { box-shadow: 0 0 12px rgba(180,80,255,0.7), inset 0 0 6px rgba(180,80,255,0.15); }
}

/* ── Equip hint (after equipment/trophy purchase) ── */
#equip-hint {
    display: none;
    position: fixed; top: 14px; right: 64px; transform: translateX(8px);
    background: rgba(12, 10, 24, 0.9);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 8px;
    padding: 6px 14px;
    color: #e0e0e0;
    font-size: 13px;
    z-index: 300;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    backdrop-filter: blur(6px);
    gap: 8px;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
#equip-hint.show { display: flex; }
#equip-hint.visible { opacity: 1; transform: translateX(0); }
#equip-hint-icon {
    width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated;
}
#equip-hint-name {
    font-weight: 700; color: #2ecc71; font-family: 'Almendra', serif;
    font-size: 13px;
}
#equip-hint-label {
    font-size: 10px; color: #666;
}

/* --- Hub Wave Bar (top center, only in hub) --- */
/* NOTE: body already has zoom: var(--ui-zoom), so do NOT multiply sizes here (double-scaling) */
#hub-wave-bar {
    position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 8px;
    background: rgba(10,10,20,0.55); padding: 8px 18px;
    border-radius: 20px; border: 1px solid rgba(26,26,46,0.5); z-index: 50;
    pointer-events: none;
}
#hub-wave-bar .hwb-dots { display: flex; gap: 4px; align-items: center; }
#hub-wave-bar .hwb-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #333; border: 1px solid #444;
}
#hub-wave-bar .hwb-dot.done { background: #4caf50; border-color: #66bb6a; }
#hub-wave-bar .hwb-dot.current { background: #f0c040; border-color: #f5d060; box-shadow: 0 0 6px rgba(240,192,64,0.6); animation: hwbPulse 1.5s ease-in-out infinite; }
#hub-wave-bar .hwb-dot.boss {
    width: 28px; height: 28px; border-radius: 3px;
    border: 1px solid #555; background-size: contain; background-position: center;
    background-repeat: no-repeat; image-rendering: pixelated;
}
#hub-wave-bar .hwb-dot.boss.done { border-color: #e74c3c; box-shadow: 0 0 4px rgba(231,76,60,0.3); }
#hub-wave-bar .hwb-dot.boss.current { border-color: #f0c040; box-shadow: 0 0 6px rgba(240,192,64,0.5); }
@keyframes hwbPulse { 0%, 100% { box-shadow: 0 0 4px rgba(240,192,64,0.4); } 50% { box-shadow: 0 0 10px rgba(240,192,64,0.8); } }

/* --- Combat Info (top right, out of boss-bar way) --- */
#combat-info {
    position: absolute; top: 8px; right: 64px;
    display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
#wave-display {
    font-size: 13px; font-weight: 800; color: #f1c40f;
    letter-spacing: 3px; text-transform: uppercase;
    text-shadow: 0 0 10px rgba(241,196,15,0.4), 0 1px 3px rgba(0,0,0,0.8);
    font-family: 'Segoe UI', sans-serif;
}
#timer {
    font-size: 22px; font-weight: 700; color: #ddd;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    font-family: 'Segoe UI', sans-serif;
    transition: color 0.3s, text-shadow 0.3s;
}
#timer.timer-warning {
    color: #e74c3c;
    text-shadow: 0 0 12px rgba(231,76,60,0.6), 0 0 30px rgba(231,76,60,0.3);
    animation: timer-pulse 1s ease-in-out infinite;
}
@keyframes timer-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}
#combat-stats {
    display: flex; gap: 12px; margin-top: 2px;
}
#gold-display { font-size: 13px; font-weight: bold; color: #f1c40f; }
#kill-count { font-size: 13px; color: #e74c3c; }

/* Level Up Screen */
/* Rarity colors (shared across systems) */
.rarity-common { color: #95a5a6; }
.rarity-uncommon { color: #2ecc71; }
.rarity-rare { color: #3498db; }
.rarity-epic { color: #9b59b6; }

/* ── Micro Bonus Screen (Level Up) ── */
#micro-bonus-screen {
    display: none; position: fixed; inset: 0;
    background: rgba(5, 5, 8, 0.92);
    z-index: 100; pointer-events: all;
    align-items: center; justify-content: center; flex-direction: column;
    font-family: 'Segoe UI', sans-serif; color: #e0e0e0;
}
#micro-bonus-screen.show { display: flex; cursor: default; }

#mb-title {
    font-size: 28px; font-weight: 700; color: #f1c40f; font-family: 'Almendra', serif;
    letter-spacing: 3px; margin-bottom: 6px;
    text-shadow: 0 0 16px rgba(241,196,15,0.4);
}
#mb-subtitle { font-size: 13px; color: #666; margin-bottom: 28px; }

#mb-choices {
    display: flex; gap: 16px; justify-content: center; flex-wrap: nowrap;
    align-items: stretch;
}
#mb-reroll-container {
    display: flex; justify-content: center; margin-top: 14px;
}

.mb-card {
    width: 180px; padding: 20px 16px;
    background: linear-gradient(180deg, #1a1020 0%, #0d0d1a 100%);
    border: 2px solid #333; border-radius: 12px;
    cursor: pointer; transition: all 0.25s;
    text-align: center; display: flex; flex-direction: column; align-items: center;
    pointer-events: all; position: relative;
}
/* Invisible hover zone below card — prevents jitter from translateY(-4px) on hover */
.mb-card::after {
    content: ''; position: absolute; bottom: -8px; left: 0; right: 0; height: 8px;
}
.mb-card:hover {
    border-color: #f1c40f; transform: translateY(-4px);
    background: linear-gradient(180deg, #221530 0%, #121225 100%);
}
body.gp-active .mb-card:hover, body.kb-nav .mb-card:hover { border-color: inherit; transform: none; background: inherit; }

.mb-card.gp-focus,
body.gp-active .mb-card.gp-focus:hover,
body.kb-nav .mb-card.gp-focus:hover {
    border-color: #f1c40f; transform: translateY(-4px);
    background: linear-gradient(180deg, #221530 0%, #121225 100%);
    box-shadow: 0 0 16px rgba(241,196,15,0.3);
}

.mb-card-epic {
    border-color: #9b59b6;
    box-shadow: 0 0 30px rgba(155,89,182,0.4);
    animation: epicPulse 1.5s ease-in-out infinite alternate;
}
.mb-card-epic:hover { border-color: #c39bd3; }
body.gp-active .mb-card-epic:hover, body.kb-nav .mb-card-epic:hover { border-color: inherit; }
@keyframes epicPulse {
    from { box-shadow: 0 0 20px rgba(155,89,182,0.3); }
    to   { box-shadow: 0 0 40px rgba(155,89,182,0.7); }
}

.mb-rarity   { font-size: 11px; font-weight: 600; margin-bottom: 8px; letter-spacing: 1px; }
.mb-icon     { font-size: 36px; margin-bottom: 10px; }
.mb-name     { font-size: 16px; font-weight: 700; color: #e0e0e0; margin-bottom: 4px; font-family: 'Almendra', serif; }
.mb-desc     { font-size: 11px; color: #888; line-height: 1.4; margin-bottom: 10px; }
.mb-value {
    font-size: 20px; font-weight: 700; color: #f1c40f;
    background: rgba(241,196,15,0.1); padding: 4px 14px; border-radius: 6px;
    margin-top: auto; line-height: 1.5;
}
.mb-total    { font-size: 10px; color: #555; margin-top: 6px; }


@keyframes slotUnlockGlow {
    from { box-shadow: 0 0 8px rgba(46,204,113,0.2); }
    to   { box-shadow: 0 0 20px rgba(46,204,113,0.5); }
}

/* ── Reroll Button ── */
.mb-reroll-btn {
    text-align: center;
    padding: 8px 20px; border-radius: 8px; cursor: pointer;
    background: rgba(241,196,15,0.1); border: 2px solid rgba(241,196,15,0.3);
    color: #f1c40f; font-size: 13px; font-weight: 600;
    transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.mb-reroll-btn:hover { background: rgba(241,196,15,0.2); border-color: #f1c40f; }
body.gp-active .mb-reroll-btn:hover, body.kb-nav .mb-reroll-btn:hover { background: inherit; border-color: inherit; }
.mb-reroll-btn.gp-focus { border-color: #4a9eff; box-shadow: 0 0 12px rgba(74,158,255,0.3); }
.mb-reroll-btn.disabled {
    opacity: 0.4; cursor: not-allowed; border-color: #555; color: #888;
}
.mb-reroll-btn.disabled.gp-focus { border-color: #4a9eff; box-shadow: 0 0 12px rgba(74,158,255,0.2); opacity: 0.5; }
.mb-reroll-btn.disabled:hover { background: rgba(241,196,15,0.1); border-color: #333; }
.mb-reroll-cost { font-size: 12px; color: #e67e22; }
.mb-reroll-key {
    font-size: 10px; background: #444; color: #eee; padding: 2px 6px;
    border-radius: 4px; margin-left: 4px;
}

/* ── Auto Weapon Pick Screen ── */
#auto-weapon-pick-screen {
    display: none; position: fixed; inset: 0;
    background: rgba(5, 5, 8, 0.92);
    z-index: 100; pointer-events: all;
    align-items: center; justify-content: center; flex-direction: column;
    font-family: 'Segoe UI', sans-serif; color: #e0e0e0;
}
#auto-weapon-pick-screen.show { display: flex; cursor: default; }

#awp-title {
    font-size: 24px; font-weight: 700; color: #3498db;
    letter-spacing: 2px; margin-bottom: 6px;
    text-shadow: 0 0 16px rgba(52,152,219,0.4);
}
#awp-subtitle { font-size: 13px; color: #666; margin-bottom: 28px; }

#awp-grid {
    display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
    max-width: 1100px;
}
#awp-reroll-container {
    display: flex; justify-content: center; margin-top: 14px;
}

.awp-card {
    width: 220px; flex-shrink: 0; padding: 14px 14px;
    background: linear-gradient(180deg, #101828 0%, #0d0d1a 100%);
    border: 2px solid #2a3a5a; border-radius: 10px;
    cursor: pointer; transition: all 0.25s;
    text-align: left; display: flex; flex-direction: column;
    pointer-events: all; position: relative;
}
/* Invisible hover zone below card — prevents jitter from translateY on hover */
.awp-card::after {
    content: ''; position: absolute; bottom: -8px; left: 0; right: 0; height: 8px;
}
.awp-card-tooltip { font-size: 11px; }
.awp-card:hover {
    border-color: #3498db; transform: translateY(-4px);
    background: linear-gradient(180deg, #182540 0%, #121225 100%);
    box-shadow: 0 0 20px rgba(52,152,219,0.3);
}
body.gp-active .awp-card:hover, body.kb-nav .awp-card:hover { border-color: inherit; transform: none; background: inherit; box-shadow: none; }
.awp-card.gp-focus,
body.gp-active .awp-card.gp-focus:hover,
body.kb-nav .awp-card.gp-focus:hover {
    border-color: #3498db; transform: translateY(-4px);
    background: linear-gradient(180deg, #182540 0%, #121225 100%);
    box-shadow: 0 0 20px rgba(52,152,219,0.3);
}
/* Auto skill cards — warm beige tone */
.awp-card-auto { border-color: rgba(200,169,110,0.4); }
.awp-card-auto:hover {
    border-color: #c8a96e; transform: translateY(-4px);
    background: linear-gradient(180deg, #28201a 0%, #151210 100%);
    box-shadow: 0 0 20px rgba(200,169,110,0.25);
}
body.gp-active .awp-card-auto:hover, body.kb-nav .awp-card-auto:hover { border-color: inherit; transform: none; background: inherit; box-shadow: none; }
.awp-card-auto.gp-focus,
body.gp-active .awp-card-auto.gp-focus:hover,
body.kb-nav .awp-card-auto.gp-focus:hover {
    border-color: #c8a96e; transform: translateY(-4px);
    background: linear-gradient(180deg, #28201a 0%, #151210 100%);
    box-shadow: 0 0 20px rgba(200,169,110,0.25);
}

.awp-card-icon { font-size: 32px; margin-bottom: 8px; }
.awp-card-name { font-size: 13px; font-weight: 700; color: #e0e0e0; margin-bottom: 4px; }
.awp-card-desc { font-size: 10px; color: #888; line-height: 1.3; margin-bottom: 8px; }

/* ============================================================
   Player Menu (ESC) — Sliding Pages
   ============================================================ */

/* HTML Labels (crisp text overlays) */
.hl { font-family: 'Inter', 'Segoe UI', Arial, sans-serif; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.5); }
.hl-interact {
    font-family: 'Almendra', serif; font-size: 13px; font-weight: 700; color: #1abc9c; letter-spacing: 2px;
    text-transform: uppercase; background: transparent; padding: 5px 12px; border: none;
    text-shadow: 0 0 10px rgba(26,188,156,0.3), 0 2px 4px rgba(0,0,0,0.8);
}
.hl-interact .hl-key {
    font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700; color: #0a0a10;
    background: linear-gradient(180deg, #1abc9c 0%, #16a085 100%); padding: 3px 8px; border-radius: 3px;
    display: inline-block; margin-right: 6px; text-shadow: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}
.hl-speech {
    font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; color: #f0e6d2; letter-spacing: 0.3px;
    background: linear-gradient(180deg, rgba(20,15,30,0.95) 0%, rgba(10,8,16,0.95) 100%);
    padding: 12px 16px; border-radius: 6px; position: relative;
    border: 1px solid rgba(26,188,156,0.2); max-width: 220px; white-space: normal !important; line-height: 1.4;
    box-shadow: 0 0 15px rgba(26,188,156,0.06), 0 4px 20px rgba(0,0,0,0.5);
}
.hl-speech::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, #1abc9c, transparent); border-radius: 6px 6px 0 0;
}
.hl-speech .hl-npc-name-inline {
    font-family: 'Almendra', serif; font-size: 10px; font-weight: 700; color: #1abc9c;
    letter-spacing: 2px; text-transform: uppercase; display: block; margin-bottom: 4px;
}
.hl-speech-call { animation: speech-pulse 1.5s ease-in-out infinite; }
@keyframes speech-pulse {
    0%, 100% { border-color: rgba(26,188,156,0.2); box-shadow: 0 0 15px rgba(26,188,156,0.06), 0 4px 20px rgba(0,0,0,0.5); }
    50% { border-color: rgba(26,188,156,0.6); box-shadow: 0 0 20px rgba(26,188,156,0.2), 0 4px 20px rgba(0,0,0,0.5); }
}
.hl-npc-name {
    font-size: 10px; font-weight: 700; color: #cccccc; letter-spacing: 0.5px;
}
.hl-portal {
    font-family: 'Almendra', serif; font-size: 13px; font-weight: 700; color: #f0c040; letter-spacing: 1px;
    text-transform: uppercase;
    background: rgba(10, 10, 20, 0.85); padding: 4px 14px; border-radius: 6px;
    border: 1px solid rgba(240, 192, 64, 0.3);
    text-shadow: 0 0 10px rgba(240, 192, 64, 0.4), 0 1px 3px rgba(0,0,0,0.9);
}
.hl-showcase {
    font-size: 10px; font-weight: 700; color: #cccccc; letter-spacing: 0.3px;
}
.hl-hint {
    font-size: 12px; color: #ffffff; letter-spacing: 0.3px;
}
/* Sage "?" floating quest marker — golden magical glow */
.hl-sage-hint {
    font-family: 'Almendra', serif; font-size: 26px; font-weight: 700; color: #f0d060;
    text-shadow: 0 0 8px rgba(240,208,96,0.8), 0 0 20px rgba(240,180,60,0.4), 0 2px 4px rgba(0,0,0,0.9);
    animation: sage-hint-bob 2s ease-in-out infinite;
}
@keyframes sage-hint-bob {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50% { transform: translate(-50%, -50%) translateY(-6px); }
}
/* Portal onboarding balloon (first hub only) */
.hl-portal-balloon {
    font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; color: #e8d5ff;
    background: linear-gradient(180deg, rgba(30,20,50,0.95) 0%, rgba(15,10,25,0.95) 100%);
    padding: 10px 14px; border-radius: 8px; white-space: normal !important; max-width: 190px;
    line-height: 1.35; text-align: center; position: relative;
    border: 1px solid rgba(155,89,182,0.35);
    box-shadow: 0 0 16px rgba(155,89,182,0.15), 0 4px 16px rgba(0,0,0,0.5);
}
.hl-portal-balloon::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, #9b59b6, transparent); border-radius: 8px 8px 0 0;
}
.hl-portal-balloon::after {
    content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
    border-left: 8px solid transparent; border-right: 8px solid transparent;
    border-top: 8px solid rgba(15,10,25,0.95);
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
}

#player-menu {
    display: none; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10001; align-items: center; justify-content: center;
    backdrop-filter: blur(2px);
    font-family: 'Segoe UI', sans-serif;
}
#player-menu.show { display: flex; }

.menu-panel {
    width: 460px; max-width: 95vw; max-height: calc(92vh * var(--ui-zoom-inv, 1));
    transition: width 0.2s ease;
    height: fit-content;
    background: linear-gradient(180deg, #0d0d1a 0%, #111125 100%);
    border: 1px solid #2a2a4a;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(100, 60, 200, 0.15), 0 8px 32px rgba(0,0,0,0.6);
    display: flex; flex-direction: column;
    overflow: hidden;
}

.menu-panel.menu-wide { width: 720px; }

/* --- Header --- */
.menu-header {
    display: grid; grid-template-columns: 32px 1fr 32px; align-items: center;
    padding: 10px 16px 8px;
    border-bottom: 1px solid #222244;
    background: rgba(20, 15, 40, 0.6);
}
.menu-header-left { display: flex; align-items: baseline; gap: 10px; justify-content: center; }
#menu-title {
    font-size: 20px; font-weight: 700; color: #f1c40f;
    letter-spacing: 3px; text-transform: uppercase;
    font-family: 'Almendra', serif;
    text-shadow: 0 0 12px rgba(241, 196, 15, 0.3), 0 1px 2px rgba(0,0,0,0.6);
}
#menu-level {
    font-size: 12px; color: #888; font-weight: 600;
}
.menu-close {
    font-size: 26px; color: #555; cursor: pointer;
    line-height: 1; transition: color 0.2s;
    pointer-events: all; justify-self: end;
}
.menu-close:hover { color: #e74c3c; }

/* --- Navigation (dots + arrows) --- */
.menu-nav {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; padding: 5px 0;
    border-bottom: 1px solid #1a1a30;
}
.menu-nav-hint {
    font-size: 10px; color: #555; min-width: 24px; text-align: center;
    font-weight: bold; letter-spacing: 0.5px;
}
.menu-nav-hint kbd {
    display: inline-block; background: rgba(255,255,255,0.06); border: 1px solid #444;
    border-radius: 3px; padding: 1px 5px; font-size: 10px; color: #888; font-family: inherit;
}
.menu-arrow {
    font-size: 14px; color: #666; cursor: pointer;
    padding: 2px 6px; border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    user-select: none;
    pointer-events: all;
}
.menu-arrow:hover { color: #f1c40f; background: rgba(241,196,15,0.08); }
#menu-dots {
    display: flex; gap: 6px; align-items: center;
}
.dot {
    width: 22px; height: 22px; border-radius: 50%;
    background: transparent; cursor: pointer;
    transition: all 0.2s; pointer-events: all;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid transparent;
}
.dot img {
    width: 18px; height: 18px; object-fit: contain;
    image-rendering: pixelated; filter: brightness(0.45);
    transition: filter 0.2s;
}
.dot:hover img { filter: brightness(0.75); }
.dot:hover { background: rgba(255,255,255,0.04); }
.dot.active { border-color: rgba(241,196,15,0.4); background: rgba(241,196,15,0.08); transform: scale(1.15); }
.dot.active img { filter: brightness(1) drop-shadow(0 0 3px rgba(241,196,15,0.6)); }
.dot.dot-notify { animation: dot-pulse 1.2s ease-in-out infinite; }
.dot.dot-notify img { filter: brightness(1) drop-shadow(0 0 4px rgba(46,204,113,0.8)); }
@keyframes dot-pulse {
    0%, 100% { transform: scale(1); border-color: rgba(46,204,113,0.3); }
    50% { transform: scale(1.25); border-color: rgba(46,204,113,0.8); background: rgba(46,204,113,0.12); }
}

/* --- Body --- */
.menu-body {
    flex: 0 1 auto; min-height: 0; overflow-y: auto; padding: 4px 14px 6px;
    scrollbar-width: none; position: relative;
}
.menu-body::-webkit-scrollbar { display: none; }

.menu-footer {
    padding: 5px 14px;
    text-align: center; font-size: 10px; color: #444;
    border-top: 1px solid #1a1a30;
    letter-spacing: 0.8px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    flex-wrap: wrap;
}
.menu-shortcuts-hint {
    display: flex; align-items: center; gap: 6px;
    font-size: 9px; color: #555; letter-spacing: 0.3px;
}
.menu-shortcuts-hint kbd {
    display: inline-block;
    background: rgba(255,255,255,0.06); border: 1px solid #333;
    border-radius: 3px; padding: 1px 5px;
    font-size: 9px; font-weight: 700; color: #999;
    font-family: inherit; line-height: 1.3;
}
.menu-abandon-btn {
    background: #5c1a1a; color: #e74c3c; border: 1px solid #e74c3c40;
    padding: 4px 12px; border-radius: 4px; font-size: 10px;
    cursor: pointer; letter-spacing: 0.5px; font-weight: 600;
    transition: background 0.2s;
}
.menu-abandon-btn:hover { background: #7a2020; }

.menu-footer-btns { display: flex; gap: 8px; }

.menu-main-btn {
    background: #1a1a3a; color: #888; border: 1px solid #33335540;
    padding: 4px 12px; border-radius: 4px; font-size: 10px;
    cursor: pointer; letter-spacing: 0.5px; font-weight: 600;
    transition: all 0.2s;
}
.menu-main-btn:hover { background: #2a2a4a; color: #aaa; border-color: #55558840; }

/* --- Section blocks --- */
.pm-section { margin-bottom: 6px; }
.pm-label {
    font-size: 9px; font-weight: 700; color: #777;
    text-transform: uppercase; letter-spacing: 1.5px;
    margin-bottom: 4px; padding-bottom: 2px;
    border-bottom: 1px solid #1a1a30;
    text-align: center;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* --- PAGE: Personagem (Overview) --- */
.pm-overview {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px;
}
.pm-portrait-frame {
    width: 44px; height: 44px;
    border: 2px solid #3a3a5a;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0,0,0,0.3);
    box-shadow: 0 0 20px rgba(100,60,200,0.2);
}
.pm-portrait-img {
    width: 100%; height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}
.pm-char-identity { text-align: center; margin-top: -2px; }
.pm-char-name {
    font-size: 14px; font-weight: 700; color: #ff9944;
    text-shadow: 0 0 10px rgba(255,153,68,0.25);
}
.pm-char-role { font-size: 10px; color: #888; margin-top: 1px; }
.pm-char-level { font-size: 10px; color: #666; margin-top: 1px; }
.pm-resource-bars {
    width: 100%;
    display: flex; flex-direction: column; gap: 2px;
}
.pm-resource {
    display: flex; align-items: center; gap: 6px;
}
.pm-resource-label {
    width: 70px; font-size: 10px; color: #888; font-weight: 600;
    white-space: nowrap;
}
.pm-resource-bar-wrap {
    flex: 1; display: flex;
}
.pm-resource-bar {
    height: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 4px; overflow: hidden;
}
.pm-resource-fill {
    height: 100%; border-radius: 3px;
    transition: width 0.3s ease;
}
.pm-resource-text {
    min-width: 60px; text-align: right;
    font-size: 10px; font-weight: 600; color: #ccc;
}
.pm-weapons-summary {
    width: 100%;
    display: flex; flex-direction: column; gap: 4px;
}
.pm-weapon-row {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.02);
    border-radius: 6px;
}
.pm-weapon-icon { font-size: 20px; width: 28px; text-align: center; }
.pm-weapon-name { flex: 1; font-size: 12px; color: #ddd; }
.pm-weapon-badge {
    font-size: 9px; font-weight: 700; padding: 1px 6px;
    border-radius: 3px; letter-spacing: 0.5px;
}

/* --- Perk & Passive cards (Menu ESC Page 0) --- */
.pm-perk-card {
    display: flex; align-items: flex-start; gap: 6px;
    padding: 5px 7px; background: rgba(230,126,34,0.08);
    border: 1px solid rgba(230,126,34,0.25); border-radius: 6px;
}
.pm-perk-icon { font-size: 18px; display: flex; align-items: center; }
.pm-perk-icon-img { width: 20px; height: 20px; image-rendering: pixelated; border-radius: 3px; }
.pm-perk-info { flex: 1; }
.pm-perk-name { font-size: 11px; font-weight: 600; color: #a0724a; }
.pm-perk-desc { font-size: 9px; color: #aaa; margin-top: 1px; line-height: 1.3; }
.pm-perk-status { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 3px; margin-left: 6px; }
.pm-perk-on { background: rgba(46,204,113,0.2); color: #2ecc71; }
.pm-perk-off { background: rgba(149,165,166,0.2); color: #666; }
.pm-perk-stacks { background: rgba(241,196,15,0.2); color: #f1c40f; }

.pm-passive-card {
    display: flex; align-items: flex-start; gap: 6px;
    padding: 5px 7px; background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06); border-radius: 6px;
    position: relative;
}
.pm-passive-lock-overlay {
    position: absolute; inset: 0; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; background: rgba(0,0,0,0.45);
    border-radius: 6px; pointer-events: none;
}
.pm-passive-info { flex: 1; }
.pm-passive-name { font-size: 11px; color: #cc3333; font-weight: 600; }
.pm-passive-desc { font-size: 10px; color: #e6c84b; margin-top: 2px; }
.pm-mastery-bar {
    width: 100%; height: 4px; background: rgba(255,255,255,0.08);
    border-radius: 2px; margin-top: 4px; overflow: hidden;
}
.pm-mastery-fill {
    height: 100%; background: linear-gradient(90deg, #8e44ad, #c39bd3);
    border-radius: 2px; transition: width 0.3s;
}
.pm-mastery-label { font-size: 9px; color: #8e44ad; margin-top: 2px; }

/* --- PAGE: Equipamento (Paper-Doll) --- */
.pm-paperdoll {
    display: flex; flex-direction: column; align-items: center;
}
/* --- Paper Doll Grid --- */
.pm-doll-grid {
    display: grid;
    grid-template-columns: 54px 1fr 54px;
    grid-template-rows: auto auto auto auto;
    gap: 0px 4px;
    justify-items: center;
    align-items: center;
    padding: 2px 4px;
}
.pm-doll-slot {
    width: 52px; height: 52px;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 1px;
    background: rgba(255,255,255,0.02);
    border: 1px dashed #2a2a3a;
    border-radius: 8px;
    cursor: default;
    transition: all 0.2s ease;
    position: relative;
}
.pm-doll-slot:hover { border-color: #555; background: rgba(255,255,255,0.04); }
.pm-doll-equipped {
    border-style: solid;
    border-color: var(--slot-color, #555);
    background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
    box-shadow: 0 0 8px color-mix(in srgb, var(--slot-color, #555) 25%, transparent);
}
.pm-doll-equipped:hover {
    box-shadow: 0 0 12px color-mix(in srgb, var(--slot-color, #555) 40%, transparent);
}
/* Lv badge — over the icon with dark outline for readability */
.pm-slot-lv {
    position: absolute; top: 2px; left: 3px;
    font-size: 11px; font-weight: 700; color: #fff;
    line-height: 1; pointer-events: none; z-index: 2;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 0 4px #000;
}
.pm-doll-slot-icon-wrap {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
}
.pm-doll-slot-placeholder {
    width: 20px; height: 20px; object-fit: contain;
    image-rendering: pixelated; opacity: 0.2;
    filter: grayscale(1);
}
.pm-doll-item-img {
    width: 28px; height: 28px; object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}
.pm-doll-item-emoji { font-size: 20px; }
.pm-doll-slot-name {
    font-size: 9px; color: #777; text-align: center;
    overflow: hidden; text-overflow: ellipsis;
    max-width: 52px; line-height: 1.2;
    letter-spacing: 0.3px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    word-break: break-word;
}
.pm-doll-capacete { grid-column: 2; grid-row: 1; }
.pm-doll-arma     { grid-column: 1; grid-row: 2; }
.pm-doll-armadura { grid-column: 3; grid-row: 2; }
.pm-doll-bota     { grid-column: 1; grid-row: 4; }
.pm-doll-amuleto  { grid-column: 3; grid-row: 4; }
.pm-doll-character {
    grid-column: 2; grid-row: 2 / 4;
    display: flex; align-items: center; justify-content: center;
}
.pm-doll-char-frame {
    width: 70px; height: 68px;
    display: flex; align-items: flex-end; justify-content: center;
    background: radial-gradient(ellipse at center bottom, rgba(255,153,68,0.06) 0%, transparent 70%);
    border-radius: 10px;
    position: relative;
}
.pm-doll-char-frame::after {
    content: '';
    position: absolute; bottom: 8px; left: 50%;
    transform: translateX(-50%);
    width: 50px; height: 6px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.4) 0%, transparent 70%);
    border-radius: 50%;
}
.pm-doll-sprite {
    max-width: 56px; max-height: 64px;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 10px rgba(255,153,68,0.25));
    position: relative; z-index: 1;
}

/* --- Trophy Grid --- */
.pm-trophy-grid {
    display: grid;
    grid-template-columns: repeat(5, 52px);
    gap: 3px;
    justify-content: center;
}
.pm-trophy-slot {
    width: 52px; height: 52px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1px;
    background: rgba(255,255,255,0.02);
    border: 1px solid #1a1a2e; border-radius: 6px;
    cursor: default;
    transition: all 0.2s ease;
    position: relative;
}
.pm-trophy-filled {
    border-color: var(--trophy-color, #555);
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
}
.pm-trophy-filled:hover {
    background: rgba(255,255,255,0.05);
    box-shadow: 0 0 10px color-mix(in srgb, var(--trophy-color, #555) 30%, transparent);
}
.pm-trophy-img { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; }
.pm-trophy-emoji { font-size: 20px; }
.pm-trophy-tier { font-size: 9px; font-weight: 600; letter-spacing: 0.5px; }
.pm-trophy-empty { opacity: 0.35; border-style: dashed; }
.pm-trophy-placeholder {
    width: 20px; height: 20px; object-fit: contain;
    image-rendering: pixelated; opacity: 0.3;
    filter: grayscale(1) brightness(0.6);
}

/* --- WASD Cursor Focus --- */
.menu-focused {
    outline: 2px solid #4a9eff !important;
    outline-offset: 3px;
    border-radius: 8px;
    border-color: #4a9eff !important;
    box-shadow: 0 0 12px rgba(74, 158, 255, 0.3);
}

/* --- Menu Tooltip --- */
.menu-tooltip {
    display: none; position: fixed; z-index: 100000;
    background: #0d0d1a; border: 1px solid #3a3a5a;
    border-radius: 8px; padding: 10px 14px;
    max-width: 280px; min-width: 180px;
    pointer-events: none; box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}
#hud-tooltip {
    background: rgba(10, 10, 26, 0.88);
    backdrop-filter: blur(8px);
    min-width: 0; max-width: 300px; width: max-content;
}
.menu-tooltip.show { display: block; }
.tt-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; text-align: center; color: #eee; font-family: 'Almendra', serif; letter-spacing: 0.5px; }
.tt-desc { font-size: 11px; color: #bbb; margin-bottom: 6px; line-height: 1.4; }
.tt-rarity { font-size: 10px; margin-bottom: 4px; }
.tt-stats .shop-stat { font-size: 11px; display: flex; justify-content: space-between; gap: 8px; }
.tt-stats .shop-stat-name { color: #aaa; }
.tt-stats .shop-stat-val { font-weight: 600; }

/* --- Skill Tooltip (.stt) — used by buildSkillTooltipHTML (hud, levelup, menu) --- */
.stt { width: 100%; }
.stt-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.stt-icon { flex-shrink: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.stt-icon img { image-rendering: pixelated; }
.stt-header-info { flex: 1; min-width: 0; }
.stt-name { font-size: 14px; font-weight: 700; color: #eee; font-family: 'Almendra', serif; letter-spacing: 0.5px; line-height: 1.2; }
.stt-subtitle { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.stt-subtitle-auto { color: #c8a96e; }
.stt-subtitle-active { color: #3498db; }
.stt-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.stt-tag { font-size: 9px; padding: 2px 6px; border-radius: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stt-tag-phys { background: #e67e2220; color: #e67e22; border: 1px solid #e67e2240; }
.stt-tag-mag { background: #8e44ad20; color: #a78bfa; border: 1px solid #8e44ad40; }
.stt-tag-cac { background: #e74c3c20; color: #e74c3c; border: 1px solid #e74c3c40; }
.stt-tag-dist { background: #3498db20; color: #3498db; border: 1px solid #3498db40; }
.stt-tag-both { background: #9b59b620; color: #af7ac5; border: 1px solid #9b59b640; }
.stt-tag-single { background: #f39c1220; color: #f39c12; border: 1px solid #f39c1240; }
.stt-tag-zone { background: #1abc9c20; color: #1abc9c; border: 1px solid #1abc9c40; }
.stt-stats { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.stt-stat { display: flex; align-items: center; gap: 4px; font-size: 11px; line-height: 1.3; }
.stt-stat-icon { width: 12px; height: 12px; flex-shrink: 0; object-fit: contain; image-rendering: pixelated; vertical-align: middle; }
.stt-stat-label { color: #999; flex: 1; }
.stt-stat-val { font-weight: 600; white-space: nowrap; }
.stt-desc { font-size: 11px; color: #bbb; line-height: 1.4; margin-bottom: 6px; }
.stt-fx { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.stt-fx-row { display: flex; align-items: center; gap: 4px; font-size: 11px; line-height: 1.3; }
.stt-fx-icon { width: 12px; height: 12px; flex-shrink: 0; object-fit: contain; image-rendering: pixelated; }
.stt-fx-icon-emoji { font-size: 11px; width: 14px; flex-shrink: 0; text-align: center; }
.stt-cost { font-size: 11px; color: #888; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.stt-cost .stt-stat-icon { width: 10px; height: 10px; }
.stt-cost-free { color: #555; font-style: italic; }

/* Skill tooltip inside weapon pick cards (awp) */
.awp-card-tooltip .stt-name { font-size: 13px; }
.awp-card-tooltip .stt-subtitle { font-size: 9px; }
.awp-card-tooltip .stt-tag { font-size: 9px; padding: 1px 5px; }
.awp-card-tooltip .stt-stat { font-size: 10px; }
.awp-card-tooltip .stt-desc { font-size: 10px; }
.awp-card-tooltip .stt-fx-row { font-size: 10px; }
.awp-card-tooltip .stt-cost { font-size: 10px; }

/* --- PAGE: Inventário (Bag) — 5 cols × 2 rows --- */
.pm-inv-grid {
    display: grid; grid-template-columns: repeat(5, 52px); gap: 3px;
    justify-content: center;
}
.pm-inv-slot {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1px; padding: 2px 1px; width: 52px; height: 52px; box-sizing: border-box;
    background: rgba(255,255,255,0.02); border: 1px dashed #2a2a3a;
    border-radius: 6px; transition: all 0.2s ease;
    position: relative;
}
.pm-inv-filled {
    border-style: solid;
    border-color: var(--inv-color, #555);
    cursor: default;
    box-shadow: 0 0 6px color-mix(in srgb, var(--inv-color, #555) 20%, transparent);
}
.pm-inv-filled:hover {
    background: rgba(255,255,255,0.05);
    box-shadow: 0 0 10px color-mix(in srgb, var(--inv-color, #555) 35%, transparent);
}
.pm-inv-empty { opacity: 0.2; }
.pm-inv-icon { font-size: 16px; }
.pm-inv-icon img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.pm-inv-slot-label {
    font-size: 9px; color: #555; text-transform: uppercase;
}
.pm-inv-actions {
    display: flex; gap: 2px; margin-top: 1px;
}
.pm-inv-btn {
    font-size: 9px; padding: 1px 4px; border: none; border-radius: 3px;
    cursor: pointer; font-weight: 600; transition: background 0.15s;
}
.pm-inv-equip { background: rgba(46,204,113,0.2); color: #2ecc71; }
.pm-inv-equip:hover { background: rgba(46,204,113,0.35); }
.pm-inv-sell { background: rgba(241,196,15,0.2); color: #f1c40f; }
.pm-inv-sell:hover { background: rgba(241,196,15,0.35); }
.pm-inv-sell-all {
    width: 100%; margin-top: 8px; padding: 6px 12px;
    font-size: 11px; font-weight: 600; color: #f1c40f;
    background: rgba(241,196,15,0.08); border: 1px solid rgba(241,196,15,0.2);
    border-radius: 6px; cursor: pointer; transition: background 0.15s;
}
.pm-inv-sell-all:hover { background: rgba(241,196,15,0.15); }

/* Loot popup buttons */
.lc-btn-store { background: rgba(52,152,219,0.15); color: #3498db; border: 1px solid rgba(52,152,219,0.3); }
.lc-btn-store:hover { background: rgba(52,152,219,0.25); }
.lc-btn-store.lc-btn-disabled { opacity: 0.4; cursor: not-allowed; }
.lc-btn-sell { background: rgba(241,196,15,0.15); color: #f1c40f; border: 1px solid rgba(241,196,15,0.3); }
.lc-btn-sell:hover { background: rgba(241,196,15,0.25); }

/* --- PAGE 3: Damage Bonus Grid --- */
.pm-dmg-grid {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.pm-dmg-chip {
    display: flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 5px;
    border: 1px solid; font-size: 11px;
}
.pm-dmg-icon { font-size: 12px; }
.pm-dmg-name { color: #aaa; font-size: 10px; }
.pm-dmg-val { font-weight: 700; font-size: 11px; }

.pm-dmg-inactive {
    display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px;
}
.pm-dmg-mini {
    font-size: 10px; color: #444; padding: 2px 6px;
    background: rgba(255,255,255,0.02); border-radius: 3px;
}

/* --- PAGE: Atributos (Stat Cards) --- */
/* Equipment + Stats side by side */
.pm-equip-stats-row { display: flex; gap: 12px; align-items: flex-start; }
.pm-equip-col { flex: 0 0 260px; min-width: 0; }
.pm-stats-col { flex: 1; min-width: 0; border-left: 1px solid #222240; padding-left: 12px; }
.pm-equip-sub { margin-top: 6px; }
.pm-section-compact { margin-top: 6px; }
.pm-sub-label {
    display: flex; align-items: center; gap: 5px;
    margin-bottom: 4px; padding-bottom: 3px;
    border-bottom: 1px solid #1a1a30;
}
.pm-sub-label span {
    font-size: 10px; font-weight: 600; color: #888;
    letter-spacing: 0.8px;
}
.pm-sub-label-icon {
    width: 14px; height: 14px; object-fit: contain;
    image-rendering: pixelated; opacity: 0.5;
}
.pm-sub-label-svg {
    width: 14px; height: 14px; color: #666; opacity: 0.5;
}
.pm-sub-count {
    font-size: 9px !important; font-weight: 400 !important;
    color: #555 !important; margin-left: auto;
}
.pm-inv-placeholder {
    width: 16px; height: 16px; color: #333; opacity: 0.4;
}
.pm-stat-cards {
    display: flex; flex-direction: column; gap: 5px;
}
.pm-stats-col .pm-stat-cards { margin-top: 0; }
.pm-stat-card {
    border-radius: 8px;
    border: 1px solid #222240;
    overflow: hidden;
    background: rgba(15,13,28,0.7);
}
.pm-card-header {
    padding: 4px 10px;
    font-size: 10px; font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.pm-card-body {
    padding: 4px 8px 6px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 1px 10px;
}
.pm-card-stat {
    display: flex; align-items: center; gap: 4px;
    padding: 1px 0; font-size: 10px; min-width: 0;
}
.pm-card-stat-icon { width: 14px; min-width: 14px; text-align: center; font-size: 10px; }
.pm-card-stat-icon img { width: 14px; height: 14px; }
.pm-card-stat-label { color: #888; font-size: 10px; white-space: nowrap; }
.pm-card-stat-val { font-size: 10px; font-weight: 600; color: #ccc; margin-left: auto; white-space: nowrap; }

/* --- PAGE: Configuracoes --- */
.pm-config {
    display: flex; flex-direction: column; gap: 10px;
}
.pm-config-section {
    display: flex; flex-direction: column; gap: 6px;
}
.pm-slider-row {
    display: flex; align-items: center; gap: 8px;
    padding: 2px 0;
}
img.pm-slider-icon { width: 24px; height: 24px; image-rendering: auto; object-fit: contain; vertical-align: middle; }
.pm-slider-icon { font-size: 14px; width: 24px; text-align: center; }
.pm-slider-label { min-width: 68px; width: 68px; font-size: 11px; color: #aaa; }
.pm-slider {
    flex: 1; height: 6px;
    -webkit-appearance: none; appearance: none;
    background: #111120; border-radius: 3px;
    outline: none; cursor: pointer;
}
.pm-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #f1c40f;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(241,196,15,0.4);
}
.pm-slider::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%; border: none;
    background: #f1c40f;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(241,196,15,0.4);
}
.pm-slider-val {
    min-width: 36px; text-align: right;
    font-size: 11px; font-weight: 600; color: #ccc;
}
.pm-config-placeholder {
    font-size: 12px; color: #444; padding: 16px;
    text-align: center; font-style: italic;
}

.pm-lang-grid {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0;
}
.pm-lang-badge {
    position: relative; cursor: pointer;
    border-radius: 6px; padding: 3px;
    border: 2px solid transparent;
    transition: border-color 0.2s, opacity 0.2s;
}
.pm-lang-badge:hover, .pm-lang-badge.menu-focused { border-color: rgba(255,255,255,0.3); }
.pm-lang-badge.active { border-color: #f1c40f; }
.pm-lang-badge.active.menu-focused { border-color: #f1c40f; box-shadow: 0 0 8px rgba(241,196,15,0.4); }
.pm-lang-badge.locked { opacity: 0.45; cursor: pointer; filter: grayscale(0.4); }
.pm-lang-badge.locked:hover, .pm-lang-badge.locked.menu-focused { opacity: 0.7; filter: grayscale(0.2); }
.pm-lang-lock {
    position: absolute; top: -4px; right: -4px; font-size: 10px;
    background: #1a1a2e; border-radius: 50%; padding: 1px;
}
.pm-lang-toast {
    margin-top: 6px; padding: 4px 12px; border-radius: 6px;
    background: rgba(231,76,60,0.15); border: 1px solid rgba(231,76,60,0.3);
    color: #e74c3c; font-size: 12px; text-align: center;
    opacity: 0; transform: translateY(-4px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.pm-lang-toast.show {
    opacity: 1; transform: translateY(0);
}
.pm-lang-flag {
    display: block; width: 36px; height: 24px; border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    object-fit: cover;
}

.pm-config-actions {
    display: flex; flex-direction: column; gap: 6px;
    margin-top: 4px; padding-top: 4px;
    border-top: 1px solid #ffffff08;
}
.pm-config-btn {
    width: 100%; padding: 8px 14px; border: 1px solid #3a3a5a;
    border-radius: 6px; background: rgba(15, 15, 30, 0.6);
    color: #aaa; font-size: 12px; cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-align: center;
}
.pm-config-btn:hover { background: rgba(30, 30, 50, 0.8); color: #e0e0e0; border-color: #555; }
.pm-config-btn-main { color: #888; }
.pm-config-btn-main:hover { border-color: #e74c3c60; color: #e74c3c; background: #2a1515; }
.pm-config-btn-abandon { color: #e67e22; border-color: #e67e2240; }
.pm-config-btn-abandon:hover { background: #2a2015; border-color: #e67e22; }
.pm-config-btn-quit { color: #e74c3c; border-color: #e74c3c40; }
.pm-config-btn-quit:hover { background: #2a1515; border-color: #e74c3c; }
.pm-overview-actions { width: 100%; margin-top: 10px; padding-top: 10px; }

/* --- PAGE: Amigos --- */
.pm-friends-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 32px 16px;
    background: rgba(255,255,255,0.02); border-radius: 10px;
    border: 1px dashed #222240;
}

/* --- Empty states --- */
.pm-empty {
    font-size: 12px; color: #444; padding: 16px;
    text-align: center; font-style: italic;
}
.pm-empty-sm {
    font-size: 11px; color: #444; padding: 8px;
    text-align: center; font-style: italic;
}

/* --- PAGE 2: Resources --- */
.pm-penalty {
    font-size: 11px; color: #e74c3c; padding: 4px 8px;
    background: rgba(231,76,60,0.1); border-radius: 4px;
    margin-top: 4px;
}
.pm-items-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
}
.pm-item-slot {
    display: flex; align-items: center; gap: 5px;
    padding: 4px 8px; background: rgba(255,255,255,0.03);
    border: 1px solid #222240; border-radius: 5px;
}
.pm-item-empty { opacity: 0.4; }
.pm-item-key {
    font-size: 9px; font-weight: 700; color: #666;
    background: rgba(255,255,255,0.06); padding: 1px 4px;
    border-radius: 3px;
}
.pm-item-icon { font-size: 14px; }
.pm-item-name { font-size: 10px; color: #bbb; }
.pm-item-charges { font-size: 10px; font-weight: 700; color: #f1c40f; margin-left: auto; }

/* Damage numbers */
.dmg-number {
    position: fixed; left: 0; top: 0; font-weight: bold; pointer-events: none; z-index: 50;
    text-shadow: 1px 1px 2px #000; will-change: transform, opacity;
}
.dmg-number.crit {
    text-shadow: 0 0 6px #f39c12, 0 0 12px #e67e22, 1px 1px 2px #000;
}

/* Heal numbers */
.heal-number {
    position: fixed; left: 0; top: 0; font-weight: bold; pointer-events: none; z-index: 50;
    will-change: transform, opacity;
}
.heal-number.lifesteal {
    color: #2ecc71; font-size: 12px;
    text-shadow: 0 0 4px #27ae60, 1px 1px 1px #000;
}
.heal-number.pure-heal {
    color: #2ecc71; font-size: 16px;
    text-shadow: 0 0 8px #27ae60, 0 0 16px #1a9c4f, 1px 1px 2px #000;
}

/* ============================================================
   Death Splash (Tela 1 — dramática)
   ============================================================ */
#death-splash {
    display: none; position: fixed; inset: 0; background: #000;
    z-index: 200; align-items: center; justify-content: center; flex-direction: column;
    font-family: 'Segoe UI', sans-serif; color: #e0e0e0;
    overflow: hidden;
}
#death-splash.show { display: flex; animation: deathFadeIn 1.2s ease-out; }
@keyframes deathFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.ds-vignette {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(139,0,0,0.15) 70%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
}
.ds-content {
    position: relative; z-index: 1; display: flex; flex-direction: column;
    align-items: center; gap: 16px; max-width: 600px; text-align: center;
}

/* Character death portrait */
.ds-character { margin-bottom: 8px; }
.ds-char-img {
    max-width: 200px; max-height: 200px; image-rendering: pixelated;
    filter: drop-shadow(0 0 20px rgba(200,50,30,0.4));
    animation: deathCharFloat 3s ease-in-out infinite;
}
.ds-char-dead {
    filter: drop-shadow(0 0 20px rgba(200,50,30,0.4)) grayscale(0.6) brightness(0.5);
    transform: rotate(90deg);
}
.ds-char-fallback {
    font-size: 80px; filter: grayscale(0.5);
    animation: deathCharFloat 3s ease-in-out infinite;
}
@keyframes deathCharFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Message */
.ds-message {
    font-size: 28px; font-weight: 300; color: #c0392b; letter-spacing: 2px;
    text-transform: uppercase; text-shadow: 0 0 30px rgba(192,57,43,0.5);
    animation: deathMsgIn 2s ease-out;
}
@keyframes deathMsgIn {
    0% { opacity: 0; transform: translateY(20px); letter-spacing: 8px; }
    100% { opacity: 1; transform: translateY(0); letter-spacing: 2px; }
}

.ds-wave {
    font-size: 16px; color: #666; margin-top: 4px;
}

.ds-continue {
    font-size: 13px; color: #555; margin-top: 30px;
    animation: continueBlink 2s ease-in-out infinite;
    animation-delay: 1s; opacity: 0;
}
@keyframes continueBlink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* ============================================================
   Death Summary (Tela 2 — stats completos)
   ============================================================ */
#death-summary {
    display: none; position: fixed; inset: 0;
    background: rgba(5,5,10,0.95);
    z-index: 200; align-items: center; justify-content: center;
    font-family: 'Segoe UI', sans-serif; color: #e0e0e0;
}
#death-summary.show { display: flex; animation: sumFadeIn 0.5s ease-out; }
@keyframes sumFadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }

.dsum-layout {
    display: flex; align-items: flex-start; justify-content: center; gap: 14px;
    max-width: 920px; width: 95vw;
    max-height: calc(95vh * var(--ui-zoom-inv, 1));
    position: relative;
}

.dsum-panel {
    flex: 0 1 640px; min-width: 0; width: 100%; max-width: 640px;
    max-height: calc(82vh * var(--ui-zoom-inv, 1));
    display: flex; flex-direction: column;
    padding: 0;
    background: linear-gradient(180deg, rgba(20,15,25,0.95) 0%, rgba(10,8,15,0.98) 100%);
    border: 1px solid rgba(200,50,30,0.15); border-radius: 16px;
    box-shadow: 0 0 60px rgba(200,50,30,0.08), inset 0 1px 0 rgba(255,255,255,0.03);
}
@media (max-height: 700px) {
    .dsum-panel { max-height: calc(90vh * var(--ui-zoom-inv, 1)); }
    .dsum-header { padding: 14px 20px 10px; }
    .dsum-body { padding: 10px 20px 6px; }
    .dsum-buttons { padding: 10px 20px 14px; }
    .dsum-title { font-size: 20px; }
}
@media (max-width: 700px) {
    .dsum-panel { max-width: none; }
}

/* Side tooltip (lateral) — position absolute para não empurrar o painel */
.dsum-side-tooltip {
    position: absolute; left: calc(50% + 334px); top: 50%; transform: translateY(-50%);
    width: 240px;
    background: linear-gradient(180deg, rgba(15,13,25,0.98) 0%, rgba(8,6,16,0.99) 100%);
    border: 1px solid rgba(74,158,255,0.25); border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.6), 0 0 12px rgba(74,158,255,0.1);
    min-height: 120px;
}
@keyframes dsumSideIn { 0% { opacity: 0; transform: translateX(-8px); } 100% { opacity: 1; transform: translateX(0); } }
.dsum-side-tooltip .dsum-tip-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; font-family: 'Almendra', serif; display: flex; align-items: center; gap: 5px; }
.dsum-side-tooltip .dsum-tip-name img { width: 22px; height: 22px; image-rendering: pixelated; flex-shrink: 0; }
.dsum-side-tooltip .dsum-tip-tags { font-size: 10px; color: #7f8c8d; margin: 2px 0 6px; }
.dsum-side-tooltip .dsum-tip-grid { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 6px 0; font-size: 11px; font-weight: 600; }
.dsum-side-tooltip .dsum-tip-desc { font-size: 11px; color: #aaa; line-height: 1.35; margin: 6px 0; }
.dsum-side-tooltip .dsum-tip-fx { font-size: 10px; line-height: 1.5; margin: 4px 0; }
.dsum-side-tooltip .dsum-tip-cost { font-size: 10px; color: #777; margin-top: 6px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,0.06); }
.dsum-side-tooltip .dsum-tip-rarity { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.dsum-side-tooltip .dsum-tip-slot { font-size: 9px; color: #666; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.dsum-side-tooltip .dsum-tip-stat { font-size: 11px; color: #bbb; display: flex; align-items: center; gap: 4px; padding: 1px 0; }
.dsum-side-tooltip .dsum-tip-stat img { width: 14px; height: 14px; }
.dsum-side-tooltip .dsum-tip-val { margin-left: auto; color: #4fc3f7; font-weight: 600; }
.dsum-side-tooltip .dsum-tip-type .dsum-tip-val { color: #f39c12; }
.dsum-side-tooltip .dsum-tip-axis .dsum-tip-val { color: #9b59b6; }
.dsum-side-tooltip .dsum-tip-mini-stats { font-size: 10px; color: #777; margin-top: 2px; }
/* Hide side tooltip on narrow screens */
@media (max-width: 960px) {
    .dsum-side-tooltip { display: none !important; }
}

/* Header — portrait inline com titulo */
.dsum-header {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 24px 12px; flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.dsum-header-portrait img {
    width: 48px; height: 48px; image-rendering: pixelated; border-radius: 8px;
    border: 2px solid rgba(231,76,60,0.3); background: rgba(0,0,0,0.4);
}
.dsum-header-portrait .dsum-char-icon { font-size: 36px; }
.dsum-header-text { flex: 1; }
.dsum-title {
    font-size: 24px; font-weight: 900; color: #e74c3c; letter-spacing: 2px;
    text-transform: uppercase; text-shadow: 0 0 20px rgba(231,76,60,0.3);
    font-family: 'Almendra', serif;
}
.dsum-subtitle { font-size: 13px; color: #777; margin-top: 2px; }

/* Scrollable body — scrollbar invisível */
.dsum-body {
    flex: 1; overflow-y: auto; padding: 12px 24px 6px;
    scrollbar-width: none; /* Firefox */
}
.dsum-body::-webkit-scrollbar { display: none; } /* Chrome/Edge */

/* Stats grid */
.dsum-stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px;
    margin-bottom: 10px;
}
.dsum-stat {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px; padding: 5px 10px; text-align: center;
}
.dsum-stat-label { display: block; font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: 1px; }
.dsum-stat-value { display: block; font-size: 16px; font-weight: 700; color: #eee; margin-top: 1px; font-family: 'Almendra', serif; }

/* Equipment section */
.dsum-section { margin-bottom: 8px; }
.dsum-section-title {
    font-size: 12px; font-weight: 700; color: #888; text-transform: uppercase;
    letter-spacing: 1px; margin-bottom: 6px; padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.dsum-bonus-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.dsum-bonus-tag {
    font-size: 10px; padding: 2px 7px; border-radius: 4px;
    background: rgba(46,204,113,0.12); color: #2ecc71; font-weight: 600;
    border: 1px solid rgba(46,204,113,0.2);
}

/* Abilities grid */
.dsum-abilities-grid, .dsum-equip-grid { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.dsum-ability-group { display: flex; align-items: center; gap: 6px; }
.dsum-ability-label { font-size: 10px; color: #555; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; min-width: 36px; }
.dsum-ability-icons { display: flex; gap: 5px; flex-wrap: wrap; }
.dsum-ability-icon {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px; cursor: pointer; transition: all 0.15s;
}
.dsum-ability-icon img { width: 28px; height: 28px; image-rendering: pixelated; }
.dsum-gear-icon, .dsum-trophy-icon {
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.04); border: 2px solid #444;
    border-radius: 6px; cursor: pointer; transition: all 0.15s;
}
.dsum-gear-icon img, .dsum-trophy-icon img { width: 26px; height: 26px; image-rendering: pixelated; }
.dsum-nav-item:hover, .dsum-nav-item.gp-focus {
    background: rgba(74,158,255,0.12); border-color: #4a9eff !important;
    box-shadow: 0 0 10px rgba(74,158,255,0.3);
    transform: translateY(-2px);
}
.dsum-empty { font-size: 11px; color: #555; font-style: italic; }

/* Tooltip classes moved to .dsum-side-tooltip above */

/* Kill breakdown */
.dsum-kill-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px 10px;
}
.dsum-kill-row {
    display: flex; align-items: center; gap: 5px; padding: 3px 6px;
    border-radius: 4px; background: rgba(255,255,255,0.02);
}
.dsum-kill-sprite {
    width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated;
    flex-shrink: 0;
}
.dsum-kill-icon { font-size: 13px; width: 24px; text-align: center; flex-shrink: 0; }
.dsum-kill-name { flex: 1; font-size: 12px; color: #aaa; }
.dsum-kill-count { font-size: 12px; font-weight: 700; color: #ddd; }
.dsum-kill-empty { font-size: 12px; color: #555; font-style: italic; }
.dsum-kill-more { font-size: 11px; color: #666; font-style: italic; padding: 2px 6px; }

/* Cinzas + Maestria lado a lado */
.dsum-rewards-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    margin-top: 6px;
}
.dsum-cinzas {
    background: rgba(255,102,34,0.08); border: 1px solid rgba(255,102,34,0.2);
    border-radius: 10px; padding: 10px 12px;
}
.dsum-mastery {
    background: rgba(128,80,200,0.08); border: 1px solid rgba(128,80,200,0.2);
    border-radius: 10px; padding: 10px 12px;
}

/* Buttons — fixos no fundo, não scrollam */
.dsum-buttons {
    display: flex; gap: 14px; justify-content: center;
    padding: 12px 24px 16px; flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.death-buttons { display: flex; gap: 16px; margin-top: 10px; }
.death-btn {
    padding: 11px 28px; font-size: 15px; color: white;
    border: none; border-radius: 8px; cursor: pointer; font-weight: 600;
    transition: background 0.2s, transform 0.1s;
}
.death-btn:hover { transform: scale(1.05); }
.death-btn:active { transform: scale(0.97); }
.death-btn-retry { background: #e74c3c; }
.death-btn-retry:hover { background: #c0392b; }
.death-btn-change { background: #2c3e50; border: 1px solid #4a5568; }
.death-btn-change:hover { background: #34495e; }

/* ============================================================
   Character Select Screen
   ============================================================ */
#char-select-screen {
    display: none; position: fixed; inset: 0;
    background: radial-gradient(ellipse at center, #0d0d1a 0%, #050508 100%);
    z-index: 300;
    font-family: 'Segoe UI', sans-serif;
}
#char-select-screen.show { display: block; cursor: default; }

/* Resume Banner */
.resume-banner {
    position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
    z-index: 20; width: auto; max-width: 640px;
    background: linear-gradient(135deg, rgba(30,60,30,0.85) 0%, rgba(20,40,20,0.9) 100%);
    border: 1px solid rgba(100,200,100,0.35); border-radius: 10px;
    padding: 12px 20px; box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    animation: rb-slideIn 0.4s ease-out;
}
@keyframes rb-slideIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.rb-content { display: flex; align-items: center; gap: 16px; justify-content: space-between; }
.rb-left { display: flex; align-items: center; gap: 12px; }
.rb-char-img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 0 4px rgba(100,200,100,0.3)); }
.rb-info { display: flex; flex-direction: column; gap: 2px; }
.rb-title { font-family: 'Almendra', serif; font-size: 15px; font-weight: 700; color: #a0e0a0; letter-spacing: 1.5px; text-transform: uppercase; }
.rb-details { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #ccc; flex-wrap: wrap; }
.rb-char { color: #e8d48b; font-weight: 600; }
.rb-wave { color: #aadcaa; }
.rb-gold { color: #e8d48b; display: flex; align-items: center; gap: 2px; }
.rb-diff { display: flex; align-items: center; gap: 3px; }
.rb-diff-icon { width: 14px; height: 14px; vertical-align: middle; }
.rb-sep { color: #555; }
.rb-buttons { display: flex; gap: 8px; flex-shrink: 0; }
.rb-btn {
    font-family: 'Almendra', serif; font-size: 14px; font-weight: 700;
    padding: 8px 18px; border-radius: 6px; cursor: pointer;
    border: 1px solid; transition: all 0.15s; letter-spacing: 0.5px;
}
.rb-btn-resume {
    background: rgba(60,140,60,0.7); border-color: rgba(100,200,100,0.5);
    color: #e0ffe0; text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.rb-btn-resume:hover, .rb-btn-resume.rb-focused {
    background: rgba(80,180,80,0.8); border-color: rgba(130,255,130,0.7);
    box-shadow: 0 0 12px rgba(100,255,100,0.3); color: #fff;
}
.rb-btn-discard {
    background: rgba(60,30,30,0.6); border-color: rgba(150,80,80,0.4);
    color: #daa;
}
.rb-btn-discard:hover, .rb-btn-discard.rb-focused {
    background: rgba(80,40,40,0.7); border-color: rgba(200,100,100,0.6);
    color: #fcc;
}

/* Profile Selector (inside player menu) */
.pm-profile-section { margin-bottom: 4px; }
.ps-row-menu { display: flex; gap: 6px; }
.ps-tab {
    flex: 1; display: flex; flex-direction: column; gap: 2px;
    padding: 8px 12px; border-radius: 6px; cursor: pointer;
    background: rgba(30,30,50,0.6); border: 1px solid rgba(80,80,120,0.3);
    color: #888; font-size: 12px; font-family: 'Almendra', serif;
    transition: all 0.15s; user-select: none; text-align: center;
}
.ps-tab:hover, .ps-tab.ps-hover {
    background: rgba(40,40,60,0.8); color: #bbb; border-color: rgba(120,120,180,0.5);
    box-shadow: 0 0 6px rgba(100,100,200,0.15);
}
.ps-tab.ps-active {
    background: rgba(50,40,20,0.8); border-color: rgba(218,165,32,0.5);
    color: #f0d060; box-shadow: 0 0 10px rgba(218,165,32,0.2);
}
.ps-tab.ps-active .ps-name { color: #f0d060; }
.ps-tab.ps-active .ps-meta { color: #b8a050; }
.ps-tab-top { display: flex; align-items: center; justify-content: center; gap: 5px; }
.ps-name { font-weight: 700; letter-spacing: 0.5px; font-size: 13px; }
.ps-cinzas { font-size: 11px; color: #e8d48b; }
.ps-meta { font-size: 10px; color: #666; font-family: 'Inter', sans-serif; display: flex; align-items: center; justify-content: center; gap: 3px; }
.ps-meta.ps-empty { color: #555; font-style: italic; }
.ps-diff-icon { width: 14px; height: 14px; vertical-align: middle; image-rendering: pixelated; }
.ps-run-dot {
    display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: #6c6; box-shadow: 0 0 4px rgba(100,200,100,0.5);
}
.ps-delete {
    font-size: 11px; cursor: pointer; opacity: 0.4; margin-left: auto;
    transition: opacity 0.2s, transform 0.2s;
}
.ps-delete:hover { opacity: 0.9; transform: scale(1.2); }
.ps-delete-confirm { opacity: 1; animation: deletePulse 0.6s ease-in-out infinite; }
@keyframes deletePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.3); } }
.ps-delete-hint {
    text-align: center; font-size: 10px; color: #665; margin-top: 4px;
    font-family: 'Inter', sans-serif;
}
.ps-delete-hint kbd {
    background: rgba(60,40,40,0.5); border: 1px solid rgba(120,80,80,0.3);
    border-radius: 3px; padding: 1px 5px; font-size: 9px; color: #a66;
}
.ps-header { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ps-hint { font-size: 10px; color: #555; font-family: 'Inter', sans-serif; }
.ps-hint kbd {
    padding: 1px 5px; border-radius: 3px; font-size: 10px;
    background: rgba(60,60,80,0.5); border: 1px solid rgba(80,80,100,0.3); color: #777;
}

/* Phases */
.cs-phase {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 0.4s, transform 0.4s;
}
.cs-phase-hidden {
    opacity: 0; pointer-events: none; transform: translateX(60px);
}
/* Phase 2 (chars) — scrollable, centered like weapon-select */
#cs-phase-chars {
    justify-content: flex-start;
    overflow-y: auto; overflow-x: hidden;
    padding: 40px 10px 10px;
    scrollbar-width: none; /* Firefox */
}
#cs-phase-chars > .cs-header { margin-top: auto; }
#cs-phase-chars > .cs-chars-layout { margin-bottom: auto; }
/* Hints dentro do fluxo (não fixed) — evita sobreposição com cards */
#cs-phase-chars > .input-hint {
    position: static; transform: none;
    text-align: center; flex-shrink: 0;
    padding: 8px 0 4px;
}
#cs-phase-chars::-webkit-scrollbar { display: none; } /* Chrome */

/* Header (matches ws-header style) */
.cs-header { text-align: center; margin-bottom: 20px; }
.cs-back-btn {
    position: absolute; top: 16px; left: 20px;
    background: rgba(20, 20, 40, 0.8); border: 1px solid #3a3a5a; border-radius: 6px;
    color: #bbb; font-size: 13px; font-weight: 700; padding: 6px 14px; cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    z-index: 10; letter-spacing: 0.5px;
}
.cs-back-btn:hover { background: rgba(40, 40, 60, 0.9); color: #fff; border-color: #6cb4ee; }
.cs-title-small {
    font-family: 'Almendra', serif;
    font-size: 22px; font-weight: 700; letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #ffecd2 0%, #f0932b 50%, #eb4d4b 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.cs-diff-badge-abs {
    position: absolute; top: 18px; right: 70px;
    font-family: 'Almendra', serif;
    font-size: 12px; font-weight: 700; padding: 5px 14px;
    border-radius: 6px; letter-spacing: 1.5px; z-index: 10;
    color: #bbb; border: 1px solid #3a3a5a;
    background: rgba(20, 20, 40, 0.8);
}

/* Confirm difficulty button */
.cs-confirm-btn {
    margin-top: 24px; padding: 14px 48px;
    background: linear-gradient(135deg, #ff6633 0%, #e65100 100%);
    border: none; border-radius: 10px;
    color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 2px;
    cursor: pointer; transition: all 0.25s;
    box-shadow: 0 4px 20px rgba(255,102,51,0.3);
}
.cs-confirm-btn:hover {
    transform: translateY(-2px); box-shadow: 0 6px 30px rgba(255,102,51,0.5);
}
.cs-confirm-btn:active { transform: translateY(0); }
#cs-menu-btn {
    position: absolute; top: 12px; right: 12px;
    width: 44px; height: 44px;
    background: rgba(15, 15, 30, 0.85); border: 1px solid #3a3a5a;
    border-radius: 8px; color: #bbb; font-size: 24px;
    cursor: pointer; z-index: 301;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    backdrop-filter: blur(4px);
}
#cs-menu-btn:hover { background: rgba(30, 30, 50, 0.95); color: #e0e0e0; border-color: #e67e22; }

#ws-menu-btn {
    position: absolute; top: 12px; right: 12px;
    width: 44px; height: 44px;
    background: rgba(15, 15, 30, 0.85); border: 1px solid #3a3a5a;
    border-radius: 8px; color: #bbb; font-size: 24px;
    cursor: pointer; z-index: 301;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    backdrop-filter: blur(4px);
}
#ws-menu-btn:hover { background: rgba(30, 30, 50, 0.95); color: #e0e0e0; border-color: #e67e22; }

.cs-title {
    font-family: 'Almendra', serif;
    font-size: 28px; font-weight: 700; letter-spacing: 4px; margin-bottom: 6px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #ffecd2 0%, #f0932b 50%, #eb4d4b 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.cs-subtitle { font-size: 13px; color: #555; margin-bottom: 20px; }

/* Layout: grid left + detail right */
.cs-chars-layout {
    display: flex; gap: 20px; width: 100%; max-width: 1200px;
    margin: 0 auto; padding: 0 16px;
    align-items: flex-start;
    /* Encolhe o layout pra caber em viewports menores que o design (1200px) */
    zoom: min(1, calc(100vw / 1200));
}
#char-select-grid {
    display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
    flex: 1; padding: 10px 0 20px; align-content: flex-start;
    max-width: 750px;
}
/* Detail panel */
.cs-detail-panel {
    width: 280px; min-width: 280px;
    background: linear-gradient(180deg, #12122a 0%, #0d0d1a 100%);
    border: 2px solid #2a2a4a; border-radius: 10px;
    padding: 10px 12px;
}
.cs-detail-placeholder { color: #444; font-size: 12px; text-align: center; padding: 40px 0; }
/* Detail panel content */
.cs-d-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cs-d-portrait { width: 48px; height: 48px; object-fit: contain; image-rendering: auto; border-radius: 6px; }
.cs-d-portrait-placeholder { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; font-size: 28px; background: #1a1a2e; border-radius: 6px; }
.cs-d-name { font-size: 15px; font-weight: 700; color: #ff9944; }
.cs-d-role { font-size: 10px; color: #888; }
.cs-d-hint { text-align: center; font-size: 9px; color: #444; margin-top: 4px; letter-spacing: 1px; }
/* Card perk label */
.cs-card-perk { font-size: 9px; color: #e67e22; margin-top: 4px; opacity: 0.8; }

.cs-card {
    width: 160px; padding: 10px 8px 8px;
    background: linear-gradient(180deg, #12122a 0%, #0d0d1a 100%);
    border: 2px solid #2a2a4a; border-radius: 12px;
    cursor: pointer; transition: all 0.3s;
    text-align: center; display: flex; flex-direction: column; align-items: center;
    position: relative;
}
/* Invisible hover zone below card — prevents jitter from translateY on hover */
.cs-card::after {
    content: ''; position: absolute; bottom: -10px; left: 0; right: 0; height: 10px;
}
/* Mouse mode: hover funciona normalmente */
body:not(.gp-active) .cs-card:hover {
    border-color: #6cb4ee; transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(108,180,238,0.2);
}
.cs-card:active { transform: translateY(-2px); }
.cs-card.cs-pinned { border-color: #6cb4ee; transform: translateY(-6px); box-shadow: 0 8px 30px rgba(108,180,238,0.3); }
/* Gamepad/keyboard nav mode: gp-focus funciona, hover desativado */
body.gp-active .cs-card:hover, body.kb-nav .cs-card:hover,
#char-select-grid:has(.gp-focus) .cs-card:hover:not(.gp-focus) { border-color: #2a2a4a; transform: none; box-shadow: none; }
body.gp-active .cs-card.gp-focus, body.kb-nav .cs-card.gp-focus, .cs-card.gp-focus {
    border-color: #6cb4ee; transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(108,180,238,0.3), 0 0 0 2px rgba(108,180,238,0.15);
}
.cs-card.cs-locked {
    opacity: 0.5; cursor: default; border-style: dashed; filter: grayscale(70%);
}
.cs-card.cs-locked:hover {
    border-color: #2a2a4a; transform: none; box-shadow: none; opacity: 0.6;
}
.cs-lock-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 28px; background: rgba(0,0,0,0.3); border-radius: 8px;
    pointer-events: none;
}

/* Sprite wrapper for selection animation */
.cs-sprite-wrap {
    position: relative; width: 90px; height: 90px; margin-bottom: 6px;
    overflow: visible;
}
.cs-preview {
    width: 90px; height: 90px; object-fit: contain;
    image-rendering: auto; border-radius: 8px;
    transition: transform 0.3s, filter 0.3s;
}
.cs-anim-canvas {
    width: 180px; height: 180px;
    image-rendering: pixelated; position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 2; pointer-events: none;
}
.cs-select-flash {
    position: absolute; inset: 0; border-radius: 8px;
    background: radial-gradient(circle, rgba(255,102,34,0.6) 0%, transparent 70%);
    opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.cs-preview-placeholder {
    width: 90px; height: 90px; display: flex;
    align-items: center; justify-content: center;
    font-size: 40px; color: #333; margin-bottom: 6px;
}

/* Selection animation */
.cs-selecting { }
.cs-selecting .cs-select-flash { display: none; }
@keyframes cs-flash-anim {
    0% { opacity: 0; }
    15% { opacity: 1; }
    60% { opacity: 0.3; }
    100% { opacity: 0; }
}
@keyframes cs-name-glow {
    0% { filter: brightness(1); }
    20% { filter: brightness(1.5) drop-shadow(0 0 8px rgba(255,255,255,0.5)); }
    100% { filter: brightness(1); }
}
/* Other cards dim when one is selected */
.cs-dimmed {
    opacity: 0.25 !important; transform: scale(0.97) !important;
    transition: opacity 0.3s, transform 0.3s !important;
    pointer-events: none;
}

.cs-name {
    font-family: 'Almendra', serif;
    font-size: 15px; font-weight: 700; margin-bottom: 2px;
    background: linear-gradient(180deg, #ffecd2 0%, #f0932b 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.cs-role { font-size: 10px; color: #888; margin-bottom: 4px; }
.cs-desc { font-size: 11px; color: #666; line-height: 1.4; margin-bottom: 10px; min-height: 32px; }
.cs-weapon {
    font-size: 11px; color: #ff6633;
    background: #1a1020; padding: 3px 12px; border-radius: 10px;
}
/* Section titles inside card */
.cs-section-title {
    width: 100%; font-size: 9px; color: #444; text-transform: uppercase;
    letter-spacing: 1.5px; margin: 3px 0 1px; padding-left: 2px; text-align: left;
}

/* Compact 2-column grid for stats */
.cs-grid2 {
    width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 1px 4px; margin-bottom: 2px;
}
/* Custom tooltip for char-select (JS-driven, appended to body) */
[data-tip] { position: relative; cursor: default; }
.cs-card:hover { z-index: 10; }
#cs-tooltip {
    position: fixed; z-index: 99999;
    padding: 5px 10px;
    background: rgba(10, 10, 20, 0.97); color: #ddd;
    font-size: 11px; line-height: 1.3; white-space: nowrap;
    border: 1px solid #3a3a5a; border-radius: 6px;
    pointer-events: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.7);
    display: none;
}

.cs-cell {
    display: flex; align-items: center; gap: 2px;
    padding: 1px 3px; font-size: 10px; border-radius: 3px;
}
.cs-cell:nth-child(odd) { background: rgba(255,255,255,0.02); }
.gp-tip-focus { outline: 1px solid #e67e22; outline-offset: 1px; border-radius: 3px; background: rgba(230,126,34,0.1) !important; }
.cs-cl { flex: 1; color: #666; font-size: 9px; white-space: nowrap; }
.cs-cv { font-weight: 700; color: #ccc; font-size: 10px; }
.cs-val-active { color: #ddd; }
.cs-val-zero { color: #2a2a3a; }
.cs-val-phys { color: #e67e22; }
.cs-val-mag { color: #9b59b6; }
.cs-val-en-dom { color: #2ecc71; font-weight: 800; text-shadow: 0 0 6px rgba(46,204,113,0.4); }
.cs-val-es-dom { color: #2ecc71; font-weight: 800; text-shadow: 0 0 6px rgba(46,204,113,0.4); }
.cs-val-neg { color: #e74c3c; }
.cs-val-buff { color: #2ecc71; }
.cs-val-heal { color: #27ae60; }

/* Potions row */
.cs-potions {
    display: flex; gap: 4px; justify-content: center; margin-bottom: 4px; flex-wrap: wrap;
}
.cs-potion {
    display: flex; align-items: center; gap: 2px;
    font-size: 10px; color: #999; background: #0a0a18; padding: 2px 5px;
    border-radius: 6px; border: 1px solid #1a1a2a;
}
.cs-potion span { font-weight: 600; }
.cs-potion-zero { opacity: 0.3; }
.cs-potion-blocked { border-color: #e74c3c40; }
.cs-potion-blocked span { color: #e74c3c; font-weight: 700; }
.cs-potion-icon-wrap { position: relative; display: inline-flex; }
.cs-potion-lock { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 10px; filter: drop-shadow(0 0 2px #000); pointer-events: none; }

/* Perk box (efeito inato) — layout centralizado */
.cs-perk-box {
    width: 100%; font-size: 10px; background: #0d0d20;
    padding: 4px 6px; border-radius: 6px; margin-top: 2px;
    line-height: 1.2; border: 1px solid #a0522d40;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
}
.cs-perk-header { color: #a0522d; font-size: 10px; margin-bottom: 1px; }
.cs-perk-icon { font-size: 11px; }
.cs-perk-img { width: 20px; height: 20px; image-rendering: pixelated; border-radius: 3px; margin-bottom: 1px; }
.cs-perk-desc { color: #ddd; font-size: 9px; }

/* Restrictions */
.cs-restrictions {
    width: 100%; margin-top: 2px;
}
.cs-restriction {
    display: block; font-size: 9px; color: #e74c3c; text-align: center;
    background: #e74c3c10; padding: 2px 4px; border-radius: 4px;
    border: 1px solid #e74c3c30;
}

/* Passive box — layout centralizado */
.cs-passive-box {
    width: 100%; font-size: 10px; color: #ccc; background: #0a0a18;
    padding: 4px 6px; border-radius: 6px; margin-top: 2px;
    line-height: 1.2; border: 1px solid #cc333340;
    min-height: 24px; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
}
.cs-passive-box .cs-passive-icon { font-size: 11px; }
.cs-passive-box .cs-perk-img { width: 20px; height: 20px; image-rendering: pixelated; border-radius: 3px; margin-bottom: 1px; }
.cs-passive-name { color: #cc3333; font-size: 10px; margin-bottom: 1px; }
.cs-passive-desc { color: #ddd; font-size: 9px; }
.cs-passive-locked { color: #444; font-size: 10px; }

/* Placeholder perk preview (future character) */
.cs-perk-preview {
    margin-top: 12px; padding: 8px; border: 1px dashed #f1c40f44;
    border-radius: 8px; background: #1a1a10;
}
.cs-perk-tag {
    font-size: 9px; color: #f1c40f; letter-spacing: 1px; font-weight: 700;
    margin-bottom: 4px;
}
.cs-perk-desc { font-size: 11px; color: #ddd; }

.cs-hint { margin-top: 24px; font-size: 11px; color: #444; }

/* ============================================================
   Weapon Select Screen
   ============================================================ */
#weapon-select-screen {
    display: none; position: fixed; inset: 0;
    background: radial-gradient(ellipse at center, #0d0d1a 0%, #050508 100%);
    z-index: 300;
    align-items: center; justify-content: center; flex-direction: column;
    padding: 40px 10px 10px;
    font-family: 'Segoe UI', sans-serif;
    overflow-y: auto; scrollbar-width: none;
}
/* Hint dentro do fluxo */
#weapon-select-screen > .input-hint {
    position: static; transform: none;
    text-align: center; flex-shrink: 0;
    padding: 8px 0 4px;
}
#weapon-select-screen::-webkit-scrollbar { display: none; }
#weapon-select-screen.show { display: flex; cursor: default; }
/* Bloco grid+detail — centralizado pelo justify-content do pai */
#weapon-select-screen > .ws-content { align-self: center; }

.ws-back-btn {
    position: absolute; top: 16px; left: 20px;
    background: rgba(20, 20, 40, 0.8); border: 1px solid #3a3a5a;
    border-radius: 6px; color: #bbb; font-size: 13px; font-weight: 700;
    padding: 6px 14px; cursor: pointer; letter-spacing: 0.5px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ws-back-btn:hover { background: rgba(40, 40, 60, 0.9); color: #fff; border-color: #6cb4ee; }

.ws-header { text-align: center; margin-bottom: 20px; }
.ws-title {
    font-family: 'Almendra', serif;
    font-size: 22px; font-weight: 700; letter-spacing: 3px; margin-bottom: 4px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #ffecd2 0%, #f0932b 50%, #eb4d4b 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ws-subtitle { font-size: 11px; color: #555; margin-bottom: 14px; }

/* Banner explicativo energia/essência */
.ws-resource-banner {
    display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
    background: rgba(255,255,255,0.03); border: 1px solid #1a1a30; border-radius: 8px;
    padding: 6px 16px; margin-bottom: 14px; font-size: 11px; color: #777;
    max-width: 640px; align-self: flex-start; margin-left: calc(50% - 450px);
}
.ws-resource-banner .ws-rb-sep { color: #333; margin: 0 4px; }
.ws-resource-banner img { width: 14px; height: 14px; vertical-align: middle; }

/* Gradiente de recomendação nos cards */
.ws-card.ws-rec-energy {
    background: linear-gradient(135deg, #12122a 30%, rgba(230,126,34,0.22) 100%);
    border-color: rgba(230,126,34,0.3);
}
.ws-card.ws-rec-essence {
    background: linear-gradient(135deg, #12122a 30%, rgba(155,89,182,0.22) 100%);
    border-color: rgba(155,89,182,0.3);
}
/* Nomes mais opacos nos cards NÃO recomendados (quando há recomendação ativa) */
.ws-has-rec .ws-card:not(.ws-rec-energy):not(.ws-rec-essence) .ws-card-name { color: #666; }
.ws-has-rec .ws-card:not(.ws-rec-energy):not(.ws-rec-essence) { opacity: 0.7; }

/* Indicador de sinergia no painel de detalhes */
.ws-synergy {
    width: 100%; margin-top: 4px; padding: 6px 8px;
    border-radius: 8px; font-size: 10px; line-height: 1.4; text-align: center;
}
.ws-synergy.ws-syn-good {
    background: rgba(230,126,34,0.08); border: 1px solid rgba(230,126,34,0.2);
}
.ws-synergy.ws-syn-good-es {
    background: rgba(155,89,182,0.08); border: 1px solid rgba(155,89,182,0.2);
}
.ws-synergy.ws-syn-neutral {
    background: rgba(255,255,255,0.02); border: 1px solid #1a1a30;
}

/* Filtros */
/* Filter row with Q/E or LB/RB hints on sides */
.ws-filter-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ws-filter-hint {
    display: inline-block; font-size: 10px; color: #555; background: rgba(255,255,255,0.04);
    border: 1px solid #333; border-radius: 3px; padding: 1px 6px;
    font-family: inherit; font-weight: 600; min-width: 20px; text-align: center;
}
body.kb-nav .ws-filter-hint, body.gp-active .ws-filter-hint { color: #777; border-color: #444; background: rgba(255,255,255,0.06); }

/* Input hints (bottom of each screen) */
.input-hint {
    position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
    font-size: 11px; color: #444; letter-spacing: 0.5px; white-space: nowrap;
    z-index: 10; pointer-events: none;
}
.input-hint kbd {
    display: inline-block; background: rgba(255,255,255,0.06); border: 1px solid #444;
    border-radius: 3px; padding: 0 5px; font-size: 10px; color: #777; font-family: inherit;
    margin: 0 1px; font-weight: 600;
}
.input-hint .hint-sep { margin: 0 8px; color: #333; }
/* Panel inline hints (healer, book — inside the panel, not fixed) */
.panel-hints {
    text-align: center; font-size: 11px; color: #444;
    letter-spacing: 0.5px; margin-top: 8px; padding-top: 6px;
    border-top: 1px solid #1a1a30;
}
.panel-hints kbd {
    display: inline-block; background: rgba(255,255,255,0.06); border: 1px solid #444;
    border-radius: 3px; padding: 0 5px; font-size: 10px; color: #777; font-family: inherit;
    margin: 0 1px; font-weight: 600;
}
.panel-hints .hint-sep { margin: 0 8px; color: #333; }
/* Gamepad button shape (circle = remete ao controle) */
kbd.gp-btn-a, kbd.gp-btn-b, kbd.gp-btn-cross, kbd.gp-btn-circle {
    width: 20px; height: 20px; border-radius: 50%; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; line-height: 1; vertical-align: middle;
    box-sizing: border-box; border-width: 2px;
    background: rgba(20,20,30,0.9);
}
/* Gamepad button colors (Xbox: A=green, B=red, DPad cross) */
kbd.gp-btn-a {
    color: #5ec269; border-color: #5ec269;
    background: rgba(94,194,105,0.15);
}
kbd.gp-btn-b {
    color: #e05454; border-color: #e05454;
    background: rgba(224,84,84,0.15);
}
/* PlayStation button colors (Cross=blue, Circle=red) */
kbd.gp-btn-cross {
    color: #6eafef; border-color: #6eafef;
    background: rgba(110,175,239,0.15);
}
kbd.gp-btn-circle {
    color: #e05454; border-color: #e05454;
    background: rgba(224,84,84,0.15);
}
.gp-dpad {
    display: inline-block; font-size: 15px; color: #aaa;
    vertical-align: -2px; margin-right: 2px;
    text-shadow: 0 0 6px rgba(170,170,170,0.3);
}

/* Overlay tab hints (shop, altar, ferreiro) */
.overlay-tab-hint {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; color: #666; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12); border-radius: 5px;
    padding: 4px 8px; min-width: 22px;
    font-family: inherit; font-weight: 700; letter-spacing: 0.5px;
    cursor: pointer; vertical-align: middle; transition: all 0.15s;
}
.overlay-tab-hint:hover { color: #f1c40f; border-color: rgba(241,196,15,0.3); background: rgba(241,196,15,0.06); }

.ws-filters { display: flex; gap: 6px; justify-content: center; }
.ws-filter-btn {
    padding: 5px 14px; font-size: 11px; font-weight: 600;
    background: rgba(255,255,255,0.03); border: 1px solid #2a2a4a;
    border-radius: 8px; color: #666; cursor: pointer;
    transition: all 0.2s; font-family: inherit;
}
.ws-filter-btn:hover { border-color: #555; color: #aaa; }
.ws-filter-btn.active {
    border-color: #6cb4ee; color: #6cb4ee;
    background: rgba(108,180,238,0.1);
}

/* Layout: grid (detail agora é absolute fora do flow) */
.ws-content {
    display: flex; gap: 20px; align-items: flex-start;
    max-width: 900px; width: 94%;
    padding-right: 260px; /* espaço pro detail absolute (240px + 20px gap) */
}

#weapon-select-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 6px; flex: 1;
    min-height: 168px; align-content: start;
}

.ws-card {
    display: flex; gap: 8px; padding: 8px 10px;
    background: linear-gradient(180deg, #12122a 0%, #0d0d1a 100%);
    border: 2px solid #2a2a4a; border-radius: 10px;
    cursor: pointer; transition: all 0.2s;
    align-items: center;
    min-width: 0;
}
body:not(.gp-active) .ws-card:hover {
    border-color: #6cb4ee;
    box-shadow: 0 2px 12px rgba(108,180,238,0.2);
}
.ws-card:active { transform: scale(0.97); }
.ws-card.ws-pinned { border-color: #6cb4ee; box-shadow: 0 4px 20px rgba(108,180,238,0.3); background: linear-gradient(180deg, #1a1530 0%, #12102a 100%); }
body.gp-active .ws-card:hover, body.kb-nav .ws-card:hover,
#weapon-select-grid:has(.gp-focus) .ws-card:hover:not(.gp-focus) { border-color: #2a2a4a; transform: none; box-shadow: none; }
body.gp-active .ws-card.gp-focus, body.kb-nav .ws-card.gp-focus, .ws-card.gp-focus {
    border-color: #6cb4ee;
    box-shadow: 0 2px 16px rgba(108,180,238,0.3), 0 0 0 2px rgba(108,180,238,0.15);
}

.ws-icon {
    flex-shrink: 0; width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: #0a0a18; border-radius: 8px; border: 1px solid #222240;
}
.ws-card-name {
    flex: 1; font-size: 11px; font-weight: 600; color: #ddd;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-elem { font-size: 13px; flex-shrink: 0; }

/* Painel de detalhes — absolute no lado direito do screen */
.ws-detail {
    width: 240px;
    background: linear-gradient(180deg, #12122a 0%, #0d0d1a 100%);
    border: 1px solid #2a2a4a; border-radius: 12px;
    padding: 18px 16px;
    display: flex; flex-direction: column; align-items: center;
    gap: 8px;
    position: fixed; top: 50%; right: calc(50% - 450px); transform: translateY(-50%);
    overflow-y: hidden;
}
.ws-detail::-webkit-scrollbar { display: none; }
.ws-detail-placeholder {
    color: #444; font-size: 12px; font-style: italic;
    margin: auto; text-align: center;
}
.ws-d-icon {
    width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    background: #0a0a18; border-radius: 10px; border: 1px solid #222240;
}
.ws-d-name {
    font-family: 'Almendra', serif;
    font-size: 16px; font-weight: 700; text-align: center;
    background: linear-gradient(180deg, #ffecd2 0%, #f0932b 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ws-d-desc {
    font-size: 11px; color: #888; text-align: center;
    line-height: 1.4;
}
.ws-d-tags {
    display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;
    font-size: 10px; color: #bbb;
}
.ws-d-tags > span { background: #1a1a2e; padding: 2px 7px; border-radius: 6px; }
.ws-d-stats {
    width: 100%; display: flex; flex-direction: column; gap: 3px;
    margin-top: 4px;
}
.ws-d-stat {
    display: flex; justify-content: space-between;
    font-size: 11px; color: #aaa;
    padding: 2px 0; border-bottom: 1px solid #1a1a30;
}
.ws-d-stat b { color: #eee; }
.ws-d-cost {
    font-size: 11px; margin-top: 4px;
}
.ws-d-hint {
    font-size: 10px; color: #555; font-style: italic;
    margin-top: 8px; padding-top: 8px;
}

/* Wave Banner — dramatic center entrance */
#wave-banner {
    display: none; position: fixed; top: 28%; left: 50%; transform: translate(-50%, -50%);
    z-index: 99999; font-family: 'Almendra', serif; text-align: center;
    pointer-events: none;
}
#wave-banner.show { display: block; }
#wave-banner h2 {
    font-size: 52px; font-weight: 700;
    background: linear-gradient(180deg, #e8dcc8 0%, #a08a6e 45%, #c4b08a 55%, #7a6850 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    filter: drop-shadow(0 0 18px rgba(200,170,120,0.35)) drop-shadow(0 2px 6px rgba(0,0,0,0.9));
    letter-spacing: 4px; text-transform: uppercase;
    animation: waveBannerIn 2s ease-out forwards;
}
#wave-banner .wave-sub {
    font-size: 17px; color: #e74c3c; letter-spacing: 5px; font-weight: 700;
    font-family: 'Almendra', serif;
    text-shadow: 0 0 12px rgba(231,76,60,0.5), 0 2px 4px rgba(0,0,0,0.8);
    animation: waveBannerIn 2s ease-out forwards;
    margin-bottom: 6px;
}
@keyframes waveBannerIn {
    0%   { opacity: 0; transform: scale(0.5); }
    15%  { opacity: 1; transform: scale(1.08); }
    30%  { opacity: 1; transform: scale(1); }
    70%  { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.95) translateY(-20px); }
}

/* ============================================================
   Boss Entrance Cinematic
   ============================================================ */
#boss-entrance-overlay {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
#boss-entrance-overlay .be-vignette {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.7) 100%);
    animation: beVignetteIn 0.5s ease-out forwards;
}
@keyframes beVignetteIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
#boss-entrance-overlay .be-flash {
    position: absolute; inset: 0;
    background: rgba(241,196,15,0.15);
    animation: beFlash 0.6s ease-out forwards;
}
@keyframes beFlash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
#boss-entrance-overlay .be-content {
    position: relative; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
#boss-entrance-overlay .be-wave {
    font-size: 16px; font-weight: 700; letter-spacing: 8px;
    color: #c0392b; font-family: 'Segoe UI', sans-serif;
    text-shadow: 0 0 20px rgba(192,57,43,0.6), 0 2px 4px rgba(0,0,0,0.9);
    opacity: 0; transform: translateY(8px);
    animation: beSlideIn 0.5s ease-out 0.2s forwards;
}
#boss-entrance-overlay .be-name {
    font-size: clamp(28px, 5vw, 48px); font-weight: 900; letter-spacing: 6px;
    color: #c0392b; font-family: serif; text-transform: uppercase;
    text-shadow: 0 0 40px rgba(192,57,43,0.7), 0 0 15px rgba(192,57,43,0.4),
                 0 4px 12px rgba(0,0,0,0.9);
    opacity: 0; transform: scale(1.4);
    animation: beNameIn 0.7s ease-out 0.3s forwards;
    max-width: 90vw; white-space: nowrap;
}
@keyframes beNameIn {
    0% { opacity: 0; transform: scale(1.4); }
    60% { opacity: 1; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}
#boss-entrance-overlay .be-line-top,
#boss-entrance-overlay .be-line-bot {
    width: 0; height: 2px;
    background: linear-gradient(90deg, transparent, #f1c40f, transparent);
    animation: beLineGrow 0.8s ease-out 0.4s forwards;
}
@keyframes beLineGrow {
    0% { width: 0; opacity: 0; }
    100% { width: 320px; opacity: 1; }
}
@keyframes beSlideIn {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}
#boss-entrance-overlay.be-fade-out {
    transition: opacity 0.6s ease-out;
    opacity: 0;
}

/* ============================================================
   Shop Screen
   ============================================================ */
#shop-screen {
    display: none; position: fixed; inset: 0;
    background: rgba(5,5,8,0.85);
    z-index: 100; align-items: center; justify-content: center;
    font-family: 'Segoe UI', sans-serif; color: #e0e0e0;
    overflow-y: auto; scrollbar-width: none;
}
#shop-screen::-webkit-scrollbar { display: none; }
#shop-screen.show { display: flex; cursor: default; }

.shop-panel {
    width: 96%; max-width: 1150px;
    padding: 14px 20px 10px;
    max-height: calc(94vh * var(--ui-zoom-inv, 1));
    display: flex; flex-direction: column;
}
.shop-main {
    display: flex; flex: 1 1 auto; min-height: 0; gap: 12px;
}
.shop-panel .shop-body {
    flex: 1 1 auto;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
    padding: 0 10px;
}
.shop-panel .shop-body::-webkit-scrollbar {
    display: none;
}
/* Scroll indicators — pulsing arrows */
.scroll-indicator {
    position: sticky; left: 0; right: 0;
    display: flex; justify-content: center; align-items: center;
    height: 24px; min-height: 24px; z-index: 50; pointer-events: none;
    opacity: 0; transition: opacity 0.3s;
    margin: 0 -14px; padding: 0 14px; /* extend to full width past body padding */
}
.scroll-indicator.visible { opacity: 1; }
.scroll-indicator-up { top: 0; background: linear-gradient(to bottom, rgba(10,10,20,0.95) 30%, transparent); }
.scroll-indicator-down { bottom: 0; background: linear-gradient(to top, rgba(10,10,20,0.95) 30%, transparent); }
.scroll-indicator span {
    color: #f5a623; font-size: 18px;
    animation: scrollPulse 1.2s ease-in-out infinite;
}
@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(3px); }
}
.scroll-indicator-up span {
    animation: scrollPulseUp 1.2s ease-in-out infinite;
}
@keyframes scrollPulseUp {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}

.shop-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px; gap: 16px;
    flex-shrink: 0;
}
.shop-tabs {
    display: flex; align-items: center; gap: 2px;
    background: rgba(0,0,0,0.3); border-radius: 8px; padding: 3px;
    border: 1px solid rgba(255,255,255,0.06);
}
.shop-tab {
    padding: 7px 22px; border: none; border-radius: 6px;
    background: transparent; color: #666;
    font-size: 12px; font-weight: 700; cursor: pointer;
    transition: all 0.2s; text-transform: uppercase; letter-spacing: 1.5px;
}
.shop-tab:hover { background: rgba(255,255,255,0.05); color: #aaa; }
.shop-tab-active {
    background: linear-gradient(180deg, rgba(241,196,15,0.2), rgba(241,196,15,0.08));
    color: #f1c40f;
    box-shadow: 0 0 10px rgba(241,196,15,0.15), inset 0 1px 0 rgba(241,196,15,0.2);
}
.shop-tab-arrow { padding: 7px 10px; font-size: 10px; color: #444; background: transparent; border: none; border-radius: 6px; }
.shop-tab-arrow:hover { color: #f1c40f; background: rgba(255,255,255,0.04); }
.shop-title {
    font-family: 'Almendra', serif;
    font-size: 26px; font-weight: 700; letter-spacing: 4px; margin: 0;
    text-transform: uppercase;
    background: linear-gradient(180deg, #ffecd2 0%, #f0932b 50%, #eb4d4b 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.shop-gold-display {
    font-size: 22px; font-weight: 700; color: #f1c40f;
    background: rgba(241,196,15,0.08);
    padding: 4px 16px; border-radius: 8px;
    border: 1px solid rgba(241,196,15,0.2);
}

.shop-section-label {
    font-size: 11px; font-weight: 700; color: #888;
    text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 8px; padding-bottom: 4px;
    border-bottom: 1px solid #1a1a30;
    display: flex; align-items: center; gap: 10px;
}
.shop-trophy-info {
    font-size: 10px; color: #666; font-weight: 400;
    letter-spacing: 0;
}

.shop-grid {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-bottom: 8px;
    padding: 6px 0;
}

/* Equipment cards — fixed size, same in shop & ferreiro */
.shop-card {
    flex: 0 0 calc(20% - 10px); max-width: calc(20% - 10px); min-width: 0; padding: 6px 8px;
    height: 185px; overflow: hidden;
    background: linear-gradient(180deg, #12122a 0%, #0d0d1a 100%);
    border: 2px solid #333; border-radius: 10px;
    transition: all 0.2s; display: flex; flex-direction: column; position: relative;
}
.shop-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
body.gp-active .shop-card:hover, body.kb-nav .shop-card:hover { transform: none; box-shadow: none; border-color: inherit; }

/* Trophy cards — same size as equipment */
.shop-card-trophy {
    padding: 14px 14px;
}
/* Potion cards in shop */
.shop-card-potion {
    border-color: rgba(46,204,113,0.2);
}

.shop-sold {
    opacity: 0.3; align-items: center; justify-content: center;
    border-style: dashed;
}
.shop-sold-text { color: #555; font-size: 12px; font-weight: 700; letter-spacing: 1px; }

.shop-card-header {
    display: flex; align-items: center; gap: 5px; margin-bottom: 3px;
    position: relative; z-index: 1;
}
.shop-card-icon { font-size: 20px; flex-shrink: 0; }
.shop-card-icon img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.shop-card-name { font-size: 10px; font-weight: 700; line-height: 1.2; }
.shop-card-sublabel { font-size: 9px; margin-top: 1px; }

.shop-lock-btn {
    position: absolute; top: 4px; right: 4px;
    cursor: pointer; font-size: 14px; opacity: 0.15;
    transition: opacity 0.2s; user-select: none; z-index: 2;
}
.shop-lock-btn:hover { opacity: 0.5; }
.shop-lock-btn.shop-lock-active { opacity: 0.9; filter: drop-shadow(0 0 4px rgba(241,196,15,0.5)); }

.shop-card-slot {
    font-size: 9px; font-weight: 700; color: #666;
    text-transform: uppercase; letter-spacing: 1px;
    background: rgba(255,255,255,0.04);
    padding: 1px 5px; border-radius: 3px;
    display: inline-block; margin-bottom: 3px; width: fit-content;
}
.shop-card-slot-bg {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 90%; height: auto; max-height: 90%;
    object-fit: contain; image-rendering: pixelated;
    opacity: 0.07; filter: grayscale(1);
    pointer-events: none; z-index: 0;
}
.shop-lv-badge {
    font-size: 9px; font-weight: 600; color: #8899aa;
    background: rgba(255,255,255,0.06);
    padding: 1px 5px; border-radius: 3px;
    margin-left: 4px; vertical-align: middle;
}

.shop-card-desc {
    font-size: 11px; color: #999; margin-bottom: 4px;
    line-height: 1.3; position: relative; z-index: 1;
}
.shop-trophy-desc {
    font-size: 12px; color: #aaa; line-height: 1.4;
    margin-bottom: 12px; min-height: 32px;
}

.shop-card-stats {
    flex: 1; min-height: 0; margin-bottom: 4px;
    overflow-y: auto; scrollbar-width: none;
    position: relative; z-index: 1;
}
.shop-stat {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 10px; padding: 0;
}
.shop-stat { cursor: default; }
.shop-stat-name { color: #aaa; display: inline-flex; align-items: center; }
.stat-icon { width: 12px; height: 12px; vertical-align: middle; image-rendering: pixelated; margin-right: 2px; }
.stat-label { font-size: 10px; color: #aaa; }
.shop-stat-val { font-weight: 600; margin-left: 2px; }
.shop-stat-swap {
    font-size: 10px; margin-left: 4px; opacity: 0.6;
    cursor: help;
}
.shop-stat-type { padding-left: 6px; margin-top: 1px; border-radius: 4px; padding: 1px 6px; }
.shop-stat-type-physical {
    border-left: 2px solid #f39c1260 !important;
    background: rgba(243,156,18,0.12) !important;
}
.shop-stat-type-physical .shop-stat-val { color: #f39c12 !important; }
.shop-stat-type-magical {
    border-left: 2px solid #9b59b660 !important;
    background: rgba(155,89,182,0.12) !important;
}
.shop-stat-type-magical .shop-stat-val { color: #9b59b6 !important; }
.shop-stat-axis { border-left: 2px solid #4fc3f760; padding-left: 6px; margin-top: 1px; }

/* Custom stat tooltip (instant, no native delay) */
.stat-tip {
    position: fixed; z-index: 9999;
    background: #1a1a2e; color: #ccc; border: 1px solid #3a3a5a;
    padding: 3px 8px; border-radius: 4px; font-size: 11px;
    pointer-events: none; white-space: nowrap;
    opacity: 0; transition: opacity 0.08s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.stat-tip.show { opacity: 1; }

.shop-card-replace {
    font-size: 9px; color: #e67e22;
    text-align: center; margin-top: 3px;
    line-height: 1.2; flex-shrink: 0;
}
.shop-card-warn {
    font-size: 10px; color: #e74c3c;
    margin-bottom: 6px;
}

.shop-buy-btn {
    font-family: 'Almendra', serif;
    width: 100%; padding: 4px 0; margin-top: auto; flex-shrink: 0;
    background: transparent; color: #1abc9c;
    border: 1px solid rgba(26,188,156,0.3); border-radius: 4px;
    font-size: 11px; font-weight: 700; cursor: pointer;
    letter-spacing: 1.5px; text-transform: uppercase;
    transition: all 0.2s;
    position: relative; z-index: 1;
}
.shop-buy-btn:hover { background: rgba(26,188,156,0.1); border-color: rgba(26,188,156,0.5); }

.shop-btn-disabled {
    opacity: 0.35; cursor: not-allowed;
    pointer-events: none;
}

/* Shop toast — compact feedback message */
#shop-toast {
    position: fixed; top: 18%; left: 50%; transform: translateX(-50%) translateY(-8px);
    z-index: 10000; pointer-events: none;
    background: rgba(10,10,20,0.92); border: 1px solid rgba(231,76,60,0.4);
    color: #e74c3c; font-size: 14px; font-weight: 700; letter-spacing: 1px;
    padding: 8px 24px; border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 12px rgba(231,76,60,0.15);
    opacity: 0; transition: opacity 0.2s, transform 0.2s;
    font-family: 'Segoe UI', sans-serif;
}
#shop-toast.show {
    opacity: 1; transform: translateX(-50%) translateY(0);
}

/* Equipped item preview panel (below shop cards) — 5 mini-slots */
.shop-equip-preview {
    position: fixed; bottom: 0; left: 0; right: 0;
    padding: 6px 12px;
    background: linear-gradient(180deg, #151530 0%, #0c0c1a 100%);
    border-top: 1px solid #2a2a45;
    animation: shopPreviewIn 0.15s ease-out;
    z-index: 101;
}
@keyframes shopPreviewIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.ep-slots { display: flex; gap: 4px; justify-content: center; }
.ep-slot-wrap { flex: 1; max-width: 220px; display: flex; }
.ep-slot-wrap.ep-active .ep-slot { border-color: #f1c40f; background: rgba(241,196,15,0.08); box-shadow: 0 0 10px rgba(241,196,15,0.2); }
.ep-slot-wrap:not(.ep-active) .ep-slot { opacity: 0.4; }
.ep-slot {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 6px; border-radius: 6px;
    border: 1px solid #222; background: rgba(255,255,255,0.02);
    min-height: 36px; flex: 1;
}
.ep-slot-empty {
    flex-direction: column; justify-content: center; border-style: dashed; border-color: #1a1a30;
}
.ep-slot-placeholder {
    width: 20px; height: 20px; object-fit: contain;
    image-rendering: pixelated; opacity: 0.2;
    filter: grayscale(1);
}
.ep-slot-label { font-size: 9px; color: #444; text-transform: uppercase; letter-spacing: 1px; }
.ep-slot-icon { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; image-rendering: pixelated; }
.ep-slot-info { flex: 1; min-width: 0; overflow: hidden; }
.ep-slot-name { font-size: 9px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-slot-lv { font-size: 9px; font-weight: 600; color: #8899aa; background: rgba(255,255,255,0.06); padding: 0 3px; border-radius: 2px; margin-left: 2px; }
.ep-slot-stats { display: flex; flex-wrap: wrap; gap: 1px 6px; }
.ep-slot-desc { font-size: 9px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-mini-stat { font-size: 9px; color: #4fc3f7; white-space: nowrap; display: inline-flex; align-items: center; gap: 1px; }
.ep-mini-icon { width: 10px; height: 10px; vertical-align: -1px; }

/* Compare tooltip (hover on equipped item) */
.shop-compare-tooltip {
    position: absolute; z-index: 200;
    width: 210px; padding: 14px 16px;
    background: linear-gradient(180deg, #1a1a35 0%, #0e0e1c 100%);
    border: 2px solid #555; border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.7);
    pointer-events: none;
    animation: shopTooltipIn 0.12s ease-out;
}
@keyframes shopTooltipIn {
    from { opacity: 0; transform: translateX(-4px); }
    to { opacity: 1; transform: translateX(0); }
}
.shop-compare-label {
    font-size: 9px; font-weight: 700; color: #888;
    text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 8px; padding-bottom: 4px;
    border-bottom: 1px solid #2a2a40;
}

/* Sell tab layout: potions left + bag grid right */
.sell-layout { display: flex; gap: 12px; align-items: flex-start; }
.sell-potions { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; min-width: 120px; margin-top: 24px; }
.sell-bag { flex: 1; }
.sell-bag-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
}
.sell-bag-grid .shop-card,
.sell-bag-grid .sell-slot-empty {
    min-width: 0; max-width: none;
    flex: none; height: 185px; overflow: hidden;
}
.sell-slot-empty {
    border: 1px dashed #1a1a30; border-radius: 8px;
    background: rgba(255,255,255,0.01);
}
/* Compact potion sell rows */
.sell-potion-row {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 6px; border-radius: 6px;
    background: rgba(255,255,255,0.03); border: 1px solid #222;
}
.sell-potion-row.sell-potion-empty { opacity: 0.4; }
.sell-potion-icon { flex-shrink: 0; }
.sell-potion-qty { font-size: 11px; color: #ccc; font-weight: 700; min-width: 16px; }
.sell-potion-btn {
    margin-left: auto; font-size: 9px; padding: 2px 8px;
    background: rgba(46,204,113,0.1); color: #2ecc71;
    border: 1px solid rgba(46,204,113,0.3); border-radius: 4px;
    cursor: pointer; font-family: inherit; font-weight: 600;
    white-space: nowrap;
}
.sell-potion-btn:hover { background: rgba(46,204,113,0.2); }
.sell-potion-btn.shop-btn-disabled { opacity: 0.3; cursor: default; }
.sell-potion-row.gp-focus { border-color: #4a9eff; box-shadow: 0 0 8px rgba(74,158,255,0.3); }

/* Shop sell section (legacy compat) */
.shop-sell-grid {
    display: flex; flex-wrap: wrap; gap: 14px;
    margin-bottom: 16px;
}
.shop-sell-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 10px; border-radius: 6px;
    background: rgba(255,255,255,0.02);
    border: 1px solid #333;
}
.shop-sell-equipped { border-style: dashed; }
.shop-sell-icon { font-size: 16px; flex-shrink: 0; }
.shop-sell-name { flex: 1; font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-sell-slot { font-size: 9px; color: #666; text-transform: uppercase; min-width: 55px; }
.shop-sell-btn {
    font-size: 10px; padding: 3px 8px; border: none; border-radius: 4px;
    background: rgba(241,196,15,0.15); color: #f1c40f;
    cursor: pointer; font-weight: 600; white-space: nowrap;
    transition: background 0.15s;
}
.shop-sell-btn:hover { background: rgba(241,196,15,0.3); }

/* Potion shop section — card style matching trophies */
.shop-potion-grid {
    display: flex; flex-wrap: wrap; gap: 10px;
}
.shop-potion-grid .shop-card {
    flex: 0 0 calc(20% - 10px); max-width: calc(20% - 10px); min-width: 0;
}
.shop-potion-card {
    display: flex; flex-direction: column; gap: 6px;
    padding: 10px 12px; border-radius: 8px;
    background: rgba(46,204,113,0.04);
    border: 1px solid rgba(46,204,113,0.15);
    transition: all 0.2s ease;
}
.shop-potion-card:hover {
    background: rgba(46,204,113,0.08);
    border-color: rgba(46,204,113,0.3);
}
.shop-potion-card-header {
    display: flex; align-items: center; gap: 8px;
}
.shop-potion-icon { font-size: 16px; flex-shrink: 0; }
.shop-potion-icon img { width: 24px; height: 24px; object-fit: contain; }
.shop-potion-name { font-size: 12px; color: #ccc; font-weight: 600; flex: 1; }
.shop-potion-stock { font-size: 10px; color: #888; }
.shop-potion-btn {
    font-size: 11px; padding: 5px 10px; border: none; border-radius: 5px;
    cursor: pointer; font-weight: 600; white-space: nowrap;
    transition: background 0.15s; width: 100%; text-align: center;
}
.shop-potion-buy { background: rgba(46,204,113,0.12); color: #2ecc71; }
.shop-potion-buy:hover { background: rgba(46,204,113,0.25); }
.shop-potion-sell-btn { background: rgba(241,196,15,0.12); color: #f1c40f; }
.shop-potion-sell-btn:hover { background: rgba(241,196,15,0.25); }

/* Legacy potion items (sell tab) */
.shop-potion-item {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 8px; border-radius: 6px;
    background: rgba(255,255,255,0.02);
    border: 1px solid #333;
}

/* Shop footer */
.shop-footer {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 10px; padding-top: 10px;
    border-top: 1px solid #1a1a30;
    flex-shrink: 0;
}
.shop-sidebar {
    display: flex; flex-direction: column; gap: 8px;
    justify-content: center; align-items: stretch;
    flex-shrink: 0; width: 110px;
}
.shop-sidebar .shop-btn {
    width: 100%; text-align: center; padding: 8px 4px; font-size: 10px; letter-spacing: 0.5px;
}
.shop-sidebar .shop-gp-hints {
    flex-direction: column; gap: 4px; font-size: 10px;
}
.shop-btn {
    font-family: 'Almendra', serif;
    padding: 8px 20px; border-radius: 4px;
    font-size: 13px; font-weight: 700; cursor: pointer;
    border: 1px solid; letter-spacing: 1px; text-transform: uppercase;
    transition: all 0.2s; background: transparent;
}
.shop-btn-reroll {
    background: rgba(241,196,15,0.1); color: #f1c40f;
    border-color: rgba(241,196,15,0.3);
}
.shop-btn-reroll:hover { background: rgba(241,196,15,0.2); }

.shop-btn-proceed {
    background: rgba(231,76,60,0.1); color: #e74c3c;
    border-color: rgba(231,76,60,0.3);
}
.shop-btn-proceed:hover { background: rgba(231,76,60,0.2); }

/* Shop gamepad hints */
.shop-gp-hints {
    gap: 12px; margin-right: auto;
}
.shop-gp-hint {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; color: #888;
}
.gp-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; padding: 0; border-radius: 50%;
    background: rgba(20,20,30,0.9); border: 2px solid rgba(255,255,255,0.15);
    font-size: 10px; font-weight: 700; color: #aaa;
    text-transform: uppercase; letter-spacing: 0; line-height: 1;
    box-sizing: border-box; flex-shrink: 0;
}
.gp-a { color: #5ec269; border-color: #5ec269; background: rgba(94,194,105,0.15); }
.gp-b { color: #e05454; border-color: #e05454; background: rgba(224,84,84,0.15); }
.gp-x { color: #4a9eff; border-color: #4a9eff; background: rgba(74,158,255,0.15); }
.gp-y { color: #f1c40f; border-color: #f1c40f; background: rgba(241,196,15,0.15); }
/* PlayStation colors: ✕=blue, ○=red, □=pink, △=green */
body.gp-ps .gp-a { color: #6eafef; border-color: #6eafef; background: rgba(110,175,239,0.15); }
body.gp-ps .gp-x { color: #d363d3; border-color: #d363d3; background: rgba(211,99,211,0.15); }
body.gp-ps .gp-y { color: #5ec269; border-color: #5ec269; background: rgba(94,194,105,0.15); }
.gp-only { display: none; }
body.gp-active .gp-only { display: flex; }
.kb-only { display: flex; }
body.gp-active .kb-only { display: none; }

/* Shop gamepad/keyboard focus */
.shop-card.gp-focus {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 0 18px rgba(74,158,255,0.6), 0 0 0 2px rgba(74,158,255,0.25), 0 6px 20px rgba(0,0,0,0.5);
    border-color: #4a9eff !important;
    animation: shopFocusPulse 1.5s ease-in-out infinite;
}
@keyframes shopFocusPulse {
    0%, 100% { box-shadow: 0 0 18px rgba(74,158,255,0.6), 0 0 0 2px rgba(74,158,255,0.25), 0 6px 20px rgba(0,0,0,0.5); }
    50% { box-shadow: 0 0 24px rgba(74,158,255,0.8), 0 0 0 3px rgba(74,158,255,0.35), 0 6px 20px rgba(0,0,0,0.5); }
}
.shop-btn.gp-focus {
    box-shadow: 0 0 12px rgba(74,158,255,0.5);
    border-color: #4a9eff !important;
    transform: scale(1.05);
}
.shop-sell-item.gp-focus {
    border-color: #4a9eff !important;
    box-shadow: 0 0 12px rgba(74,158,255,0.5);
    transform: translateY(-2px);
}
.shop-potion-item.gp-focus, .shop-potion-card.gp-focus {
    border-color: #4a9eff !important;
    box-shadow: 0 0 12px rgba(74,158,255,0.5);
    background: rgba(74,158,255,0.1);
    border-radius: 8px;
}

/* Shop sell confirmation overlay */
#shop-confirm-overlay {
    position: absolute; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    animation: shopConfirmFadeIn 0.15s ease-out;
}
@keyframes shopConfirmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.shop-confirm-panel {
    background: linear-gradient(180deg, #1a1a35 0%, #0e0e1c 100%);
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 12px; padding: 24px 32px;
    min-width: 320px; max-width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 60px rgba(0,0,0,0.4);
    text-align: center;
    animation: shopConfirmSlideIn 0.15s ease-out;
}
@keyframes shopConfirmSlideIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.shop-confirm-icon { font-size: 28px; margin-bottom: 8px; }
.shop-confirm-icon img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.shop-confirm-text {
    font-size: 14px; color: #ccc; margin-bottom: 16px; line-height: 1.5;
}
.shop-confirm-item {
    display: block; font-size: 15px; font-weight: 700; margin: 4px 0;
}
.shop-confirm-price {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 16px; font-weight: 700; color: #f1c40f;
}
.shop-confirm-buttons {
    display: flex; gap: 12px; justify-content: center;
}
.shop-confirm-btn {
    flex: 1; padding: 8px 0; border-radius: 6px;
    font-family: 'Almendra', serif; font-size: 13px; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase;
    cursor: pointer; transition: all 0.2s; border: 1px solid;
}
.shop-confirm-yes {
    background: rgba(46,204,113,0.15); color: #2ecc71;
    border-color: rgba(46,204,113,0.4);
}
.shop-confirm-yes:hover { background: rgba(46,204,113,0.25); }
.shop-confirm-yes.gp-focus {
    box-shadow: 0 0 12px rgba(46,204,113,0.5);
    border-color: #2ecc71;
}
.shop-confirm-no {
    background: rgba(231,76,60,0.1); color: #e74c3c;
    border-color: rgba(231,76,60,0.3);
}
.shop-confirm-no:hover { background: rgba(231,76,60,0.2); }
.shop-confirm-no.gp-focus {
    box-shadow: 0 0 12px rgba(231,76,60,0.5);
    border-color: #e74c3c;
}
.shop-confirm-hints {
    margin-top: 12px; display: flex; gap: 16px; justify-content: center;
    font-size: 10px; color: #666;
}
.kb-hint-key {
    background: rgba(60,60,80,0.6); border: 1px solid rgba(100,100,140,0.4);
    border-radius: 3px; padding: 1px 6px; font-size: 10px; color: #aaa;
    font-family: 'Inter', sans-serif;
}

/* Shop shake (can't buy feedback) */
.shop-shake {
    animation: shopShake 0.4s ease-out;
}
@keyframes shopShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-6px); }
    30% { transform: translateX(5px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
}

/* Shop controls hint bar */
.shop-controls-hint {
    display: flex; align-items: center; justify-content: center;
    gap: 4px; padding: 6px 0 2px;
    border-top: 1px solid #1a1a30;
    font-size: 10px; color: #666;
    flex-shrink: 0;
}
.sh-mode { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; }
.sh-gp { display: none; }
body.gp-active .sh-kb { display: none; }
body.gp-active .sh-gp { display: inline-flex; }
.sh-pair { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.sh-key {
    display: inline-block;
    background: rgba(255,255,255,0.06); border: 1px solid #333; border-radius: 3px;
    padding: 1px 5px; font-family: monospace; font-size: 9px; font-weight: 700;
    color: #999; min-width: 18px; text-align: center;
}
.sh-sep { color: #333; margin: 0 4px; }

/* Transmute / Altar / Death gamepad focus */
.tm-item.gp-focus, .tm-tab.gp-focus, .tm-axis-btn.gp-focus, .tm-upgrade-btn.gp-focus {
    border-color: #4a9eff !important;
    box-shadow: 0 0 12px rgba(74,158,255,0.5);
}
.altar-card.gp-focus {
    border-color: #4a9eff !important;
    box-shadow: 0 0 12px rgba(74,158,255,0.5);
}
.altar-tab-btn.gp-focus {
    border-color: #4a9eff !important;
    box-shadow: 0 0 8px rgba(74,158,255,0.4);
}
.death-btn.gp-focus {
    border-color: #4a9eff !important;
    box-shadow: 0 0 12px rgba(74,158,255,0.5);
    transform: scale(1.05);
}

/* ============================================================
   Transmute Screen (Blacksmith)
   ============================================================ */
/* --- Tutorial Book --- */
#book-screen {
    display: none; position: fixed; inset: 0;
    background: rgba(5,5,8,0.85);
    z-index: 100; align-items: center; justify-content: center;
    font-family: 'Segoe UI', sans-serif; color: #e0e0e0;
}
#book-screen.show { display: flex; }
.book-panel {
    position: relative;
    background: linear-gradient(180deg, #1a1a2e, #0d0d1a);
    border: 1px solid #ffffff12; border-radius: 10px;
    padding: 14px 18px; max-width: 540px; width: 90%;
    max-height: calc(65vh * var(--ui-zoom-inv, 1)); display: flex; flex-direction: column;
    overflow: hidden;
}
.book-header {
    text-align: center; margin-bottom: 8px;
}
.book-title {
    font-family: 'Almendra', serif;
    font-size: 15px; font-weight: 700; margin: 0; letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #ffecd2 0%, #f0932b 50%, #eb4d4b 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.book-close-btn {
    position: absolute; right: 14px; top: 12px; z-index: 2;
    background: none; border: 1px solid #333; border-radius: 6px;
    color: #888; font-size: 14px; cursor: pointer; padding: 2px 8px;
    transition: all 0.2s;
}
.book-close-btn:hover { color: #e74c3c; border-color: #e74c3c; }

/* Book nav row (tabs + LB/RB hints) */
.book-nav-row {
    display: flex; align-items: center; gap: 4px; margin-bottom: 8px;
}
.book-nav-row > .overlay-tab-hint { flex-shrink: 0; }
.book-tabs {
    display: flex; gap: 3px; flex: 1; min-width: 0; justify-content: center;
    overflow-x: auto; scrollbar-width: none;
}
.book-tabs::-webkit-scrollbar { display: none; }
.book-tab-btn {
    padding: 3px 5px; font-size: 9px; font-weight: 600;
    background: rgba(255,255,255,0.03); border: 1px solid #2a2a4a;
    border-radius: 6px; color: #666; cursor: pointer;
    transition: all 0.2s; font-family: inherit; white-space: nowrap;
    flex-shrink: 0;
}
.book-tab-btn img { width: 16px; height: 16px; }
/* Mouse click icons for tutorial book */
.book-mouse {
    display: inline-block; width: 14px; height: 20px;
    border: 1.5px solid #666; border-radius: 6px 6px 4px 4px;
    position: relative; vertical-align: middle; margin-right: 3px;
}
.book-mouse::after {
    content: ''; position: absolute; top: 0; left: 50%;
    width: 0; height: 45%; border-left: 1px solid #666;
}
.book-mouse::before {
    content: ''; position: absolute; top: 0; width: 50%; height: 45%;
}
.book-mouse-l::before {
    left: 0; background: rgba(26,188,156,0.5); border-radius: 5px 0 0 0;
}
.book-mouse-r::before {
    right: 0; left: auto; background: rgba(26,188,156,0.5); border-radius: 0 5px 0 0;
}
.book-tab-btn:hover { border-color: #555; color: #aaa; }
.book-tab-active {
    border-color: #6cb4ee; color: #6cb4ee;
    background: rgba(108,180,238,0.1);
}
.book-content-wrap {
    position: relative; flex: 1; overflow-y: auto; scrollbar-width: none;
    min-height: 0;
}
.book-content-wrap::-webkit-scrollbar { display: none; }
.book-content { padding: 4px 0; }
.book-scroll-hint {
    position: sticky; left: 0; right: 0; height: 24px; z-index: 2;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; opacity: 0; transition: opacity 0.2s;
    font-size: 14px; color: #d4a04a;
}
.book-scroll-hint.visible { opacity: 1; }
.book-scroll-hint-up { top: 0; background: linear-gradient(to bottom, #0d1b2aee 40%, transparent); }
.book-scroll-hint-down { bottom: 0; background: linear-gradient(to top, #0d1b2aee 40%, transparent); }
.book-section { margin-bottom: 6px; }
.book-section-title {
    font-size: 11px; font-weight: 700; color: #bbb;
    margin-bottom: 3px; letter-spacing: 1px; text-transform: uppercase;
    border-bottom: 1px solid #1a1a30; padding-bottom: 2px;
}
.book-text { font-size: 10px; color: #999; line-height: 1.4; margin-bottom: 3px; }
.book-highlight {
    background: rgba(108,180,238,0.08); border: 1px solid rgba(108,180,238,0.2);
    border-radius: 6px; padding: 6px 10px; font-size: 11px; color: #aaa; margin: 6px 0;
}
.book-keys { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.book-key-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #999; }
.book-key {
    display: inline-block; background: rgba(255,255,255,0.06); border: 1px solid #444;
    border-radius: 4px; padding: 2px 8px; font-size: 11px; color: #bbb;
    font-weight: 600; min-width: 28px; text-align: center;
}
.book-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0; }
.book-card {
    background: rgba(255,255,255,0.03); border: 1px solid #2a2a4a;
    border-radius: 6px; padding: 6px 8px; font-size: 11px;
}
.book-card b { color: #ccc; }
.book-list { list-style: none; padding: 0; margin: 8px 0; }
.book-list li {
    font-size: 12px; color: #999; padding: 4px 0 4px 16px;
    position: relative; line-height: 1.5;
}
.book-list li::before {
    content: '•'; position: absolute; left: 4px; color: #6cb4ee;
}

.book-note {
    font-size: 10px; color: #666; font-style: italic; margin-top: 6px;
}
.book-potion-row {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: #999;
}
.book-potion-row img {
    width: 20px; height: 20px; image-rendering: pixelated;
}

/* ── Healer NPC Panel ── */
#healer-screen {
    display: none; position: fixed; inset: 0;
    background: rgba(5,5,8,0.85);
    z-index: 100; align-items: center; justify-content: center;
    font-family: 'Segoe UI', sans-serif; color: #e0e0e0;
}
#healer-screen.show { display: flex; }
.healer-panel {
    background: linear-gradient(180deg, #1a1a2e, #0d0d1a);
    border: 1px solid #ffffff12; border-radius: 10px;
    padding: 16px 20px; max-width: 360px; width: 90%;
    display: flex; flex-direction: column; gap: 10px;
}
.healer-header {
    display: flex; justify-content: space-between; align-items: center;
}
.healer-title {
    font-family: 'Almendra', serif;
    font-size: 15px; font-weight: 700; margin: 0;
    letter-spacing: 3px; text-transform: uppercase;
    background: linear-gradient(180deg, #ffecd2 0%, #f0932b 50%, #eb4d4b 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.healer-gold-display {
    font-size: 14px; font-weight: 700; color: #f1c40f;
}
.healer-close-btn {
    background: none; border: 1px solid #333; border-radius: 6px;
    color: #888; font-size: 16px; cursor: pointer; padding: 4px 10px;
    transition: all 0.2s;
}
.healer-close-btn:hover { color: #e74c3c; border-color: #e74c3c; }
.healer-content { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.healer-hp-display { width: 100%; }
.healer-hp-bar-bg {
    position: relative; height: 18px; background: #1a1a2e;
    border-radius: 8px; overflow: hidden; border: 1px solid #333;
}
.healer-hp-bar-fill {
    position: absolute; top: 0; left: 0; height: 100%;
    border-radius: 8px; transition: width 0.3s ease;
}
.healer-hp-bar-fill:first-child {
    background: linear-gradient(90deg, #c0392b, #e74c3c);
    z-index: 2;
}
.healer-hp-bar-preview {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    opacity: 0.25; z-index: 1;
}
.healer-hp-text {
    text-align: center; margin-top: 6px; font-size: 13px; font-weight: 600;
}
.healer-cost {
    font-size: 14px; font-weight: 600; color: #ccc;
    display: flex; align-items: center; gap: 4px; justify-content: center;
}
.healer-note {
    font-size: 11px; color: #666; text-align: center;
}
.healer-heal-btn {
    background: rgba(46,204,113,0.15); border: 2px solid #2ecc71;
    color: #2ecc71; font-size: 13px; font-weight: 700; padding: 10px 28px;
    border-radius: 8px; cursor: pointer; transition: all 0.2s;
    text-transform: uppercase; letter-spacing: 1px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.healer-heal-btn:hover { background: rgba(46,204,113,0.25); }
.healer-heal-btn kbd {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.06); border: 1px solid #444;
    border-radius: 3px; padding: 1px 6px; font-size: 10px; color: #888;
    font-weight: 600; font-family: inherit;
}
.healer-heal-btn kbd.gp-btn-a, .healer-heal-btn kbd.gp-btn-cross {
    width: 18px; height: 18px; border-radius: 50%; padding: 0;
    font-size: 10px; border-width: 2px; box-sizing: border-box;
}
.healer-heal-btn kbd.gp-btn-a { color: #5ec269; border-color: #5ec269; background: rgba(94,194,105,0.15); }
.healer-heal-btn kbd.gp-btn-cross { color: #6eafef; border-color: #6eafef; background: rgba(110,175,239,0.15); }
.healer-btn-disabled { opacity: 0.4; cursor: not-allowed; }
.healer-btn-disabled:hover { background: rgba(46,204,113,0.15); }
@keyframes healer-shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
.healer-shake { animation: healer-shake 0.4s ease; }

#transmute-screen {
    display: none; position: fixed; inset: 0;
    background: rgba(5,5,8,0.85);
    z-index: 100; align-items: center; justify-content: center;
    font-family: 'Segoe UI', sans-serif; color: #e0e0e0;
    overflow-y: auto; scrollbar-width: none;
}
#transmute-screen::-webkit-scrollbar { display: none; }
#transmute-screen.show { display: flex; cursor: default; }

.tm-panel {
    width: 94%; max-width: 1050px;
    padding: 24px 28px 20px;
    max-height: calc(90vh * var(--ui-zoom-inv, 1));
    display: flex; flex-direction: column;
}
.tm-body {
    flex: 1 1 auto;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.tm-body::-webkit-scrollbar { display: none; }
.tm-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 4px;
}
.tm-title {
    font-size: 26px; font-weight: 700; color: #e67e22;
    letter-spacing: 3px; margin: 0;
    text-shadow: 0 0 16px rgba(230,126,34,0.4);
}
.tm-gold-display {
    font-size: 22px; font-weight: 700; color: #f1c40f;
    background: rgba(241,196,15,0.08);
    padding: 4px 16px; border-radius: 8px;
    border: 1px solid rgba(241,196,15,0.2);
}
.tm-subtitle {
    font-size: 11px; color: #666; margin-bottom: 8px;
}

/* Equipment items — same fixed size as shop cards */
.tm-items {
    display: flex; flex-wrap: wrap; gap: 14px;
    margin-bottom: 16px;
}
.tm-item {
    flex: 0 0 calc(20% - 10px); max-width: calc(20% - 10px); min-width: 0; padding: 6px 8px;
    height: 185px; overflow-y: auto; scrollbar-width: none;
    background: linear-gradient(180deg, #12122a 0%, #0d0d1a 100%);
    border: 2px solid #2a2a3a; border-radius: 10px;
    cursor: pointer; transition: all 0.2s;
    display: flex; flex-direction: column;
}
.tm-item:hover { border-color: #e67e22; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
.tm-item-selected { border-color: #e67e22; box-shadow: 0 0 8px rgba(230,126,34,0.2); }

.tm-item-header {
    display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.tm-item-icon { font-size: 20px; }
.tm-item-icon img { width: 26px; height: 26px; object-fit: contain; }
.tm-item-name { font-size: 11px; font-weight: 700; }
.tm-badge {
    font-size: 9px; font-weight: 700; letter-spacing: 0.5px;
    padding: 1px 5px; border-radius: 3px; border: 1px solid;
    background: rgba(0,0,0,0.3); margin-left: 6px; vertical-align: middle;
}
.tm-item-slot {
    font-size: 9px; color: #666; text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 3px;
}
.tm-item-axis {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
    font-size: 12px; font-weight: 600; margin-top: auto;
}
.tm-item-cost { color: #f1c40f; font-size: 11px; }
.tm-no-gold { color: #e74c3c; }
.tm-item-stats { font-size: 9px; line-height: 1.4; color: #aaa; margin: 3px 0; flex: 1; }
.tm-cstat-grid { display: flex; flex-direction: column; gap: 1px; margin: 3px 0; }
.tm-cstat-row { display: flex; align-items: center; gap: 4px; font-size: 10px; }
.tm-cstat-name { color: #aaa; flex: 1; }
.tm-cstat-val { color: #4fc3f7; font-weight: 600; }

.tm-empty {
    padding: 20px; text-align: center;
    color: #555; font-size: 12px;
}

/* Axis selection grid */
.tm-axis-section {
    border-top: 1px solid #1a1a30;
    padding-top: 12px;
}
.tm-axis-label {
    font-size: 11px; color: #888; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 10px;
}
.tm-axis-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.tm-axis-btn {
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 8px;
    background: rgba(255,255,255,0.03);
    border: 2px solid #333; border-radius: 8px;
    color: #ddd; cursor: pointer;
    transition: all 0.15s;
}
.tm-axis-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.06);
    transform: translateY(-1px);
}
.tm-axis-icon { font-size: 22px; margin-bottom: 2px; }
.tm-axis-name { font-size: 14px; font-weight: 700; }
.tm-axis-desc { font-size: 10px; color: #777; }
.tm-axis-tag {
    font-size: 9px; font-weight: 700; letter-spacing: 1px;
    color: #888; background: rgba(255,255,255,0.06);
    padding: 1px 6px; border-radius: 3px; margin-top: 4px;
}
.tm-axis-current { opacity: 0.4; }
.tm-axis-disabled { opacity: 0.3; cursor: not-allowed; }

/* Tabs */
.tm-tabs {
    display: flex; gap: 2px; margin-bottom: 14px;
    background: rgba(0,0,0,0.3); border-radius: 8px; padding: 3px;
    border: 1px solid rgba(255,255,255,0.06);
}
.tm-tab {
    flex: 1; padding: 8px 4px;
    background: transparent;
    border: none; border-radius: 6px;
    color: #666; font-size: 12px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    letter-spacing: 0.5px; text-transform: uppercase;
}
.tm-tab:hover { background: rgba(255,255,255,0.05); color: #aaa; }
.tm-tab-active {
    color: #e67e22;
    background: linear-gradient(180deg, rgba(230,126,34,0.2), rgba(230,126,34,0.08));
    box-shadow: 0 0 10px rgba(230,126,34,0.15), inset 0 1px 0 rgba(230,126,34,0.2);
}
.tm-tab-locked {
    opacity: 0.5;
}

/* Locked upgrade tab */
.tm-locked {
    display: flex; flex-direction: column; align-items: center;
    padding: 40px 20px; text-align: center; gap: 10px;
}
.tm-locked-icon { opacity: 0.6; }
.tm-locked-icon .lock-icon { width: 48px; height: 48px; }
.tm-locked-title {
    font-size: 18px; font-weight: 700; color: #e67e22;
    letter-spacing: 1px;
}
.tm-locked-desc {
    font-size: 12px; color: #888; line-height: 1.6;
}

/* Upgrade comparison (before → after) */
.tm-upgrade-compare {
    display: flex; align-items: flex-start; justify-content: center;
    gap: 16px; margin-bottom: 16px;
}
.tm-upgrade-arrow-big {
    font-size: 32px; color: #666; align-self: center;
    padding: 0 8px;
}

/* Upgrade-specific */
.tm-rarity-badge { font-weight: 700; font-size: 12px; }
.tm-upgrade-arrow { color: #666; font-size: 14px; margin: 0 4px; }
.tm-maxed-tag {
    font-size: 9px; font-weight: 700; letter-spacing: 1px;
    color: #f1c40f; background: rgba(241,196,15,0.1);
    padding: 2px 8px; border-radius: 4px;
}
.tm-item-maxed { opacity: 0.45; cursor: default; pointer-events: none; }

/* Upgrade preview */
.tm-upgrade-preview {
    display: flex; flex-direction: column; gap: 4px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 6px; margin-bottom: 10px;
}
.tm-stat-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; padding: 2px 0;
}
.tm-stat-name { color: #999; }
.tm-stat-val { color: #ddd; font-weight: 600; }
.tm-stat-up { color: #2ecc71; font-weight: 700; }

/* Upgrade confirm button */
.tm-upgrade-confirm {
    display: flex; justify-content: center; padding-top: 6px;
}
.tm-upgrade-btn {
    padding: 10px 24px;
    background: linear-gradient(180deg, #1a3a1a 0%, #0d1f0d 100%);
    border: 2px solid #2ecc71; border-radius: 8px;
    color: #ddd; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: all 0.15s;
    display: flex; align-items: center; gap: 8px;
}
.tm-upgrade-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #1f4a1f 0%, #0d2a0d 100%);
    transform: translateY(-1px);
    box-shadow: 0 0 12px rgba(46,204,113,0.3);
}
.tm-upgrade-cost {
    color: #f1c40f; font-size: 11px;
    background: rgba(241,196,15,0.1);
    padding: 2px 8px; border-radius: 4px;
}

.tm-main {
    display: flex; flex: 1 1 auto; min-height: 0; gap: 12px;
}
.tm-sidebar {
    display: flex; flex-direction: column; gap: 8px;
    justify-content: center; align-items: stretch;
    flex-shrink: 0; width: 100px;
}
.tm-sidebar .shop-btn {
    width: 100%; text-align: center; padding: 8px 8px; font-size: 11px;
}
.tm-footer {
    display: flex; justify-content: flex-end; padding-top: 8px;
    border-top: 1px solid #1a1a30;
    flex-shrink: 0;
}

/* ============================================================
   Loot Comparison Popup
   ============================================================ */
#loot-compare-screen {
    display: none; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 110; align-items: center; justify-content: center;
    flex-direction: column;
    font-family: 'Segoe UI', sans-serif; color: #e0e0e0;
}
#loot-compare-screen.show { display: flex; cursor: default; }

.lc-panel { width: 90%; max-width: 520px; text-align: center; }
.lc-title {
    font-size: 24px; font-weight: 700; color: #2ecc71;
    letter-spacing: 2px; margin-bottom: 20px;
    text-shadow: 0 0 12px rgba(46,204,113,0.4);
}
.lc-cards {
    display: flex; align-items: stretch; justify-content: center; gap: 16px;
    margin-bottom: 20px;
}
.lc-card {
    flex: 1; max-width: 200px; padding: 16px 12px;
    background: linear-gradient(180deg, #12122a 0%, #0d0d1a 100%);
    border: 2px solid #333; border-radius: 10px;
    text-align: center;
}
.lc-card-new { border-color: rgba(46,204,113,0.4); }
.lc-card-old { border-color: rgba(231,76,60,0.4); }
.lc-label { font-size: 10px; font-weight: 700; letter-spacing: 2px; margin-bottom: 8px; }
.lc-icon { font-size: 32px; margin-bottom: 6px; }
.lc-name { font-size: 14px; font-weight: 700; }
.lc-rarity { font-size: 10px; margin-bottom: 8px; }
.lc-stats { font-size: 11px; text-align: left; }
.lc-stat { padding: 1px 0; color: #aaa; }
.lc-vs {
    display: flex; align-items: center;
    font-size: 18px; font-weight: 700; color: #555;
}
.lc-buttons { display: flex; gap: 12px; justify-content: center; }
.lc-btn {
    padding: 10px 24px; border-radius: 8px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    border: 2px solid; transition: all 0.15s;
}
.lc-btn-equip {
    background: rgba(46,204,113,0.1); color: #2ecc71;
    border-color: rgba(46,204,113,0.3);
}
.lc-btn-equip:hover { background: rgba(46,204,113,0.2); }
.lc-btn-discard {
    background: rgba(231,76,60,0.1); color: #e74c3c;
    border-color: rgba(231,76,60,0.3);
}
.lc-btn-discard:hover { background: rgba(231,76,60,0.2); }

/* Trophy swap popup */
.lc-trophy-new { text-align: center; margin-bottom: 12px; }
.lc-trophy-label {
    font-size: 11px; color: #888; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 8px;
}
.lc-trophy-list {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 240px; overflow-y: auto;
    margin-bottom: 12px;
}
.lc-trophy-slot {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border: 2px solid #2a2a3a; border-radius: 6px;
    cursor: pointer; transition: all 0.15s;
}
.lc-trophy-slot:hover { border-color: #555; background: rgba(255,255,255,0.05); }
.lc-trophy-selected { border-color: #e67e22; box-shadow: 0 0 8px rgba(230,126,34,0.3); }
.lc-trophy-icon { font-size: 20px; }

/* ============================================================
   Wave Bonus Screen
   ============================================================ */
#wave-bonus-screen {
    display: none; position: fixed; inset: 0;
    background: rgba(3, 3, 6, 0.94);
    z-index: 100;
    align-items: center; justify-content: center; flex-direction: column;
    font-family: 'Segoe UI', sans-serif; color: #e0e0e0;
}
#wave-bonus-screen.show { display: flex; cursor: default; }

.wb-title {
    font-size: 22px; font-weight: 800; color: #ff6633; font-family: 'Almendra', serif;
    letter-spacing: 5px; margin-bottom: 4px; text-transform: uppercase;
    text-shadow: 0 0 20px rgba(255,102,51,0.5), 0 2px 4px rgba(0,0,0,0.8);
}
.wb-subtitle { font-size: 12px; color: #555; margin-bottom: 32px; letter-spacing: 0.5px; }

#wb-choices {
    display: flex; gap: 18px; justify-content: center; flex-wrap: wrap;
}

.wb-card {
    width: 190px; padding: 24px 18px 20px;
    background: linear-gradient(180deg, #141022 0%, #0a0a14 100%);
    border: 2px solid #2a2a3a; border-radius: 14px;
    cursor: pointer; transition: all 0.25s ease-out;
    text-align: center; display: flex; flex-direction: column; align-items: center;
    position: relative;
}
/* Invisible hover zone below card — prevents jitter from translateY on hover */
.wb-card::after {
    content: ''; position: absolute; bottom: -10px; left: 0; right: 0; height: 10px;
}
.wb-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--wb-accent, #ff6633), transparent);
    opacity: 0; transition: opacity 0.25s;
}
.wb-card:hover::before, .wb-card.gp-focus::before { opacity: 1; }
.wb-card:hover {
    border-color: #ff6633; transform: translateY(-6px);
    box-shadow: 0 8px 28px rgba(255,102,51,0.15), 0 0 1px rgba(255,102,51,0.3);
}
body.gp-active .wb-card:hover, body.kb-nav .wb-card:hover { border-color: inherit; transform: none; box-shadow: none; }
body.gp-active .wb-card:hover::before, body.kb-nav .wb-card:hover::before { opacity: 0; }
.wb-card:active { transform: translateY(-2px); }
.wb-card.gp-focus,
body.gp-active .wb-card.gp-focus:hover,
body.kb-nav .wb-card.gp-focus:hover {
    border-color: #ff6633; transform: translateY(-6px);
    box-shadow: 0 8px 28px rgba(255,102,51,0.2), 0 0 1px rgba(255,102,51,0.4);
}
body.gp-active .wb-card.gp-focus:hover::before,
body.kb-nav .wb-card.gp-focus:hover::before { opacity: 1; }

/* Bonus Picked Feedback */
.bonus-picked-feedback {
    position: fixed; top: 38%; left: 50%; transform: translate(-50%, -50%) scale(0.6);
    z-index: 99999; display: flex; align-items: center; gap: 12px;
    background: rgba(8,8,16,0.95); border: 2px solid #f1c40f;
    border-radius: 12px; padding: 14px 28px;
    font-size: 22px; font-weight: 700; color: #fff;
    opacity: 0; transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none; text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    box-shadow: 0 0 30px rgba(241,196,15,0.3);
}
.bonus-picked-feedback.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.bonus-picked-feedback.fade { opacity: 0; transform: translate(-50%, -60%) scale(0.9); transition: all 0.35s ease-in; }
.bpf-icon { display: flex; align-items: center; }
.bpf-icon img { width: 36px; height: 36px; image-rendering: pixelated; }
.bpf-text { white-space: nowrap; }

.wb-card-icon { margin-bottom: 12px; }
.wb-card-icon img { width: 42px; height: 42px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); }
.wb-card-name {
    font-size: 15px; font-weight: 800; color: #ff9944; margin-bottom: 3px;
    letter-spacing: 0.5px; text-transform: uppercase; font-family: 'Almendra', serif;
}
.wb-card-desc { font-size: 11px; color: #666; line-height: 1.4; margin-bottom: 12px; }
.wb-card-value {
    font-size: 22px; font-weight: 800;
    padding: 4px 16px; border-radius: 8px;
    background: rgba(255,255,255,0.04);
}
.wb-card-rarity {
    font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
    margin-top: 6px; opacity: 0.9;
}
.wb-card-total {
    font-size: 10px; color: #444; margin-top: 8px;
}
#wb-reroll-container {
    display: flex; justify-content: center; margin-top: 18px;
}

/* ============================================================
   Victory Screen
   ============================================================ */
#victory-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5,5,8,0.92);
    display: none; align-items: center; justify-content: center;
    flex-direction: column; z-index: 200;
    font-family: 'Segoe UI', sans-serif;
}
#victory-screen.show { display: flex; }
#victory-screen button {
    padding: 12px 36px; font-size: 16px; cursor: pointer; margin-top: 20px;
    background: linear-gradient(135deg, #e67e22, #f39c12); border: none; border-radius: 8px;
    color: #fff; font-weight: 700; letter-spacing: 1px;
}
#victory-screen button:hover { filter: brightness(1.15); }

.victory-title { font-size: 48px; font-weight: 900; color: #f1c40f; text-transform: uppercase; letter-spacing: 4px; text-shadow: 0 0 30px rgba(241,196,15,0.5); font-family: 'Almendra', serif; }
.victory-subtitle { font-size: 16px; color: #aaa; margin-top: 8px; }
.death-run-stats { font-size: 13px; color: #999; margin: 16px 0; line-height: 1.8; text-align: center; }

/* Cinzas (shared by death + victory) */
.cinzas-section { background: rgba(255,102,34,0.08); border: 1px solid rgba(255,102,34,0.2); border-radius: 10px; padding: 16px 24px; margin-top: 16px; min-width: 280px; }
.cinzas-header { font-size: 13px; font-weight: 700; color: #ff6622; text-align: center; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; }
.cinzas-breakdown { font-size: 11px; color: #aaa; }
.cinzas-row { display: flex; justify-content: space-between; padding: 1px 0; }
.cinzas-multi { color: #f39c12; font-weight: 700; border-top: 1px solid rgba(255,255,255,0.08); margin-top: 4px; padding-top: 4px; }
.cinzas-first-kill { color: #2ecc71; font-weight: 700; }
.cinzas-icon { width: 20px; height: 20px; vertical-align: middle; image-rendering: pixelated; margin-left: 2px; }
.cinzas-total { font-size: 18px; font-weight: 900; color: #ff6622; text-align: center; margin-top: 6px; text-shadow: 0 0 12px rgba(255,102,34,0.4); }
.cinzas-balance { font-size: 11px; color: #888; text-align: center; margin-top: 2px; }
.difficulty-unlock { color: #2ecc71; font-weight: 700; text-align: center; margin-top: 12px; font-size: 14px; }
.extinction-clear { color: #c89cff; font-weight: 700; text-align: center; margin-top: 14px; font-size: 15px; font-style: italic; text-shadow: 0 0 20px rgba(155,89,182,0.6); letter-spacing: 0.5px; }

/* ── Mastery Section (death/victory + char-select) ── */
.mastery-section { margin-top: 14px; padding: 10px 14px; background: rgba(155,89,182,0.08); border: 1px solid rgba(155,89,182,0.25); border-radius: 8px; }
.mastery-header { font-size: 12px; font-weight: 700; color: #9b59b6; text-align: center; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 1px; }
.mastery-unlock-banner { text-align: center; font-size: 15px; font-weight: 900; color: #f1c40f; margin-bottom: 6px; text-shadow: 0 0 12px rgba(241,196,15,0.5); animation: mastery-glow 1.5s ease-in-out infinite alternate; }
@keyframes mastery-glow { from { text-shadow: 0 0 8px rgba(241,196,15,0.3); } to { text-shadow: 0 0 20px rgba(241,196,15,0.8); } }
.mastery-xp-gain { text-align: center; font-size: 12px; font-weight: 700; color: #bb8fce; margin-bottom: 6px; }
.mastery-xp-gain.mastery-complete { color: #2ecc71; }
.mastery-xp-gain.mastery-xp-zero { color: #666; }
.mastery-bar-wrap { width: 100%; height: 10px; background: rgba(0,0,0,0.4); border-radius: 5px; overflow: hidden; border: 1px solid rgba(155,89,182,0.3); }
.mastery-bar-fill { height: 100%; background: linear-gradient(90deg, #8e44ad, #bb8fce); border-radius: 5px; transition: width 0.6s ease; }
.mastery-bar-label { text-align: center; font-size: 11px; color: #888; margin-top: 3px; }

/* Char-select mastery */
.cs-mastery { margin-top: 3px; width: 100%; }
.cs-mastery-row { display: flex; align-items: center; gap: 6px; }
.cs-mastery-label { color: #888; font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.cs-mastery-bar {
    flex: 1; height: 14px; background: rgba(0,0,0,0.5); border-radius: 7px;
    overflow: hidden; position: relative; border: 1px solid rgba(255,255,255,0.06);
}
.cs-mastery-bar-fill {
    height: 100%; background: linear-gradient(90deg, #8e44ad, #bb8fce);
    border-radius: 7px; transition: width 0.3s ease;
}
.cs-mastery-bar-fill.cs-mastery-complete { background: linear-gradient(90deg, #f1c40f, #f39c12); }
.cs-mastery-pct {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700; color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.cs-passive-locked-overlay { opacity: 0.45; filter: grayscale(0.6); position: relative; }
.cs-passive-lock-icon { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 16px; }

/* ============================================================
   Altar das Cinzas
   ============================================================ */
#altar-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5,5,8,0.85);
    display: none; align-items: center; justify-content: center;
    z-index: 150; font-family: 'Segoe UI', sans-serif;
}
#altar-screen.show { display: flex; }

.altar-panel {
    background: linear-gradient(180deg, #0d0d18, #0a0a14);
    border: 1px solid #2a1a10; border-radius: 10px;
    width: 400px; max-width: 95vw; max-height: calc(80vh * var(--ui-zoom-inv, 1)); display: flex; flex-direction: column;
    box-shadow: 0 0 40px rgba(255,102,34,0.15);
}
.altar-header {
    position: relative; display: flex; align-items: center; justify-content: center;
    padding: 12px 16px; border-bottom: 1px solid #1a1a2e;
}
.altar-title { font-size: 15px; font-weight: 900; color: #ff6622; letter-spacing: 2px; }
.altar-cinzas-display { position: absolute; right: 16px; }
.altar-cinzas-display { font-size: 14px; font-weight: 700; color: #f39c12; }
.altar-tabs { display: flex; align-items: center; padding: 0 12px; gap: 4px; border-bottom: 1px solid #1a1a2e; }
.altar-tab-btn {
    flex: 1; padding: 8px; background: transparent; border: none; border-bottom: 2px solid transparent;
    color: #666; font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.altar-tab-btn:hover { color: #aaa; }
.altar-tab-btn:focus { outline: none; }
.altar-tab-btn.gp-focus:not(.altar-tab-active) { box-shadow: 0 0 8px rgba(74,158,255,0.4); }
.altar-tab-btn.altar-tab-active.gp-focus { box-shadow: none; }
.altar-tab-active { color: #ff6622; border-bottom-color: #ff6622; }
.altar-content-wrap {
    position: relative; flex: 1 1 auto; overflow: clip; min-height: 0;
    display: flex; flex-direction: column;
}
.altar-content {
    padding: 8px 12px 8px 12px; overflow-y: auto; flex: 1 1 auto; min-height: 0;
    scrollbar-width: none;
}
.altar-content::-webkit-scrollbar { display: none; }
.altar-scroll-hint {
    position: absolute; left: 0; right: 0; height: 28px;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; z-index: 2; opacity: 0; transition: opacity 0.2s;
    font-size: 16px; color: #d4a04a; letter-spacing: 0;
}
.altar-scroll-hint.visible { opacity: 1; }
.altar-scroll-hint-up { top: 0; background: linear-gradient(to bottom, #0d1b2aee 40%, transparent); }
.altar-scroll-hint-down { bottom: 0; background: linear-gradient(to top, #0d1b2aee 40%, transparent); }

.altar-card {
    background: rgba(255,255,255,0.03); border: 1px solid #1a1a2e; border-radius: 8px;
    padding: 10px; margin-bottom: 6px; transition: border-color 0.2s;
    scroll-margin: 30px 0;
}
.altar-card:last-child { margin-bottom: 0; }
.altar-card:hover { border-color: #ff662240; }
.altar-maxed { opacity: 0.6; }
.altar-owned { opacity: 0.6; }
.altar-card-header { display: flex; align-items: center; gap: 8px; }
.altar-icon { font-size: 20px; }
.altar-icon img { width: 28px !important; height: 28px !important; }
.altar-card-info { flex: 1; }
.altar-card-name { font-size: 12px; font-weight: 700; color: #ddd; }
.altar-card-effect { font-size: 10px; color: #888; }
.altar-card-level { font-size: 11px; font-weight: 700; color: #ff6622; }
.altar-bar-bg { height: 3px; background: #1a1a2e; border-radius: 2px; margin: 6px 0; }
.altar-bar-fill { height: 100%; background: linear-gradient(90deg, #e67e22, #f39c12); border-radius: 2px; transition: width 0.3s; }
.altar-buy-btn {
    width: 100%; padding: 5px; background: rgba(255,102,34,0.15); border: 1px solid #ff662240;
    border-radius: 5px; color: #ff6622; font-size: 11px; font-weight: 700; cursor: pointer;
    transition: all 0.2s;
}
.altar-buy-btn:hover { background: rgba(255,102,34,0.25); }
.altar-btn-disabled { opacity: 0.4; cursor: not-allowed; }
.altar-maxed-label, .altar-owned-label {
    text-align: center; padding: 6px; font-size: 11px; font-weight: 700;
    color: #2ecc71; letter-spacing: 2px;
}
.altar-footer { padding: 10px 12px; border-top: 1px solid #1a1a2e; text-align: center; }
@keyframes altar-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}
.altar-shake { animation: altar-shake 0.4s ease; }

/* ============================================================
   Difficulty Selector (in char-select)
   ============================================================ */
/* --- Difficulty Drum Roller (roulette cylinder) --- */
#difficulty-selector { text-align: center; }

/* Stylized title */
.diff-title {
    font-size: 14px; font-weight: 400; letter-spacing: 6px; text-transform: uppercase;
    color: #555; margin-bottom: 8px;
}
.diff-title-main {
    font-family: 'Almendra', serif;
    font-size: 28px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase;
    background: linear-gradient(180deg, #ffecd2 0%, #f0932b 50%, #eb4d4b 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px; line-height: 1.1;
}

.diff-drum {
    position: relative; width: min(620px, 90vw); height: min(420px, 80vh); margin: 0 auto;
    user-select: none; overflow: hidden;
    mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 88%, transparent 100%);
}
.diff-drum-item {
    position: absolute; left: 50%; width: min(460px, 75vw);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 20px; border-radius: 20px;
    border: 3px solid transparent;
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    transform-origin: center center;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.35s, background 0.35s, box-shadow 0.35s;
}
.diff-drum-item.diff-drum-center {
    background: rgba(255,255,255,0.07);
    z-index: 5;
}
.diff-drum-item.diff-drum-locked {
    filter: grayscale(0.5); cursor: not-allowed;
}
.diff-drum-icon-row {
    display: flex; align-items: center; gap: 12px; justify-content: center;
}
.diff-drum-icon {
    flex-shrink: 0; object-fit: contain;
    image-rendering: pixelated;
    transition: width 0.35s, height 0.35s;
}
.diff-drum-info { text-align: center; width: 100%; }
.diff-drum-name {
    font-family: 'Almendra', serif;
    font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
    transition: font-size 0.35s, color 0.35s;
}
.diff-drum-desc {
    font-size: 12px; color: #888; margin-top: 4px;
    overflow: hidden; transition: max-height 0.35s, opacity 0.35s;
}
.diff-drum-stats {
    font-size: 11px; color: #666; margin-top: 5px;
    display: flex; gap: 14px; justify-content: center;
    overflow: hidden; transition: max-height 0.35s, opacity 0.35s;
}
.diff-drum-stats span { white-space: nowrap; }
.diff-drum-lock { font-size: 12px; margin-left: 6px; opacity: 0.6; }
/* Hint at bottom */
.diff-hint {
    margin-top: 8px; font-size: 11px; color: #444; letter-spacing: 1px;
}
.diff-hint kbd {
    display: inline-block; background: rgba(255,255,255,0.06); border: 1px solid #444;
    border-radius: 3px; padding: 0 5px; font-size: 10px; color: #777; font-family: inherit;
    margin: 0 1px; font-weight: 600;
}
.diff-hint .hint-sep { margin: 0 8px; color: #333; }
.diff-hint kbd.gp-btn-a, .diff-hint kbd.gp-btn-b, .diff-hint kbd.gp-btn-cross, .diff-hint kbd.gp-btn-circle {
    width: 20px; height: 20px; border-radius: 50%; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; line-height: 1; vertical-align: middle;
    box-sizing: border-box; border-width: 2px;
    background: rgba(20,20,30,0.9);
}
.diff-hint kbd.gp-btn-a { color: #5ec269; border-color: #5ec269; background: rgba(94,194,105,0.15); }
.diff-hint kbd.gp-btn-b { color: #e05454; border-color: #e05454; background: rgba(224,84,84,0.15); }
.diff-hint kbd.gp-btn-cross { color: #6eafef; border-color: #6eafef; background: rgba(110,175,239,0.15); }
.diff-hint kbd.gp-btn-circle { color: #e05454; border-color: #e05454; background: rgba(224,84,84,0.15); }
/* Confirm animation */
.diff-drum-item.diff-confirm {
    animation: diffConfirmPulse 0.5s ease-out forwards;
    z-index: 10 !important;
}
.diff-drum-item.diff-fade-out {
    opacity: 0 !important;
    transform: translate(-50%, -50%) scale(0.7) !important;
    transition: opacity 0.35s ease-out, transform 0.35s ease-out !important;
}
@keyframes diffConfirmPulse {
    0%   { transform: translate(-50%, -50%) scale(1); }
    30%  { transform: translate(-50%, -50%) scale(1.08); }
    60%  { transform: translate(-50%, -50%) scale(1.02); }
    100% { transform: translate(-50%, -50%) scale(1); }
}
/* Gamepad focus */
.diff-drum-item.gp-focus { border-color: #4a9eff !important; box-shadow: 0 0 12px rgba(74,158,255,0.3); }

/* ============================================================
   CHEST GACHA (Lucky Chest Roulette)
   ============================================================ */
#chest-gacha-screen {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 150; align-items: center; justify-content: center;
}
#chest-gacha-screen.show { display: flex; }

.cg-backdrop {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
}

/* Screen flash on result */
.cg-flash {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #f1c40f; opacity: 0; z-index: 3; pointer-events: none;
}
.cg-flash.active {
    animation: cg-flash-anim 0.6s ease-out forwards;
}
@keyframes cg-flash-anim {
    0% { opacity: 0.7; }
    100% { opacity: 0; }
}

.cg-container {
    position: fixed; z-index: 1;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex; flex-direction: column; align-items: center;
    justify-content: center;
    gap: 0;
    width: 500px; height: 520px;
    padding: 20px 60px;
}

.cg-frame {
    position: absolute; top: 40px; bottom: 50px; left: 0; right: 0;
    background: url('../assets/ui/chest_bg.webp') center/100% 100% no-repeat;
    pointer-events: none;
}

.cg-title {
    font-family: 'Almendra', serif;
    font-size: 22px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase;
    background: linear-gradient(180deg, #ffecd2 0%, #f0932b 50%, #eb4d4b 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    position: absolute; top: 10px; z-index: 2;
}
.cg-subtitle {
    font-size: 11px; color: #666; margin-top: -4px;
}

/* Wheel — image-based roulette */
.cg-wheel-wrap {
    position: relative; width: 320px; height: 320px; z-index: 1;
}
.cg-wheel-container {
    position: relative; width: 320px; height: 320px;
}
.cg-wheel-img {
    width: 100%; height: 100%; object-fit: contain;
    border-radius: 50%;
    filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.5));
}
.cg-emoji-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
}
.cg-emoji-layer span {
    position: absolute; font-size: 22px;
    transform: translate(-50%, -50%);
    text-shadow: 0 0 6px rgba(0,0,0,0.8);
}
.cg-arrow-img {
    position: absolute; top: 50%; left: 50%;
    width: 55px; height: 130px;
    object-fit: contain;
    transform-origin: center bottom;
    transform: translate(-50%, -100%) rotate(0deg);
    filter: drop-shadow(0 0 8px rgba(241, 196, 15, 0.5));
    pointer-events: none;
    z-index: 3;
}

/* Arrow flash when landing */
.cg-arrow-flash {
    animation: cg-arrow-pulse 0.4s ease 3;
}
@keyframes cg-arrow-pulse {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(241, 196, 15, 0.5)); }
    50% { filter: drop-shadow(0 0 20px #f1c40f) brightness(1.4); }
}

/* Explosion particles container */
.cg-explosion {
    position: absolute; top: 50%; left: 50%;
    width: 0; height: 0; z-index: 4; pointer-events: none;
}

/* Individual particle */
.cg-particle {
    position: absolute;
    width: var(--size); height: var(--size);
    background: var(--color);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--color);
    animation: cg-particle-fly 1s ease-out var(--delay) forwards;
    opacity: 0;
}
@keyframes cg-particle-fly {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    70% { opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* Emoji sparkles */
.cg-sparkle {
    position: absolute;
    font-size: 20px;
    animation: cg-sparkle-fly 1.2s ease-out var(--delay) forwards;
    opacity: 0;
}
@keyframes cg-sparkle-fly {
    0% { transform: translate(0, 0) scale(0.5) rotate(0deg); opacity: 1; }
    60% { opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(360deg); opacity: 0; }
}

/* Result — overlay on top of wheel */
.cg-result {
    position: absolute; inset: 0; margin: auto;
    width: fit-content; height: fit-content;
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; animation: cg-result-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(0, 0, 0, 0.85);
    padding: 16px 28px; border-radius: 10px;
    border: 1px solid rgba(241, 196, 15, 0.15);
    z-index: 5;
}
@keyframes cg-result-pop {
    from { opacity: 0; transform: scale(0.5) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.cg-result-icon { font-size: 48px; }
.cg-result-name {
    font-size: 18px; font-weight: 700; color: #f1c40f;
    text-shadow: 0 0 8px rgba(241, 196, 15, 0.3);
}
.cg-result-desc { font-size: 12px; color: #aaa; transition: opacity 0.4s ease-out; }

/* Choice (Dado Carregado) — overlay on top of wheel */
.cg-choice {
    position: absolute; inset: 0; margin: auto;
    width: fit-content; height: fit-content;
    animation: cg-result-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(0, 0, 0, 0.85);
    padding: 12px 20px; border-radius: 10px;
    border: 1px solid rgba(241, 196, 15, 0.15);
    z-index: 5;
}
.cg-choice-title {
    text-align: center; font-size: 14px; font-weight: 700;
    color: #f1c40f; letter-spacing: 1px; margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(241,196,15,0.3);
}
.cg-choice-cards {
    display: flex; align-items: center; gap: 12px;
}
.cg-choice-card {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 16px 20px; min-width: 140px;
    background: rgba(255,255,255,0.04); border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px; cursor: pointer;
    transition: border-color 0.2s, transform 0.15s, background 0.2s;
}
.cg-choice-card:hover {
    border-color: #f1c40f; transform: scale(1.05);
    background: rgba(241,196,15,0.06);
}
.cg-choice-card:active { transform: scale(0.97); }
.cg-choice-icon { font-size: 40px; }
.cg-choice-icon img { width: 48px; height: 48px; object-fit: contain; }
.cg-choice-name { font-size: 13px; font-weight: 700; text-align: center; }
.cg-choice-desc { font-size: 10px; color: #aaa; text-align: center; }
.cg-choice-vs {
    font-size: 12px; color: #666; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
}

/* Chest animation canvas */
#cg-chest-anim {
    width: 280px; height: 280px;
    image-rendering: pixelated;
    z-index: 1;
}

/* Buttons */
.cg-open-btn, .cg-spin-btn, .cg-collect-btn {
    padding: 10px 32px; border: 2px solid #f1c40f60;
    background: rgba(0, 0, 0, 0.7); color: #f1c40f;
    font-size: 14px; font-weight: 700; letter-spacing: 1px;
    border-radius: 8px; cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    margin-top: 12px; z-index: 1;
}
.cg-gp-hints {
    gap: 16px; margin-top: 8px; z-index: 1;
}
.cg-gp-hint {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; color: #888;
}
/* Gamepad: hide mouse buttons, show gp hints */
body.gp-active .cg-open-btn,
body.gp-active .cg-spin-btn,
body.gp-active .cg-collect-btn { display: none !important; }
.cg-open-btn:hover, .cg-spin-btn:hover, .cg-collect-btn:hover {
    background: #f1c40f30; border-color: #f1c40f80;
    box-shadow: 0 0 12px rgba(241, 196, 15, 0.3);
}
.cg-open-btn.gp-focus, .cg-spin-btn.gp-focus, .cg-collect-btn.gp-focus {
    outline: 2px solid #4a9eff;
    outline-offset: 3px;
    box-shadow: 0 0 12px rgba(74, 158, 255, 0.3);
}

/* ---- Achievement Panel ---- */
.ach-header { margin-bottom: 10px; }
.ach-progress-summary {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; background: linear-gradient(180deg, rgba(18,18,42,0.8) 0%, rgba(13,13,26,0.8) 100%);
    border: 1px solid rgba(240,192,64,0.15); border-radius: 8px;
}
.ach-progress-text { font-size: 14px; color: #f0c040; font-weight: 700; min-width: 60px; }
.ach-progress-bar-bg {
    flex: 1; height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden;
}
.ach-progress-bar-fill { height: 100%; background: linear-gradient(90deg, #d4a020, #f0c040); border-radius: 4px; transition: width 0.4s ease-out; }
.ach-progress-pct { font-size: 12px; color: #aaa; min-width: 35px; text-align: right; }

/* Tab row with arrow hints */
.ach-tab-row {
    display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.ach-tab-hint {
    flex-shrink: 0; font-size: 10px; color: #555; user-select: none;
}
.ach-tab-hint kbd {
    display: inline-block; padding: 1px 5px; border-radius: 3px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    font-size: 10px; color: #666; font-family: inherit;
}
.ach-tabs {
    display: flex; gap: 4px; overflow-x: auto; flex: 1;
    scrollbar-width: none; -ms-overflow-style: none;
    scroll-behavior: smooth;
}
.ach-tabs::-webkit-scrollbar { display: none; }
.ach-tab {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 10px; font-size: 11px; border-radius: 6px; cursor: pointer;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    color: #888; transition: all 0.2s ease; white-space: nowrap; flex-shrink: 0;
}
.ach-tab:hover { background: rgba(255,255,255,0.08); color: #bbb; border-color: rgba(255,255,255,0.12); }
.ach-tab.active {
    background: rgba(240,192,64,0.15); border-color: rgba(240,192,64,0.35);
    color: #f0c040;
}
.ach-tab-icon {
    width: 16px; height: 16px; object-fit: contain; image-rendering: pixelated;
    flex-shrink: 0;
}
.ach-tab-emoji { font-size: 13px; flex-shrink: 0; }
.ach-tab-label { font-weight: 600; }
.ach-tab-count { font-size: 10px; color: #666; margin-left: 2px; }
.ach-tab.active .ach-tab-count { color: rgba(240,192,64,0.6); }

/* Achievement card list */
.ach-list { display: flex; flex-direction: column; gap: 5px; padding-bottom: 14px; }
.ach-card {
    display: flex; align-items: center; gap: 12px; padding: 8px 12px;
    border-radius: 8px;
    background: linear-gradient(180deg, #12122a 0%, #0d0d1a 100%);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.2s ease;
    cursor: pointer;
}
.ach-card:hover {
    border-color: rgba(255,255,255,0.15);
    background: linear-gradient(180deg, #16163a 0%, #0f0f22 100%);
}
.ach-card.unlocked:hover { border-color: rgba(240,192,64,0.5); }
.ach-card.in-progress:hover { border-color: rgba(74,158,255,0.4); }
body.gp-active .ach-card:hover { border-color: inherit; background: inherit; }

/* Unlocked state */
.ach-card.unlocked {
    background: linear-gradient(180deg, rgba(240,192,64,0.08) 0%, rgba(13,13,26,0.9) 100%);
    border-color: rgba(240,192,64,0.3);
}
.ach-card.unlocked .ach-card-name { color: #f0c040; }
.ach-card.unlocked .ach-card-icon-wrap { filter: none; }

/* In-progress state */
.ach-card.in-progress {
    border-color: rgba(74,158,255,0.25);
}
.ach-card.in-progress .ach-card-icon-wrap { filter: saturate(0.4) brightness(0.7); }

/* Locked state */
.ach-card.locked { opacity: 0.65; }
.ach-card.locked .ach-card-icon-wrap { filter: grayscale(1) brightness(0.5); }

/* Icon wrapper with tier rings */
.ach-card-icon-wrap {
    width: 48px; height: 48px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; overflow: hidden;
    background: #0a0a18;
    border: 2px solid rgba(255,255,255,0.08);
    transition: filter 0.3s ease;
    position: relative;
}
.ach-card-icon-wrap.ach-icon-fallback {
    font-size: 22px;
}
.ach-card-icon-wrap.ach-icon-fallback .ach-card-icon-text { display: flex !important; }
.ach-card-icon {
    width: 48px; height: 48px; object-fit: cover; border-radius: 6px;
}
.ach-card-icon-text {
    font-size: 22px; display: none;
    align-items: center; justify-content: center;
    width: 100%; height: 100%;
}

/* Tier rings for bestiário / boss tiers */
.ach-tier-bronze { border-color: #cd7f32 !important; box-shadow: inset 0 0 6px rgba(205,127,50,0.25); }
.ach-tier-silver { border-color: #c0c0c0 !important; box-shadow: inset 0 0 6px rgba(192,192,192,0.25); }
.ach-tier-gold   { border-color: #ffd700 !important; box-shadow: inset 0 0 8px rgba(255,215,0,0.3); }
.ach-card.unlocked .ach-tier-bronze { box-shadow: 0 0 8px rgba(205,127,50,0.4), inset 0 0 6px rgba(205,127,50,0.25); }
.ach-card.unlocked .ach-tier-silver { box-shadow: 0 0 8px rgba(192,192,192,0.4), inset 0 0 6px rgba(192,192,192,0.25); }
.ach-card.unlocked .ach-tier-gold   { box-shadow: 0 0 10px rgba(255,215,0,0.5), inset 0 0 8px rgba(255,215,0,0.3); }

/* Card info */
.ach-card-info { flex: 1; min-width: 0; }
.ach-card-name { font-size: 13px; font-weight: 700; color: #ddd; line-height: 1.3; }
.ach-card-desc { font-size: 11px; color: #777; margin-top: 2px; line-height: 1.3; }
.ach-card-check {
    font-size: 16px; color: #f0c040; flex-shrink: 0;
    text-shadow: 0 0 6px rgba(240,192,64,0.5);
}

/* Progress bar */
.ach-card-progress { margin-top: 5px; display: flex; align-items: center; gap: 8px; }
.ach-card-bar-bg {
    flex: 1; height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden;
}
.ach-card.in-progress .ach-card-bar-fill {
    height: 100%; background: linear-gradient(90deg, #2980b9, #4a9eff); border-radius: 3px;
    transition: width 0.3s ease;
}
.ach-card.unlocked .ach-card-bar-fill,
.ach-card-bar-fill {
    height: 100%; background: linear-gradient(90deg, #d4a020, #f0c040); border-radius: 3px;
    transition: width 0.3s ease;
}
.ach-card-bar-text { font-size: 10px; color: #777; min-width: 55px; text-align: right; white-space: nowrap; }

/* Gamepad/keyboard focus for achievement cards */
.ach-card.menu-focused {
    border-color: #4a9eff !important;
    box-shadow: 0 0 14px rgba(74,158,255,0.5), 0 0 0 2px rgba(74,158,255,0.2);
    animation: achFocusPulse 1.5s ease-in-out infinite;
}
@keyframes achFocusPulse {
    0%, 100% { box-shadow: 0 0 14px rgba(74,158,255,0.5), 0 0 0 2px rgba(74,158,255,0.2); }
    50% { box-shadow: 0 0 20px rgba(74,158,255,0.7), 0 0 0 3px rgba(74,158,255,0.3); }
}
/* Suppress hover effect when gamepad-focused cards exist */
body.gp-active .ach-card:hover, body.kb-nav .ach-card:hover { transform: none; box-shadow: none; }
.ach-card:hover { background: linear-gradient(180deg, #161630 0%, #0f0f20 100%); }

/* ---- Achievement Toast ---- */
#achievement-toast {
    position: fixed; top: 50px; right: -400px; width: 340px;
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(135deg, #0d0d1a 0%, #1a1030 50%, #0d0d1a 100%);
    border: 2px solid #f0c040; border-radius: 12px;
    padding: 14px 18px; z-index: 99999;
    transition: right 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 30px rgba(240,192,64,0.3), 0 8px 32px rgba(0,0,0,0.7),
                inset 0 1px 0 rgba(255,255,255,0.05);
    overflow: hidden;
}
#achievement-toast.show { right: 20px; }
#achievement-toast.show .ach-toast-shine { animation: achToastShine 0.8s ease-out 0.3s; }
.ach-toast-icon-wrap {
    width: 56px; height: 56px; flex-shrink: 0;
    border-radius: 10px; overflow: hidden;
    background: #0a0a18; border: 2px solid rgba(240,192,64,0.5);
    box-shadow: 0 0 12px rgba(240,192,64,0.25);
    display: flex; align-items: center; justify-content: center;
}
.ach-toast-icon { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.ach-toast-body { flex: 1; min-width: 0; }
.ach-toast-header {
    font-size: 10px; color: #f0c040; text-transform: uppercase;
    letter-spacing: 1.5px; margin-bottom: 3px; font-weight: 600;
}
.ach-toast-name { font-size: 15px; font-weight: 700; color: #fff; text-shadow: 0 0 8px rgba(240,192,64,0.3); }
.ach-toast-desc { font-size: 11px; color: #999; margin-top: 3px; line-height: 1.3; }
.ach-toast-shine {
    position: absolute; top: -50%; left: -60%; width: 40%; height: 200%;
    background: linear-gradient(90deg, transparent, rgba(240,192,64,0.15), transparent);
    transform: rotate(25deg); pointer-events: none;
}
@keyframes achToastShine { 0% { left: -60%; } 100% { left: 120%; } }
