/* ==========================================================================
   DIABLO II: SANCTUARY CLICKER — DARK FANTASY UI THEME
   Integrated with AI-Generated High-Fidelity Gothic Assets
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;900&family=Philosopher:ital,wght@0,400;0,700;1,400;1,700&family=Ruslan+Display&display=swap');

:root {
    --d2-font-title: 'Ruslan Display', 'Philosopher', 'Cinzel', Georgia, serif;
    --d2-font-body: 'Philosopher', 'Cinzel', Georgia, serif;
    --d2-font-ui: 'Philosopher', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Authentic Gothic Color Palette with High Contrast & Readability */
    --color-bg-deep: #080706;
    --color-panel-stone: #120e0b;
    --color-border-outer: #665037;
    --color-border-inner: #3a2b1c;
    --color-gold-bright: #f2db8d;
    --color-gold-text: #e6d5a8;
    --color-gold-dim: #b8a374;
    --color-text-muted: #cdbe9e;

    /* Diablo II Item Rarities */
    --rarity-normal: #e0e0e0;
    --rarity-magic: #5c84ff;
    --rarity-rare: #ffff60;
    --rarity-set: #00e800;
    --rarity-unique: #c49942;

    /* Combat Accents */
    --color-blood: #a81515;
    --color-mana: #1a4ec4;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--color-bg-deep);
    background-image: 
        radial-gradient(ellipse at 50% 15%, rgba(45, 26, 16, 0.5) 0%, rgba(10, 8, 7, 0.98) 75%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.015) 25%, transparent 25%),
        linear-gradient(225deg, rgba(255, 255, 255, 0.015) 25%, transparent 25%),
        linear-gradient(45deg, rgba(255, 255, 255, 0.015) 25%, transparent 25%),
        linear-gradient(315deg, rgba(255, 255, 255, 0.015) 25%, transparent 25%);
    background-size: 100% 100%, 32px 32px, 32px 32px, 32px 32px, 32px 32px;
    background-position: 0 0, 16px 0, 16px 0, 0 16px, 0 16px;
    color: var(--color-gold-text);
    font-family: var(--d2-font-body);
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    touch-action: pan-y;
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0a0806; }
::-webkit-scrollbar-thumb { background: #3d2f1f; border: 1px solid #5a472c; }

/* =========================================================
   TOP HEADER
   ========================================================= */
.d2-header {
    background: linear-gradient(180deg, #1e1711 0%, #110d09 70%, #080604 100%);
    border-bottom: 2px solid var(--color-border-outer);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(230, 200, 117, 0.25);
    padding: 6px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 20;
    min-height: 48px;
}

.d2-logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.d2-logo-title {
    font-family: var(--d2-font-title);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--color-gold-bright);
    text-shadow: 0 0 12px rgba(230, 200, 117, 0.45), 2px 2px 4px #000;
    text-transform: uppercase;
}

.d2-logo-subtitle {
    font-size: 12px;
    color: #cfbf9f;
    letter-spacing: 0.5px;
    display: none;
}

@media (min-width: 600px) {
    .d2-logo-subtitle { display: block; }
    .d2-logo-title { font-size: 24px; }
}

.d2-header-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

#btn-open-settings {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* =========================================================
   SETTINGS MODAL (Compact & Clean on all devices)
   ========================================================= */
.settings-modal-card {
    max-width: 440px;
    width: 95%;
    background: linear-gradient(180deg, #18120d 0%, #0d0a07 100%);
    border: 2px solid #6b5338;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.95), inset 0 0 20px rgba(0, 0, 0, 0.8);
    padding: 16px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #3d2f1f;
    padding-bottom: 8px;
    position: relative;
}

.settings-modal-title {
    font-family: var(--d2-font-title);
    font-size: 16px;
    color: var(--color-gold-bright);
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(230, 200, 117, 0.5);
    margin: 0;
}

.settings-modal-icon {
    font-size: 18px;
    margin-right: 6px;
}

.settings-close-icon-btn {
    background: transparent;
    border: none;
    color: #a89476;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 3px;
    transition: color 0.1s ease;
}

.settings-close-icon-btn:hover {
    color: #ff4444;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-section-title {
    font-family: var(--d2-font-title);
    font-size: 12px;
    color: #bfa168;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(82, 64, 43, 0.5);
    padding-bottom: 3px;
}

.settings-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
}

.settings-action-btn {
    width: 100%;
    font-size: 11.5px;
    padding: 8px 6px;
    min-height: 38px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.settings-modal-footer {
    display: flex;
    justify-content: center;
    border-top: 1px solid #3d2f1f;
    padding-top: 12px;
}

.settings-modal-footer .d2-btn {
    min-width: 140px;
}

/* =========================================================
   AUTHENTIC BEVELED GOTHIC BUTTONS
   ========================================================= */
.d2-btn {
    font-family: var(--d2-font-title);
    font-size: 13px;
    letter-spacing: 0.6px;
    padding: 7px 12px;
    min-height: 34px;
    cursor: pointer;
    border-radius: 3px;
    text-transform: uppercase;
    transition: all 0.08s ease;
    outline: none;
    position: relative;
    border: 2px solid #6b5338;
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.18), inset -1px -1px 0 rgba(0, 0, 0, 0.8), 0 2px 4px #000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.d2-btn-gold {
    background: linear-gradient(180deg, #382a1b 0%, #20170d 50%, #120e08 100%);
    color: var(--color-gold-bright);
    border-color: #8c7145;
}

.d2-btn-gold:active, .d2-btn-gold:hover {
    background: linear-gradient(180deg, #4d3a25 0%, #2e2012 50%, #1a1209 100%);
    border-color: var(--color-gold-bright);
    color: #ffffff;
}

.d2-btn-gold.active {
    background: linear-gradient(180deg, #5e4624 0%, #3d2b15 50%, #24190c 100%);
    border-color: #ffd700;
    color: #fff9d2;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4), inset 0 0 4px rgba(255, 215, 0, 0.2);
}

.d2-btn-red {
    background: linear-gradient(180deg, #4d1515 0%, #250909 100%);
    border-color: #a82a2a;
    color: #ffb3b3;
}

.d2-btn-gray {
    background: linear-gradient(180deg, #282828 0%, #121212 100%);
    border-color: #555;
    color: #ddd;
}

/* =========================================================
   NAVIGATION TABS
   ========================================================= */
.d2-tabs-bar {
    display: flex;
    justify-content: center;
    background: #0a0806;
    border-bottom: 2px solid #4a3824;
    padding: 5px 6px;
    gap: 5px;
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.8);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.d2-main-tab-btn {
    flex: 1;
    min-width: 68px;
    max-width: 180px;
    background: linear-gradient(180deg, #241b12 0%, #120e08 100%);
    border: 1px solid #665037;
    color: #e6d5a8;
    padding: 10px 8px;
    font-family: var(--d2-font-title);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.6px;
    cursor: pointer;
    border-radius: 3px;
    text-align: center;
    white-space: nowrap;
    transition: all 0.1s ease;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.d2-main-tab-btn:hover {
    border-color: var(--color-gold-bright);
    color: #ffffff;
}

.d2-main-tab-btn.active {
    background: linear-gradient(180deg, #591616 0%, #240707 100%);
    border-color: #e63939;
    color: #ffffff;
    box-shadow: inset 0 0 10px rgba(255, 40, 40, 0.4), 0 0 10px rgba(180, 20, 20, 0.5);
}

.d2-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

.d2-tab-text {
    display: inline;
}

/* =========================================================
   MAIN WRAPPER & TAB VIEWS
   ========================================================= */
.d2-main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 10px 135px 10px; /* Space for the bottom HUD */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.tab-view {
    display: none;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    animation: fadeIn 0.15s ease;
}

.tab-view.active {
    display: flex !important;
    flex-direction: column !important;
}

#view-camp {
    display: none;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 30px;
}

#view-camp.active {
    display: flex !important;
    flex-direction: column !important;
}

#camp-status-banner {
    width: 100%;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

/* GOTHIC PANELS WITH BEVELED METAL FRAMES */
.d2-panel {
    background: linear-gradient(180deg, #15110d 0%, #0d0a07 100%);
    border: 2px solid #52402b;
    outline: 1px solid #281d11;
    outline-offset: -4px;
    border-radius: 2px;
    position: relative;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.95),
        0 6px 20px rgba(0, 0, 0, 0.9);
    padding: 12px;
}

.d2-panel-title {
    font-family: var(--d2-font-title);
    font-size: 16px;
    color: var(--color-gold-bright);
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
    border-bottom: 2px solid #3d2f1f;
    padding-bottom: 6px;
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(230, 200, 117, 0.4);
}

/* =========================================================
   1. DUNGEON VIEW (With High-Res Cathedral Crypt Backdrop)
   ========================================================= */
#view-dungeon {
    flex-direction: column;
    gap: 12px;
}

.dungeon-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.dungeon-arena-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 420px;
    position: relative;
    touch-action: pan-y;
    /* High-Res Dark Fantasy Cathedral Crypt Background */
    background: 
        linear-gradient(180deg, rgba(10, 8, 7, 0.35) 0%, rgba(10, 8, 7, 0.8) 100%),
        url('../assets/img/dungeon_bg.jpg') center center / cover no-repeat;
    border: 2px solid #6b5338;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.95), 0 8px 30px rgba(0,0,0,0.9);
}

.dungeon-nav-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(22, 17, 12, 0.9) 0%, rgba(10, 8, 6, 0.95) 100%);
    backdrop-filter: blur(6px);
    padding: 5px 8px 4px;
    border: 1px solid #5a4530;
    box-shadow: inset 0 1px 0 rgba(255, 215, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.6);
    margin-bottom: 8px;
    border-radius: 3px;
    box-sizing: border-box;
}

.dungeon-nav-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.dungeon-loc-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.d2-btn-arrow {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: linear-gradient(180deg, #2c2217 0%, #151009 100%);
    border: 1px solid #6b5338;
    color: var(--color-gold-bright);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.d2-btn-arrow:hover:not(:disabled) {
    background: linear-gradient(180deg, #3d2f20 0%, #1c150e 100%);
    border-color: #ffd700;
    color: #fff;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.35);
}

.d2-btn-arrow:active:not(:disabled) {
    transform: scale(0.95);
}

.d2-btn-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: #382c1e;
    color: #635342;
}

.dungeon-loc-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
}

.dungeon-act-title {
    font-family: var(--d2-font-title);
    font-size: 10.5px;
    color: #b09977;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.dungeon-floor-title {
    font-family: var(--d2-font-title);
    font-size: 14.5px;
    font-weight: 700;
    color: var(--color-gold-bright);
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 1px 1px 3px #000;
}

.dungeon-auto-btn {
    height: 28px;
    min-height: 28px;
    padding: 2px 10px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 2px;
}

.dungeon-nav-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 3px;
    padding-top: 3px;
    border-top: 1px solid rgba(82, 64, 43, 0.45);
    font-size: 11.5px;
    gap: 8px;
}

.dungeon-progress-text {
    font-size: 11.5px;
    font-weight: 700;
    color: #e6d5a8;
    white-space: nowrap;
    flex-shrink: 0;
    text-shadow: 1px 1px 2px #000;
}

.dungeon-checkpoint-info {
    font-size: 11px;
    color: #bfa780;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.92;
}

.dungeon-checkpoint-info::before {
    content: "🚩 ";
    font-size: 10.5px;
}

.monster-arena {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: crosshair;
    position: relative;
    padding: 10px 0;
    touch-action: pan-y;
}

.monster-avatar {
    width: 190px;
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.05s ease;
    filter: drop-shadow(0 12px 25px rgba(0, 0, 0, 0.95));
}

@media (min-width: 600px) {
    .monster-avatar { width: 230px; height: 230px; }
}

.monster-avatar:active {
    transform: scale(0.94);
}

.monster-avatar.hit-react {
    animation: monsterHit 0.1s ease;
}

.monster-avatar.crit-shake {
    animation: monsterCritShake 0.22s ease;
}

@keyframes monsterHit {
    0% { transform: scale(0.92) rotate(-2deg); filter: brightness(1.7) drop-shadow(0 0 20px #ff3333); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes monsterCritShake {
    0% { transform: translate(4px, -4px) scale(0.88); filter: brightness(2.2) drop-shadow(0 0 30px #ffaa00); }
    25% { transform: translate(-5px, 4px) scale(0.92); }
    50% { transform: translate(4px, 3px) scale(0.96); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Monster Attack Lunge Forward */
.monster-avatar.monster-attack-lunge {
    animation: monsterAttackLunge 0.3s ease-out;
}

@keyframes monsterAttackLunge {
    0% { transform: scale(1) translateY(0); filter: brightness(1); }
    40% { transform: scale(1.18) translateY(16px); filter: brightness(1.8) drop-shadow(0 0 30px #ff1a1a); }
    100% { transform: scale(1) translateY(0); filter: brightness(1); }
}

.monster-name-box {
    font-family: var(--d2-font-title);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 2px 2px 4px #000, 0 0 10px rgba(0,0,0,0.8);
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 16px;
    border-radius: 2px;
    border: 1px solid rgba(82, 64, 43, 0.6);
}


/* Monster HP Bar */
.monster-hp-container {
    width: 90%;
    max-width: 440px;
    margin-top: 10px;
    position: relative;
}

.d2-bar-outer {
    height: 24px;
    background: #0a0705;
    border: 2px solid #52402b;
    box-shadow: inset 0 0 8px #000;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.d2-bar-fill-hp {
    height: 100%;
    background: linear-gradient(180deg, #c92222 0%, #7d0d0d 100%);
    width: 100%;
    transition: width 0.08s linear;
    box-shadow: 0 0 10px rgba(255, 30, 30, 0.5);
}

.d2-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 1px 1px 2px #000;
    pointer-events: none;
    white-space: nowrap;
}

.boss-timer-box {
    margin-top: 8px;
    background: rgba(160, 20, 20, 0.5);
    border: 1px solid #ff4444;
    padding: 5px 14px;
    border-radius: 2px;
    color: #ffcccc;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 220px;
    box-sizing: border-box;
    animation: pulseGlow 1s infinite alternate;
}

#boss-timer-val {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    display: inline-block;
    min-width: 66px;
    text-align: right;
    font-weight: 900;
    font-size: 19px;
    color: #ffdd44;
}

@keyframes pulseGlow {
    from { opacity: 0.8; }
    to { opacity: 1; text-shadow: 0 0 8px #ff4444; }
}

/* Monster Attack Charge Bar */
.monster-attack-container {
    width: 90%;
    max-width: 440px;
    margin-top: 5px;
    position: relative;
}

.monster-attack-outer {
    height: 16px;
    background: #0d0705;
    border: 1px solid #63391b;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 6px #000;
}

.monster-attack-fill {
    height: 100%;
    background: linear-gradient(90deg, #d35400 0%, #e74c3c 70%, #ff7675 100%);
    width: 0%;
    transition: width 0.05s linear;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.7);
}

.monster-attack-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-family: var(--d2-font-title);
    font-weight: 700;
    color: #ffd2cc;
    text-shadow: 1px 1px 2px #000;
    pointer-events: none;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

/* Floor Clear Treasure Chest */
.dungeon-chest-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 15px 0;
    animation: chestBounce 0.6s infinite alternate ease-in-out;
    z-index: 40;
}

.d2-chest-visual {
    font-size: 64px;
    filter: drop-shadow(0 0 20px #f1c40f);
    transition: transform 0.1s ease;
}

.d2-chest-visual:active {
    transform: scale(0.9);
}

.d2-chest-label {
    font-family: var(--d2-font-title);
    font-size: 14px;
    color: var(--color-gold-bright);
    background: rgba(18, 12, 8, 0.92);
    border: 1px solid var(--color-gold-dark);
    padding: 5px 16px;
    margin-top: 6px;
    text-shadow: 0 0 6px #000;
    border-radius: 2px;
}

@keyframes chestBounce {
    from { transform: translateY(0); }
    to { transform: translateY(-8px) scale(1.04); }
}

/* Hero Defeat Banner */
.hero-defeat-banner {
    position: absolute;
    top: 35%;
    left: 8%;
    right: 8%;
    background: rgba(45, 5, 5, 0.95);
    border: 2px solid #e74c3c;
    color: #fff;
    font-family: var(--d2-font-title);
    font-size: 15px;
    font-weight: 900;
    text-align: center;
    padding: 14px;
    box-shadow: 0 0 30px rgba(231, 76, 60, 0.85);
    z-index: 80;
    animation: defeatPulse 0.4s infinite alternate;
    border-radius: 3px;
}

@keyframes defeatPulse {
    from { transform: scale(1); }
    to { transform: scale(1.03); }
}

/* Floating Damage Received on Player */
.player-dmg-floater {
    position: absolute;
    font-family: var(--d2-font-title);
    font-size: 20px;
    font-weight: 900;
    color: #ff3333;
    text-shadow: 0 0 10px #000, 2px 2px 4px #000;
    pointer-events: none;
    z-index: 120;
    animation: playerDmgFloat 0.75s ease-out forwards;
}

.player-dmg-floater.block {
    color: #00ffff;
    font-size: 19px;
    text-shadow: 0 0 12px #00a8ff, 2px 2px 4px #000;
}

@keyframes playerDmgFloat {
    0% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -45px) scale(0.9); }
}

/* Combat Floaters */
.combat-dmg-floater {
    position: absolute;
    font-family: var(--d2-font-title);
    font-weight: 900;
    font-size: 19px;
    color: #ffffff;
    text-shadow: 0 0 5px #000, 2px 2px 3px #000;
    pointer-events: none;
    animation: floatCombatDmg 0.75s ease-out forwards;
    transform: translate(-50%, -50%);
    z-index: 25;
}

.combat-dmg-floater.crit {
    font-size: 26px;
    color: #ffdf40;
    text-shadow: 0 0 10px #ff3300, 2px 2px 4px #000;
}

@keyframes floatCombatDmg {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.8); }
    30% { transform: translate(-50%, -60px) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, -110px) scale(1); }
}

/* Combat Log Feed */
.combat-log-feed {
    height: 175px;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}

.combat-log-entry {
    padding: 5px 8px;
    background: rgba(0, 0, 0, 0.45);
    border-left: 3px solid #555;
    line-height: 1.45;
}

.combat-log-entry.log-success { border-left-color: #2ecc71; color: #a9dfbf; }
.combat-log-entry.log-drop { border-left-color: var(--color-gold-bright); color: #f9e79f; }
.combat-log-entry.log-fail { border-left-color: #e74c3c; color: #f5b7b1; }
.combat-log-entry.log-info { border-left-color: #3498db; color: #aed6f1; }

/* =========================================================
   2. GYM / SKILL TRAINING STATION (With Generated Barbell)
   ========================================================= */
#view-gym {
    flex-direction: column;
    gap: 12px;
}

.gym-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 800px) {
    .gym-layout {
        grid-template-columns: 260px 1fr;
    }
}

.gym-station-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
}

@media (min-width: 800px) {
    .gym-station-list {
        flex-direction: column;
        overflow-x: visible;
    }
}

.gym-station-tab {
    flex: 1;
    min-width: 140px;
    background: linear-gradient(180deg, #1c150e 0%, #0d0a07 100%);
    border: 1px solid #4a3824;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.12s ease;
}

.gym-station-tab.active {
    border-color: var(--color-gold-bright);
    background: linear-gradient(180deg, #332415 0%, #171008 100%);
    box-shadow: 0 0 10px rgba(230, 200, 117, 0.25);
}

.gym-station-name {
    font-family: var(--d2-font-title);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-gold-bright);
    margin-bottom: 2px;
}

.gym-station-desc {
    font-size: 12.5px;
    color: #cfc0a8;
    line-height: 1.35;
}

/* Gym Arena */
.gym-arena {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-height: 440px;
}

.gym-status-top {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3d2f1f;
    padding-bottom: 8px;
    margin-bottom: 12px;
    gap: 12px;
}

.gym-status-info {
    flex: 1;
    min-width: 0;
}

.gym-status-badges {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gym-timer-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #17110c;
    border: 1px solid #4a3824;
    padding: 5px 10px;
    border-radius: 2px;
    width: 116px;
    min-width: 116px;
    max-width: 116px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.gym-timer-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

#gym-timer-val {
    font-family: var(--d2-font-title), 'Courier New', monospace;
    font-size: 19px;
    font-weight: 900;
    color: var(--color-gold-bright);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    display: inline-block;
    width: 68px;
    text-align: right;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.gym-timer-display span.time-urgent {
    color: #ff3333 !important;
    transform: none !important;
    animation: timerPulseGlow 0.35s infinite alternate ease-in-out;
}

@keyframes timerPulseGlow {
    from {
        filter: brightness(1);
        text-shadow: 0 0 6px rgba(255, 0, 0, 0.7);
    }
    to {
        filter: brightness(1.35);
        text-shadow: 0 0 16px rgba(255, 50, 50, 1), 0 0 25px rgba(255, 0, 0, 0.8);
    }
}

/* Training Camp Interactive Arena */
.gym-exercise-visual-area {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    min-height: 230px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* Base Stage Container */
.camp-stage-container {
    width: 100%;
    height: 100%;
    min-height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* =========================================================
   STATION 1: STRENGTH - TRAINING DUMMY (БОЕВОЙ МАНЕКЕН)
   ========================================================= */
.stage-dummy {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.dummy-avatar-wrap {
    position: relative;
    width: 160px;
    height: 210px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transform-origin: bottom center;
    transition: transform 0.08s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dummy-avatar-wrap.shake-left {
    transform: rotate(-10deg) scale(0.96);
}

.dummy-avatar-wrap.shake-right {
    transform: rotate(10deg) scale(0.96);
}

.dummy-avatar-wrap.knockout {
    animation: dummyKnockout 0.8s ease-in-out infinite alternate;
}

@keyframes dummyKnockout {
    from { transform: rotate(-14deg) translateY(6px); }
    to { transform: rotate(14deg) translateY(-2px); }
}

.dummy-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.9));
}

.dummy-combo-badge {
    position: absolute;
    top: 5px;
    font-family: var(--d2-font-title);
    font-size: 13px;
    font-weight: 900;
    color: #ffaa00;
    background: rgba(20, 10, 5, 0.85);
    border: 1px solid #c0392b;
    padding: 2px 10px;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(231, 76, 60, 0.6);
    letter-spacing: 1px;
    animation: comboPulse 0.4s infinite alternate;
}

@keyframes comboPulse {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

/* Wood Splinter & Spark Particle */
.camp-particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    animation: campParticleFly 0.6s ease-out forwards;
}

@keyframes campParticleFly {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2); }
}

/* =========================================================
   STATION 2: DEXTERITY - ARCHERY RANGE (СТРЕЛЬБИЩЕ)
   ========================================================= */
.stage-archery {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    max-width: 440px;
    height: 100%;
    gap: 16px;
    position: relative;
    padding: 8px 12px;
}

.archery-target-box {
    position: relative;
    width: 150px;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.archery-target-svg {
    width: 130px;
    height: 130px;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.95));
}

.archery-arrow-fly {
    position: absolute;
    width: 70px;
    height: 12px;
    pointer-events: none;
    transition: all 0.22s ease-out;
}

.archery-arrow-fly.hidden {
    opacity: 0;
    transform: translate(-120px, 0) scale(0.8);
}

.archery-arrow-fly.hit-center {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    filter: drop-shadow(0 0 8px #ffeb3b);
}

.archery-arrow-fly.miss {
    opacity: 0.35;
    transform: translate(65px, -55px) rotate(-35deg) scale(0.8);
}

.archery-aim-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.archery-meter-title {
    font-family: var(--d2-font-title);
    font-size: 13px;
    font-weight: 700;
    color: var(--color-gold-bright);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.archery-track-outer {
    position: relative;
    width: 44px;
    height: 180px;
    background: linear-gradient(180deg, #120b08 0%, #080504 100%);
    border: 2px solid #52402b;
    outline: 1px solid #1a120a;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 0 10px #000;
}

.archery-sweet-spot {
    position: absolute;
    width: 100%;
    left: 0;
    background: linear-gradient(180deg, rgba(46, 204, 113, 0.35) 0%, rgba(39, 174, 96, 0.55) 100%);
    border-top: 2px solid #2ecc71;
    border-bottom: 2px solid #2ecc71;
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.archery-sweet-spot-text {
    font-size: 11px;
    font-weight: 900;
    color: #eaffea;
    text-shadow: 0 0 4px #000;
    letter-spacing: 0.5px;
}

.archery-aim-pointer {
    position: absolute;
    left: 2px;
    right: 2px;
    height: 8px;
    background: #e74c3c;
    border: 1px solid #fff;
    border-radius: 2px;
    box-shadow: 0 0 8px #ff4757;
    transition: top 0.04s linear;
}

.archery-aim-pointer.in-zone {
    background: #f1c40f;
    box-shadow: 0 0 10px #f1c40f, 0 0 18px #2ecc71;
}

.archery-shot-lock-wrapper {
    width: 80px;
    height: 6px;
    background: #1c140e;
    border: 1px solid #4a3824;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.archery-shot-lock-fill {
    height: 100%;
    background: linear-gradient(90deg, #f39c12 0%, #2ecc71 100%);
    width: 0%;
    transition: width 0.08s linear;
}

.archery-status-text {
    font-size: 12.5px;
    font-weight: 700;
    color: #d6c8b0;
    min-height: 18px;
}

/* =========================================================
   STATION 3: ENERGY - ALTAR OF MEDITATION (АЛТАРЬ МЕДИТАЦИИ)
   ========================================================= */
.stage-altar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.altar-visual-box {
    position: relative;
    width: 200px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.altar-crystal-orb {
    position: absolute;
    top: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #9b59b6 0%, #3498db 50%, #150d2a 100%);
    box-shadow: 0 0 25px rgba(155, 89, 182, 0.8), 0 0 50px rgba(52, 152, 219, 0.6);
    animation: altarOrbFloat 2.2s ease-in-out infinite alternate;
}

@keyframes altarOrbFloat {
    from { transform: translateY(0px) scale(0.95); }
    to { transform: translateY(-10px) scale(1.05); filter: drop-shadow(0 0 15px #bb68ec); }
}

.altar-aura-ring {
    position: absolute;
    top: 12px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1.5px dashed rgba(187, 104, 236, 0.65);
    animation: auraSpin 6s linear infinite;
    pointer-events: none;
}

@keyframes auraSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.altar-stone-svg {
    position: absolute;
    bottom: 4px;
    width: 170px;
    height: 120px;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.95));
}

.altar-zen-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 240px;
    margin-top: 4px;
    gap: 3px;
}

.altar-zen-track {
    position: relative;
    width: 100%;
    height: 14px;
    background: #140d16;
    border: 1px solid #5a3c63;
    border-radius: 3px;
    overflow: hidden;
}

.altar-zen-zone {
    position: absolute;
    left: 45%;
    width: 40%;
    height: 100%;
    background: rgba(155, 89, 182, 0.35);
    border-left: 1px solid #bb68ec;
    border-right: 1px solid #bb68ec;
}

.altar-zen-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #9b59b6 70%, #e056fd 100%);
    width: 0%;
    transition: width 0.08s linear;
}

.altar-zen-label {
    font-size: 12.5px;
    color: #dfc8ed;
    font-weight: 700;
}

/* =========================================================
   STATION 4: VITALITY - CAMP CROSS & BREATH WHEEL (КРОСС)
   ========================================================= */
.stage-vitality {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    max-width: 480px;
    height: 100%;
    gap: 16px;
    position: relative;
    padding: 6px 10px;
}

/* DEAD BY DAYLIGHT SKILL CHECK WHEEL & TRACK */
.stage-vitality {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    gap: 8px;
}

.vitality-run-track-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 260px;
    background: #140d08;
    border: 1px solid #4a3724;
    padding: 4px 12px;
    border-radius: 2px;
    box-shadow: inset 0 0 8px #000;
}

.vitality-runner-avatar {
    font-size: 18px;
    animation: runnerBob 0.35s ease-in-out infinite alternate;
}

@keyframes runnerBob {
    from { transform: translateY(0); }
    to { transform: translateY(-4px); }
}

.vitality-lap-text, .vitality-dist-text {
    font-family: var(--d2-font-title);
    font-size: 13px;
    color: var(--color-gold-bright);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* THE DEAD BY DAYLIGHT SKILL CHECK WHEEL */
.breath-wheel-box {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
    touch-action: manipulation;
}

.breath-wheel-svg {
    width: 220px;
    height: 220px;
    overflow: visible;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.95));
}

/* Authentic Dead by Daylight Red Pointer Needle */
.breath-wheel-needle {
    position: absolute;
    width: 4px;
    height: 96px;
    top: 14px;
    left: 108px; /* (220 - 4) / 2 */
    transform-origin: 2px 96px; /* Pivot at center (110, 110) */
    pointer-events: none;
    z-index: 5;
    will-change: transform;
}

.dbd-needle-tip {
    position: absolute;
    top: -6px;
    left: -4px;
    width: 12px;
    height: 14px;
    background: #ff1111;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    box-shadow: 0 0 10px #ff0000;
}

.dbd-needle-body {
    width: 4px;
    height: 96px;
    background: linear-gradient(180deg, #ff1a1a 0%, #ff5555 50%, #ffffff 100%);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.9), 0 0 15px rgba(255, 60, 60, 0.6);
}

.breath-wheel-center-hub {
    position: absolute;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #2a1e14 0%, #100b07 100%);
    border: 3px solid #5a442b;
    box-shadow: inset 0 0 14px #000, 0 4px 15px rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 6;
    pointer-events: none;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.breath-hub-icon {
    font-size: 13px;
    line-height: 1;
    margin-bottom: 1px;
}

.breath-mult-val {
    font-family: var(--d2-font-title);
    font-size: 19px;
    font-weight: 900;
    color: #4cd137;
    text-shadow: 0 0 8px rgba(76, 209, 55, 0.7);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.breath-mult-val.high {
    color: #ff9f1a;
    text-shadow: 0 0 12px #ff3838, 0 0 20px #ff9f1a;
    animation: multFire 0.35s infinite alternate;
}

@keyframes multFire {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.breath-mult-label {
    font-size: 10.5px;
    color: #cfc0a8;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Wheel Flash Ripples (Great / Good / Miss) */
.wheel-flash-green {
    box-shadow: inset 0 0 14px #000, 0 0 25px #2ecc71, 0 0 40px rgba(46, 204, 113, 0.7) !important;
    border-color: #2ecc71 !important;
}

.wheel-flash-gray {
    box-shadow: inset 0 0 14px #000, 0 0 22px #e2e8f0, 0 0 35px rgba(226, 232, 240, 0.6) !important;
    border-color: #cbd5e1 !important;
}

.wheel-flash-empty {
    box-shadow: inset 0 0 14px #000, 0 0 25px #e74c3c, 0 0 40px rgba(231, 76, 60, 0.8) !important;
    border-color: #e74c3c !important;
}

/* Skill Check Legend */
.dbd-wheel-legend {
    display: flex;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--d2-font-title);
    margin-top: 2px;
}

.dbd-legend-item {
    background: #140d08;
    padding: 2px 6px;
    border: 1px solid #3d2b1a;
    border-radius: 2px;
}

.legend-green { color: #2ecc71; border-color: #27ae60; }
.legend-gray { color: #cbd5e1; border-color: #64748b; }
.legend-red { color: #e74c3c; border-color: #7f1d1d; }

/* Floater Enhancements */
.gym-rep-floater {
    position: absolute;
    font-family: var(--d2-font-title);
    font-size: 18px;
    font-weight: 900;
    color: #4cd137;
    text-shadow: 0 0 8px #000, 2px 2px 3px #000;
    pointer-events: none;
    animation: floatRep 0.65s ease-out forwards;
    z-index: 50;
    white-space: nowrap;
}

.gym-rep-floater.floater-green {
    color: #2ecc71;
    font-size: 20px;
    text-shadow: 0 0 10px #27ae60, 2px 2px 3px #000;
}

.gym-rep-floater.floater-gray {
    color: #bdc3c7;
    font-size: 16px;
}

.gym-rep-floater.floater-red {
    color: #e74c3c;
    font-size: 18px;
    text-shadow: 0 0 10px #c0392b, 2px 2px 3px #000;
}

.gym-rep-floater.floater-crit {
    color: #f1c40f;
    font-size: 22px;
    text-shadow: 0 0 12px #e67e22, 2px 2px 3px #000;
}

@keyframes floatRep {
    0% { opacity: 1; transform: translate(-50%, 0) scale(0.9); }
    100% { opacity: 0; transform: translate(-50%, -60px) scale(1.15); }
}

.gym-progress-wrapper {
    width: 95%;
    max-width: 520px;
    margin: 10px 0;
}

.gym-bar-fill {
    height: 100%;
    background: linear-gradient(180deg, #f1c40f 0%, #b7950b 100%);
    width: 0%;
    transition: width 0.08s linear;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.gym-action-btn {
    width: 90%;
    max-width: 320px;
    height: 54px;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.gym-action-btn.pumping {
    background: linear-gradient(180deg, #c0392b 0%, #6e1818 100%);
    border-color: #e74c3c;
    color: #fff;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
}

/* =========================================================
   3. INVENTORY & PAPERDOLL (Authentic Diablo II Precision)
   ========================================================= */
#view-inventory {
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* Character Sub-tabs Bar (Экипировка, Характеристики, Навыки) */
.char-subtabs-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    background: #110d0a;
    padding: 5px 6px;
    border: 1px solid #4a3824;
    border-radius: 4px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
}

.char-subtab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(180deg, #241b12 0%, #120e08 100%);
    border: 1px solid #5a452f;
    color: #cfbf9f;
    font-family: var(--d2-font-title);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 9px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-shadow: 1px 1px 2px #000;
    position: relative;
    white-space: nowrap;
}

.char-subtab-btn:hover {
    border-color: var(--color-gold-bright);
    color: #ffffff;
    background: linear-gradient(180deg, #2e2319 0%, #1a130e 100%);
}

.char-subtab-btn.active {
    background: linear-gradient(180deg, #591616 0%, #240707 100%);
    border-color: #e63939;
    color: #ffffff;
    box-shadow: inset 0 0 10px rgba(255, 40, 40, 0.4), 0 0 8px rgba(180, 20, 20, 0.5);
}

.char-subview {
    width: 100%;
}

.equipment-view-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.char-stats-panel {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.paperdoll-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, #17110c 0%, #0d0906 100%);
    border: 2px solid #52402b;
    outline: 1px solid #281d11;
    outline-offset: -4px;
    padding: 12px;
    position: relative;
    box-shadow: inset 0 0 20px #000;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.paperdoll-frame {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
    width: 100%;
}

.paperdoll-row-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 220px;
}

.paperdoll-row-middle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 270px;
    gap: 8px;
}

.paperdoll-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 280px;
    gap: 4px;
}

/* Paperdoll Slots */
.paperdoll-slot {
    background: #090705;
    border: 2px solid #4a3824;
    outline: 1px solid #1a140d;
    outline-offset: -2px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 2px 2px 6px #000, 1px 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.1s ease;
}

.paperdoll-slot:hover, .paperdoll-slot:active {
    border-color: var(--color-gold-bright);
    background: rgba(0, 180, 0, 0.15); /* D2 Green highlight */
}

/* Slot Sizes */
.slot-head { width: 56px; height: 56px; }
.slot-amulet { width: 36px; height: 36px; position: absolute; right: 8px; top: 10px; }
.slot-body { width: 64px; height: 86px; }
.slot-weapon { width: 56px; height: 100px; }
.slot-shield { width: 56px; height: 100px; }
.slot-gloves { width: 52px; height: 52px; }
.slot-belt { width: 56px; height: 30px; }
.slot-boots { width: 52px; height: 52px; }
.slot-ring { width: 36px; height: 36px; }

.slot-placeholder {
    color: #382c1e;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.equipped-item {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
}

.equipped-item svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px #000);
}

.item-name-tag { display: none; }

/* Bag Grid (10 x 4) */
.inventory-grid-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(10, 33px);
    grid-template-rows: repeat(4, 33px);
    gap: 3px;
    background: #060504;
    border: 3px solid #4a3824;
    padding: 6px;
    box-shadow: inset 0 0 12px #000;
}

@media (min-width: 420px) {
    .inventory-grid {
        grid-template-columns: repeat(10, 36px);
        grid-template-rows: repeat(4, 36px);
    }
}

.inv-cell {
    width: 100%;
    height: 100%;
    background: #110d0a;
    border: 1px solid #281d12;
    box-shadow: inset 1px 1px 4px #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.inv-cell:active, .inv-cell:hover {
    background: rgba(0, 160, 0, 0.35); /* D2 placement green */
    border-color: #27ae60;
}

.inv-cell.has-item {
    background: #1a130e;
}

.inv-item-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.inv-item-content svg {
    width: 100%;
    height: 100%;
}

.inv-cell.rarity-magic { border-color: #2b45a0; }
.inv-cell.rarity-rare { border-color: #8f852b; }
.inv-cell.rarity-set { border-color: #1a781a; }
.inv-cell.rarity-unique { border-color: #9c7324; box-shadow: inset 0 0 4px rgba(212, 163, 75, 0.4); }

/* Quick Bulk Sell Bar */
.inventory-bulk-sell-bar {
    width: 100%;
    margin-top: 6px;
    padding: 8px 10px;
    background: rgba(14, 10, 8, 0.9);
    border: 1px solid #4a3824;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: inset 0 0 8px #000;
}

.bulk-sell-label {
    font-size: 12.5px;
    font-family: var(--d2-font-title);
    color: var(--color-gold-bright);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.bulk-sell-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.bulk-sell-btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 120px;
    padding: 7px 10px;
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
    border: 1px solid #3d2c1c;
    background: linear-gradient(to bottom, #2b1f14, #150f0a);
    color: #e6d5a8;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 3px;
    min-height: 34px;
}

.bulk-sell-btn:hover {
    filter: brightness(1.25);
    border-color: var(--color-gold-bright);
}

.bulk-sell-btn:active {
    transform: scale(0.97);
}

.bulk-sell-btn.sell-normal {
    border-color: #7f8c8d;
    color: #ecf0f1;
}

.bulk-sell-btn.sell-magic {
    border-color: #2980b9;
    color: #5dade2;
}

.bulk-sell-btn.sell-rare {
    border-color: #d4ac0d;
    color: #f7dc6f;
}

.bulk-sell-btn.sell-all {
    border-color: #c0392b;
    color: #e74c3c;
    background: linear-gradient(to bottom, #3d1411, #1a0807);
}

@media (min-width: 600px) {
    .bulk-sell-btn {
        flex: 1 1 calc(25% - 6px);
    }
}


/* Character Stats */
.char-sheet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13.5px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(82, 64, 43, 0.4);
}

.stat-label { color: #d6c8b0; font-weight: 600; }
.stat-value { color: #fff; font-weight: 700; }

.training-affixes-panel {
    margin-top: 10px;
    background: #0a0705;
    border: 1px solid #3d2f1f;
    padding: 10px;
    font-size: 12.5px;
}

.stat-line { margin-bottom: 3px; line-height: 1.35; }
.stat-line.weighted { color: #f39c12; }
.stat-line.lightened { color: #2ecc71; }
.stat-line.bonus { color: #3498db; }
.stat-line.muted { color: #7f8c8d; font-style: italic; }

/* =========================================================
   AUTHENTIC DIABLO II TOOLTIP
   ========================================================= */
.d2-floating-tooltip {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    display: none;
    max-width: 350px;
}

.d2-floating-tooltip.visible {
    display: block;
}

/* On touch/mobile screens, disable floating mouse-hover tooltips to prevent duplicate windows when opening item modal */
@media (hover: none), (pointer: coarse) {
    #d2-floating-tooltip,
    .d2-floating-tooltip {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

.d2-tooltip {
    background: #000000;
    border: 1px solid #ffffff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.95);
    padding: 10px 14px;
    text-align: center;
    border-radius: 0;
}

.d2-tooltip-title {
    font-family: var(--d2-font-title);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.d2-tooltip-type { font-size: 13px; color: #ffffff; margin-bottom: 4px; }
.d2-tooltip-divider { height: 1px; background: #333333; margin: 6px 0; }
.d2-stat-base { font-size: 13px; color: #ffffff; margin-bottom: 2px; }
.d2-val-white { color: #ffffff; font-weight: 700; }
.d2-stat-req { font-size: 13px; color: #ff3333; margin-bottom: 2px; }
.d2-stat-magic { font-size: 13px; color: #486eff; margin-bottom: 2px; }
.d2-stat-training { font-size: 13px; margin-bottom: 2px; font-weight: 700; }
.stat-weighted { color: #f39c12; }
.stat-lightened { color: #2ecc71; }
.stat-gym-timer { color: #00ffff; }
.d2-flavor-text { font-size: 12px; color: #e0d2ad; font-style: italic; }
.d2-set-name { font-size: 13px; color: #00e800; font-weight: 700; }

/* =========================================================
   AUTHENTIC DIABLO II BOTTOM HUD
   (Featuring High-Res Angel, Demon Sculptures & Gothic Console)
   ========================================================= */
.d2-bottom-hud {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 112px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    pointer-events: none;
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
}

.hud-inner-container {
    display: flex;
    align-items: flex-end;
    pointer-events: auto;
    position: relative;
    max-width: 850px;
    width: 100%;
    justify-content: space-between;
    height: 106px;
}

/* Angel Sculpture & Life Orb (Left) */
.hud-angel-life-box {
    width: 125px;
    height: 106px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.hud-sculpture-img {
    position: absolute;
    height: 108px;
    bottom: 0;
    pointer-events: none;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.9));
    z-index: 2;
}
.hud-angel-img { left: 0; }
.hud-demon-img { right: 0; }

/* Demon Sculpture & Mana Orb (Right) */
.hud-demon-mana-box {
    width: 125px;
    height: 106px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 3D Glass Orbs */
.hud-orb-sphere {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #080605;
    border: 3px solid #5a472c;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 15px #000, 0 4px 15px rgba(0,0,0,0.95);
    z-index: 5;
}

.hud-liquid-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transition: height 0.3s cubic-bezier(0.2, 0.8, 0.4, 1);
}

.hud-liquid-life {
    background: radial-gradient(circle at 50% 30%, #e74c3c 0%, #900c3f 65%, #420404 100%);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.85);
}

.hud-liquid-mana {
    background: radial-gradient(circle at 50% 30%, #3498db 0%, #1a5276 65%, #071e3d 100%);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.85);
}

.hud-orb-glass-glint {
    position: absolute;
    top: 5px;
    left: 10px;
    width: 26px;
    height: 15px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0%, transparent 100%);
    border-radius: 50%;
    transform: rotate(-25deg);
    pointer-events: none;
    z-index: 6;
}

.hud-orb-numeric-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13.5px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 5px #000, 1px 1px 3px #000, 0 0 8px #000;
    pointer-events: none;
    z-index: 7;
    white-space: nowrap;
}

/* Center Gothic Forged Belt Console */
.hud-center-panel {
    flex: 1;
    height: 64px;
    margin: 0 4px;
    background: 
        linear-gradient(180deg, rgba(20, 15, 10, 0.85) 0%, rgba(10, 8, 6, 0.95) 100%),
        url('../assets/img/hud_belt.jpg') center center / cover no-repeat;
    border: 2px solid #5a472c;
    border-radius: 3px 3px 0 0;
    box-shadow: 0 6px 20px #000, inset 0 1px 0 rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px 12px;
}

.hud-center-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hud-potions-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.hud-potion-btn {
    width: 38px;
    height: 38px;
    background: #0d0a08;
    border: 1px solid #6b5338;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: inset 0 0 6px #000, 0 2px 4px #000;
    transition: all 0.08s ease;
}

.hud-potion-btn:active {
    border-color: var(--color-gold-bright);
    transform: scale(0.95);
}

.hud-potion-btn svg { width: 85%; height: 85%; }

.hud-xp-outer {
    width: 100%;
    height: 10px;
    background: #080605;
    border: 1px solid #3d2f1f;
    overflow: hidden;
}

.hud-xp-fill {
    height: 100%;
    background: linear-gradient(180deg, #9b59b6 0%, #6c3483 100%);
    width: 0%;
}

/* Responsive Scaling for Mobile */
@media (max-width: 600px) {
    .hud-inner-container { height: 94px; }
    .hud-angel-life-box, .hud-demon-mana-box { width: 96px; height: 94px; }
    .hud-sculpture-img { height: 92px; }
    .hud-orb-sphere { width: 64px; height: 64px; }
    .hud-orb-numeric-text { font-size: 12.5px; font-weight: 900; }
    .hud-center-panel { height: 58px; margin: 0 2px; padding: 4px 6px; }
    .hud-potion-btn { width: 36px; height: 36px; }
}

/* Action Modal */
.d2-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 600;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.d2-modal-card {
    background: #0c0907;
    border: 2px solid #52402b;
    padding: 16px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 0 30px #000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-buttons-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* =========================================================
   DIABLO II NOTIFICATION BADGES & LEVEL UP ALERT
   ========================================================= */
.d2-tab-badge {
    background: #9c1515;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    border: 1px solid var(--color-gold-bright);
    margin-left: 4px;
    box-shadow: 0 0 8px rgba(230, 30, 30, 0.8);
    display: inline-block;
    animation: tabBadgePulse 1.4s infinite alternate;
}

/* Diablo II square button with plus for unspent skill points */
.d2-tab-badge-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    min-width: 15px;
    max-width: 15px;
    padding: 0;
    background: linear-gradient(180deg, #b01515 0%, #520707 100%);
    border: 1.5px solid var(--color-gold-bright);
    border-radius: 2px;
    color: #fff4b8;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    margin-left: 4px;
    box-shadow: 0 0 6px rgba(230, 30, 30, 0.8), inset 0 1px 0 rgba(255, 220, 130, 0.5);
    animation: tabBadgePulse 1.4s infinite alternate;
    user-select: none;
    box-sizing: border-box;
    text-shadow: 0 1px 2px #000;
    vertical-align: middle;
}

@keyframes tabBadgePulse {
    from { transform: scale(0.95); box-shadow: 0 0 4px rgba(230, 30, 30, 0.6); }
    to { transform: scale(1.08); box-shadow: 0 0 10px rgba(255, 215, 0, 0.9), 0 0 12px rgba(230, 30, 30, 0.9); }
}

.hud-levelup-alert {
    background: linear-gradient(180deg, #b01010 0%, #650909 100%);
    color: #fff6a0;
    border: 1px solid var(--color-gold-bright);
    font-family: var(--d2-font-title);
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 8px;
    cursor: pointer;
    border-radius: 2px;
    animation: hudLevelUpPulse 1.1s infinite alternate;
    text-transform: uppercase;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
    outline: none;
}

@keyframes hudLevelUpPulse {
    from { border-color: #ffd700; box-shadow: 0 0 4px rgba(255, 215, 0, 0.5); }
    to { border-color: #ffffff; box-shadow: 0 0 12px rgba(255, 215, 0, 0.9), 0 0 8px #ff3333; }
}

/* =========================================================
   STAT POINTS BANNER & ALLOCATION BUTTONS
   ========================================================= */
.stat-points-banner {
    background: linear-gradient(180deg, rgba(66, 32, 14, 0.7) 0%, rgba(26, 16, 10, 0.9) 100%);
    border: 1px solid var(--color-gold-bright);
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: center;
    box-shadow: 0 0 12px rgba(230, 200, 117, 0.35);
    animation: statBannerPulse 2s infinite alternate;
}

@keyframes statBannerPulse {
    from { border-color: #7d653c; }
    to { border-color: #ffd700; }
}

.stat-points-banner-text {
    font-family: var(--d2-font-title);
    font-size: 14px;
    color: var(--color-gold-bright);
}

.stat-points-banner-text b {
    color: #ffffff;
    font-size: 16px;
    text-shadow: 0 0 8px #ffd700;
}

.stat-points-banner-sub {
    font-size: 12px;
    color: #cfc0a8;
}

.stat-item.stat-allocatable {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-value-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.d2-stat-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #2b1f14 0%, #16100a 100%);
    border: 1px solid #5a472c;
    color: #b8a374;
    font-family: var(--d2-font-title);
    font-size: 16px;
    font-weight: 700;
    cursor: default;
    border-radius: 3px;
    padding: 0;
    outline: none;
    transition: all 0.1s ease;
}

.d2-stat-btn.can-add {
    background: linear-gradient(180deg, #991414 0%, #520909 100%);
    border-color: var(--color-gold-bright);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    animation: statBtnGlow 1.2s infinite alternate;
}

.d2-stat-btn.can-add:hover, .d2-stat-btn.can-add:active {
    background: linear-gradient(180deg, #cc1e1e 0%, #7a0e0e 100%);
    border-color: #ffffff;
    transform: scale(1.1);
}

@keyframes statBtnGlow {
    from { border-color: #c49942; box-shadow: 0 0 4px rgba(230, 200, 117, 0.4); }
    to { border-color: #ffd700; box-shadow: 0 0 10px rgba(255, 215, 0, 0.85); }
}

/* =========================================================
   DIABLO II SKILL TREES VIEW
   ========================================================= */
.skills-panel-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.skills-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid #3d2f1f;
    padding-bottom: 8px;
}

.skills-title-group {
    display: flex;
    flex-direction: column;
}

.skills-points-status {
    font-size: 13.5px;
    color: #cfbf9f;
}

.skill-points-counter {
    font-family: var(--d2-font-title);
    font-size: 16px;
    font-weight: 700;
    color: #8c7855;
    padding: 2px 8px;
    background: #140d08;
    border: 1px solid #3d2f1f;
    border-radius: 2px;
    margin-left: 4px;
}

.skill-points-counter.has-points {
    color: #ffffff;
    background: #4a1208;
    border-color: var(--color-gold-bright);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    text-shadow: 0 0 6px #ffd700;
}

.skill-tree-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid #3d2f1f;
}

.skill-tree-tabs,
.skill-tree-nav-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    flex: 1;
    max-width: 500px;
}

.skill-tree-tab-btn {
    font-size: 13px;
    padding: 8px 6px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: linear-gradient(180deg, #221a13 0%, #120e0a 100%);
    border: 1px solid #4a3822;
    border-radius: 3px;
    color: #e6d5a8;
    min-height: 38px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.skill-tree-tab-btn:hover {
    border-color: #8c7855;
    background: linear-gradient(180deg, #2e2319 0%, #1a130e 100%);
}

.skill-tree-tab-btn.active {
    background: linear-gradient(180deg, #422d17 0%, #22160b 100%);
    border-color: var(--color-gold-bright);
    color: var(--color-gold-bright);
    box-shadow: inset 0 0 8px rgba(230, 200, 117, 0.3), 0 0 6px rgba(0, 0, 0, 0.9);
}

.active-aura-summary {
    width: 100%;
}

.active-aura-badge {
    background: linear-gradient(180deg, rgba(32, 22, 14, 0.9) 0%, rgba(14, 10, 6, 0.95) 100%);
    border: 1px solid #7d653c;
    border-radius: 3px;
    padding: 7px 14px;
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-gold-bright);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.active-aura-badge.muted {
    color: #7d6b45;
    border-color: #382c1b;
}

.aura-rune {
    font-size: 16px;
    color: #ffd700;
    text-shadow: 0 0 8px #ffd700;
    animation: runePulse 1.5s infinite alternate;
}

@keyframes runePulse {
    from { transform: scale(1); opacity: 0.8; }
    to { transform: scale(1.2); opacity: 1; }
}

/* 3-Column Skills Tree Container */
.skills-tree-grid-container {
    width: 100%;
    position: relative;
}

.skills-trees-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    align-items: start;
    width: 100%;
}

.skill-tree-column-panel {
    display: flex;
    flex-direction: column;
    background: rgba(14, 10, 7, 0.75);
    border: 1px solid #3d2f1f;
    border-radius: 4px;
    overflow: hidden;
    min-width: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
    transition: border-color 0.2s ease;
}

.skill-tree-column-panel:hover {
    border-color: #5a4228;
}

.skill-tree-column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: linear-gradient(180deg, #261b11 0%, #140e08 100%);
    border-bottom: 2px solid #4a3824;
}

.skill-tree-column-icon {
    font-size: 18px;
    line-height: 1;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.4));
    flex-shrink: 0;
}

.skill-tree-column-title-box {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.skill-tree-column-title {
    font-family: var(--d2-font-title);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--color-gold-bright);
    text-shadow: 0 0 6px rgba(230, 200, 117, 0.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
}

.skill-tree-column-desc {
    font-size: 10.5px;
    color: #a89476;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

/* Tree Grid & Rows & SVG Viewport */
.skills-tree-viewport {
    position: relative;
    background: 
        radial-gradient(ellipse at 50% 50%, rgba(28, 18, 12, 0.6) 0%, rgba(8, 6, 4, 0.98) 100%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.008) 0, rgba(255, 255, 255, 0.008) 16px, transparent 16px, transparent 32px);
    padding: 10px 6px;
    border-radius: 0 0 4px 4px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.95);
    overflow: visible;
}

.skills-tree-svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.skills-tree-grid {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.skill-tree-row {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    padding: 3px 0;
    border-bottom: 1px dashed rgba(82, 64, 43, 0.25);
}

.skill-tree-row:last-child {
    border-bottom: none;
}

.skill-row-lvl-badge {
    font-family: var(--d2-font-title);
    font-size: 10.5px;
    color: #cfbf9f;
    width: 38px;
    min-width: 38px;
    text-align: center;
    background: #140d08;
    border: 1px solid #3d2f1f;
    padding: 3px 0;
    border-radius: 2px;
    user-select: none;
    letter-spacing: 0.3px;
}

.skill-row-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    flex: 1;
}

.skill-slot-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 72px;
    position: relative;
}

/* Skill Node */
.skill-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 86px;
    padding: 4px 2px;
    cursor: pointer;
    position: relative;
    border-radius: 3px;
    transition: all 0.12s ease;
    background: rgba(16, 11, 7, 0.9);
    border: 1px solid #382a1b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    z-index: 2;
}

.skill-node:hover {
    background: rgba(36, 26, 17, 0.96);
    border-color: #7d653c;
    box-shadow: 0 0 10px rgba(125, 101, 60, 0.5);
    transform: translateY(-1px);
}

.skill-icon-frame {
    width: 44px;
    height: 44px;
    position: relative;
    border: 2px solid #4a3824;
    border-radius: 3px;
    background: #080604;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 6px #000;
}

.skill-icon-frame svg {
    width: 100%;
    height: 100%;
    display: block;
}

.skill-node-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 3px;
}

.skill-node-name {
    font-size: 10.5px;
    color: #d6c8b0;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 82px;
    line-height: 1.25;
}

.skill-node-rank {
    font-family: var(--d2-font-title);
    font-size: 10.5px;
    color: #8c7855;
    margin-top: 1px;
}

/* Learned / Can Learn / Locked States */
.skill-node.learned {
    border-color: #634e30;
}

.skill-node.learned .skill-icon-frame {
    border-color: var(--color-gold-bright);
    box-shadow: 0 0 8px rgba(230, 200, 117, 0.35);
}

.skill-node.learned .skill-node-name {
    color: var(--color-gold-bright);
}

.skill-node.learned .skill-node-rank {
    color: #ffffff;
    font-weight: 700;
}

.skill-node.learned .skill-node-rank.maxed {
    color: #ffd700;
    text-shadow: 0 0 6px #ffd700;
}

.skill-node.can-learn {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    animation: nodeCanLearnGlow 1.4s infinite alternate;
}

.skill-node.can-learn .skill-icon-frame {
    border-color: #ffd700;
}

@keyframes nodeCanLearnGlow {
    from { border-color: #a87e22; box-shadow: 0 0 4px rgba(255, 215, 0, 0.3); }
    to { border-color: #ffffff; box-shadow: 0 0 12px rgba(255, 215, 0, 0.8); }
}

.skill-node.locked {
    opacity: 0.55;
    filter: grayscale(0.65);
}

.skill-node.locked:hover {
    opacity: 0.8;
    filter: grayscale(0.2);
}

.skill-node.active-aura-node .skill-icon-frame {
    border-color: #00ffff;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.7);
}

.aura-active-glow {
    position: absolute;
    inset: 0;
    border: 2px solid #5ac8fa;
    box-shadow: inset 0 0 8px rgba(90, 200, 250, 0.8);
    pointer-events: none;
    animation: auraGlowSpin 2s infinite alternate;
}

@keyframes auraGlowSpin {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* Quick Add Button on Node */
.skill-add-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: linear-gradient(180deg, #991414 0%, #520909 100%);
    border: 1px solid #ffd700;
    color: #ffffff;
    font-family: var(--d2-font-title);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 3px;
    padding: 0;
    box-shadow: 0 0 6px #ffd700;
    animation: statBtnGlow 1.2s infinite alternate;
    z-index: 5;
}

.skill-add-btn:hover {
    transform: scale(1.15);
    background: #cc1818;
}

/* Responsive: Desktop (3 columns side by side) vs Mobile (tabbed single column) */
@media (min-width: 980px) {
    .skill-tree-tabs,
    .skill-tree-nav-tabs {
        display: none !important;
    }
    .skills-trees-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    .skill-tree-column-panel {
        display: flex !important;
    }
}

@media (max-width: 979px) {
    .skill-tree-tabs,
    .skill-tree-nav-tabs {
        display: grid;
        width: 100%;
        max-width: 100%;
    }
    .skills-trees-container {
        display: flex;
        flex-direction: column;
    }
    .skill-tree-column-panel {
        display: none;
    }
    .skill-tree-column-panel.active-tab {
        display: flex;
    }
    .skill-node {
        max-width: 96px;
        padding: 5px;
    }
    .skill-icon-frame {
        width: 48px;
        height: 48px;
    }
    .skill-node-name {
        font-size: 11.5px;
        max-width: 92px;
    }
    .skill-row-lvl-badge {
        font-size: 11px;
        width: 44px;
        min-width: 44px;
    }
}


/* =========================================================
   AUTHENTIC DIABLO II SKILL TOOLTIP
   ========================================================= */
.d2-skill-tooltip {
    max-width: 350px;
    width: 350px;
}

.d2-tooltip-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gold-title {
    font-family: var(--d2-font-title);
    font-size: 16px;
    color: var(--color-gold-bright);
    text-shadow: 0 0 8px rgba(230, 200, 117, 0.5);
    border-bottom: 1px solid #4a3824;
    padding-bottom: 2px;
}

.italic-subtitle {
    font-size: 12px;
    color: #cfbf9f;
    font-style: italic;
}

.tooltip-rank-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    align-items: center;
}

.rank-badge {
    font-family: var(--d2-font-title);
    color: #ffffff;
    font-weight: 700;
    background: #241a12;
    padding: 2px 7px;
    border: 1px solid #5a472c;
    border-radius: 2px;
}

.tooltip-req-box {
    background: rgba(14, 10, 7, 0.8);
    border: 1px solid #332718;
    padding: 5px 8px;
    border-radius: 2px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.text-gray { color: #8e8e93; }
.text-red { color: #ff453a; font-weight: 700; }
.text-green { color: #30d158; }
.text-gold { color: var(--color-gold-bright); }
.text-bright { color: #ffffff; font-weight: 700; }

.tooltip-desc-box {
    font-size: 12.5px;
    line-height: 1.45;
    color: #e6d5a8;
    margin: 2px 0;
}

.tooltip-bonus-box, .tooltip-next-box {
    background: rgba(22, 16, 11, 0.9);
    border-left: 2px solid var(--color-gold-bright);
    padding: 5px 8px;
    font-size: 12.5px;
}

.tooltip-next-box {
    border-left-color: #5ac8fa;
}

.bonus-header {
    font-size: 11.5px;
    color: #cfbf9f;
    margin-bottom: 2px;
}

.bonus-val {
    font-size: 12.5px;
    line-height: 1.35;
}

.tooltip-aura-status {
    background: #18140e;
    border: 1px dashed #7d653c;
    padding: 5px 8px;
    font-size: 11.5px;
    text-align: center;
    color: #cfbf9f;
    margin-top: 4px;
}

.tooltip-aura-status.active-aura {
    border-color: #5ac8fa;
    color: #5ac8fa;
    font-weight: 700;
    background: rgba(0, 122, 255, 0.1);
}

/* =========================================================
   DIABLO II MONSTER PACKS & MULTI-TARGETING ARENA
   ========================================================= */
.dungeon-record-badge {
    font-size: 12px;
    color: #f1c40f;
    opacity: 0.9;
    margin-left: 4px;
}

.monster-pack-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 8px;
    padding: 6px 0;
}

.monster-pack-container.single-mode {
    max-width: 440px;
}

.monster-pack-container.pack-mode {
    max-width: 620px;
    flex-wrap: wrap;
    justify-content: center;
}

.pack-monster-card {
    background: linear-gradient(180deg, rgba(28, 19, 13, 0.95) 0%, rgba(12, 8, 5, 0.98) 100%);
    border: 2px solid #52402b;
    border-radius: 4px;
    padding: 4px 4px 6px;
    cursor: pointer;
    user-select: none;
    touch-action: pan-y;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.pack-monster-card:hover {
    border-color: #8f6e42;
    transform: translateY(-2px);
}

/* Monsters with high-res sprite graphics: no card box / borders */
.pack-monster-card.card-has-sprite,
.pack-monster-card.card-has-sprite:hover,
.pack-monster-card.card-has-sprite.active-target,
.pack-monster-card.card-has-sprite.is-dead {
    background: transparent !important;
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.pack-monster-card.card-has-sprite.active-target .monster-sprite-img {
    filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.95)) drop-shadow(0 8px 20px rgba(0, 0, 0, 0.95)) !important;
}

.pack-card-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2px;
    z-index: 2;
}

.pack-card-name {
    font-family: var(--d2-font-title);
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 98%;
    text-shadow: 1px 1px 3px #000;
    box-sizing: border-box;
}

.pack-monster-card.card-has-sprite .pack-card-name {
    background: rgba(0, 0, 0, 0.75);
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid rgba(82, 64, 43, 0.6);
}

.pack-target-pip {
    display: inline-block;
    animation: targetPipPulse 0.9s infinite alternate;
}

@keyframes targetPipPulse {
    from { transform: scale(0.92); opacity: 0.9; }
    to { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 4px #ffd700); }
}

.pack-hp-outer {
    width: 96%;
    height: 16px;
    background: #0a0705;
    border: 1px solid #52402b;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    margin-top: 2px;
    box-shadow: inset 0 0 6px #000;
}

.pack-hp-fill {
    height: 100%;
    background: linear-gradient(180deg, #c92222 0%, #7d0d0d 100%);
    transition: width 0.08s linear;
}

.pack-hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 1px 1px 2px #000;
    pointer-events: none;
    white-space: nowrap;
    line-height: 1;
}

.pack-monster-avatar {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease;
    position: relative;
    overflow: visible;
    width: 100%;
}

.pack-mode .pack-monster-card.card-has-sprite .pack-monster-avatar {
    width: 135px;
    height: 135px;
}

.pack-mode .pack-monster-card.pack-2-cols.card-has-sprite .pack-monster-avatar {
    width: 175px;
    height: 175px;
}

.single-mode .pack-monster-card {
    width: 100%;
    max-width: 480px;
    min-height: 260px;
    padding: 8px 12px;
}

.single-mode .pack-monster-card.card-has-sprite .pack-monster-avatar {
    width: 220px;
    height: 220px;
}

.single-mode .pack-monster-avatar {
    width: 180px;
    height: 180px;
}

.pack-mode .pack-monster-card {
    flex: 1 1 calc(33.3% - 8px);
    max-width: 240px;
    min-width: 90px;
    min-height: 210px;
}

.pack-mode .pack-monster-card.pack-2-cols {
    flex: 1 1 calc(50% - 8px);
    max-width: 300px;
}

.pack-mode .pack-monster-avatar {
    width: 110px;
    height: 110px;
}

@media (max-width: 480px) {
    .pack-mode .pack-monster-card {
        padding: 3px 2px 4px;
        min-height: 155px;
        flex: 1 1 calc(33.3% - 4px);
    }
    .pack-mode .pack-monster-card.pack-2-cols {
        flex: 1 1 calc(50% - 4px);
    }
    .pack-mode .pack-monster-card.card-has-sprite .pack-monster-avatar {
        width: 105px;
        height: 110px;
    }
    .pack-mode .pack-monster-avatar {
        width: 85px;
        height: 85px;
    }
    .pack-card-name {
        font-size: 11px;
        padding: 1px 4px;
    }
    .pack-hp-outer {
        height: 14px;
        margin-top: 1px;
    }
    .pack-hp-text {
        font-size: 9px;
    }
    .pack-atk-outer {
        height: 12px;
    }
    .pack-atk-text {
        font-size: 9px;
    }
}

/* Active Target Border & Reticle */
.pack-monster-card.active-target {
    border-color: #ffd700 !important;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.65), inset 0 0 10px rgba(255, 215, 0, 0.25) !important;
    transform: scale(1.03);
    z-index: 10;
}

.pack-badge-target {
    background: #b01010;
    color: #ffd700;
    font-family: var(--d2-font-title);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 2px;
    border: 1px solid #ffd700;
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
    pointer-events: none;
    animation: targetBadgePulse 1s infinite alternate;
}

@keyframes targetBadgePulse {
    from { opacity: 0.9; transform: translateX(-50%) scale(0.98); }
    to { opacity: 1; transform: translateX(-50%) scale(1.04); }
}

.pack-badge-healer {
    background: #145a32;
    color: #58d68d;
    border: 1px solid #27ae60;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 2px;
    margin-bottom: 2px;
    font-family: var(--d2-font-title);
    white-space: nowrap;
    text-shadow: 0 0 4px #000;
}

.pack-badge-boss {
    background: #6c3483;
    color: #f4d03f;
    border: 1px solid #f39c12;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 2px;
    margin-bottom: 2px;
    font-family: var(--d2-font-title);
    white-space: nowrap;
}

.pack-badge-guardian {
    background: #7d6608;
    color: #f9e79f;
    border: 1px solid #f1c40f;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 2px;
    margin-bottom: 2px;
    font-family: var(--d2-font-title);
    white-space: nowrap;
}


.monster-sprite-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.85));
    transition: transform 0.08s ease, filter 0.08s ease;
    user-select: none;
    pointer-events: none;
}

.monster-sprite-img.state-hurt {
    filter: drop-shadow(0 0 18px #ff2222) brightness(1.35) !important;
    transform: scale(0.93) rotate(-3deg);
}

.monster-sprite-img.state-attack {
    filter: drop-shadow(0 0 20px #ff9900) brightness(1.25) !important;
    transform: scale(1.1) translateY(4px);
}

.monster-sprite-img.state-dead {
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.95)) saturate(0.9) !important;
    transform: translateY(6px);
}


.pack-atk-outer {
    width: 100%;
    height: 15px;
    background: #0d0705;
    border: 1px solid #63391b;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    margin-top: 3px;
    box-shadow: inset 0 0 5px #000;
}

.pack-atk-fill {
    height: 100%;
    background: linear-gradient(90deg, #d35400 0%, #e74c3c 70%, #ff7675 100%);
    transition: width 0.05s linear;
}

.pack-atk-fill.heal-fill {
    background: linear-gradient(90deg, #117a65 0%, #27ae60 70%, #82e0aa 100%) !important;
}

.pack-atk-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10.5px;
    font-family: var(--d2-font-title);
    font-weight: 700;
    color: #ffd2cc;
    text-shadow: 1px 1px 2px #000;
    pointer-events: none;
    white-space: nowrap;
}

/* =========================================================
   CIRCULAR ATTACK DIAL (ЦИФЕРБЛАТ АТАКИ ВРАГА)
   Полупрозрачный значок атаки на фоне + таймер в секундах
   обведены заполняющимся по кругу индикатором
   ========================================================= */
.monster-atk-dial {
    position: absolute;
    left: 8px;
    bottom: 8px;
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.95));
    pointer-events: none;
    z-index: 10;
    overflow: visible;
    transition: transform 0.12s ease, filter 0.15s ease;
}

.monster-atk-dial.dial-ready {
    animation: dialReadyPulse 0.35s infinite alternate;
}

@keyframes dialReadyPulse {
    from { transform: scale(1.04); filter: drop-shadow(0 0 6px #ff4242); }
    to { transform: scale(1.15); filter: drop-shadow(0 0 12px #ff7675); }
}

.monster-atk-dial.is-healer.dial-ready {
    animation: dialReadyHealerPulse 0.35s infinite alternate;
}

@keyframes dialReadyHealerPulse {
    from { transform: scale(1.04); filter: drop-shadow(0 0 6px #2ecc71); }
    to { transform: scale(1.15); filter: drop-shadow(0 0 12px #82e0aa); }
}

.pack-monster-card.is-dead {
    opacity: 0.6;
    pointer-events: none;
    transform: scale(0.95);
    border-color: #332718;
}

.monster-dead-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 6px #000) grayscale(1);
}

/* Lunge animation on attack */
.pack-monster-card.card-lunge {
    animation: packCardLunge 0.28s ease-out;
}

@keyframes packCardLunge {
    0% { transform: scale(1) translateY(0); filter: brightness(1); }
    40% { transform: scale(1.12) translateY(12px); filter: brightness(1.7) drop-shadow(0 0 20px #ff2222); }
    100% { transform: scale(1) translateY(0); filter: brightness(1); }
}

/* Hit react animation */
.pack-monster-card.card-hit {
    animation: packCardHit 0.16s ease;
}

@keyframes packCardHit {
    0% { transform: scale(0.93); filter: brightness(1.8) drop-shadow(0 0 15px #ff4444); }
    100% { transform: scale(1); }
}

.pack-monster-card.card-crit {
    animation: packCardCrit 0.22s ease;
}

@keyframes packCardCrit {
    0% { transform: scale(0.88) rotate(-2deg); filter: brightness(2.4) drop-shadow(0 0 25px #ffaa00); }
    50% { transform: scale(1.05) rotate(2deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.pack-monster-card.card-healed {
    animation: packCardHeal 0.5s ease;
}

@keyframes packCardHeal {
    0% { box-shadow: 0 0 30px #2ecc71; filter: brightness(1.7); }
    100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8); filter: brightness(1); }
}

/* =========================================================
   DEATH / FATAL DAMAGE RESURRECTION MODAL
   ========================================================= */
.death-modal-card {
    background: radial-gradient(circle, #2c0808 0%, #120303 100%) !important;
    border: 2px solid #b71c1c !important;
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.7), inset 0 0 25px rgba(0, 0, 0, 0.9) !important;
    max-width: 400px;
    width: 92%;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.death-modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.death-modal-skull {
    font-size: 42px;
    filter: drop-shadow(0 0 15px #ff2222);
    animation: skullBob 1.6s infinite alternate ease-in-out;
}

@keyframes skullBob {
    from { transform: translateY(0); filter: drop-shadow(0 0 10px #ff2222); }
    to { transform: translateY(-6px); filter: drop-shadow(0 0 25px #ff5555); }
}

.death-modal-title {
    font-family: var(--d2-font-title);
    font-size: 24px;
    color: #ff4d4d;
    text-shadow: 0 0 12px #ff0000;
    margin: 0;
    letter-spacing: 1px;
}

.death-modal-desc {
    font-size: 14px;
    color: #e0d0c0;
    text-align: center;
    line-height: 1.45;
    margin: 4px 0;
}

.death-modal-stats-box {
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid #5a3020;
    padding: 10px 16px;
    border-radius: 3px;
    font-family: var(--d2-font-title);
    font-size: 13.5px;
    color: var(--color-gold-bright);
    text-align: center;
    width: 90%;
    box-sizing: border-box;
}

.death-modal-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
    width: 100%;
}

.death-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    width: 100%;
    text-align: center;
    cursor: pointer;
}

.death-btn-title {
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.death-btn-sub {
    font-size: 11.5px;
    opacity: 0.85;
    margin-top: 2px;
}

.d2-btn-purple {
    background: linear-gradient(180deg, #6c2a8c 0%, #3d1452 100%) !important;
    border-color: #b565d8 !important;
    color: #f5e6ff !important;
    box-shadow: 0 0 14px rgba(181, 101, 216, 0.5);
}

.d2-btn-purple:hover, .d2-btn-purple:active {
    background: linear-gradient(180deg, #8a37b3 0%, #4f1b6a 100%) !important;
    border-color: #e0a3fa !important;
    box-shadow: 0 0 22px rgba(224, 163, 250, 0.8);
    transform: translateY(-1px);
}

/* =========================================================
   SANCTUARY HUB, GATES & WAYPOINTS MAP
   ========================================================= */
.sanctuary-hub-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 480px;
    padding: 16px 12px;
    box-sizing: border-box;
    text-align: center;
    position: relative;
    background: radial-gradient(circle at 50% 30%, #1a120c 0%, #0d0906 70%, #050302 100%);
    border: 2px solid #5a4530;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.9), 0 4px 14px #000;
}

#sanctuary-hub-content {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gates-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.gates-title-box {
    margin-top: 4px;
}

.gates-title {
    font-family: var(--d2-font-title);
    font-size: 22px;
    color: var(--color-gold-bright);
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4), 2px 2px 4px #000;
    margin: 0;
}

.gates-subtitle {
    font-size: 13.5px;
    color: #e2d2a4;
    margin-top: 4px;
}

.gates-lore {
    font-size: 13px;
    line-height: 1.55;
    color: #e2d2a4;
    background: rgba(14, 10, 8, 0.75);
    border: 1px solid #483827;
    padding: 12px 16px;
    border-radius: 3px;
    max-width: 460px;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8);
}

.d2-btn-challenge {
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 1.2px !important;
    padding: 14px 28px !important;
    background: linear-gradient(180deg, #6b1414 0%, #3e0b0b 50%, #1e0505 100%) !important;
    border-color: #c0392b !important;
    color: #fff1d0 !important;
    box-shadow: 0 0 18px rgba(231, 76, 60, 0.5), inset 0 0 6px rgba(255, 255, 255, 0.2) !important;
    animation: challengePulse 2.4s ease-in-out infinite;
    cursor: pointer;
    margin-top: 6px;
}

.d2-btn-challenge:hover, .d2-btn-challenge:active {
    background: linear-gradient(180deg, #8b1c1c 0%, #520f0f 50%, #280707 100%) !important;
    border-color: #ff5252 !important;
    color: #ffffff !important;
    box-shadow: 0 0 28px rgba(255, 82, 82, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px) scale(1.02);
}

@keyframes challengePulse {
    0%, 100% { box-shadow: 0 0 14px rgba(231, 76, 60, 0.4); transform: scale(1); }
    50% { box-shadow: 0 0 26px rgba(255, 80, 80, 0.85); transform: scale(1.02); }
}

/* Waypoints Hub Selection Screen */
.waypoint-hub-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.waypoint-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 440px;
    margin-top: 8px;
}

.waypoint-card {
    background: linear-gradient(180deg, #241c14 0%, #130e09 100%);
    border: 2px solid #52402b;
    border-radius: 4px;
    padding: 10px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.15s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.7);
}

.waypoint-card:hover {
    border-color: #a88448;
    background: linear-gradient(180deg, #30251a 0%, #1a130c 100%);
}

.waypoint-card.active {
    border-color: #00ffff;
    background: linear-gradient(180deg, #182e38 0%, #0d1a20 100%);
    box-shadow: 0 0 16px rgba(0, 255, 255, 0.4), inset 0 0 8px rgba(0, 255, 255, 0.2);
}

.waypoint-card-icon {
    font-size: 26px;
    margin-bottom: 4px;
}

.waypoint-card-title {
    font-family: var(--d2-font-title);
    font-size: 13px;
    font-weight: 700;
    color: var(--color-gold-bright);
    margin-bottom: 2px;
}

.waypoint-card.active .waypoint-card-title {
    color: #80d8ff;
}

.waypoint-card-desc {
    font-size: 11px;
    color: #cfbf9f;
}

/* =========================================================
   CINEMATIC & SOUL CRYSTAL MODAL
   ========================================================= */
.cinematic-modal-card {
    max-width: 440px !important;
    background: radial-gradient(circle at 50% 20%, #201228 0%, #110915 65%, #08030b 100%) !important;
    border: 2px solid #9333ea !important;
    box-shadow: 0 0 30px rgba(147, 51, 234, 0.6), inset 0 0 15px rgba(147, 51, 234, 0.3) !important;
    text-align: center;
    padding: 18px 16px !important;
}

.cinematic-sparks-banner {
    font-size: 18px;
    color: #00ffff;
    letter-spacing: 6px;
    animation: sparksFlicker 1.5s infinite;
}

@keyframes sparksFlicker {
    0%, 100% { opacity: 0.9; text-shadow: 0 0 8px #00ffff; }
    50% { opacity: 0.4; text-shadow: none; }
}

.cinematic-title {
    font-family: var(--d2-font-title);
    font-size: 22px;
    color: #ffdd44;
    letter-spacing: 1px;
    margin: 4px 0 2px 0;
    text-shadow: 0 0 10px rgba(255, 221, 68, 0.5), 2px 2px 4px #000;
}

.cinematic-subtitle {
    font-size: 13px;
    color: #c084fc;
    font-style: italic;
}

.cinematic-art-container {
    margin: 12px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.crystal-pulsing-aura {
    animation: crystalPulse 2s ease-in-out infinite;
}

@keyframes crystalPulse {
    0%, 100% { transform-origin: 60px 60px; transform: scale(1); opacity: 0.85; }
    50% { transform-origin: 60px 60px; transform: scale(1.1); opacity: 1; }
}

.cinematic-story-text {
    font-size: 13px;
    line-height: 1.55;
    color: #e2d4ec;
    text-align: left;
    background: rgba(10, 4, 14, 0.85);
    border: 1px solid #58217a;
    padding: 12px 14px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.cinematic-highlight-box {
    margin-top: 8px;
    padding: 8px;
    background: rgba(147, 51, 234, 0.15);
    border: 1px solid #a855f7;
    border-radius: 3px;
    font-size: 12.5px;
    color: #f3e8ff;
    line-height: 1.45;
}

.d2-btn-cinematic {
    font-size: 14px !important;
    padding: 12px 20px !important;
    background: linear-gradient(180deg, #5b21b6 0%, #3b0764 100%) !important;
    border-color: #c084fc !important;
    color: #ffffff !important;
    box-shadow: 0 0 16px rgba(192, 132, 252, 0.6) !important;
    width: 100%;
}

.d2-btn-cinematic:hover {
    background: linear-gradient(180deg, #7c3aed 0%, #4c1d95 100%) !important;
    box-shadow: 0 0 24px rgba(192, 132, 252, 0.9) !important;
}

/* =========================================================
   WAYPOINT TUTORIAL MODAL
   ========================================================= */
.waypoint-tutorial-card {
    max-width: 440px !important;
    background: radial-gradient(circle at 50% 25%, #161e27 0%, #0d1217 65%, #06090c 100%) !important;
    border: 2px solid #00bcd4 !important;
    box-shadow: 0 0 25px rgba(0, 188, 212, 0.5) !important;
    text-align: center;
    padding: 16px !important;
}

.waypoint-preview-art {
    margin: 8px 0;
    display: flex;
    justify-content: center;
}

.waypoint-guide-desc {
    font-size: 13.5px;
    line-height: 1.55;
    color: #cbe3eb;
    background: rgba(8, 14, 20, 0.85);
    border: 1px solid #204051;
    padding: 12px 14px;
    border-radius: 4px;
    margin: 8px 0 14px 0;
    text-align: left;
}

.waypoint-tut-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.wp-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 9px 12px !important;
    width: 100%;
}

/* =========================================================
   RESPONSIVE TYPOGRAPHY & DESKTOP / MOBILE SCALING
   ========================================================= */
@media (min-width: 1024px) {
    .d2-main-wrapper {
        max-width: 1360px;
        padding: 14px 16px 145px 14px;
    }
    
    .d2-header {
        padding: 8px 18px;
    }
    
    .d2-logo-title {
        font-size: 24px;
    }
    
    .d2-header-controls .d2-btn {
        font-size: 13px;
        padding: 7px 12px;
    }
    
    .d2-main-tab-btn {
        font-size: 14.5px;
        padding: 11px 16px;
        min-width: 110px;
        max-width: 220px;
        min-height: 44px;
    }
    
    .dungeon-arena-panel {
        min-height: 520px;
    }
    
    .monster-arena {
        min-height: 420px;
    }
    
    .pack-mode .pack-monster-card {
        max-width: 270px;
        min-height: 270px;
    }
    
    .pack-mode .pack-monster-card.card-has-sprite .pack-monster-avatar {
        width: 170px;
        height: 170px;
    }
    
    .pack-mode .pack-monster-card.pack-2-cols {
        max-width: 350px;
        min-height: 310px;
    }
    
    .pack-mode .pack-monster-card.pack-2-cols.card-has-sprite .pack-monster-avatar {
        width: 215px;
        height: 215px;
    }
    
    .single-mode .pack-monster-card {
        max-width: 500px;
        min-height: 320px;
    }
    
    .single-mode .pack-monster-card.card-has-sprite .pack-monster-avatar {
        width: 250px;
        height: 250px;
    }
    
    .monster-atk-dial {
        width: 48px;
        height: 48px;
        left: 8px;
        bottom: 8px;
    }
    
    .pack-card-name {
        font-size: 14.5px;
    }
    
    .pack-hp-outer {
        height: 22px;
    }
    
    .pack-hp-text {
        font-size: 12px;
    }
    
    .char-sheet-grid {
        font-size: 14px;
        gap: 8px 14px;
    }
    
    .d2-btn {
        font-size: 13.5px;
        padding: 8px 14px;
    }
    
    .combat-log-feed {
        font-size: 13.5px;
        height: 195px;
    }
    
    .monster-name-box {
        font-size: 20px;
        padding: 4px 18px;
    }
    
    .gym-station-name {
        font-size: 15.5px;
    }
    
    .gym-station-desc {
        font-size: 13px;
    }
    
    .hud-inner-container {
        max-width: 950px;
        height: 112px;
    }
    
    .hud-orb-sphere {
        width: 84px;
        height: 84px;
    }
    
    .hud-orb-numeric-text {
        font-size: 15px;
    }
    
    .hud-potion-btn {
        width: 40px;
        height: 40px;
    }
}

@media (min-width: 1440px) {
    .d2-main-wrapper {
        max-width: 1560px;
        padding: 18px 20px 155px 18px;
    }
    
    .d2-header {
        padding: 10px 24px;
    }
    
    .d2-logo-title {
        font-size: 28px;
    }
    
    .d2-logo-subtitle {
        font-size: 13.5px;
    }
    
    .d2-header-controls .d2-btn {
        font-size: 14px;
        padding: 8px 14px;
    }
    
    .d2-panel-title {
        font-size: 18px;
    }
    
    .d2-main-tab-btn {
        font-size: 15.5px;
        padding: 13px 20px;
        min-width: 130px;
        max-width: 250px;
        min-height: 48px;
    }
    
    .dungeon-arena-panel {
        min-height: 600px;
    }
    
    .monster-arena {
        min-height: 500px;
    }
    
    .pack-mode .pack-monster-card {
        max-width: 320px;
        min-height: 320px;
    }
    
    .pack-mode .pack-monster-card.card-has-sprite .pack-monster-avatar {
        width: 210px;
        height: 210px;
    }
    
    .pack-mode .pack-monster-card.pack-2-cols {
        max-width: 420px;
        min-height: 360px;
    }
    
    .pack-mode .pack-monster-card.pack-2-cols.card-has-sprite .pack-monster-avatar {
        width: 260px;
        height: 260px;
    }
    
    .single-mode .pack-monster-card {
        max-width: 580px;
        min-height: 370px;
    }
    
    .single-mode .pack-monster-card.card-has-sprite .pack-monster-avatar {
        width: 300px;
        height: 300px;
    }
    
    .monster-atk-dial {
        width: 52px;
        height: 52px;
        left: 10px;
        bottom: 10px;
    }
    
    .pack-card-name {
        font-size: 16px;
    }
    
    .pack-hp-outer {
        height: 25px;
    }
    
    .pack-hp-text {
        font-size: 13px;
    }
    
    .char-sheet-grid {
        font-size: 15px;
    }
    
    .d2-btn {
        font-size: 14px;
    }
    
    .hud-inner-container {
        max-width: 1080px;
        height: 118px;
    }
    
    .hud-sculpture-img {
        height: 120px;
    }
    
    .hud-angel-life-box, .hud-demon-mana-box {
        width: 140px;
        height: 118px;
    }
    
    .hud-orb-sphere {
        width: 90px;
        height: 90px;
    }
    
    .hud-orb-numeric-text {
        font-size: 16px;
    }
    
    .hud-potion-btn {
        width: 44px;
        height: 44px;
    }
    
    .combat-log-feed {
        height: 230px;
        font-size: 14px;
    }
}

@media (min-width: 1800px) {
    .d2-main-wrapper {
        max-width: 1720px;
        padding: 22px 24px 165px;
    }
    
    .dungeon-arena-panel {
        min-height: 660px;
    }
    
    .monster-arena {
        min-height: 550px;
    }
    
    .pack-mode .pack-monster-card.card-has-sprite .pack-monster-avatar {
        width: 240px;
        height: 240px;
    }
    
    .pack-mode .pack-monster-card.pack-2-cols.card-has-sprite .pack-monster-avatar {
        width: 290px;
        height: 290px;
    }
    
    .hud-inner-container {
        max-width: 1200px;
        height: 126px;
    }
    
    .hud-orb-sphere {
        width: 98px;
        height: 98px;
    }
    
    .hud-orb-numeric-text {
        font-size: 17.5px;
    }
}

@media (max-width: 768px) {
    /* Hide individual setting buttons from header on mobile & tablets */
    #btn-toggle-sound,
    #btn-toggle-sfx,
    #btn-toggle-ambient,
    #btn-toggle-ambient-piano,
    #btn-manual-save,
    #btn-reset-game {
        display: none !important;
    }

    #btn-open-settings {
        display: inline-flex !important;
        font-size: 13px;
        padding: 6px 12px;
        min-height: 36px;
    }
}

@media (min-width: 769px) {
    /* On desktop, show all buttons in header and hide the extra settings modal button if desired, or keep as icon */
    #btn-open-settings {
        display: none;
    }
}

@media (max-width: 640px) {
    .d2-header {
        padding: 6px 10px;
    }

    .d2-header-controls {
        gap: 6px;
    }

    .d2-tabs-bar {
        padding: 4px;
        gap: 4px;
    }

    .d2-main-tab-btn {
        font-size: 11px;
        padding: 6px 3px;
        min-width: 0;
        min-height: 40px;
        gap: 2px;
    }

    /* Мобильные кнопки Персонаж и Инфо: 1 к 1 (квадратные), только значок */
    .d2-main-tab-btn.tab-btn-compact-mobile,
    .d2-main-tab-btn.tab-btn-character,
    .d2-main-tab-btn.tab-btn-info {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        min-width: 40px;
        max-width: 40px;
        aspect-ratio: 1 / 1;
        padding: 0;
        position: relative;
    }

    .d2-main-tab-btn.tab-btn-compact-mobile .d2-tab-text,
    .d2-main-tab-btn.tab-btn-character .d2-tab-text,
    .d2-main-tab-btn.tab-btn-info .d2-tab-text {
        display: none;
    }

    .d2-main-tab-btn.tab-btn-compact-mobile .d2-tab-icon,
    .d2-main-tab-btn.tab-btn-character .d2-tab-icon,
    .d2-main-tab-btn.tab-btn-info .d2-tab-icon {
        font-size: 20px;
        line-height: 1;
    }

    .d2-main-tab-btn.tab-btn-compact-mobile .d2-tab-badge,
    .d2-main-tab-btn.tab-btn-character .d2-tab-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        margin-left: 0;
        padding: 1px 4px;
        font-size: 10px;
        min-width: 16px;
        height: 16px;
        line-height: 14px;
        border-radius: 8px;
        box-sizing: border-box;
    }

    /* Компактный квадратик с плюсиком для мобильных экранов */
    .d2-tab-badge-plus {
        width: 14px;
        height: 14px;
        min-width: 14px;
        max-width: 14px;
        font-size: 12px;
        margin-left: 3px;
    }

    .char-subtabs-bar {
        gap: 4px;
        padding: 4px;
        margin-bottom: 10px;
    }

    .char-subtab-btn {
        font-size: 11.5px;
        padding: 7px 4px;
        gap: 3px;
    }

    .char-sheet-grid {
        font-size: 12.5px;
        gap: 6px;
    }

    .d2-stat-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        font-size: 17px;
    }

    /* Sanctuary Expedition: Compact Mobile Location Header */
    .dungeon-arena-panel {
        padding: 8px 6px;
        min-height: auto;
    }

    .dungeon-nav-row {
        padding: 4px 6px 3px;
        margin-bottom: 6px;
    }

    .d2-btn-arrow {
        width: 26px;
        height: 26px;
        min-width: 26px;
        min-height: 26px;
        font-size: 11px;
    }

    .dungeon-floor-title {
        font-size: 13.5px;
    }

    .dungeon-act-title {
        font-size: 9.5px;
    }

    .dungeon-auto-btn {
        height: 26px;
        min-height: 26px;
        padding: 2px 7px;
        font-size: 11px;
    }

    .dungeon-nav-meta {
        font-size: 11px;
        padding-top: 2px;
        margin-top: 2px;
    }

    .dungeon-progress-text {
        font-size: 11px;
    }

    .dungeon-checkpoint-info {
        font-size: 10.5px;
    }

    .monster-arena {
        padding: 4px 0 6px;
    }

    .pack-mode .pack-monster-card {
        padding: 3px 2px 4px;
        min-height: 160px;
    }

    .pack-mode .pack-monster-card.card-has-sprite .pack-monster-avatar {
        width: 110px;
        height: 115px;
    }

    .pack-mode .pack-monster-card.pack-2-cols.card-has-sprite .pack-monster-avatar {
        width: 145px;
        height: 145px;
    }

    .single-mode .pack-monster-card.card-has-sprite .pack-monster-avatar {
        width: 200px;
        height: 200px;
    }

    /* Camp Subtabs on Mobile: single smooth horizontal row with short labels */
    .camp-subtabs-bar {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 4px !important;
        gap: 4px !important;
        margin-bottom: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .camp-subtabs-bar::-webkit-scrollbar {
        display: none;
    }
    .camp-subtab-btn {
        flex: 1 0 auto !important;
        min-width: unset !important;
        padding: 6px 8px !important;
        font-size: 11.5px !important;
        gap: 4px !important;
        white-space: nowrap !important;
        min-height: 36px !important;
    }
    .camp-subtab-icon {
        font-size: 14px !important;
    }
    .camp-subtab-text-full {
        display: none !important;
    }
    .camp-subtab-text-short {
        display: inline !important;
    }

    /* Camp Banner on Mobile */
    .camp-banner-inner {
        padding: 8px 10px !important;
        gap: 8px !important;
        margin-bottom: 8px !important;
    }
    .camp-banner-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 22px !important;
        flex-shrink: 0 !important;
    }
    .camp-banner-text {
        min-width: 140px !important;
        flex: 1 1 auto !important;
    }
    .camp-banner-title {
        font-size: 14.5px !important;
    }
    .camp-banner-subtitle {
        font-size: 11px !important;
    }
    .camp-banner-res {
        width: 100% !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        margin-top: 2px !important;
    }
    .camp-res-chip {
        font-size: 11px !important;
        padding: 3px 8px !important;
    }

    /* Camp Buildings on Mobile */
    .camp-buildings-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .camp-building-card {
        padding: 10px !important;
    }
    .building-icon-badge {
        width: 36px !important;
        height: 36px !important;
        font-size: 20px !important;
        flex-shrink: 0 !important;
    }
    .building-title {
        font-size: 13.5px !important;
    }
    .building-lvl-badge {
        font-size: 10.5px !important;
        padding: 1px 5px !important;
    }
    .building-master {
        font-size: 11px !important;
    }
    .building-card-desc {
        font-size: 11px !important;
        min-height: unset !important;
        margin-bottom: 6px !important;
    }
    .building-status-box {
        padding: 6px 8px !important;
        margin-bottom: 8px !important;
    }
    .status-row {
        font-size: 11px !important;
    }
    .status-effect {
        font-size: 11px !important;
    }
    .building-action-row {
        flex-wrap: wrap !important;
        gap: 6px !important;
        padding-top: 6px !important;
    }
    .cost-summary {
        font-size: 11px !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
    }
    .camp-upgrade-btn {
        font-size: 11px !important;
        padding: 6px 12px !important;
        min-height: 32px !important;
        flex: 1 1 auto !important;
    }

    /* Camp Mercenaries on Mobile */
    .camp-mercs-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .camp-dps-header {
        padding: 8px 10px !important;
        gap: 4px !important;
        margin-bottom: 8px !important;
    }
    .camp-dps-badge {
        font-size: 13px !important;
    }
    .camp-dps-hint {
        font-size: 10.5px !important;
    }
    .camp-merc-card {
        padding: 10px !important;
    }
    .merc-avatar {
        width: 36px !important;
        height: 36px !important;
        font-size: 20px !important;
        flex-shrink: 0 !important;
    }
    .merc-name {
        font-size: 14px !important;
    }
    .merc-title {
        font-size: 11px !important;
    }
    .merc-lvl-tag {
        font-size: 10.5px !important;
        padding: 2px 6px !important;
    }
    .merc-desc {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }
    .merc-dps-box {
        padding: 6px 8px !important;
        margin-bottom: 8px !important;
    }
    .merc-dps-val {
        font-size: 12px !important;
        margin-bottom: 4px !important;
    }
    .perk-line {
        font-size: 10.5px !important;
    }
    .merc-upgrade-row {
        flex-wrap: wrap !important;
        gap: 6px !important;
        padding-top: 6px !important;
    }
    .merc-cost {
        font-size: 11.5px !important;
    }
    .merc-hire-btn {
        font-size: 11px !important;
        padding: 6px 12px !important;
        min-height: 32px !important;
        flex: 1 1 auto !important;
    }

    /* Sanctum of Relics on Mobile */
    .sanctum-header-box {
        padding: 8px 10px !important;
        margin-bottom: 8px !important;
    }
    .sanctum-title {
        font-size: 14px !important;
    }
    .sanctum-subtitle {
        font-size: 11px !important;
    }
    .sanctum-pedestals-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .sanctum-pedestal-card {
        padding: 10px !important;
    }
    .pedestal-relic-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 26px !important;
    }
    .pedestal-relic-title {
        font-size: 13.5px !important;
    }
    .pedestal-desc {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }
    .pedestal-effect {
        font-size: 11px !important;
        padding: 4px 6px !important;
    }

    /* Citadel & Prestige on Mobile */
    .citadel-locked-box {
        padding: 18px 12px !important;
    }
    .citadel-active-layout {
        gap: 10px !important;
    }
    .citadel-prestige-hero {
        padding: 10px !important;
    }
    .citadel-title {
        font-size: 14px !important;
    }
    .citadel-subtitle {
        font-size: 11px !important;
    }
    .citadel-explanation {
        font-size: 11px !important;
        margin-bottom: 10px !important;
        line-height: 1.4 !important;
    }
    .citadel-prestige-btn {
        font-size: 12px !important;
        padding: 9px 12px !important;
        min-height: 36px !important;
    }
    .citadel-tech-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .citadel-tech-card {
        padding: 10px !important;
    }
    .tech-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 18px !important;
        flex-shrink: 0 !important;
    }
    .tech-name {
        font-size: 12.5px !important;
    }
    .tech-rank {
        font-size: 10px !important;
    }
    .tech-desc {
        font-size: 10.5px !important;
    }
    .tech-effect {
        font-size: 10.5px !important;
        padding: 4px 6px !important;
        margin-bottom: 6px !important;
    }
    .tech-buy-row {
        flex-wrap: wrap !important;
        gap: 4px !important;
        padding-top: 4px !important;
    }
    .tech-cost {
        font-size: 11px !important;
    }
    .buy-tech-btn {
        font-size: 10.5px !important;
        padding: 4px 10px !important;
        min-height: 30px !important;
    }

    /* Quick Bulk Salvage & Bulk Sell on Mobile */
    .bulk-sell-buttons {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
    }
    .bulk-sell-btn {
        flex: 1 1 calc(50% - 4px) !important;
        font-size: 10.5px !important;
        padding: 5px 4px !important;
        min-height: 30px !important;
    }
    .bulk-sell-label {
        font-size: 11px !important;
        margin-bottom: 3px !important;
        display: block !important;
    }

    /* Item Action Modal Buttons */
    .action-buttons-row {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    .action-buttons-row .d2-btn {
        flex: 1 1 calc(50% - 6px) !important;
        font-size: 11px !important;
        padding: 6px 4px !important;
        min-height: 32px !important;
    }

    /* Training Camp (Плац / Gym) inside Camp on Mobile */
    .gym-layout {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .gym-station-list {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 4px !important;
        padding-bottom: 2px !important;
    }
    .gym-station-list::-webkit-scrollbar {
        display: none;
    }
    .gym-station-tab {
        flex: 0 0 120px !important;
        min-width: 110px !important;
        padding: 6px 8px !important;
    }
    .gym-station-name {
        font-size: 12.5px !important;
    }
    .gym-station-desc {
        font-size: 10.5px !important;
        line-height: 1.25 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .gym-arena {
        padding: 10px 8px !important;
    }
    .gym-exercise-visual-area {
        height: 180px !important;
        min-height: 180px !important;
    }
}

@media (max-width: 380px) {
    .dungeon-nav-row {
        padding: 3px 4px 2px;
    }
    .dungeon-auto-btn {
        padding: 2px 5px;
        font-size: 10px;
    }
    .dungeon-floor-title {
        font-size: 12.5px;
    }
    .dungeon-act-title {
        display: none;
    }
    .dungeon-checkpoint-info {
        font-size: 10px;
    }
    .dungeon-progress-text {
        font-size: 10.5px;
    }
    .hud-center-top-row {
        gap: 3px !important;
    }
    .hud-potions-group span {
        display: none !important;
    }
    #hud-level-badge {
        font-size: 11px !important;
        padding: 2px 5px !important;
    }
    #hud-gold-val, #hud-materials-val, #hud-souls-val {
        font-size: 11px !important;
    }
    .camp-subtab-btn {
        font-size: 10px !important;
        padding: 5px 6px !important;
    }
}

@media (min-width: 768px) {
    .dungeon-nav-row {
        padding: 6px 12px 5px;
        margin-bottom: 10px;
    }
    .d2-btn-arrow {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        font-size: 13px;
    }
    .dungeon-floor-title {
        font-size: 16px;
    }
    .dungeon-act-title {
        font-size: 11.5px;
    }
    .dungeon-auto-btn {
        height: 30px;
        min-height: 30px;
        padding: 3px 12px;
        font-size: 12px;
    }
    .dungeon-progress-text {
        font-size: 12.5px;
    }
    .dungeon-checkpoint-info {
        font-size: 12px;
    }
}





/* ==========================================================================
   CAMP & STRONGHOLD (Оплот и Цитадель Вечности) STYLES
   ========================================================================== */

#view-camp {
    display: none;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 30px;
}

#view-camp.active {
    display: flex !important;
    flex-direction: column !important;
}

#camp-status-banner {
    width: 100%;
    box-sizing: border-box;
}

.camp-subtabs-bar {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    background: #110d0a;
    padding: 5px 6px;
    border: 1px solid #4a3824;
    border-radius: 4px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
    flex-wrap: wrap;
}

.camp-subtab-btn {
    flex: 1;
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(180deg, #241b12 0%, #120e08 100%);
    border: 1px solid #5a452f;
    color: #cfbf9f;
    font-family: var(--d2-font-title);
    font-size: 13px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 3px;
    text-shadow: 1px 1px 2px #000;
}

.camp-subtab-btn:hover {
    border-color: var(--color-gold-bright);
    color: #ffffff;
    background: linear-gradient(180deg, #2e2319 0%, #1a130e 100%);
}

.camp-subtab-btn.active {
    background: linear-gradient(180deg, #644619 0%, #2e1d08 100%);
    border-color: var(--color-gold-bright);
    color: #ffffff;
    box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.3), 0 0 8px rgba(196, 153, 66, 0.4);
}

.camp-subview {
    width: 100%;
}

.camp-subview.active {
    display: block !important;
}

.camp-subview:not(.active) {
    display: none !important;
}

.camp-subtab-text-short {
    display: none;
}

.camp-subtab-icon {
    font-size: 15px;
    line-height: 1;
}

/* Camp Banner */
.camp-banner-inner {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(180deg, #1f1610 0%, #100b07 100%);
    border: 1px solid #634b2e;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8), 0 4px 10px rgba(0, 0, 0, 0.5);
    flex-wrap: wrap;
}

.camp-banner-icon {
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: #0d0906;
    border: 1px solid #85653b;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(196, 153, 66, 0.3);
}

.camp-banner-text {
    flex: 1;
    min-width: 220px;
}

.camp-banner-title {
    font-family: var(--d2-font-title);
    font-size: 19px;
    color: var(--color-gold-bright);
    margin: 0;
    text-shadow: 1px 1px 3px #000;
}

.camp-banner-subtitle {
    font-size: 12.5px;
    color: #cfbf9f;
    margin-top: 3px;
}

.camp-banner-res {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.camp-res-chip {
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 13.5px;
    font-family: var(--d2-font-title);
    background: #150f0a;
    border: 1px solid #52402b;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.camp-res-chip.gold { color: #ffd700; border-color: #7a6332; }
.camp-res-chip.mat { color: #e2d2a4; border-color: #8c734b; }
.camp-res-chip.chrono { color: #c084fc; border-color: #6b21a8; background: #1e102d; }

/* Buildings Grid & Cards */
.camp-buildings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 12px;
}

.camp-building-card {
    display: flex;
    flex-direction: column;
    padding: 14px;
    background: linear-gradient(180deg, #1c140d 0%, #0e0906 100%);
    border: 1px solid #5a452f;
    border-radius: 4px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.7);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.camp-building-card:hover {
    border-color: #8f6e43;
}

.building-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.building-icon-badge {
    font-size: 26px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #100b07;
    border: 1px solid #6b5235;
    border-radius: 4px;
}

.building-meta {
    flex: 1;
}

.building-title {
    font-family: var(--d2-font-title);
    font-size: 15px;
    color: var(--color-gold-bright);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.building-lvl-badge {
    font-size: 11px;
    background: #2a1c10;
    padding: 2px 7px;
    border: 1px solid #75552f;
    border-radius: 2px;
    color: #ffffff;
}

.building-master {
    font-size: 12px;
    color: #cfbf9f;
    margin-top: 2px;
}

.building-card-desc {
    font-size: 12px;
    color: #a8987b;
    margin-bottom: 10px;
    line-height: 1.4;
    min-height: 34px;
}

.building-status-box {
    background: #110d09;
    border: 1px solid #3d2e1e;
    padding: 8px 10px;
    border-radius: 3px;
    margin-bottom: 12px;
    flex: 1;
}

.status-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
}

.status-row.current { color: #e2d2a4; }
.status-row.next { color: var(--color-gold-bright); }

.status-effect {
    font-size: 12px;
    color: #cfbf9f;
    margin-top: 2px;
    line-height: 1.35;
}

.status-effect.next-effect {
    color: #8bc34a;
}

.building-maxed-text {
    font-family: var(--d2-font-title);
    font-size: 12px;
    color: #ffd700;
    text-align: center;
    padding: 6px 0;
}

.building-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #3d2e1e;
}

.cost-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 700;
}

.cost-item.gold { color: #ffd700; }
.cost-item.mat { color: #e2d2a4; }
.cost-item.red { color: #ff5252; }

/* Mercenaries Grid & Cards */
.camp-dps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #150f0a;
    border: 1px solid #5a452f;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.camp-dps-badge {
    font-family: var(--d2-font-title);
    font-size: 15px;
    color: #ffd700;
    font-weight: 700;
}

.camp-dps-hint {
    font-size: 12px;
    color: #cfbf9f;
}

.camp-mercs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.camp-merc-card {
    padding: 14px;
    background: linear-gradient(180deg, #1c140d 0%, #0e0906 100%);
    border: 1px solid #5a452f;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.camp-merc-card.locked {
    opacity: 0.6;
}

.merc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.merc-avatar {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #110d09;
    border: 1px solid #6b5235;
    border-radius: 50%;
}

.merc-info {
    flex: 1;
}

.merc-name {
    font-family: var(--d2-font-title);
    font-size: 16px;
    color: var(--color-gold-bright);
    margin: 0;
}

.merc-title {
    font-size: 12px;
    color: #cfbf9f;
}

.merc-lvl-tag {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #2b1d12;
    padding: 3px 8px;
    border: 1px solid #6b4d2a;
    border-radius: 3px;
}

.merc-desc {
    font-size: 12px;
    color: #a8987b;
    margin-bottom: 10px;
    line-height: 1.4;
}

.merc-dps-box {
    background: #110d09;
    border: 1px solid #3d2e1e;
    padding: 8px 10px;
    border-radius: 3px;
    margin-bottom: 12px;
    flex: 1;
}

.merc-dps-val {
    font-size: 13.5px;
    color: #e2d2a4;
    font-weight: 700;
    margin-bottom: 6px;
}

.merc-perks {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.perk-line {
    font-size: 11.5px;
    line-height: 1.35;
}

.perk-line.unlocked { color: #8bc34a; font-weight: 700; }
.perk-line.locked { color: #736149; }

.merc-upgrade-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #3d2e1e;
}

.merc-cost {
    font-size: 13px;
    color: #cfbf9f;
}

.merc-locked-notice {
    font-size: 12px;
    color: #d27979;
    text-align: center;
    padding: 10px;
    border: 1px dashed #5a2e2e;
    border-radius: 3px;
    margin-top: auto;
}

/* Sanctum Pedestals */
.sanctum-header-box {
    background: #150f0a;
    border: 1px solid #5a452f;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 12px;
    text-align: center;
}

.sanctum-title {
    font-family: var(--d2-font-title);
    font-size: 18px;
    color: var(--color-gold-bright);
    margin: 0;
}

.sanctum-subtitle {
    font-size: 12.5px;
    color: #cfbf9f;
    margin-top: 4px;
}

.sanctum-pedestals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.sanctum-pedestal-card {
    padding: 16px;
    background: linear-gradient(180deg, #1b130c 0%, #0c0805 100%);
    border: 1px solid #5a452f;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.sanctum-pedestal-card.placed {
    border-color: #ffd700;
    box-shadow: inset 0 0 15px rgba(255, 215, 0, 0.2), 0 0 10px rgba(196, 153, 66, 0.25);
}

.pedestal-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.pedestal-relic-icon {
    font-size: 38px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #110d08;
    border: 1px solid #6b5235;
    border-radius: 50%;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.9);
}

.sanctum-pedestal-card.placed .pedestal-relic-icon {
    border-color: #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.pedestal-relic-title {
    font-family: var(--d2-font-title);
    font-size: 15px;
    color: var(--color-gold-bright);
    font-weight: 700;
}

.pedestal-rarity {
    font-size: 11px;
    color: #e2d2a4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.pedestal-desc {
    font-size: 12px;
    color: #a8987b;
    margin-bottom: 10px;
    line-height: 1.35;
    flex: 1;
}

.pedestal-effect {
    font-size: 12.5px;
    color: #736149;
    background: #0f0a07;
    border: 1px solid #332314;
    padding: 6px 10px;
    border-radius: 3px;
    width: 100%;
}

.pedestal-effect.active {
    color: #ffd700;
    border-color: #7a6332;
    background: #1d140a;
}

/* Citadel & Prestige */
.citadel-locked-box {
    padding: 30px 20px;
    text-align: center;
    background: linear-gradient(180deg, #18110b 0%, #0a0704 100%);
    border: 1px solid #5a452f;
    border-radius: 4px;
}

.citadel-active-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.citadel-prestige-hero {
    padding: 16px;
    background: linear-gradient(180deg, #251230 0%, #0e0714 100%);
    border: 1px solid #8e44ad;
    border-radius: 4px;
    box-shadow: inset 0 0 15px rgba(142, 68, 173, 0.3), 0 0 12px rgba(107, 33, 168, 0.35);
}

.citadel-hero-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.citadel-title {
    font-family: var(--d2-font-title);
    font-size: 18px;
    color: #e9d5ff;
    margin: 0;
}

.citadel-subtitle {
    font-size: 13px;
    color: #c084fc;
    margin-top: 2px;
}

.citadel-explanation {
    font-size: 13px;
    color: #d8b4fe;
    line-height: 1.5;
    margin-bottom: 14px;
}

.citadel-prestige-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    background: linear-gradient(180deg, #7e22ce 0%, #3b0764 100%);
    border-color: #c084fc;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(192, 132, 252, 0.4);
}

.citadel-prestige-btn:hover {
    background: linear-gradient(180deg, #9333ea 0%, #581c87 100%);
    border-color: #ffffff;
}

.citadel-tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 12px;
}

.citadel-tech-card {
    padding: 12px;
    background: linear-gradient(180deg, #16101c 0%, #0b070e 100%);
    border: 1px solid #4a2d59;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.citadel-tech-card.learned {
    border-color: #9333ea;
}

.tech-header {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.tech-icon {
    font-size: 26px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f0a14;
    border: 1px solid #5d3673;
    border-radius: 4px;
}

.tech-name {
    font-family: var(--d2-font-title);
    font-size: 14px;
    color: #e9d5ff;
}

.tech-rank {
    font-size: 11px;
    background: #2a113d;
    padding: 2px 6px;
    border: 1px solid #6b21a8;
    border-radius: 2px;
    color: #ffffff;
    margin-left: 4px;
}

.tech-desc {
    font-size: 11.5px;
    color: #c4b5fd;
    margin-top: 2px;
}

.tech-effect {
    font-size: 12px;
    color: #f3e8ff;
    background: #110917;
    border: 1px solid #3b194d;
    padding: 6px 8px;
    border-radius: 3px;
    margin-bottom: 8px;
    flex: 1;
}

.tech-buy-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid #3b194d;
}

.tech-cost {
    font-size: 12px;
    color: #cfbf9f;
}

.tech-cost .chrono { color: #c084fc; font-weight: 700; }
.tech-cost .red { color: #ff5252; font-weight: 700; }

.tech-max-text {
    font-family: var(--d2-font-title);
    font-size: 11px;
    color: #c084fc;
    text-align: center;
    padding: 6px 0;
}

/* ==========================================================================
   GACHA-STYLE LOADING SCREEN & GRAPHICS PRELOADER
   Authentic Dark Fantasy Atmosphere with Smooth Progress & Bestiary Preload
   ========================================================================== */

.gacha-loading-screen {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background-color: #060504;
    background-image: 
        radial-gradient(circle at 50% 38%, rgba(110, 24, 18, 0.45) 0%, rgba(26, 14, 10, 0.94) 55%, rgba(6, 5, 4, 0.99) 100%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.012) 25%, transparent 25%),
        linear-gradient(225deg, rgba(255, 255, 255, 0.012) 25%, transparent 25%),
        linear-gradient(45deg, rgba(255, 255, 255, 0.012) 25%, transparent 25%),
        linear-gradient(315deg, rgba(255, 255, 255, 0.012) 25%, transparent 25%);
    background-size: 100% 100%, 32px 32px, 32px 32px, 32px 32px, 32px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), filter 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.gacha-loading-screen.gacha-screen-fadeout {
    opacity: 0;
    transform: scale(1.06);
    filter: brightness(1.25) blur(3px);
    pointer-events: none;
}

/* Background Ambient Glow */
.gacha-bg-glow {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220, 120, 30, 0.16) 0%, rgba(168, 21, 21, 0.1) 45%, transparent 70%);
    pointer-events: none;
    animation: gacha-halo-pulse 4.5s ease-in-out infinite alternate;
}

@keyframes gacha-halo-pulse {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.9; }
}

/* Main Content Container */
.gacha-content-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 92%;
    max-width: 620px;
    padding: 24px 16px;
    box-sizing: border-box;
}

/* Central Emblem / Crest */
.gacha-crest-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.gacha-crest-halo {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 207, 83, 0.35) 0%, rgba(184, 54, 16, 0.2) 50%, transparent 75%);
    filter: blur(10px);
    animation: gacha-crest-breathe 3s ease-in-out infinite alternate;
}

@keyframes gacha-crest-breathe {
    0% { transform: scale(0.92); opacity: 0.6; }
    100% { transform: scale(1.18); opacity: 1; }
}

.gacha-crest-svg {
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 16px rgba(230, 200, 117, 0.55)) drop-shadow(0 0 32px rgba(168, 21, 21, 0.45));
    animation: gacha-crest-float 4s ease-in-out infinite alternate;
}

@keyframes gacha-crest-float {
    0% { transform: translateY(0); }
    100% { transform: translateY(-6px); }
}

/* Titles */
.gacha-title-wrap {
    margin-bottom: 20px;
}

.gacha-main-title {
    font-family: var(--d2-font-title);
    font-size: clamp(34px, 7.5vw, 52px);
    font-weight: 900;
    letter-spacing: 7px;
    text-transform: uppercase;
    margin: 0 0 4px 0;
    line-height: 1.1;
    background: linear-gradient(180deg, #fff9e6 0%, #fae17d 40%, #c49942 75%, #7a5416 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 20px rgba(245, 215, 110, 0.35));
}

.gacha-subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.gacha-sub-line {
    width: 38px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c49942, transparent);
}

.gacha-sub-text {
    font-family: var(--d2-font-body);
    font-size: 13px;
    letter-spacing: 4px;
    color: #c9b484;
    text-shadow: 0 1px 4px #000;
    text-transform: uppercase;
}

/* Gacha Lore / Tip Box */
.gacha-lore-box {
    width: 100%;
    background: rgba(16, 12, 9, 0.92);
    border: 1px solid #5a452d;
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.85), 0 6px 18px rgba(0, 0, 0, 0.65);
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 22px;
    cursor: pointer;
    position: relative;
    transition: border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.gacha-lore-box:hover {
    border-color: #8c6a38;
    transform: translateY(-1px);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.85), 0 8px 22px rgba(184, 140, 60, 0.2);
}

.gacha-lore-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(140, 106, 56, 0.4);
}

.gacha-lore-tag {
    font-family: var(--d2-font-title);
    font-size: 12px;
    letter-spacing: 2px;
    color: #e6c875;
    text-transform: uppercase;
    font-weight: bold;
}

.gacha-lore-hint {
    font-size: 10.5px;
    color: #9c8a6c;
    letter-spacing: 0.5px;
}

.gacha-lore-text {
    font-family: var(--d2-font-body);
    font-size: 14.5px;
    line-height: 1.45;
    color: #e2d3b8;
    font-style: italic;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.gacha-lore-text.gacha-tip-fade {
    opacity: 0;
    transform: translateY(3px);
}

/* Progress Section */
.gacha-progress-section {
    width: 100%;
    margin-bottom: 18px;
}

.gacha-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    font-size: 13px;
    padding: 0 4px;
}

.gacha-status-text {
    color: #cfbe9e;
    font-style: italic;
    font-size: 13px;
    text-shadow: 0 1px 3px #000;
    text-align: left;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gacha-assets-count {
    color: #9c8a6c;
    font-size: 12px;
    margin: 0 12px;
    font-family: var(--d2-font-ui);
}

.gacha-percent-text {
    font-family: var(--d2-font-title);
    font-size: 20px;
    font-weight: bold;
    color: #fce282;
    text-shadow: 0 0 12px rgba(252, 226, 130, 0.65);
    min-width: 54px;
    text-align: right;
}

/* Ornate Gacha Bar Track Frame */
.gacha-bar-track-frame {
    position: relative;
    padding: 3px;
    background: #18110b;
    border: 1px solid #785a30;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8), inset 0 0 8px rgba(0, 0, 0, 0.9);
    border-radius: 3px;
}

/* Gold Corner Accents */
.gacha-bar-corner {
    position: absolute;
    width: 6px;
    height: 6px;
    border-color: #f0cb64;
    border-style: solid;
    pointer-events: none;
    z-index: 3;
}
.gacha-corner-tl { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.gacha-corner-tr { top: -2px; right: -2px; border-width: 2px 2px 0 0; }
.gacha-corner-bl { bottom: -2px; left: -2px; border-width: 0 0 2px 2px; }
.gacha-corner-br { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; }

.gacha-bar-track {
    position: relative;
    height: 18px;
    background: #090604;
    border: 1px solid #332314;
    border-radius: 2px;
    overflow: hidden;
}

.gacha-bar-fill {
    position: relative;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7c1212 0%, #b83610 28%, #e67e22 62%, #f5cf53 92%, #ffffff 100%);
    box-shadow: 0 0 16px rgba(245, 207, 83, 0.65);
    border-radius: 1px;
    transition: width 0.08s linear;
}

.gacha-bar-fill.gacha-bar-ready {
    background: linear-gradient(90deg, #b83610 0%, #e67e22 35%, #f5cf53 75%, #ffffff 100%);
    box-shadow: 0 0 22px rgba(255, 225, 125, 0.9);
}

/* Continuously Sweeping Shimmer Beam */
.gacha-bar-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
    animation: gacha-bar-sweep 2.2s infinite linear;
    pointer-events: none;
}

@keyframes gacha-bar-sweep {
    0% { left: -60%; }
    100% { left: 160%; }
}

/* Glowing Spark Point at leading edge */
.gacha-bar-spark {
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 20px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 12px #ffffff, 0 0 22px #fae17d;
}

/* Interactive Enter Prompt / Tap to Start */
.gacha-enter-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    cursor: pointer;
}

.gacha-prompt-appear {
    animation: gacha-fade-in-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes gacha-fade-in-up {
    0% { opacity: 0; transform: translateY(12px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.gacha-enter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(180deg, #aa1a1a 0%, #771212 50%, #440707 100%);
    border: 2px solid #e6c875;
    outline: 1px solid #33150d;
    box-shadow: 0 0 24px rgba(230, 200, 117, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    color: #fff6db;
    font-family: var(--d2-font-title);
    font-size: clamp(16px, 4vw, 20px);
    letter-spacing: 3px;
    font-weight: 900;
    padding: 13px 32px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
    animation: gacha-btn-pulse 1.8s infinite ease-in-out;
}

.gacha-enter-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 0 35px rgba(250, 225, 125, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    filter: brightness(1.15);
}

.gacha-enter-btn:active {
    transform: scale(0.98);
}

@keyframes gacha-btn-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(230, 200, 117, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    }
    50% {
        box-shadow: 0 0 34px rgba(250, 225, 125, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
}

.gacha-enter-subhint {
    font-size: 12.5px;
    letter-spacing: 1px;
    color: #f5dfa0;
    text-shadow: 0 0 8px rgba(245, 223, 160, 0.6);
    animation: gacha-subhint-blink 2s infinite ease-in-out;
}

@keyframes gacha-subhint-blink {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

/* Footer Version Meta */
.gacha-footer-meta {
    margin-top: 24px;
    font-size: 11px;
    color: #6d5b45;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Responsive Scaling */
@media (max-width: 600px) {
    .gacha-content-wrap {
        padding: 16px 10px;
    }
    .gacha-crest-svg {
        width: 100px;
        height: 100px;
    }
    .gacha-crest-halo {
        width: 110px;
        height: 110px;
    }
    .gacha-lore-text {
        font-size: 13.5px;
        min-height: 48px;
    }
    .gacha-progress-header {
        font-size: 12px;
    }
    .gacha-percent-text {
        font-size: 17px;
    }
    .gacha-enter-btn {
        padding: 11px 22px;
        letter-spacing: 2px;
    }
}

