:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #f1c40f;
    --dark-color: #2c3e50;
    --darker-color: #1a252f;
    --light-color: #ecf0f1;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
}

.spacebar-clicker-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 25px;
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--darker-color) 100%);
    border-radius: 15px;
    color: var(--light-color);
    font-family: 'Arial', sans-serif;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.spacebar-clicker-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.1) 0%, transparent 70%);
    animation: pulse 15s infinite linear;
    z-index: 0;
}

@keyframes pulse {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spacebar-header {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.spacebar-header h2 {
    margin: 0;
    color: var(--accent-color);
    font-size: 32px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.spacebar-subtitle {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 5px;
}

.counter-display-container {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.counter-display {
    font-size: 64px;
    font-weight: bold;
    color: var(--secondary-color);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-family: 'Courier New', monospace;
    line-height: 1;
    transition: transform 0.1s;
}

.counter-display.animate {
    transform: scale(1.05);
}

.cps-display {
    font-size: 18px;
    margin-top: 10px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

#cps-counter {
    font-weight: bold;
    color: var(--accent-color);
}

.spacebar-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2980b9 100%);
    padding: 20px;
    border-radius: 12px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    margin: 25px 0;
    transition: all 0.2s;
    user-select: none;
    position: relative;
    z-index: 1;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: none;
    color: white;
    overflow: hidden;
}

.spacebar-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
}

.spacebar-button:active {
    transform: translateY(1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.spacebar-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.spacebar-button:hover::after {
    opacity: 1;
}

.spacebar-key {
    font-size: 24px;
    margin-bottom: 5px;
}

.spacebar-label {
    font-size: 18px;
}

.click-effects-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.click-effect {
    position: absolute;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 24px;
    animation: floatUp 1s forwards;
    opacity: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes floatUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px);
        opacity: 0;
    }
}

.upgrades-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.upgrade-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 180px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.upgrade-item:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.upgrade-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    z-index: 0;
}

.upgrade-icon {
    font-size: 30px;
    color: var(--accent-color);
    margin-bottom: 10px;
    z-index: 1;
    transition: transform 0.3s;
}

.upgrade-item:hover .upgrade-icon {
    transform: scale(1.2);
}

.upgrade-info {
    width: 100%;
    z-index: 1;
}

.upgrade-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--light-color);
    text-transform: uppercase;
}

.upgrade-description {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 10px;
    min-height: 36px;
    color: var(--primary-color);
}

.upgrade-price {
    font-size: 14px;
    opacity: 0.8;
}

.upgrade-cost {
    color: var(--secondary-color);
    font-weight: bold;
}

.upgrade-count {
    font-weight: bold;
    font-size: 24px;
    margin-top: 10px;
    color: var(--accent-color);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: transform 0.3s;
}

.upgrade-item:hover .upgrade-count {
    transform: scale(1.1);
}

/* Responsive styles */
@media (max-width: 768px) {
    .spacebar-clicker-container {
        padding: 15px;
    }
    
    .upgrades-container {
        grid-template-columns: 1fr;
    }
    
    .counter-display {
        font-size: 48px;
    }
}

@media (max-width: 480px) {
    .spacebar-header h2 {
        font-size: 24px;
    }
    
    .counter-display {
        font-size: 36px;
    }
    
    .spacebar-button {
        padding: 15px;
    }
}