:root {
    --bg-color: #1a1515;
    --panel-bg: #292120;
    --mc-red: #da291c;
    --mc-yellow: #ffc72c;
    --text-primary: #ffffff;
    --text-secondary: #c2bdbd;
    --accent-glow: rgba(255, 199, 44, 0.5);
    --border-radius: 16px;
    --font-heading: 'Rowdies', cursive;
    --font-body: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    background: radial-gradient(circle at center, #351513 0%, #1a1515 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

.game-container {
    display: flex;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

.click-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
    position: relative;
    z-index: 5;
    overflow-y: auto;
}

.bounce-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.bounce-title .highlight {
    color: var(--mc-yellow);
}

.stats-board {
    background: linear-gradient(145deg, var(--mc-red), #b5150a);
    padding: 1.5rem 4rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 15px 40px rgba(218, 41, 28, 0.4), inset 0 2px 5px rgba(255, 255, 255, 0.3);
    margin-bottom: 2rem;
    border: 3px solid rgba(255, 199, 44, 0.3);
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stats-board:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(218, 41, 28, 0.5), inset 0 2px 5px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 199, 44, 0.6);
}

.wrap-count {
    font-family: var(--font-heading);
    font-size: 5rem;
    line-height: 1;
    color: var(--mc-yellow);
    text-shadow: 0 4px 15px rgba(255, 199, 44, 0.6), 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5rem;
}

.wrap-label {
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.95);
}

.wps-badge {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 600;
    display: inline-block;
    color: var(--mc-yellow);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.wrap-button-container {
    perspective: 1000px;
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    z-index: 0;
    filter: blur(20px);
    transition: width 0.3s, height 0.3s, opacity 0.3s;
    opacity: 0.8;
}

.wrap-button-container:hover .glow-effect {
    width: 220px;
    height: 220px;
    opacity: 1;
}

.wrap-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    z-index: 10;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

.wrap-btn:active {
    transform: scale(0.9);
}

.wrap-emoji {
    font-size: 10rem;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.6));
    transition: filter 0.3s, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    line-height: 1;
}

.wrap-button-container:hover .wrap-emoji {
    filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.8));
    transform: translateY(-10px) rotate(5deg) scale(1.05);
}

.flavor-text {
    margin-top: 2rem;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-secondary);
    opacity: 0.8;
    text-align: center;
    max-width: 80%;
}

/* Store Section */
.store-section {
    width: 480px;
    background-color: var(--panel-bg);
    border-left: 2px solid rgba(255, 199, 44, 0.1);
    display: flex;
    flex-direction: column;
    box-shadow: -15px 0 40px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.store-header {
    padding: 2.5rem 2rem 1.5rem;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 2px solid rgba(255, 199, 44, 0.2);
    text-align: center;
}

.store-header h2 {
    font-family: var(--font-heading);
    color: var(--mc-yellow);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.store-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.store-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Custom Scrollbar */
.store-items::-webkit-scrollbar {
    width: 10px;
}

.store-items::-webkit-scrollbar-track {
    background: var(--panel-bg);
}

.store-items::-webkit-scrollbar-thumb {
    background: rgba(255, 199, 44, 0.3);
    border-radius: 5px;
}

.store-items::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 199, 44, 0.5);
}

.click-section::-webkit-scrollbar {
    width: 6px;
}

.click-section::-webkit-scrollbar-track {
    background: transparent;
}

.click-section::-webkit-scrollbar-thumb {
    background: rgba(255, 199, 44, 0.2);
    border-radius: 3px;
}

.click-section::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 199, 44, 0.4);
}

/* Upgrades Section */
.upgrades-container {
    display: flex;
    flex-wrap: wrap;
    padding: 1rem 1.5rem 0.5rem;
    gap: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.upgrade-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex: 1;
    min-width: 80px;
    text-align: center;
}

.upgrade-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

.upgrade-item:not(.disabled):hover {
    background: rgba(218, 41, 28, 0.15);
    border-color: rgba(255, 199, 44, 0.5);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

.upgrade-item:not(.disabled):active {
    transform: translateY(0) scale(0.98);
}

.upgrade-icon {
    font-size: 2rem;
    margin-bottom: 0.2rem;
}

.upgrade-details {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upgrade-name {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.upgrade-cost {
    font-size: 0.85rem;
    color: var(--mc-yellow);
    font-weight: 800;
    display: flex;
    align-items: center;
}

.upgrade-cost .cost-icon {
    font-size: 0.8rem;
    margin-right: 0.2rem;
}

.store-item {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    padding: 1.2rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.store-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--mc-yellow);
    opacity: 0;
    transition: opacity 0.2s;
}

.store-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

.store-item.disabled::before {
    display: none;
}

.store-item:not(.disabled):hover {
    background: rgba(218, 41, 28, 0.15);
    border-color: rgba(255, 199, 44, 0.5);
    transform: translateX(-5px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.store-item:not(.disabled):hover::before {
    opacity: 1;
}

.store-item:not(.disabled):active {
    transform: translateX(-2px) scale(0.98);
}

.item-icon {
    font-size: 2.8rem;
    margin-right: 1.5rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
}

.store-item:not(.disabled):hover .item-icon {
    transform: rotate(10deg) scale(1.1);
}

.item-details {
    flex: 1;
}

.item-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.item-cost {
    display: flex;
    align-items: center;
    color: var(--mc-yellow);
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.item-cost .cost-icon {
    font-size: 1.1rem;
    margin-right: 0.4rem;
}

.item-wps {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.item-count {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.05);
    margin-left: 1.5rem;
    min-width: 40px;
    text-align: right;
    transition: color 0.3s;
}

.store-item:not(.disabled) .item-count {
    color: rgba(255, 199, 44, 0.4);
}

/* Actions */
.actions {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.danger-btn {
    background: transparent;
    border: 1px solid rgba(218, 41, 12, 0.5);
    color: rgba(218, 41, 12, 0.8);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
}

.danger-btn:hover {
    background: rgba(218, 41, 12, 0.2);
    color: var(--mc-red);
    border-color: var(--mc-red);
}

/* Floating Particles */
.particle {
    position: fixed;
    /* so it can float over everything based on clientX/Y */
    color: var(--mc-yellow);
    font-weight: 800;
    font-size: 1.8rem;
    pointer-events: none;
    animation: floatUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    z-index: 1000;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    font-family: var(--font-heading);
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translateY(-120px) scale(1.5) rotate(15deg);
    }
}

/* Pulse animation for affordable buildings */
@keyframes subtle-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 199, 44, 0.2);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 199, 44, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 199, 44, 0);
    }
}

.store-item.affordable, .upgrade-item.affordable {
    animation: subtle-pulse 2s infinite;
}

@media (max-width: 900px) {
    .game-container {
        flex-direction: column;
    }

    .store-section {
        width: 100%;
        height: 50vh;
        border-left: none;
        border-top: 2px solid rgba(255, 199, 44, 0.1);
    }

    .click-section {
        height: 50vh;
    }
}