/* SpaceClicker Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background stars animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 4s infinite;
    z-index: -1;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.game-container {
    display: grid;
    grid-template-areas: 
        "header header header"
        "main main sidebar";
    grid-template-columns: 1fr 1fr 300px;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.game-header {
    grid-area: header;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    font-size: 1.2rem;
}

.stat {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-label {
    opacity: 0.8;
    margin-right: 5px;
}

/* Main game area */
.game-main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.clicking-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.planet-container {
    position: relative;
}

.planet {
    font-size: 8rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 50%;
    padding: 20px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.planet:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.planet:active {
    transform: scale(0.95);
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.5);
}

.click-display {
    position: relative;
    height: 100px;
    width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.click-indicator {
    position: absolute;
    font-size: 1.5rem;
    font-weight: bold;
    opacity: 0;
    transform: translateY(0) scale(1);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
}

.click-indicator.critical {
    color: #ff6b6b;
    text-shadow: 0 0 15px rgba(255, 107, 107, 0.8);
    font-size: 2rem;
    animation: criticalPulse 0.3s ease-out;
}

.click-indicator.show {
    opacity: 1;
    transform: translateY(-60px) scale(1.2);
}

.click-indicator.fade-out {
    opacity: 0;
    transform: translateY(-80px) scale(0.8);
    transition: all 0.3s ease-in;
}

@keyframes criticalPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

#click-value {
    display: none; /* Hide the old single click display */
}

/* Upgrades section */
.upgrades-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.upgrades-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.upgrade-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.upgrade-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

.upgrade-icon {
    font-size: 2.5rem;
    min-width: 60px;
    text-align: center;
}

.upgrade-info {
    flex: 1;
}

.upgrade-info h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: #00ff88;
}

.upgrade-info p {
    opacity: 0.8;
    margin-bottom: 10px;
}

.upgrade-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.owned {
    font-size: 0.9rem;
    opacity: 0.7;
}

.buy-button {
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 120px;
}

.buy-button:hover {
    background: linear-gradient(45deg, #00cc6a, #00aa55);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.buy-button:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Sidebar */
.game-sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.achievements {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
}

.achievements h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #ffaa00;
}

.achievement {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    border-left: 4px solid #ffaa00;
}

.achievement.unlocked {
    background: rgba(255, 170, 0, 0.2);
    border-left-color: #ffaa00;
}

.achievement h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.achievement p {
    font-size: 0.8rem;
    opacity: 0.7;
}

.game-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-controls button {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.game-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Click animation */
@keyframes clickPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.planet.clicked {
    animation: clickPulse 0.2s ease;
}

/* Special effects for high-tier upgrades */
.upgrade-item.multiplier {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
}

.upgrade-item.synergy {
    background: rgba(138, 43, 226, 0.1);
    border: 1px solid rgba(138, 43, 226, 0.3);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.2);
}

.upgrade-item.click-upgrade {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.multiplier-value {
    color: #ffa500;
    font-weight: bold;
}

.synergy-value {
    color: #8a2be2;
    font-weight: bold;
}

.click-value {
    color: #00ffff;
    font-weight: bold;
}

/* Section headers */
.upgrades-section h2 {
    text-align: center;
    font-size: 1.8rem;
    margin: 30px 0 20px 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

.upgrades-section h2:first-of-type {
    margin-top: 0;
}

/* Upgrade type animations */
.upgrade-item.multiplier:hover {
    box-shadow: 0 10px 30px rgba(255, 165, 0, 0.2);
}

.upgrade-item.synergy:hover {
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.3);
}

.upgrade-item.click-upgrade:hover {
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.2);
}

/* Responsive design */
@media (max-width: 1024px) {
    .game-container {
        grid-template-areas: 
            "header"
            "main"
            "sidebar";
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .planet {
        font-size: 6rem;
    }
}

@media (max-width: 768px) {
    .upgrades-container {
        grid-template-columns: 1fr;
    }
    
    .upgrade-stats {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .planet {
        font-size: 4rem;
    }
}
