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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 50%, #F0E68C 100%);
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(45deg, #4CAF50, #2196F3);
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.label {
    font-weight: bold;
    margin-right: 5px;
}

.game-board {
    padding: 30px;
}

.planet-section {
    text-align: center;
    margin-bottom: 30px;
}

.planet {
    font-size: 8em;
    margin-bottom: 15px;
    transition: all 0.5s ease;
    cursor: pointer;
}

.planet:hover {
    transform: scale(1.1);
}

.planet.healthy {
    filter: hue-rotate(0deg) brightness(1);
}

.planet.warning {
    filter: hue-rotate(30deg) brightness(0.9);
    animation: warning-pulse 2s infinite;
}

.planet.danger {
    filter: hue-rotate(60deg) brightness(0.8);
    animation: danger-shake 1s infinite;
}

.planet.critical {
    filter: hue-rotate(120deg) brightness(0.6);
    animation: critical-flash 0.5s infinite;
}

@keyframes warning-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes danger-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes critical-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.planet-status {
    font-size: 1.2em;
    font-weight: bold;
    padding: 10px;
    border-radius: 10px;
    margin: 0 auto;
    max-width: 300px;
    transition: all 0.3s ease;
}

.actions-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.action-btn {
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.action-btn.good {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    color: white;
}

.action-btn.good:hover {
    background: linear-gradient(45deg, #45a049, #7CB342);
}

.action-btn.bad {
    background: linear-gradient(45deg, #f44336, #FF5722);
    color: white;
}

.action-btn.bad:hover {
    background: linear-gradient(45deg, #da190b, #E64A19);
}

.events-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.events-section h3 {
    margin-bottom: 15px;
    color: #333;
}

#events-log {
    max-height: 200px;
    overflow-y: auto;
}

.event {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 4px solid;
    animation: slideIn 0.5s ease;
}

.event.good {
    background: #e8f5e8;
    border-color: #4CAF50;
    color: #2e7d32;
}

.event.bad {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.event.neutral {
    background: #e3f2fd;
    border-color: #2196F3;
    color: #1565c0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    z-index: 1000;
}

.game-over h2 {
    font-size: 3em;
    margin-bottom: 20px;
}

.game-over p {
    font-size: 1.5em;
    margin-bottom: 30px;
    max-width: 600px;
}

.game-over button {
    padding: 15px 30px;
    font-size: 1.3em;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.game-over button:hover {
    background: #45a049;
}

.difficulty-selector {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
}

.difficulty-btn {
    margin: 0 10px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.global-impact {
    margin-top: 15px;
}

.impact-bar {
    position: relative;
    width: 300px;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    margin: 0 auto;
    overflow: hidden;
}

.impact-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A, #CDDC39);
    width: 0%;
    transition: width 0.5s ease;
}

.impact-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #333;
    font-size: 0.9em;
}

.achievements-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.achievements-panel h3 {
    margin-bottom: 15px;
    color: #333;
}

#achievements-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.achievement {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.achievement.unlocked {
    background: #e8f5e8;
    border: 2px solid #4CAF50;
}

.achievement.locked {
    background: #f5f5f5;
    border: 2px solid #ccc;
    opacity: 0.6;
}

.achievement-emoji {
    font-size: 1.5em;
    margin-right: 10px;
}

.achievement-text strong {
    display: block;
    font-size: 0.9em;
}

.achievement-text small {
    display: block;
    font-size: 0.8em;
    color: #666;
}

.research-panel {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.research-panel h3 {
    margin-bottom: 15px;
    color: #1565c0;
}

.research-progress {
    font-weight: bold;
    margin-bottom: 15px;
    color: #1976d2;
}

#research-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.research-btn {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(45deg, #2196F3, #03A9F4);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.research-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.research-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.research-btn small {
    display: block;
    font-size: 0.8em;
    margin-top: 5px;
}

.seasonal-event {
    background: linear-gradient(45deg, #FF9800, #FFC107);
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.game-controls {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 20px;
}

.control-btn {
    margin: 0 10px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #607D8B;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #546E7A;
    transform: translateY(-2px);
}

.action-btn small {
    display: block;
    font-size: 0.8em;
    margin-top: 5px;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .stats {
        flex-direction: column;
        align-items: center;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .planet {
        font-size: 6em;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .impact-bar {
        width: 250px;
    }
    
    #achievements-list {
        grid-template-columns: 1fr;
    }
    
    #research-options {
        grid-template-columns: 1fr;
    }
}
