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

body {
    font-family: 'Exo 2', sans-serif;
    background: linear-gradient(135deg, #0c0c1e 0%, #1a1a2e 50%, #16213e 100%);
    color: #fff;
    overflow: hidden;
    height: 100vh;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* HUD Styles */
#gameHUD {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(26,26,46,0.9) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 2px solid #00d4ff;
    box-shadow: 0 2px 20px rgba(0,212,255,0.3);
}

.hud-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hud-section h1 {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0,212,255,0.5);
    font-size: 1.8rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    border-radius: 25px;
    border: 1px solid rgba(0,212,255,0.3);
    font-weight: 600;
    transition: all 0.3s ease;
}

.stat:hover {
    background: rgba(0,212,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,212,255,0.3);
}

.stat i {
    color: #00d4ff;
}

/* Progress Bar */
#progressBar {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    height: 10px;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

#progressFill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff 0%, #00ff88 100%);
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(0,212,255,0.5);
}

#progressText {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* Canvas */
#gameCanvas {
    position: absolute;
    top: 90px;
    left: 0;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0c0c1e 100%);
    cursor: none;
}

/* Side Panels */
.panel {
    position: absolute;
    width: 250px;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#instructions {
    top: 120px;
    left: 20px;
}

#achievements {
    top: 120px;
    right: 20px;
}

.panel h3 {
    font-family: 'Orbitron', monospace;
    color: #00d4ff;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 0 0 5px rgba(0,212,255,0.5);
}

.panel ul {
    list-style: none;
}

.panel li {
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.panel i {
    color: #00d4ff;
    width: 20px;
}

/* Buttons */
.btn-primary, .btn-success {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,212,255,0.3);
}

.btn-success {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    box-shadow: 0 4px 15px rgba(0,255,136,0.3);
}

.btn-primary:hover, .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,212,255,0.4);
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: rgba(0,0,0,0.95);
    color: white;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #00d4ff;
    max-width: 300px;
    z-index: 2000;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tooltip.show {
    opacity: 1;
}

.tooltip h4 {
    color: #00d4ff;
    margin-bottom: 8px;
    font-family: 'Orbitron', monospace;
}

.tooltip .price {
    color: #00ff88;
    font-weight: bold;
    font-size: 16px;
    margin-top: 8px;
}

.tooltip .category {
    display: inline-block;
    background: rgba(0,212,255,0.2);
    color: #00d4ff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-top: 5px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    margin: 2% auto;
    padding: 0;
    border: 2px solid #00d4ff;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0,212,255,0.3);
    background: rgba(0,0,0,0.3);
}

.modal-header h2 {
    color: #00d4ff;
    font-family: 'Orbitron', monospace;
    text-shadow: 0 0 10px rgba(0,212,255,0.5);
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #00d4ff;
}

.modal-body {
    padding: 20px;
}

#finalStats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-item {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(0,212,255,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(0,212,255,0.1);
    transform: translateY(-2px);
}

.stat-item i {
    color: #00d4ff;
    font-size: 20px;
}

.stat-item.total-cost {
    border: 2px solid #00ff88;
    background: rgba(0,255,136,0.1);
}

.stat-item.total-cost i {
    color: #00ff88;
}

#selectedComponents {
    margin: 30px 0;
}

#selectedComponents h3 {
    color: #00d4ff;
    font-family: 'Orbitron', monospace;
    margin-bottom: 15px;
}

#componentsList {
    display: grid;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.component-item {
    background: rgba(255,255,255,0.05);
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.component-info span {
    display: block;
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
}

.component-price {
    color: #00ff88;
    font-weight: bold;
}

/* Form Styles */
form {
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(0,212,255,0.3);
}

form h3 {
    color: #00d4ff;
    font-family: 'Orbitron', monospace;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #00d4ff;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00d4ff;
    background: rgba(0,212,255,0.1);
    box-shadow: 0 0 10px rgba(0,212,255,0.3);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #aaa;
}

/* Achievements */
#achievementsList {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.achievement {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.achievement.unlocked {
    background: rgba(0,255,136,0.2);
    border: 1px solid #00ff88;
}

.achievement i {
    font-size: 18px;
}

.achievement.unlocked i {
    color: #00ff88;
}

.achievement-text {
    flex: 1;
    font-size: 12px;
}

/* Particles */
#particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.particle {
    position: absolute;
    background: #00d4ff;
    border-radius: 50%;
    pointer-events: none;
    animation: particle-float 3s linear infinite;
}

@keyframes particle-float {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(-100px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #gameHUD {
        height: 100px;
        flex-direction: column;
        padding: 10px;
        gap: 10px;
    }
    
    .hud-section {
        gap: 10px;
    }
    
    .hud-section h1 {
        font-size: 1.4rem;
    }
    
    .panel {
        width: 200px;
        padding: 15px;
    }
    
    #gameCanvas {
        top: 120px;
    }
    
    #progressBar {
        top: 110px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    #finalStats {
        grid-template-columns: 1fr;
    }
}

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

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0099cc, #00d4ff);
}

/* Loading Animation */
@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

.loading {
    animation: pulse 2s infinite;
}

/* Success Animation */
@keyframes success {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(0,255,136,0.5);
    }
    100% {
        transform: scale(1);
    }
}

.success-animation {
    animation: success 0.6s ease;
}
