* {
    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;
}

/* ===== LAYOUT ===== */
.container {
    display: grid;
    grid-template-columns: 320px 1fr 360px;
    height: 100vh;
    gap: 2px;
    background: #0a0c10;
}

.panel {
    padding: 28px 24px;
    background: linear-gradient(180deg, #16191f 0%, #13161c 100%);
    overflow-y: auto;
    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);
}

.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;
}

/* ===== CONFIGURATION INPUTS ===== */
.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 ===== */
.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 INPUTS ===== */
.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 ===== */
.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;
    border: 2px solid rgba(255, 255, 255, 0.08);
}

.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;
}

/* ===== EQUIPMENT SLOTS ===== */
.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;
    border: 2px solid rgba(255, 255, 255, 0.08);
}

.slot-square:hover {
    transform: scale(1.02);
    z-index: 10;
}

.slot-square.filled {
}

.armor-overlay {
    position: absolute;
    inset: 0;
    padding: 6px;
    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 ===== */
.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 ===== */
.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;
    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;
    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-search {
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 20px;
    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;
}

.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);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    overflow-y: auto;
    padding: 6px;
}

.item-card {
    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: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.item-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(90, 108, 255, 0) 0%, rgba(90, 108, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-card:hover {
    border-color: #5a6cff;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(90, 108, 255, 0.3);
}

.item-card:hover::before {
    opacity: 1;
}

.item-card:active {
    transform: translateY(-2px);
}

.item-card.disabled {
    opacity: 0.25;
    pointer-events: none;
    filter: grayscale(1);
}

.item-card-inner {
    background: rgba(0, 0, 0, 0.85);
    padding: 12px 14px;
    border-radius: 8px;
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 1;
}

.item-card-name {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 14px;
    color: #e8eaed;
    letter-spacing: -0.01em;
}

.item-card-level {
    font-size: 12px;
    color: #7a84a8;
    font-weight: 600;
}

/* ===== DETAIL MODAL ===== */
.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);
}

/* ===== TOOLTIP ===== */
.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;
}

/* ===== BACKGROUND LAYERS ===== */
.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;
}

/* ===== SCROLLBARS ===== */
::-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;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .overlay-content {
        width: 95%;
    }
}