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

body {
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    color: #fff;
    user-select: none;
}

#scene-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.control-panel {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(20, 40, 60, 0.8));
    border: 2px solid rgba(0, 255, 255, 0.4);
    border-radius: 15px;
    padding: 20px;
    min-width: 280px;
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    pointer-events: auto;
    opacity: 1;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3), inset 0 0 20px rgba(0, 255, 255, 0.05);
}

.control-panel h3 {
    color: #00ffff;
    margin-bottom: 15px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    letter-spacing: 2px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    color: #ccffff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

.value-display {
    color: #00ff88;
    font-weight: bold;
    margin-left: 10px;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
}

.control-group select,
.control-group input[type="range"],
.control-group input[type="color"] {
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(0, 50, 80, 0.4));
    border: 1px solid rgba(0, 255, 255, 0.5);
    border-radius: 8px;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.control-group select {
    font-size: 12px;
    cursor: pointer;
}

.control-group select option {
    background: #001122;
    color: #fff;
}

input[type="range"] {
    -webkit-appearance: none;
    height: 8px;
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.2), rgba(0, 255, 255, 0.6));
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="range"]:hover {
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #00ffff, #0080ff);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 255, 255, 1), 0 0 5px rgba(0, 255, 255, 0.5);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(0, 255, 255, 1), 0 0 10px rgba(0, 255, 255, 0.8);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #00ffff, #0080ff);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 15px rgba(0, 255, 255, 1);
}

.button-group {
    margin-top: 20px;
}

.button-group button {
    width: 100%;
    margin-bottom: 12px;
    padding: 12px;
    background: linear-gradient(45deg, #00ffff, #0080ff, #8000ff);
    background-size: 300% 300%;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.1);
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.button-group button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8), inset 0 0 15px rgba(255, 255, 255, 0.2);
    animation-duration: 1s;
}

.button-group button:active {
    transform: translateY(-1px);
}

#mega-burst-btn {
    background: linear-gradient(45deg, #ff0080, #ff8000, #ffff00);
    font-size: 14px;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

#mega-burst-btn:hover {
    box-shadow: 0 0 40px rgba(255, 0, 128, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.3);
}

.info-panel {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.7));
    border: 2px solid rgba(0, 255, 136, 0.4);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(15px);
    pointer-events: none;
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.3);
}

.spore-counter {
    color: #00ff88;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
    letter-spacing: 1px;
}

.spore-rate {
    color: #ffaa00;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 0 0 8px rgba(255, 170, 0, 0.6);
}

#mushroom-info {
    color: #ffaa00;
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 600;
    text-shadow: 0 0 5px rgba(255, 170, 0, 0.5);
}

.real-size-info {
    color: #aaaaff;
    font-size: 11px;
    margin-bottom: 8px;
    font-style: italic;
    opacity: 0.8;
}

.science-fact {
    color: #aa88ff;
    font-size: 12px;
    font-style: italic;
    line-height: 1.4;
    opacity: 0.9;
    text-shadow: 0 0 5px rgba(170, 136, 255, 0.4);
    animation: factGlow 3s ease-in-out infinite;
}

@keyframes factGlow {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; text-shadow: 0 0 10px rgba(170, 136, 255, 0.6); }
}

.paint-mode {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, rgba(80, 0, 80, 0.9), rgba(40, 0, 60, 0.8));
    border: 2px solid rgba(255, 0, 255, 0.4);
    border-radius: 12px;
    padding: 15px;
    backdrop-filter: blur(10px);
    pointer-events: auto;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
}

.paint-mode button,
.paint-mode input {
    margin: 5px 0;
    padding: 8px 12px;
    background: linear-gradient(45deg, #ff00ff, #8000ff);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.paint-mode input[type="color"] {
    width: 50px;
    height: 35px;
    padding: 0;
    border-radius: 8px;
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
    .control-panel {
        top: 10px;
        left: 10px;
        right: 10px;
        min-width: auto;
        padding: 15px;
        font-size: 12px;
    }

    .control-panel h3 {
        font-size: 16px;
    }

    .spore-counter {
        font-size: 14px;
    }

    .info-panel {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 15px;
    }

    .paint-mode {
        top: auto;
        bottom: 120px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .control-panel {
        padding: 12px;
    }

    .control-group {
        margin-bottom: 12px;
    }

    .control-group label {
        font-size: 11px;
    }

    .button-group button {
        padding: 10px;
        font-size: 11px;
    }

    .spore-counter {
        font-size: 12px;
    }
}

/* Enhanced glowing effects */
@keyframes hyperGlow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), 0 0 40px rgba(0, 255, 255, 0.1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.6), 0 0 60px rgba(0, 255, 255, 0.2), 0 0 80px rgba(0, 255, 255, 0.1);
    }
}

.control-panel {
    animation: hyperGlow 6s ease-in-out infinite;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, rgba(0, 255, 255, 0.6), rgba(0, 128, 255, 0.6));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, rgba(0, 255, 255, 0.8), rgba(0, 128, 255, 0.8));
}

/* Cursor effects for paint mode */
body.paint-mode {
    cursor: crosshair;
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1s ease-in-out infinite;
}

/* Special effects for mega burst button */
#mega-burst-btn::after {
    content: '💥';
    margin-left: 8px;
    font-size: 16px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Enhanced tooltips */
[title] {
    position: relative;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(0, 255, 255, 0.5);
    border-radius: 6px;
    padding: 8px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}