/* ================= WRAPPER ================= */

.sab-calculator-wrapper {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #4a4a4a;
    border-radius: 12px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    font-family: "Arial Black", sans-serif;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

/* ================= HEADER ================= */

.sab-calculator-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #4a4a4a;
}

.sab-header-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.sab-title {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.sab-subtitle {
    font-size: 12px;
    color: #aaa;
}

/* ================= LAYOUT ================= */

.sab-calculator-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .sab-calculator-content {
        grid-template-columns: 1fr;
    }
}

/* ================= LEFT PANEL ================= */

.sab-left-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ================= SECTION ================= */

.sab-section {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border: 2px solid #4a4a4a;
    border-radius: 8px;
    padding: 14px;
}

.sab-label {
    display: block;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sab-info-text {
    font-size: 10px;
    color: #888;
    margin-top: 6px;
}

.sab-info-value {
    font-size: 12px;
    color: #aaa;
    margin-top: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.sab-green {
    color: #4CAF50;
    font-weight: bold;
}

/* ================= BRAINROT SEARCH ================= */

.sab-brainrot-selected {
    background: #1a1a1a;
    border: 2px solid #4a4a4a;
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.sab-selected-brainrot-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #4a4a4a;
}

.sab-selected-brainrot-title {
    flex: 1;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
}

.sab-clear-brainrot-btn {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: #F44336;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sab-clear-brainrot-btn:hover {
    background: rgba(244, 67, 54, 0.3);
    border-color: #F44336;
}

.sab-brainrot-search {
    position: relative;
}

.sab-brainrot-input {
    width: 95%;
    background: #1a1a1a;
    border: 2px solid #4a4a4a;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.sab-brainrot-input:focus {
    outline: none;
    border-color: #5a5a5a;
    box-shadow: 0 0 8px rgba(74, 74, 74, 0.4);
}

.sab-brainrot-input::placeholder {
    color: #666;
}

.sab-brainrot-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 2px solid #4a4a4a;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.sab-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #2a2a2a;
    transition: background 0.2s ease;
    display: flex;
    gap: 10px;
    align-items: center;
}

.sab-dropdown-item:hover {
    background: #2a2a2a;
}

.sab-dropdown-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #4a4a4a;
}

.sab-dropdown-text {
    flex: 1;
}

.sab-dropdown-name {
    font-weight: bold;
    font-size: 12px;
    color: #fff;
}

.sab-dropdown-income {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

.sab-dropdown-empty {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 12px;
}

/* ================= BUTTONS ================= */

.sab-mutation-grid,
.sab-traits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 6px;
}

.sab-mutation-btn,
.sab-trait-btn {
    background: #2a2a2a;
    border: 2px solid #4a4a4a;
    color: #aaa;
    padding: 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sab-mutation-btn:hover,
.sab-trait-btn:hover {
    border-color: #5a5a5a;
    color: #ccc;
}

.sab-mutation-btn.active {
    background: #4CAF50;
    border-color: #66BB6A;
    color: #fff;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

.sab-trait-btn.active {
    background: #FFD700;
    border-color: #ffed4e;
    color: #000;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.sab-btn-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #4a4a4a;
}

.sab-btn-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.sab-btn-value {
    font-size: 8px;
    opacity: 0.8;
    margin-top: 2px;
}

/* ================= TRAITS SELECTED ================= */

.sab-traits-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.sab-trait-tag {
    background: #2a2a2a;
    border: 1px solid #FFD700;
    color: #FFD700;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
}

/* ================= SLIDERS ================= */

.sab-base-multi-slider,
.sab-friend-boost-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #1a1a1a;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    accent-color: #4CAF50;
    cursor: pointer;
}

.sab-base-multi-slider::-webkit-slider-thumb,
.sab-friend-boost-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}

.sab-base-multi-slider::-moz-range-thumb,
.sab-friend-boost-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}

/* ================= RESULT PANEL ================= */

.sab-result-panel {
    display: flex;
    align-items: flex-start;
}

.sab-result-box {
    background: linear-gradient(135deg, #4CAF50, #2d8a3d);
    border: 4px solid #66BB6A;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.3);
    position: sticky;
    top: 140px;
}

.sab-result-label {
    font-size: 11px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sab-result-income {
    font-size: 40px;
    font-weight: 900;
    color: #fff;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
    margin-bottom: 8px;
    font-family: 'Arial Black', sans-serif;
}

.sab-result-after-multi {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16px;
    font-weight: 600;
}

.sab-result-breakdown {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 14px;
    text-align: left;
}

.sab-result-image {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.sab-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 11px;
    color: #fff;
}

.sab-breakdown-item:last-child {
    border-bottom: none;
}

.sab-breakdown-item span:first-child {
    opacity: 0.85;
}

.sab-breakdown-item span:last-child {
    font-weight: bold;
    text-align: right;
}

.sab-breakdown-small {
    font-size: 9px !important;
    word-break: break-word;
}

/* ================= SCROLLBAR ================= */

.sab-brainrot-dropdown::-webkit-scrollbar {
    width: 6px;
}

.sab-brainrot-dropdown::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.sab-brainrot-dropdown::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 3px;
}

.sab-brainrot-dropdown::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

/* ================= PARTICLE EFFECTS ================= */

.sab-result-image-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.sab-particles-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 6px;
    overflow: hidden;
}

.sab-particle {
    position: absolute;
    width: 40px;
    height: 40px;
    object-fit: contain;
    opacity: 0.7;
    animation: sab-particle-orbit 12s infinite linear;
    --particle-index: 0;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

@keyframes sab-particle-orbit {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) translateX(100px) translateY(0px) scale(1);
        opacity: 0.7;
    }
    10% {
        transform: translate(-50%, -50%) rotate(36deg) translateX(130px) translateY(var(--offset-y, 0)) scale(1.05);
        opacity: 0.8;
    }
    15% {
        transform: translate(-50%, -50%) rotate(54deg) translateX(110px) translateY(var(--offset-y, 0)) scale(1);
        opacity: 0.3;
    }
    20% {
        transform: translate(-50%, -50%) rotate(72deg) translateX(120px) translateY(var(--offset-y, 0)) scale(0.9);
        opacity: 0.9;
    }
    25% {
        transform: translate(-50%, -50%) rotate(90deg) translateX(140px) translateY(var(--offset-y, 0)) scale(1.1);
        opacity: 0.8;
    }
    30% {
        transform: translate(-50%, -50%) rotate(108deg) translateX(85px) translateY(var(--offset-y, 0)) scale(0.95);
        opacity: 0.7;
    }
    35% {
        transform: translate(-50%, -50%) rotate(126deg) translateX(125px) translateY(calc(var(--offset-y, 0) * 0.5)) scale(1);
        opacity: 0.4;
    }
    40% {
        transform: translate(-50%, -50%) rotate(144deg) translateX(100px) translateY(var(--offset-y, 0)) scale(0.85);
        opacity: 0.9;
    }
    45% {
        transform: translate(-50%, -50%) rotate(162deg) translateX(135px) translateY(calc(var(--offset-y, 0) * -0.5)) scale(1.15);
        opacity: 0.85;
    }
    50% {
        transform: translate(-50%, -50%) rotate(180deg) translateX(110px) translateY(var(--offset-y, 0)) scale(1);
        opacity: 0.7;
    }
    55% {
        transform: translate(-50%, -50%) rotate(198deg) translateX(145px) translateY(calc(var(--offset-y, 0) * 0.3)) scale(0.9);
        opacity: 0.75;
    }
    60% {
        transform: translate(-50%, -50%) rotate(216deg) translateX(80px) translateY(var(--offset-y, 0)) scale(1.08);
        opacity: 0.3;
    }
    65% {
        transform: translate(-50%, -50%) rotate(234deg) translateX(120px) translateY(calc(var(--offset-y, 0) * -0.4)) scale(0.95);
        opacity: 0.85;
    }
    70% {
        transform: translate(-50%, -50%) rotate(252deg) translateX(130px) translateY(var(--offset-y, 0)) scale(1.12);
        opacity: 0.8;
    }
    75% {
        transform: translate(-50%, -50%) rotate(270deg) translateX(100px) translateY(calc(var(--offset-y, 0) * 0.6)) scale(1);
        opacity: 0.7;
    }
    80% {
        transform: translate(-50%, -50%) rotate(288deg) translateX(140px) translateY(var(--offset-y, 0)) scale(0.88);
        opacity: 0.4;
    }
    85% {
        transform: translate(-50%, -50%) rotate(306deg) translateX(90px) translateY(calc(var(--offset-y, 0) * -0.3)) scale(1.1);
        opacity: 0.9;
    }
    90% {
        transform: translate(-50%, -50%) rotate(324deg) translateX(125px) translateY(var(--offset-y, 0)) scale(1.02);
        opacity: 0.75;
    }
    95% {
        transform: translate(-50%, -50%) rotate(342deg) translateX(110px) translateY(var(--offset-y, 0)) scale(0.95);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg) translateX(100px) translateY(0px) scale(1);
        opacity: 0.7;
    }
}
@media (max-width: 600px) {
    .sab-calculator-wrapper {
        padding: 12px;
        transform: scale(0.85);
        transform-origin: top center;
    }

    .sab-title {
        font-size: 20px;
    }

    .sab-result-box {
        position: static;
    }

    .sab-result-income {
        font-size: 28px;
    }

    .sab-mutation-grid,
    .sab-traits-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ================= CLEAN MUTATION FILTERS ================= */

/* Gold */
.sab-filter-gold {
    filter: grayscale(100%) sepia(100%) saturate(300%)
            hue-rotate(5deg) brightness(0.9) contrast(1.3);
}

/* Diamond */
.sab-filter-diamond {
    filter: grayscale(100%) sepia(100%) saturate(300%)
            hue-rotate(160deg) brightness(0.9) contrast(1.35);
}

/* Candy */
.sab-filter-candy {
    filter: grayscale(100%) sepia(100%) saturate(300%)
            hue-rotate(270deg) brightness(0.85) contrast(1.3);
}

/* Lava */
.sab-filter-lava {
    filter: grayscale(100%) sepia(100%) saturate(300%)
            hue-rotate(-15deg) brightness(0.85) contrast(1.4);
}

/* Bloodrot */
.sab-filter-bloodrot {
    filter:
        grayscale(100%)
        sepia(40%)
        saturate(700%)
        hue-rotate(-45deg)
        brightness(0.95)
        contrast(1.45);

    animation: sab-blood-pulse 3.2s ease-in-out infinite;
}

/* Galaxy */
.sab-filter-galaxy {
    filter: grayscale(100%) sepia(100%) saturate(300%)
            hue-rotate(220deg) brightness(0.85) contrast(1.3);
}

/* YinYang */
.sab-filter-yinyang {
    filter: grayscale(100%)
            brightness(0.85)
            contrast(1.45)
            saturate(0.9);
}


/* Radioactive */
.sab-filter-radioactive {
    animation: sab-radioactive-glow 2.2s ease-in-out infinite;
}


/* Rainbow (keep yours — it’s already correct) */
.sab-filter-rainbow {
    animation: sab-rainbow-hue-rotate 4.2s linear infinite;
}

.sab-filter-cursed {
    filter: url(#sab-cursed-filter);
}

@keyframes sab-blood-pulse {
    0%, 100% {
        filter:
            grayscale(100%)
            sepia(40%)
            saturate(700%)
            hue-rotate(-45deg)
            brightness(0.95)
            contrast(1.45);
    }
    50% {
        filter:
            grayscale(100%)
            sepia(40%)
            saturate(800%)
            hue-rotate(-42deg)
            brightness(0.99)
            contrast(1.55);
    }
}




@keyframes sab-rainbow-hue-rotate {
    0% { filter: grayscale(100%) brightness(1.01) contrast(1.8) sepia(0.5) saturate(800%) hue-rotate(0deg) brightness(1.01); }
    100% { filter: grayscale(100%) brightness(1.01) contrast(1.8) sepia(0.5) saturate(800%) hue-rotate(360deg) brightness(1.01); }
}

@keyframes sab-lava-glow {
    0%, 100% {
        filter: grayscale(100%)
                sepia(100%)
                saturate(480%)
                hue-rotate(15deg)
                brightness(0.9)
                contrast(1.35);
    }
    50% {
        filter: grayscale(100%)
                sepia(100%)
                saturate(520%)
                hue-rotate(15deg)
                brightness(0.95)
                contrast(1.45);
    }
}


@keyframes sab-radioactive-glow {
    0%, 100% {
        filter: grayscale(100%) sepia(100%) saturate(420%)
                hue-rotate(45deg) brightness(0.9) contrast(1.45);
    }
    50% {
        filter: grayscale(100%) sepia(100%) saturate(450%)
                hue-rotate(45deg) brightness(0.95) contrast(1.55);
    }
}
