  /* --- Base Styles --- */
        body { margin: 0; background: #000; overflow: hidden; font-family: 'Rajdhani', sans-serif; }

        .skill-tree-page {
            background-color: #050608; color: #eee; margin: 0;
            overflow: hidden; height: 100vh; width: 100vw; position: relative; direction: ltr;
        }

        /* --- MODAL STYLES (החלק הקיים לשמירה) --- */
        .modal-overlay {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.7); z-index: 2000; backdrop-filter: blur(5px);
        }
        .modal {
            display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
            background: #1a1d26; border: 1px solid #333; width: 400px; padding: 30px;
            border-radius: 12px; z-index: 2001; box-shadow: 0 20px 50px rgba(0,0,0,0.8);
            color: #fff; text-align: right; direction: rtl;
        }
        .modal h3 { margin-top: 0; color: #fff; border-bottom: 1px solid #333; padding-bottom: 15px; margin-bottom: 20px; font-size: 1.5rem; }
        
        .form-group { margin-bottom: 20px; }
        .form-group label { display: block; margin-bottom: 8px; color: #aaa; font-size: 0.9rem; }
        .form-group input, .form-group textarea {
            width: 100%; background: #0b0d12; border: 1px solid #444; color: #fff;
            padding: 10px; border-radius: 6px; font-family: inherit; font-size: 1rem;
            box-sizing: border-box;
        }
        .form-group input:focus, .form-group textarea:focus { border-color: #d69e2e; outline: none; }
        .form-group textarea { height: 100px; resize: vertical; }

        .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
        .btn-modal { padding: 8px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; border: none; transition: 0.2s; }
        .btn-cancel { background: transparent; border: 1px solid #555; color: #ccc; }
        .btn-cancel:hover { background: #333; color: white; }
        .btn-confirm { background: #48bb78; color: white; }
        .btn-confirm:hover { background: #38a169; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3); }

        /* --- UI Styles --- */
        .tree-header { position: absolute; top: 0; left: 0; right: 0; height: 92px; background: linear-gradient(180deg, rgba(10, 11, 16, 0.95) 0%, rgba(10, 11, 16, 0) 100%); z-index: 1000; display: flex; align-items: center; justify-content: space-between; padding: 0 40px; pointer-events: none; }
        .tree-header > * { pointer-events: auto; }
        .points-display { font-size: 1.8rem; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: 2px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
        .points-current { color: #d69e2e; } .points-max { color: #555; } .points-current.limit-reached { color: #ff2a2a; text-shadow: 0 0 15px rgba(255, 42, 42, 0.6); }
        .btn-group { display: flex; gap: 10px; }
        .btn-save:disabled {
    background: #2d3748;
    border-color: #4a5568;
    color: #718096;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}
        .btn-save:disabled:hover {
    background: #2d3748;
    border-color: #4a5568;
    color: #718096;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.btn-action {
    position: relative;
    padding: 10px 20px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    overflow: hidden;
}
/* כפתור איפוס */
.btn-reset {
    background: rgba(229, 62, 62, 0.1);
    color: #fc8181;
    border-color: rgba(229, 62, 62, 0.3);
}
.btn-reset:hover {
    background: rgba(229, 62, 62, 0.2);
    box-shadow: 0 0 15px rgba(229, 62, 62, 0.4);
    transform: translateY(-2px);
    color: #fff;
}      
.btn-undo {
    background: rgba(236, 201, 75, 0.1);
    color: #f6e05e;
    border-color: rgba(236, 201, 75, 0.3);
}
.btn-undo:hover {
    background: rgba(236, 201, 75, 0.2);
    box-shadow: 0 0 15px rgba(236, 201, 75, 0.4);
    transform: translateY(-2px);
    color: #fff;
}
.btn-save {
    background: linear-gradient(135deg, #2f855a 0%, #276749 100%);
    color: #fff;
    border: 1px solid #48bb78;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}
.btn-save:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    box-shadow: 0 0 20px rgba(72, 187, 120, 0.6);
    transform: translateY(-2px) scale(1.02);
}        /* הודעת שגיאה מתחת לכפתורים */
.limit-error-msg {
    color: #fc8181;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 5px;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 8px;
    border-radius: 4px;
    border-right: 2px solid #fc8181;
    animation: fadeIn 0.5s ease;
}
        #tree-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at 50% 50%, #1a1d26 0%, #050608 80%); overflow: hidden; cursor: grab; } #tree-container:active { cursor: grabbing; } #tree-canvas { position: absolute; transform-origin: 0 0; will-change: transform; } svg { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; z-index: 1; }
        line { stroke: #333; stroke-width: 3; transition: stroke 0.4s, filter 0.4s; stroke-linecap: round; } line.active { stroke-width: 4; stroke: #fff; filter: drop-shadow(0 0 5px rgba(255,255,255,0.5)); }
        .skill-node { position: absolute; background: #0b0d12; border: 2px solid #555; border-radius: 50%; display: flex; justify-content: center; align-items: center; z-index: 10; cursor: pointer; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; transform: translate(-50%, -50%); box-shadow: 0 0 10px rgba(0,0,0,0.8); user-select: none; } .skill-node:hover { transform: translate(-50%, -50%) scale(1.15); z-index: 20; border-color: #fff !important; }
        .skill-node.small { width: 50px; height: 50px; } .skill-node.large { width: 80px; height: 80px; border-width: 3px; } .skill-node.passive { width: 60px; height: 60px; border-radius: 50%; border-style: double; border-width: 4px; }
        .skill-node.locked { filter: grayscale(1) brightness(0.7); cursor: not-allowed; border-color: #333 !important; } .skill-node.available { border-color: #888; box-shadow: 0 0 0 rgba(255,255,255,0); animation: pulse-border 2s infinite; } .skill-node.purchased { background: #14161f; border-color: #fff; box-shadow: 0 0 20px rgba(255,255,255,0.2); color: #fff; animation: none; }
        .icon-container { width: 60%; height: 60%; display: flex; justify-content: center; align-items: center; pointer-events: none; } .icon-container img { width: 100%; height: 100%; object-fit: contain; opacity: 0.6; transition: 0.3s; } .skill-node.purchased .icon-container img { opacity: 1; filter: drop-shadow(0 0 5px rgba(255,255,255,0.5)); }
        .node-counter { position: absolute; bottom: -22px; background: #050608; border: 1px solid #444; border-radius: 10px; padding: 2px 8px; font-size: 12px; font-weight: 700; color: #777; pointer-events: none; z-index: 15; box-shadow: 0 2px 4px rgba(0,0,0,0.5); } .skill-node.maxed .node-counter { color: #050608; background: #fff; border-color: #fff; }
        .branch-survival.available { border-color: #ff2a2a; box-shadow: 0 0 15px rgba(255, 42, 42, 0.3); } .branch-survival.purchased { border-color: #ff2a2a; box-shadow: 0 0 25px rgba(255, 42, 42, 0.6); } .branch-mobility.available { border-color: #ffd700; box-shadow: 0 0 15px rgba(255, 215, 0, 0.3); } .branch-mobility.purchased { border-color: #ffd700; box-shadow: 0 0 25px rgba(255, 215, 0, 0.6); } .branch-conditioning.available { border-color: #00ff88; box-shadow: 0 0 15px rgba(0, 255, 136, 0.3); } .branch-conditioning.purchased { border-color: #00ff88; box-shadow: 0 0 25px rgba(0, 255, 136, 0.6); }
        @keyframes pulse-border { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.1); } 50% { box-shadow: 0 0 15px rgba(255,255,255,0.2); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.1); } }
        .skill-tooltip { position: fixed; z-index: 9999; background-color: #f3e5d0; color: #111; padding: 12px 16px; border-radius: 4px; box-shadow: 0 4px 20px rgba(0,0,0,0.6); pointer-events: none; display: none; width: 260px; font-family: 'Rajdhani', sans-serif; border: 1px solid #cbbba0; text-align: left; direction: ltr; }
        .tooltip-title { font-weight: 800; text-transform: uppercase; font-size: 1.3rem; margin-bottom: 6px; color: #000; line-height: 1; } .tooltip-desc { font-size: 1rem; color: #444; line-height: 1.2; margin-bottom: 8px; font-weight: 600; direction: rtl; text-align: right; } .tooltip-req { font-size: 0.85rem; font-weight: 800; text-transform: uppercase; color: #000; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(0,0,0,0.1); }
        
        /* Edit Mode Overlay */
        .edit-mode-overlay {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.8); z-index: 9999; justify-content: center; align-items: center;
            backdrop-filter: blur(5px); animation: fadeIn 0.3s ease-out;
        }
        .edit-mode-box {
            background: rgba(26, 32, 44, 0.95); border: 1px solid #ecc94b; box-shadow: 0 0 30px rgba(236, 201, 75, 0.15);
            padding: 40px; width: 400px; max-width: 90%; border-radius: 12px; text-align: center; color: #fff;
            transform: scale(0.9); animation: popIn 0.3s ease-out forwards;
        }
        .edit-mode-box i { font-size: 3rem; color: #ecc94b; margin-bottom: 20px; display: block; }
        .edit-mode-box h3 { margin: 0 0 15px 0; font-size: 1.8rem; color: #fff; font-weight: 700; }
        .edit-mode-box p { margin: 0 0 30px 0; color: #cbd5e0; font-size: 1.1rem; line-height: 1.6; }
        .btn-understand { background: #ecc94b; color: #000; border: none; padding: 12px 40px; font-size: 1.1rem; font-weight: bold; border-radius: 6px; cursor: pointer; transition: all 0.2s; font-family: inherit; }
        .btn-understand:hover { background: #d69e2e; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(236, 201, 75, 0.3); }
        
        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
        @keyframes popIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
   .build-limit-counter {
        position: absolute;
        top: 80px; /* מתחת להדר */
        left: 40px;
        background: rgba(11, 13, 18, 0.9);
        border: 1px solid #444;
        border-right: 3px solid #d69e2e; /* פס כתום בצד */
        padding: 10px 20px;
        border-radius: 4px;
        color: #fff;
        font-family: 'Rajdhani', sans-serif;
        z-index: 100;
        backdrop-filter: blur(4px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    }
    .build-limit-counter .count-number {
        font-size: 1.4rem;
        font-weight: 700;
        color: #d69e2e;
    }
    .build-limit-counter .count-label {
        font-size: 0.9rem;
        color: #aaa;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    .build-limit-counter.limit-reached {
        border-right-color: #e53e3e; /* אדום אם נגמר */
    }
    .build-limit-counter.limit-reached .count-number {
        color: #e53e3e;
    }