 :root {
            --primary: #00f0ff;
            --secondary: #4ade80;
            --bg-dark: #080a0f;
            --glass-bg: rgba(15, 20, 25, 0.65);
            --text-main: #f0f0f0;
            --text-muted: #999;
            --danger: #ff4757;
            --corrupted: #b33939;
            --corrupted-glow: #e056fd;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            user-select: none;
        }

        body {
    font-family: 'Outfit', sans-serif;
    background: url('background.png') center/cover no-repeat, #080a0f;
    color: var(--text-main);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
        ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

        .glass-panel {
            background: var(--glass-bg);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid var(--glass-border);
            box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
        }

        input, textarea, select {
            background: rgba(0, 0, 0, 0.619);
            border: 1px solid var(--glass-border);
            color: white;
            padding: 12px;
            border-radius: 8px;
            font-family: 'Outfit', sans-serif;
            outline: none;
            
            width: 100%;
        }
        input:focus, textarea:focus, select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
        }

        button {
            cursor: pointer;
            font-family: 'Outfit', sans-serif;
            border: none;
            outline: none;
            
        }

        /* Layout */
        #main-view {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: transparent; 
}
        
        .main-overlay {
            position: absolute; top:0; left:0; width:100%; height:100%;
            pointer-events: none;
        }

#left-menu-wrapper {
    position: absolute;
    left: 0; 
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 30px;
    z-index: 10;
}

#main-icons-group {
    position: relative;
    display: flex;
}

#combined-icons {
    height: 540px; 
    width: auto;
    display: block;
}

#click-areas {
    position: absolute;
    top: 0; left: 0;
    width: 250px; 
    height: 100%;
    display: flex;
    flex-direction: column;
}

.click-area {
    flex: 1; 
    display: flex;
    align-items: center;
    padding-left: 160px; 
    cursor: pointer;
}

.db-btn-bottom {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-left: 10px;
    cursor: pointer;
}

.db-btn-bottom img {
    width: 50px; height: 50px; object-fit: contain;
}

.click-area span, .db-btn-bottom span {
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: transform 0.1s;
}

.click-area:active span, .db-btn-bottom:active span {
    transform: scale(0.92);
}

.menu-item:active { transform: scale(0.95); }
.menu-item img {
    width: 150px; 
    height: auto; 
    border-radius: 0; 
    object-fit: contain;
}


    


#sidebar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 550px;
    height: 100%;
    margin: 0;
    border-radius: 0; 
    border-left: 4px solid #111; 
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10;
    box-sizing: border-box;
}
#build-name-input { font-size: 1.4rem; padding: 5px; }
.slot-image { width: 36px; height: 36px; }
.slot-text { font-size: 0.9rem; }
#sidebar-slots-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: min-content;
    gap: 10px;
    flex: 1; 
    min-height: 0;
    overflow-y: auto; 
    padding-right: 5px;
    padding-bottom: 15px;
    overflow-x: hidden;
}


.build-slot, .mantra-slot, .sidebar-stats, .action-btn {
    border-radius: 0 !important;
}
#slot-kit { grid-column: 1; grid-row: 1; }
#slot-oath { grid-column: 2; grid-row: 1; }
#slot-weapon { grid-column: 1; grid-row: 2; }
#slot-bell { grid-column: 2; grid-row: 2; }
#slot-mantras { grid-column: 1; grid-row: 3; }
#slot-enchant { grid-column: 2; grid-row: 3; }
#slot-notes { grid-column: 1 / -1; grid-row: 4; }
.sidebar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    width: 100%;
    gap: 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 15px;
    margin-top: auto;
}

        #build-name-input {
            width: 100%;
            font-size: 1.8rem;
            font-weight: 800;
            text-align: center;
            background: transparent;
            border: none;
            border-bottom: 2px solid var(--glass-border);
            border-radius: 0;
            padding: 10px;
            margin-bottom: 10px;
            color: white;
        }
        #build-name-input:focus { border-bottom-color: var(--primary); box-shadow: none; }

        .build-slot {
            background: rgb(0, 0, 0);
            border: 1px solid rgba(255,255,255,0.08);
            padding: 15px;
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: pointer;
            border-image: url('border-normal.png') 24 fill stretch;
            min-height: 85px;
        }

        .slot-info { display: flex; flex-direction: column; flex: 1; justify-content: center; }
        .slot-label {
            font-size: 0.75rem;
            color: #e0e0e0;
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-bottom: 4px;
            font-weight: 600;
        }
        .slot-content { display: flex; align-items: center; gap: 15px; width: 100%; }
        .slot-image {
            width: 48px; height: 48px;
            border-radius: 8px;
            background: #111;
            object-fit: cover;
            border: 1px solid rgba(255,255,255,0.1);
        }
        .slot-text { font-weight: 600; font-size: 1.1rem; color: white; }
        .slot-empty { color: #013930d9;; font-style: italic;  font-weight: normal; font-size: 1rem; }

        .corrupted-text { color: var(--corrupted-glow); text-shadow: 0 0 10px rgba(224, 86, 253, 0.6); }

        .mantra-list { display: flex; flex-direction: column; gap: 10px; }
        .mantra-slot {
            padding: 12px;
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: pointer;
            transition: 0.2s;
        }
        .mantra-slot img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; }
        
        .gem-badge {
            font-size: 0.7rem;
            padding: 4px 10px;
            border-radius: 12px;
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.466);
            color: white;
            margin-left: auto;
            text-transform: uppercase;
            font-weight: bold;
        }
        .auto-mantra {
            border-color: rgba(255, 215, 0, 0.4);
            background: rgba(255, 215, 0, 0.05);
            cursor: default;
        }
        .auto-badge { color: white; font-size: 0.7rem; margin-left: auto; text-transform: uppercase; font-weight: bold; text-shadow: 0 0 5px rgb(255, 255, 255); }

        .sidebar-actions {
            margin-top: auto;
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding-top: 20px;
            border-top: 1px solid rgba(255,255,255,0.05);
        }
.action-btn {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid transparent;
    font-size: 1rem;
    cursor: pointer;
}
        .btn-share { background: rgb(74, 222, 128); color: #035c23; border-color: rgba(74, 222, 128, 0.3); }
        
        .btn-evil { 
            background: rgb(255, 71, 86); 
            color: #7c040e; 
            border-color: rgba(255, 71, 87, 0.3); 
        }
        .btn-clear {
    grid-column: 1 / -1; 
}

        /* Modals */
        .modal-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.85);
            backdrop-filter: blur(8px);
            display: flex; align-items: center; justify-content: center;
            z-index: 100;
            opacity: 0; pointer-events: none;
            transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .modal-overlay.active { opacity: 1; pointer-events: all; }

        .modal-container {
            width: 85%; height: 85%;
            border-radius: 24px;
            display: flex; flex-direction: column;
            overflow: hidden;
            transform: scale(0.95);
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .modal-overlay.active .modal-container { transform: scale(1); }

        .modal-header {
            padding: 25px 35px;
            border-bottom: 1px solid var(--glass-border);
            display: flex; justify-content: space-between; align-items: center;
            background: rgba(0,0,0,0.4);
        }
        .modal-header h2 { font-size: 1.8rem; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: 2px; }
        .modal-close {
            background: transparent; color: rgba(255,255,255,0.5); font-size: 2rem; line-height: 1;
        }
        .modal-body-split { display: flex; flex: 1; overflow: hidden; background: rgba(10,12,15,0.8); }
        .modal-left {
            flex: 2; padding: 25px; border-right: 1px solid var(--glass-border);
            display: flex; flex-direction: column;
            overflow-y: auto;
            position: relative;
        }
        .modal-right {
            flex: 1; padding: 35px; background: rgba(5,7,10,0.9);
            overflow-y: auto;
        }

        .search-bar-container { position: sticky; top: 0; padding-bottom: 15px; z-index: 2; margin-bottom: 10px; }
        .search-bar { width: 100%; font-size: 1.1rem; padding: 15px 20px; border-radius: 12px; }

       .tabs { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 20px; 
    overflow-x: auto; 
    padding-bottom: 10px;
    min-height: 55px; 
    align-items: center; 
    flex-shrink: 0;
}
        .tab-btn {
    background: rgba(0, 0, 0, 0.6); 
    padding: 10px 20px; 
    border-radius: 20px; 
    color: #e2e8f0 !important; 
    border: 1px solid transparent;
    white-space: nowrap; 
    font-weight: 600; 
    font-size: 0.9rem !important; 
    letter-spacing: 1px;
    flex-shrink: 0; 
    height: 40px; 
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}
       .tab-btn.active { 
    background: rgba(255, 255, 255, 0.15); 
    color: whitesmoke !important; 
    border-color: rgba(255, 255, 255, 0.5); 
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2); 
}

        .item-grid {
            display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px;
        }
        .item-card {
            background: rgba(0,0,0,0.4);
            border-radius: 6px; padding: 15px; text-align: center; cursor: pointer;
            display: flex; flex-direction: column; align-items: center;
        }
        .item-card img { width: 70px; height: 70px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; border: 1px solid rgba(255,255,255,0.1); }
    .item-card .name { 
    font-size: 1rem; 
    font-weight: 600; 
    color: #ddd; 
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    display: block;
    width: 100%;
    }
        .bell-hint { font-size: 0.7rem; color: #888; margin-top: 8px; background: rgba(0,0,0,0.4); padding: 4px 8px; border-radius: 8px; }

        /* Item Details Pane */
        .detail-img { width: 120px; height: 120px; border-radius: 16px; object-fit: cover; margin-bottom: 25px; border: 1px solid rgba(255,255,255,0.1); }
        .detail-name { font-size: 2rem; font-weight: 800; margin-bottom: 15px; color: wheat; text-transform: uppercase; letter-spacing: 1px; }
        .detail-desc { color: #bbb; line-height: 1.7; margin-bottom: 25px; white-space: pre-wrap; font-size: 1.05rem; }
        .detail-extra-imgs { display: flex; flex-direction: column; gap: 15px; }
        .detail-extra-imgs img { width: 100%; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); }

        /* Context Menu */
        #context-menu {
            position: fixed; background: rgba(15, 20, 25, 0.95); border: 1px solid rgba(0,240,255,0.3);
            border-radius: 12px; padding: 8px; z-index: 1000; display: none; min-width: 180px;
             backdrop-filter: blur(10px);
        }
        .ctx-item { padding: 12px 18px; cursor: pointer; border-radius: 8px; color: #eee; font-size: 0.95rem; font-weight: 600; transition: 0.2s; }
        .ctx-danger { color: var(--danger); }

        /* DB specific */
        .db-modal-content { max-width: 900px; margin: 0 auto; width: 90%; height: 85%; display: flex; flex-direction: column; }
        .db-header { padding: 25px 35px; border-bottom: 1px solid var(--glass-border); display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.4); }
        .db-body { padding: 30px; overflow-y: auto; flex: 1; }
        
        .db-grid { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
        .db-row { display: flex; align-items: center; background: rgba(0,0,0,0.4); padding: 12px 20px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }
        .db-row img { width: 40px; height: 40px; border-radius: 8px; margin-right: 15px; object-fit: cover; }
        .db-row-name { flex: 1; font-weight: 600; font-size: 1.1rem; }
        .db-row-cat { color: #888; font-size: 0.8rem; margin-right: 20px; text-transform: uppercase; }
        .db-actions button { padding: 8px 16px; margin-left: 8px; border-radius: 8px; color: white; font-weight: bold; }
        .btn-edit { background: rgba(59, 130, 246, 0.2); border: 1px solid rgba(59, 130, 246, 0.5); color: #60a5fa; }
        .btn-del { background: rgba(225, 29, 72, 0.2); border: 1px solid rgba(225, 29, 72, 0.5); color: #fb7185; }
        
        .db-form { display: flex; flex-direction: column; gap: 20px; }
        .form-group { display: flex; flex-direction: column; gap: 8px; }
        .form-group label { color: #bbb; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
        .form-actions { display: flex; gap: 15px; margin-top: 20px; }
        .btn-primary { background: var(--primary); color: #000; padding: 15px 30px; border-radius: 12px; font-weight: 800; text-transform: uppercase; }
        .btn-secondary { background: rgba(255,255,255,0.1); color: white; padding: 15px 30px; border-radius: 12px; font-weight: 800; }
        
        #db-add-btn { width: 100%; margin-top: 20px; background: rgba(0,240,255,0.1); color: var(--primary); border: 1px dashed var(--primary); padding: 15px; border-radius: 12px; font-weight: bold; font-size: 1.1rem; }


        .hidden { display: none !important; }
#menu-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 85%;
    border: 8px solid #111; 
    background: url('meaubg.png') center/cover no-repeat, #151515; 
    z-index: 10;
    overflow: hidden; 
}
@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

#start-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, #222, #050505);
    z-index: 9999; display: flex; flex-direction: column;
    align-items: center; justify-content: center; cursor: pointer;
    transition: opacity 0.5s ease-out; 
}

#start-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

#start-screen img { 
    max-width: 60%; height: auto; 
    opacity: 0;
    animation: fadeInSlideUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; 
}
.start-text { 
    margin-top: 20px; font-size: 1.5rem; color: #ffd700; 
    text-transform: uppercase; letter-spacing: 3px; font-weight: 300; 
    opacity: 0;
    animation: fadeInSlideUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; 
    animation-delay: 0.3s;
}
.selection-container {
    border-radius: 0 !important; 
    position: relative;
    border: 4px solid #111;
}

.abs-close {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 101;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    text-shadow: 0 2px 4px #000;
    transition: color 0.2s;
}

.abs-close:hover {
    color: var(--danger);
}

.modal-body-split.sharp-edges {
    border-radius: 0;
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
}

.modal-right.slim-right {
    flex: 0 0 400px !important; 
    background: rgba(5, 7, 10, 0.7); 
    border-left: 2px solid #111;
}
.sidebar-bottom {
    display: flex;
    flex-direction: row; 
    width: 100%;
    gap: 15px;
    flex-shrink: 0; 
    margin-top: 15px;
    padding-top: 15px;
    min-height: max-content;

    align-self: end;
}

.sidebar-buttons {
    flex: 1; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    margin-top: -30px;
}
.sidebar-stats {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0 !important;
    border-radius: 14px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 8px;
}
.sidebar-stats {
    width: 100%;
    min-height: 100%;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-row span:last-child {
    color: white;
    font-weight: 800;
}