* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, #0a0c10 0%, #1a1d28 50%, #0f1218 100%);
    color: #e8eaed;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: calc(100vh - 64px);
    gap: 2px;
    background: #0a0c10;
    overflow: hidden;
}

.panels-wrapper {
    display: grid;
    grid-template-columns: 320px 1fr 360px;
    gap: 2px;
    background: #0a0c10;
    overflow: hidden;
    min-height: 0;
}

.panel {
    padding: 28px 24px;
    background: linear-gradient(180deg, #16191f 0%, #13161c 100%);
    overflow-y: auto;
    min-height: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.panel h2 {
    margin-bottom: 24px;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    font-size: 13px;
    opacity: 0.5;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(90, 108, 255, 0.15);
}

.wide-panel {
    padding: 28px 24px;
    background: linear-gradient(180deg, #16191f 0%, #13161c 100%);
    overflow-y: auto;
    min-height: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    width: 100%;
}

.wide-panel h2 {
    margin-bottom: 24px;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    font-size: 13px;
    opacity: 0.5;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(90, 108, 255, 0.15);
}

.info-text {
    margin-top: 24px;
    padding: 16px 18px;
    background: rgba(90, 108, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(90, 108, 255, 0.12);
    font-size: 12px;
    line-height: 1.65;
    color: #a8b1d6;
    letter-spacing: 0.01em;
}

.level-input,
.stat-build-input,
.tools-input {
    background: rgba(27, 30, 36, 0.5);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.level-input:hover,
.stat-build-input:hover,
.tools-input:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.level-input:first-child,
.stat-build-input:first-child,
.tools-input:first-child {
    margin-top: 0;
}

.level-input label,
.stat-build-input > label,
.tools-input > label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 13px;
    color: #b8c0e0;
    letter-spacing: 0.02em;
}

.level-input input {
    width: 100%;
    padding: 14px 16px;
    background: #0f1115;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
}

.level-input input:focus {
    outline: none;
    border-color: #5a6cff;
    background: #12141a;
    box-shadow: 0 0 0 3px rgba(90, 108, 255, 0.15);
}

.level-input input:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.build-info {
    margin-bottom: 20px;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(90, 108, 255, 0.12) 0%, rgba(90, 108, 255, 0.05) 100%);
    border-radius: 10px;
    border: 1px solid rgba(90, 108, 255, 0.2);
    box-shadow: 0 4px 12px rgba(90, 108, 255, 0.08);
}

.build-name {
    font-size: 20px;
    font-weight: 800;
    color: #6f7dff;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    font-size: 16px;
}

.points-info {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #8892b8;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.points-info span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.points-info span span {
    color: #b8c0e0;
    font-weight: 700;
    font-size: 13px;
}

.stat-input-group {
    margin-bottom: 18px;
}

.stat-input-group:last-child {
    margin-bottom: 0;
}

.stat-input-group > label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #a8b1d6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 11px;
}

.stat-controls {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 14px;
    align-items: center;
}

.stat-number {
    width: 100%;
    padding: 10px 12px;
    background: #0f1115;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    transition: all 0.25s ease;
}

.stat-number:focus {
    outline: none;
    border-color: #5a6cff;
    background: #12141a;
    box-shadow: 0 0 0 3px rgba(90, 108, 255, 0.15);
}

.stat-number:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.stat-range {
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #0f1115 0%, rgba(90, 108, 255, 0.1) 100%);
    border-radius: 10px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
}

.stat-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #6f7dff 0%, #5a6cff 100%);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(90, 108, 255, 0.4), 0 0 0 0 rgba(90, 108, 255, 0.3);
}

.stat-range::-webkit-slider-thumb:hover {
    background: linear-gradient(135deg, #8791ff 0%, #6f7dff 100%);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(90, 108, 255, 0.5), 0 0 0 4px rgba(90, 108, 255, 0.2);
}

.stat-range::-webkit-slider-thumb:active {
    transform: scale(1.05);
}

.stat-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #6f7dff 0%, #5a6cff 100%);
    cursor: pointer;
    border-radius: 50%;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(90, 108, 255, 0.4);
}

.stat-range::-moz-range-thumb:hover {
    background: linear-gradient(135deg, #8791ff 0%, #6f7dff 100%);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(90, 108, 255, 0.5);
}

.tools-slots {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-slot {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: #0f1115;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tool-slot:hover {
    transform: scale(1.02);
}

.tool-slot.filled {
}

.tool-slot-content {
    background: rgba(0, 0, 0, 0.85);
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    width: 100%;
    backdrop-filter: blur(8px);
}

.tool-slot-label {
    font-size: 10px;
    color: #7a84a8;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.tool-slot-name {
    font-size: 13px;
    font-weight: 700;
    color: #e8eaed;
}

.slots-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.slot {
    background: linear-gradient(135deg, rgba(27, 30, 36, 0.6) 0%, rgba(20, 23, 29, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.slot:hover {
    border-color: rgba(90, 108, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 20px rgba(90, 108, 255, 0.1);
    background: linear-gradient(135deg, rgba(27, 30, 36, 0.8) 0%, rgba(20, 23, 29, 0.9) 100%);
}

.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.slot-label {
    font-size: 11px;
    font-weight: 700;
    color: #7a84a8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.slot-stats-preview {
    width: 28px;
    height: 28px;
    background: rgba(15, 17, 21, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.slot-stats-preview::after {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0.5;
}

.slot-stats-preview:hover {
    border-color: #5a6cff;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 12px rgba(90, 108, 255, 0.4);
}

.slot-stats-preview.has-stats {
    border-color: #5a6cff;
    background: linear-gradient(135deg, rgba(90, 108, 255, 0.2), rgba(90, 108, 255, 0.35));
    box-shadow: 0 0 12px rgba(90, 108, 255, 0.25);
}

.slot-stats-preview.has-stats::after {
    opacity: 1;
}

.slot-content {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 72px;
}

.slot-content.empty {
    font-size: 13px;
    font-weight: 500;
    align-items: center;
    justify-content: center;
}

.slot-square {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: #0f1115;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.slot-square:hover {
    transform: scale(1.02);
    z-index: 10;
}

.slot-square.filled {
}

.armor-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.slot-item-name {
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    letter-spacing: 0.02em;
}

.slot-item-level {
    font-size: 9px;
    opacity: 0.85;
    margin-top: 2px;
    color: #a8b1d6;
    font-weight: 600;
}

.slot-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.slot-control-btn {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: #0f1115;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    padding: 0;
}

.slot-control-btn:hover {
    transform: scale(1.02);
}

.slot-control-btn:active {
    transform: scale(1.02);
}

.stats-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    background: linear-gradient(135deg, rgba(27, 30, 36, 0.5) 0%, rgba(20, 23, 29, 0.7) 100%);
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.stat-row:hover {
    background: linear-gradient(135deg, rgba(35, 39, 50, 0.6) 0%, rgba(27, 30, 36, 0.8) 100%);
    border-color: rgba(90, 108, 255, 0.2);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-name {
    font-weight: 600;
    color: #b8c0e0;
    letter-spacing: 0.01em;
}

.stat-value {
    font-weight: 800;
    color: #6f7dff;
    min-width: 70px;
    text-align: right;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.stat-percent {
    min-width: 80px;
    text-align: right;
    color: #7a84a8;
    font-size: 13px;
    font-weight: 600;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(12px);
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.overlay.active {
    display: flex;
}

.overlay-content {
    background: linear-gradient(180deg, #16191f 0%, #13161c 100%);
    width: 90%;
    max-width: 1300px;
    max-height: 88vh;
    height: 88vh;
    padding: 32px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.overlay-header h2 {
    margin: 0;
    border: none;
    padding: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 70, 70, 0.15);
    border-color: rgba(255, 70, 70, 0.3);
    transform: scale(1.05) rotate(90deg);
}

.close-btn:active {
    transform: scale(0.95) rotate(90deg);
}

.picker-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.picker-search {
    flex: 1 1 0;
    padding: 12px 18px;
    background: rgba(27, 30, 36, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    transition: all 0.25s ease;
    font-weight: 500;
    min-width: 0;
}

.picker-search::placeholder {
    color: #7a84a8;
}

.picker-search:focus {
    outline: none;
    border-color: #5a6cff;
    background: rgba(27, 30, 36, 0.8);
    box-shadow: 0 0 0 3px rgba(90, 108, 255, 0.15);
}

.picker-ctrl-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 18px;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #a8b2d8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.picker-ctrl-btn:hover {
    background: rgba(90,108,255,0.12);
    border-color: rgba(90,108,255,0.35);
    color: #fff;
}

.picker-ctrl-btn.active {
    background: rgba(90,108,255,0.2);
    border-color: rgba(90,108,255,0.6);
    color: #8ba4ff;
}

.picker-ctrl-btn.has-selection {
    border-color: rgba(90,108,255,0.5);
    color: #8ba4ff;
}

.picker-panel {
    background: rgba(18,21,28,0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 10px;
    animation: panelSlideIn 0.2s ease;
}

@keyframes panelSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.picker-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 700;
    color: #7a84a8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.picker-panel-clear {
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    color: #7a84a8;
    font-size: 12px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.picker-panel-clear:hover {
    border-color: rgba(255,80,80,0.4);
    color: #ff7070;
}

.filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-check {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #a8b2d8;
    transition: all 0.2s ease;
    user-select: none;
}

.filter-check:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.filter-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #5a6cff;
    cursor: pointer;
}

.filter-check:has(input:checked) {
    background: rgba(90,108,255,0.15);
    border-color: rgba(90,108,255,0.5);
    color: #fff;
}

.filter-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rarity-common    { background: #b0b8c8; }
.rarity-uncommon  { background: #f0c040; }
.rarity-rare      { background: #4a8fff; }
.rarity-mystic    { background: #e04040; }
.rarity-legendary { background: #4caf7a; }
.rarity-boss      { background: #ff6060; }
.rarity-sunken    { background: #40e8e8; }
.rarity-modifier  { background: #c07aff; }

.sort-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sort-radio {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #a8b2d8;
    transition: all 0.2s ease;
    user-select: none;
}

.sort-radio:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sort-radio:has(input:checked) {
    background: rgba(90,108,255,0.15);
    border-color: rgba(90,108,255,0.5);
    color: #fff;
}

.sort-radio input[type="radio"] {
    width: 15px;
    height: 15px;
    accent-color: #5a6cff;
    cursor: pointer;
}

.sort-separator {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin: 12px 0;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    grid-auto-rows: minmax(160px, 160px);
    gap: 12px;
    overflow-y: auto;
    align-content: start;
    flex: 1 1 0px;
    min-height: 0;
}

.item-card {
    border: none;
    border-radius: 0;
    outline: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: none;
}

.item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(90, 108, 255, 0.3);
}

.item-card:active {
    transform: translateY(-1px);
}

.item-card.disabled {
    opacity: 0.25;
    pointer-events: none;
    filter: grayscale(1);
}

.item-card-image {
    position: absolute;
    inset: 0;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #111;
}

.item-card-inner {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 10px 9px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0) 100%);
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.item-card-footer-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 4px;
}

.item-card-text {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.item-card-name {
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.item-card-level {
    font-size: 11px;
    color: rgba(255,255,255,0.65);
    font-weight: 600;
    line-height: 1.2;
    margin-top: 1px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.item-card-fav-btn {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    color: rgba(255,255,255,0.5);
    flex-shrink: 0;
    transition: transform 0.15s ease, color 0.15s ease;
    z-index: 10;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
    align-self: flex-end;
}

.item-card-fav-btn:hover {
    transform: scale(1.3);
    color: #ffd700;
}

.item-card-fav-btn.favorited {
    color: #ffd700;
}

.item-card.remove-card {
    background: rgba(27, 30, 36, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-card.remove-card .item-card-image {
    display: none;
}

.item-card.remove-card .item-card-inner {
    position: static;
    background: none;
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-card.remove-card .item-card-name {
    color: #e8eaed;
    font-size: 14px;
    text-shadow: none;
    text-align: center;
    white-space: normal;
}

.item-card.remove-card .item-card-fav-btn {
    display: none;
}

.detail-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    backdrop-filter: blur(12px);
    animation: fadeIn 0.25s ease;
}

.detail-modal.active {
    display: flex;
}

.detail-content {
    background: linear-gradient(180deg, #16191f 0%, #13161c 100%);
    width: 92%;
    max-width: 650px;
    max-height: 88vh;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.detail-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.detail-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
}

.detail-footer {
    padding: 20px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-section {
    margin-bottom: 28px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h4 {
    margin-bottom: 14px;
    font-size: 13px;
    color: #6f7dff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.detail-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-option {
    background: rgba(27, 30, 36, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #b8c0e0;
}

.detail-option:hover {
    background: rgba(35, 39, 50, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.detail-option.selected {
    background: linear-gradient(135deg, rgba(90, 108, 255, 0.25) 0%, rgba(90, 108, 255, 0.15) 100%);
    border-color: #5a6cff;
    box-shadow: 0 0 16px rgba(90, 108, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.detail-option.disabled {
    opacity: 0.25;
    pointer-events: none;
    filter: grayscale(1);
}

.jewel-slots {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.jewel-slot {
    width: 48px;
    height: 48px;
    border: 2px solid #2a2e38;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #1b1e24;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.jewel-slot:hover {
    border-color: #5a6cff;
    transform: scale(1.05);
}

.jewel-slot.filled {
    border-color: #5a6cff;
    box-shadow: 0 0 8px rgba(90, 108, 255, 0.3);
}

.confirm-btn {
    width: 100%;
    padding: 12px;
    background: #5a6cff;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-btn:hover {
    background: #6f7dff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(90, 108, 255, 0.4);
}

.confirm-btn:active {
    transform: translateY(0);
}

.stat-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 2000;
    background: rgba(20, 23, 29, 0.95);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    max-width: 300px;
    font-size: 13px;
    line-height: 1.5;
    border: 2px solid #333;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

.stat-tooltip div {
    margin: 2px 0;
}

.item-stats-preview {
    background: #1b1e24;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #2a2e38;
}

.item-stats-preview div {
    padding: 4px 0;
}

.slot-square.with-layers,
.item-card.with-layers,
.slot-control-btn.with-layers,
.tool-slot.with-layers {
    background-size: cover, cover, cover;
    background-position: center, center, center;
    background-repeat: no-repeat, no-repeat, no-repeat;
}

.item-card-image.with-layers {
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
    background-position: center, center, center, center;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1b1e24;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .overlay-content {
        width: 95%;
    }
}

.main-header {
    width: 100%;
    background: linear-gradient(180deg, #16191f 0%, #13161c 100%);
    border-bottom: 1px solid rgba(90, 108, 255, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    position:static;
    top: 0;
    z-index: 500;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-content h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #e8eaed;
    text-transform: uppercase;
}

.header-content p {
    align-items: center;
    margin: 2px 0 0;
    font-size: 11px;
    color: #7a84a8;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: flex;
    flex-direction: row;
    gap: 4px;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.header-link {
    background: linear-gradient(135deg, rgba(90, 108, 255, 0.25) 0%, rgba(90, 108, 255, 0.15) 100%);
    border: 1px solid rgba(90, 108, 255, 0.4);
    padding: 6px 14px;
    border-radius: 10px;
    color: #6f7dff;
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: all 0.25s ease;
    box-shadow: 0 0 12px rgba(90, 108, 255, 0.15);
}

.header-link:hover {
    background: linear-gradient(135deg, rgba(90, 108, 255, 0.4) 0%, rgba(90, 108, 255, 0.25) 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 0 22px rgba(90, 108, 255, 0.35);
}

.wide-panel {
    padding: 20px 24px;
    background: linear-gradient(180deg, #1a1d25 0%, #151820 100%);
    border-bottom: 2px solid rgba(90, 108, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    max-height: 300px;
}

.wide-panel h2 {
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    opacity: 0.5;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(90, 108, 255, 0.15);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(90, 108, 255, 0.12) 0%, rgba(90, 108, 255, 0.08) 100%);
    border: 1px solid rgba(90, 108, 255, 0.25);
    border-radius: 10px;
    color: #e8eaed;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn:hover {
    background: linear-gradient(135deg, rgba(90, 108, 255, 0.25) 0%, rgba(90, 108, 255, 0.15) 100%);
    border-color: rgba(90, 108, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 108, 255, 0.2);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn-danger {
    background: linear-gradient(135deg, rgba(255, 90, 90, 0.12) 0%, rgba(255, 90, 90, 0.08) 100%);
    border-color: rgba(255, 90, 90, 0.25);
}

.action-btn-danger:hover {
    background: linear-gradient(135deg, rgba(255, 90, 90, 0.25) 0%, rgba(255, 90, 90, 0.15) 100%);
    border-color: rgba(255, 90, 90, 0.4);
    box-shadow: 0 4px 12px rgba(255, 90, 90, 0.2);
}

.btn-text {
    white-space: nowrap;
}

.build-code-section {
    margin-top: 16px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

.code-container {
    position: relative;
    background: rgba(27, 30, 36, 0.7);
    border-radius: 10px;
    border: 1px solid rgba(90, 108, 255, 0.2);
    padding: 16px;
}

.build-code-textarea {
    width: 100%;
    min-height: 32px;
    max-height: 64px;
    background: rgba(27, 30, 36, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #e8eaed;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;

    padding: 6px 8px;
    resize: none;
}

.build-code-textarea:focus {
    outline: none;
    border-color: rgba(90, 108, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(90, 108, 255, 0.1);
}

.build-code-textarea::placeholder {
    color: #6b7280;
}

.share-url-input {
    width: 100%;
    height: 32px;
    background: rgba(27, 30, 36, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #e8eaed;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;

    padding: 6px 8px;
}

.share-url-input:focus {
    outline: none;
    border-color: rgba(90, 108, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(90, 108, 255, 0.1);
}

.copy-icon {
    font-size: 14px;
}

.save-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.save-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.save-modal-content {
    background: linear-gradient(180deg, #1a1d25 0%, #151820 100%);
    border: 1px solid rgba(90, 108, 255, 0.3);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.save-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(90, 108, 255, 0.15);
}

.save-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.save-modal-body {
    padding: 24px;
}

.save-modal-body label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #a8b1d6;
}

.save-modal-body input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(27, 30, 36, 0.7);
    border: 1px solid rgba(90, 108, 255, 0.2);
    border-radius: 8px;
    color: #e8eaed;
    font-size: 14px;
    transition: all 0.3s ease;
}

.save-modal-body input:focus {
    outline: none;
    border-color: rgba(90, 108, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(90, 108, 255, 0.1);
}

.save-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid rgba(90, 108, 255, 0.15);
    justify-content: flex-end;
}

.cancel-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e8eaed;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.load-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.load-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.load-modal-content {
    background: linear-gradient(180deg, #1a1d25 0%, #151820 100%);
    border: 1px solid rgba(90, 108, 255, 0.3);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.load-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(90, 108, 255, 0.15);
}

.load-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.load-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.saved-builds-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.saved-build-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(27, 30, 36, 0.5);
    border: 1px solid rgba(90, 108, 255, 0.15);
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.saved-build-item:hover {
    background: rgba(27, 30, 36, 0.8);
    border-color: rgba(90, 108, 255, 0.35);
    transform: translateX(4px);
}

.saved-build-info {
    flex: 1;
}

.saved-build-name {
    font-size: 15px;
    font-weight: 600;
    color: #e8eaed;
    margin-bottom: 4px;
}

.saved-build-date {
    font-size: 11px;
    color: #6b7280;
}

.saved-build-actions {
    display: flex;
    gap: 8px;
}

.delete-build-btn {
    padding: 8px 12px;
    background: rgba(255, 90, 90, 0.15);
    border: 1px solid rgba(255, 90, 90, 0.3);
    border-radius: 6px;
    color: #ff5a5a;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-build-btn:hover {
    background: rgba(255, 90, 90, 0.25);
    border-color: rgba(255, 90, 90, 0.5);
}

.empty-builds-message {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 14px;
}

@media (max-width: 1200px) {
    .actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .panels-wrapper {
        grid-template-columns: 280px 1fr 320px;
    }
}

@media (max-width: 968px) {
    .container {
        grid-template-rows: auto auto;
        height: auto;
        min-height: calc(100vh - 64px);
    }
    
    .panels-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
    }
    
    .panel {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .wide-panel {
        padding: 16px;
        max-height: none;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .build-code-textarea {
        padding-left: 12px;
    }
}

.action-btn-picture {
    background: linear-gradient(135deg, rgba(90,200,140,0.12) 0%, rgba(60,180,110,0.08) 100%);
    border-color: rgba(90,200,140,0.3);
    color: #6fcf97;
}
.action-btn-picture:hover {
    background: linear-gradient(135deg, rgba(90,200,140,0.25) 0%, rgba(60,180,110,0.15) 100%) !important;
    border-color: rgba(90,200,140,0.5) !important;
    box-shadow: 0 4px 12px rgba(90,200,140,0.2) !important;
    color: #a8f0c0;
}

.picture-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(10px);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.picture-modal.active { display: flex; }

.picture-modal-content {
    background: linear-gradient(180deg, #1a1d25 0%, #151820 100%);
    border: 1px solid rgba(90,108,255,0.3);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    width: min(96vw, 480px);
    max-height: min(94vh, 680px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.picture-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 14px;
    border-bottom: 1px solid rgba(90,108,255,0.15);
    flex-shrink: 0;
}

.picture-modal-title {
    font-size: 18px;
    font-weight: 900;
    color: #6f7dff;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}
.picture-modal-title span {
    font-size: 12px;
    font-weight: 600;
    color: #7a84a8;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 8px;
}

.picture-modal-body {
    padding: 14px 20px 18px;
    display: flex;
    gap: 16px;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.pm-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
}

.pm-divider {
    font-size: 9px;
    font-weight: 700;
    color: #4a5280;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 7px 0 3px;
}
.pm-divider:first-child { margin-top: 0; }

.pm-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 1px 0;
    min-width: 0;
}

.pm-row-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-color: #0f1115;
    border-radius: 3px;
}
.pm-row-icon.with-layers {
    background-size: cover, cover, cover, cover;
    background-position: center, center, center, center;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
}

.pm-row-text {
    display: flex;
    flex-direction: column;
    gap: 0px;
    min-width: 0;
}
.pm-row-name {
    font-size: 11px;
    font-weight: 700;
    color: #e8eaed;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.pm-row-name.empty { color: #4a5280; font-style: italic; font-weight: 400; }
.pm-row-sub {
    font-size: 9px;
    color: #5a6888;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.pm-right {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 0 0 auto;
    min-width: 110px;
    overflow: hidden;
}

.pm-stat-line {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    line-height: 1.55;
}
.pm-stat-line img {
    width: 13px;
    height: 13px;
    object-fit: contain;
    flex-shrink: 0;
}
.pm-stat-line-name {
    flex: 1;
    font-weight: 600;
}
.pm-stat-line-val {
    font-weight: 800;
    font-size: 12px;
    min-width: 32px;
    text-align: right;
}
.pm-ep-line {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    line-height: 1.55;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.07);
    color: #b8c0e0;
    font-weight: 600;
}
.pm-ep-line-val {
    font-weight: 800;
    font-size: 13px;
    color: #6f7dff;
    margin-left: auto;
}