:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --accent-primary: #ff6b6b;
    --accent-secondary: #ff9e6b;
    --accent-success: #4caf50;
    --accent-warning: #ffeb3b;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-radius: 12px;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --transition: all 0.3s ease;
}

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

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

/* Main container */
#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Main game area - fullscreen */
#game-main {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* World Map */
#world-map {
    position: relative;
    width: 100%;
    height: 100%;
}

#map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Map loading overlay */
#map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
    font-size: 1.2rem;
    opacity: 0.7;
    z-index: 10;
    pointer-events: none;
}

/* Dark overlay for map to make UI pop */
#map-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 5;
    pointer-events: none;
}

/* Header - full width top */
#game-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: linear-gradient(to right, var(--bg-tertiary), var(--bg-secondary));
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    z-index: 20;
}

#disease-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#disease-info h1 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#disease-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-primary);
}

#dna-points {
    font-size: 0.95rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 5px;
}

#game-stats {
    display: flex;
    gap: 25px;
    font-size: 0.9rem;
}

#game-stats div {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

#game-stats div i {
    color: var(--accent-primary);
    font-size: 1.1rem;
}

/* Sidebar - right side */
#game-sidebar {
    position: absolute;
    top: 80px; /* header height */
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 320px;
    background: linear-gradient(to bottom, var(--bg-tertiary), var(--bg-secondary));
    border-left: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    z-index: 20;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
    background-color: var(--bg-tertiary);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
    transform: translateX(-50%);
}

.tab-btn.active {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.tab-btn.active::after {
    width: 100%;
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.tab-content {
    padding: 20px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.tech-tree {
    margin-top: 20px;
}

.trait {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trait:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.trait.locked {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.trait.unlocked {
    border-color: var(--accent-success);
    background: rgba(76, 175, 80, 0.1);
}

.trait.cost {
    font-size: 0.9rem;
    color: var(--accent-warning);
    font-weight: 600;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-item {
    background: var(--glass-bg);
    padding: 12px;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
}

.stat-item i {
    font-size: 1.4rem;
    margin-bottom: 8px;
    display: block;
    color: var(--accent-primary);
}

.stat-item span:first-child {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: block;
}

.stat-item span:last-child {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-top: 4px;
}

/* News Ticker - bottom overlay */
#news-ticker {
    position: absolute;
    bottom: 80px; /* above controls */
    left: 0;
    right: 0;
    background: linear-gradient(to right, var(--bg-tertiary), transparent);
    border-top: 1px solid var(--glass-border);
    padding: 12px 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(5px);
    z-index: 20;
}

#news-text {
    color: var(--accent-success);
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    animation: ticker 20s linear infinite;
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Game Controls - bottom center */
#game-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    z-index: 30;
}

#game-controls button {
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

#game-controls button i {
    font-size: 1.1rem;
}

#game-controls button:hover {
    background: var(--glass-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

#game-controls button:active {
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    #game-sidebar {
        width: 280px;
        max-width: 280px;
    }

    .sidebar-header h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    /* Mobile layout - stack */
    #game-header {
        height: 60px;
    }
    #game-sidebar {
        top: 60px;
        width: 100%;
        max-width: none;
        height: 40vh;
        border-left: none;
        border-top: 1px solid var(--glass-border);
    }
    #news-ticker {
        bottom: 60px; /* adjust for mobile */
    }
    #game-controls {
        bottom: 10px;
        width: 90%;
        max-width: 400px;
    }
}