* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial Black', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

#backgroundCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: fixed;
    pointer-events: none;
    z-index: 2;
    font-size: 2rem;
    animation: floatUp 1.5s ease-out forwards;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0.5);
    }
}


.gallery-switch {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    justify-content: flex-end;
}

.gallery-switch.main-open {
    justify-content: flex-start;
}

.gallery-info {
    color: #ffeb3b;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    text-align: right;
}

.gallery-tab {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 2px solid rgba(255, 235, 59, 0.5);
    color: #ffeb3b;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.gallery-tab.active {
    background: linear-gradient(135deg, #ff006e 0%, #ff4d00 100%);
    border-color: #ffeb3b;
    box-shadow: 0 6px 20px rgba(255, 0, 110, 0.25);
}

.gallery-tab:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.gallery-locked {
    background: rgba(0, 0, 0, 0.4);
    border: 2px dashed #ffeb3b;
    border-radius: 14px;
    color: #fff;
    padding: 1.5rem;
    text-align: center;
    font-weight: bold;
}

.stock-tag {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    background: rgba(255, 235, 59, 0.15);
    color: #ffeb3b;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 235, 59, 0.35);
}

@media (max-width: 900px) {
    .main-container {
        gap: 1rem;
    }

    .left-spacer {
        flex: 0.5;
    }

    .brawlers-gallery {
        max-width: 280px;
    }
}

@media (max-width: 600px) {
    .main-container {
        flex-direction: column;
        height: auto;
    }

    .left-spacer {
        display: none;
    }

    .trophy {
        width: 150px;
        height: 150px;
    }

    .brawlers-gallery {
        max-width: 100%;
    }
}

.main-container {
    display: flex;
    gap: 2rem;
    max-width: 100%;
    margin: 0 auto;
    height: 100vh;
    align-items: center;
    position: relative;
    z-index: 1;
}

.left-spacer {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 2rem;
}

.inventory-btn {
    background: linear-gradient(135deg, #ff006e 0%, #ff4d00 100%);
    color: white;
    border: 3px solid #ffeb3b;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 110, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.inventory-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(255, 0, 110, 0.6);
}

.inventory-btn:active {
    transform: scale(0.95);
}

.center-section {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    min-width: 300px;
}

.click-counter {
    background: linear-gradient(135deg, #ff006e 0%, #ff4d00 100%);
    color: #ffeb3b;
    padding: 1.5rem;
    border-radius: 15px;
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    min-width: 200px;
    border: 4px solid #ffeb3b;
    box-shadow: 0 0 30px rgba(255, 0, 110, 0.5), inset 0 0 20px rgba(255, 235, 59, 0.2);
    text-transform: uppercase;
    letter-spacing: 2px;
}

#clickCount {
    font-size: 2.2rem;
    display: inline-block;
    min-width: 60px;
    color: #ffeb3b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.stats-display {
    display: flex;
    gap: 1rem;
    margin-top: 0.8rem;
    font-size: 0.9rem;
    justify-content: center;
}

.stat-item {
    background: rgba(0, 212, 255, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #00d4ff;
    color: #00d4ff;
}

.trophy-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.trophy {
    cursor: pointer;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: all 0.2s ease;
    width: 200px;
    height: 200px;
}

.trophy:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3)) brightness(1.1);
}

.trophy:active {
    transform: scale(0.95);
}

.equipped-section {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.3) 0%, rgba(255, 77, 0, 0.3) 100%);
    border: 3px solid #ff006e;
    border-radius: 15px;
    padding: 1rem;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.4);
}

.equipped-section h3 {
    color: #ffeb3b;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.equipped-container {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.equipped-slot {
    background: linear-gradient(135deg, rgba(51, 51, 86, 0.6) 0%, rgba(102, 51, 153, 0.4) 100%);
    border: 3px solid #00d4ff;
    border-radius: 12px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    color: #ffeb3b;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.equipped-slot:hover {
    border-color: #ffeb3b;
    background: linear-gradient(135deg, rgba(102, 51, 153, 0.8) 0%, rgba(51, 51, 86, 0.8) 100%);
    box-shadow: 0 0 20px rgba(255, 235, 59, 0.5);
    transform: scale(1.05);
}

.equipped-slot img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: contain;
}

.equipped-slot .dequip-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ff006e 0%, #ff4d00 100%);
    color: white;
    border: 2px solid #ffeb3b;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
    display: none;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 0, 110, 0.5);
}

.equipped-slot:hover .dequip-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(1.1);
}

.right-section {
    flex: 0 0 400px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 2rem;
}

.brawlers-gallery {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 400px;
    overflow-y: auto;
    padding: 1rem;
    max-height: 90vh;
}

.brawler-item {
    background: linear-gradient(135deg, rgba(51, 51, 86, 0.7) 0%, rgba(102, 51, 153, 0.5) 100%);
    border: 3px solid #00d4ff;
    border-radius: 12px;
    padding: 0.8rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.brawler-item:hover {
    background: linear-gradient(135deg, rgba(102, 51, 153, 0.9) 0%, rgba(51, 51, 86, 0.9) 100%);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.5);
    border-color: #ffeb3b;
}

.brawler-info-left {
    flex: 0 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.price {
    font-size: 0.9rem;
    font-weight: bold;
    color: #ffeb3b;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.brawler-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    flex: 0 0 auto;
    object-fit: contain;
}

.brawler-info-right {
    flex: 1;
    text-align: left;
}

.brawler-name {
    font-size: 0.85rem;
    font-weight: bold;
    color: #fff;
    margin: 0 0 0.3rem 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.boost {
    font-size: 0.75rem;
    color: #00d4ff;
    margin: 0.2rem 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Brawler ALREADY BOUGHT State */
.brawler-item.already-bought {
    background: linear-gradient(135deg, rgba(80, 50, 80, 0.8) 0%, rgba(60, 40, 80, 0.8) 100%);
    opacity: 0.8;
    border-color: #888;
}

.brawler-item.already-bought .price::after {
    content: " BOUGHT";
    display: block;
    font-size: 0.65rem;
    color: #00d4ff;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Inventory Modal */
.inventory-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem;
}

.inventory-modal.active {
    display: flex;
}

.inventory-panel {
    background: linear-gradient(135deg, rgba(51, 51, 86, 0.95) 0%, rgba(102, 51, 153, 0.95) 100%);
    border: 4px solid #ff006e;
    border-radius: 15px;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(255, 0, 110, 0.4);
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.inventory-header h2 {
    color: #ffeb3b;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #ffeb3b;
    transition: all 0.3s ease;
}

.close-btn:hover {
    transform: scale(1.2);
    color: #ff006e;
}

.inventory-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inventory-item {
    background: linear-gradient(135deg, rgba(51, 51, 86, 0.7) 0%, rgba(102, 51, 153, 0.5) 100%);
    border: 2px solid #00d4ff;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.inventory-item:hover {
    background: linear-gradient(135deg, rgba(102, 51, 153, 0.8) 0%, rgba(51, 51, 86, 0.8) 100%);
    border-color: #ffeb3b;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.inventory-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.inventory-item img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: contain;
}

.inventory-item-info {
    flex: 1;
}

.inventory-item-name {
    font-weight: bold;
    color: #fff;
    margin-bottom: 0.3rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.inventory-item-action {
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    color: #333;
    border: 2px solid #ffeb3b;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.inventory-item-action:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.5);
}

.inventory-item-action.dequip {
    background: linear-gradient(135deg, #ff006e 0%, #ff4d00 100%);
    color: white;
    border-color: #ffeb3b;
}

/* Confirmation Modal */
.confirmation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.confirmation-modal.active {
    display: flex;
}

.confirmation-popup {
    background: linear-gradient(135deg, rgba(51, 51, 86, 0.95) 0%, rgba(102, 51, 153, 0.95) 100%);
    border: 4px solid #ff006e;
    border-radius: 15px;
    padding: 2rem;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(255, 0, 110, 0.4);
}

.confirmation-popup h3 {
    color: #fff;
    margin-bottom: 1.5rem;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.confirmation-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-confirm, .btn-cancel {
    padding: 0.8rem 2rem;
    border: 2px solid #ffeb3b;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-confirm {
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    color: #333;
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #00ffff 0%, #00bbff 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.5);
}

.btn-cancel {
    background: linear-gradient(135deg, #ff006e 0%, #ff4d00 100%);
    color: white;
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #ff1a7f 0%, #ff6600 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 0, 110, 0.5);
}

/* Scrollbar-Styling */
.brawlers-gallery::-webkit-scrollbar {
    width: 8px;
}

.brawlers-gallery::-webkit-scrollbar-track {
    background: rgba(51, 51, 86, 0.5);
    border-radius: 10px;
}

.brawlers-gallery::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff006e 0%, #ff4d00 100%);
    border-radius: 10px;
    border: 2px solid #ffeb3b;
}

.brawlers-gallery::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff1a7f 0%, #ff6600 100%);
}

@media (max-width: 900px) {
    .main-container {
        gap: 1rem;
    }

    .left-spacer {
        flex: 0.5;
    }

    .brawlers-gallery {
        max-width: 280px;
    }
}

@media (max-width: 600px) {
    .main-container {
        flex-direction: column;
        height: auto;
    }

    .left-spacer {
        display: none;
    }

    .trophy {
        width: 150px;
        height: 150px;
    }

    .brawlers-gallery {
        max-width: 100%;
    }
}