* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #0f0f2d, #1b1b4d);
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hub-header {
    text-align: center;
    padding: 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    animation: fadeIn 1.5s ease-in-out;
}

.hub-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #00ffea;
    text-shadow: 0px 0px 10px #00ffea;
}

.hub-nav {
    display: flex;
    gap: 10px;
    margin: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn {
    background: rgba(0, 255, 234, 0.2);
    border: 1px solid #00ffea;
    padding: 10px 20px;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: 0.3s;
    text-shadow: 0px 0px 5px #00ffea;
}

.tab-btn.active, .tab-btn:hover {
    background: #00ffea;
    color: #0f0f2d;
    box-shadow: 0 0 15px #00ffea;
}

.hub-content {
    width: 80%;
    max-width: 1000px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 50px;
    animation: fadeIn 1s ease-in-out;
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

textarea, input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: none;
    border-radius: 5px;
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: 0.3s;
}

textarea:focus, input:focus {
    box-shadow: 0 0 10px #00ffea;
}

button {
    background: #00ffea;
    border: none;
    padding: 10px 15px;
    margin-top: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: bold;
}

button:hover {
    background: #00ccba;
    box-shadow: 0 0 10px #00ffea;
}

.knowledge-list, .timeline, .ai-response, .sim-preview, .music-visualizer, .future-result {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    min-height: 80px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline {
    overflow-y: auto;
    max-height: 200px;
    border-left: 2px solid #00ffea;
    padding-left: 15px;
    position: relative;
}

.timeline::before {
    content: "";
    position: absolute;
    left: -3px;
    top: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(#00ffea, transparent);
    animation: glowScroll 3s linear infinite;
}

@keyframes glowScroll {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

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

/* Civilization Stats Panel */
.civ-stats {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 234, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.civ-stats h2 {
    color: #00ffea;
    text-shadow: 0 0 10px #00ffea;
}

.civ-stats .stats p {
    margin: 5px 0;
}

.progress-bar-container {
    margin-top: 10px;
}

.progress-bar {
    width: 100%;
    height: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 5px;
}

.progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ffea, #00ffaa);
    transition: width 0.5s;
}

/* AI Events */
.ai-events {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 234, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 150px;
    overflow-y: auto;
}

.ai-events h2 {
    color: #00ffea;
    text-shadow: 0 0 10px #00ffea;
}

.events-log div {
    margin: 5px 0;
    font-size: 14px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: -300px;
    background: rgba(0, 255, 234, 0.9);
    color: #0f0f2d;
    padding: 15px 20px;
    border-radius: 5px;
    font-weight: bold;
    transition: right 0.5s ease;
    box-shadow: 0 0 10px #00ffea;
    z-index: 999;
}

/* Civilization Map */
.civ-map {
    display: grid;
    grid-template-columns: repeat(10, 20px);
    grid-template-rows: repeat(10, 20px);
    gap: 2px;
    margin-top: 15px;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 234, 0.3);
}

.tile {
    width: 20px;
    height: 20px;
    background: #2d2d4d;
    border-radius: 2px;
    transition: background 0.3s, transform 0.2s;
}

.tile.nature {
    background: #00ff7f;
}

.tile.city {
    background: #00aaff;
}

.tile.tech {
    background: #ff00ff;
}

.tile.future {
    background: #ffff00;
}

.tile.pulse {
    transform: scale(1.3);
    box-shadow: 0 0 10px white;
    animation: pulseEffect 0.3s forwards;
}

@keyframes pulseEffect {
    100% {
        transform: scale(1);
        box-shadow: none;
    }
}

/* Music Controls */
.music-controls {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.music-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #00ffea;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
}

.music-btn:hover {
    background: #00ffea;
    color: #0f0f2d;
}

/* Tile Animations */
.tile.glow {
    animation: glowEffect 1s ease-in-out;
    box-shadow: 0 0 15px #00ffea;
}

.tile.disaster {
    animation: disasterShake 0.5s ease-in-out 3;
    background: #ff3333 !important;
}

.tile.future-pulse {
    animation: futurePulse 1.2s infinite alternate;
    box-shadow: 0 0 15px #ffff00;
}

@keyframes glowEffect {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes disasterShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
}

@keyframes futurePulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Era Themes */
body.stone {
    background: linear-gradient(135deg, #2d2d2d, #4d4d4d);
}

body.medieval {
    background: linear-gradient(135deg, #3d2f20, #6e4b27);
}

body.industrial {
    background: linear-gradient(135deg, #2a2a2a, #4f4f4f);
}

body.digital {
    background: linear-gradient(135deg, #0f0f2d, #1b1b4d);
}

body.galactic {
    background: linear-gradient(135deg, #000010, #0a0030);
    color: #00ffea;
}

body.galactic .hub-header h1 {
    text-shadow: 0px 0px 15px #00ffff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hub-content {
        width: 95%;
        padding: 15px;
    }
    
    .hub-header {
        padding: 20px;
    }
    
    .hub-header h1 {
        font-size: 2rem;
    }
    
    .hub-nav {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    
    .tab-btn {
        width: 200px;
        text-align: center;
    }
    
    .civ-map {
        grid-template-columns: repeat(8, 18px);
        grid-template-rows: repeat(8, 18px);
    }
    
    .tile {
        width: 18px;
        height: 18px;
    }
    
    .music-controls {
        flex-direction: column;
        gap: 5px;
    }
    
    .civ-stats, .ai-events {
        margin: 10px 0;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .hub-header h1 {
        font-size: 1.5rem;
    }
    
    .civ-map {
        grid-template-columns: repeat(6, 16px);
        grid-template-rows: repeat(6, 16px);
    }
    
    .tile {
        width: 16px;
        height: 16px;
    }
    
    .tab-btn {
        width: 180px;
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* Achievement Notifications */
.achievement-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 1001;
}

.achievement-notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.achievement-icon {
    font-size: 3rem;
    animation: bounce 1s ease infinite;
}

.achievement-content {
    color: #0f0f2d;
}

.achievement-title {
    font-size: 0.9rem;
    font-weight: bold;
    opacity: 0.8;
}

.achievement-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 5px 0;
}

.achievement-description {
    font-size: 0.9rem;
    opacity: 0.9;
}

.achievement-reward {
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 5px;
    color: #0f0f2d;
}

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

/* Sound Toggle Button Hover */
.sound-toggle:hover {
    background: #00ffea !important;
    color: #0f0f2d !important;
    box-shadow: 0 0 15px #00ffea;
}