body {
    margin: 0;
    overflow: hidden;
    background-color: #0d1117;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#ui-layer {
    position: absolute;
    top: 10px;
    left: 10px;
    /* Flyttet til venstre */
    right: auto;
    display: flex;
    gap: 10px;
    z-index: 10;
}

button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
    backdrop-filter: blur(5px);
}

button:hover {
    background: rgba(255, 255, 255, 0.3);
}

#statusOverlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 1000;
}

#debugTimer {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #AB47BC;
    color: #AB47BC;
    padding: 8px 15px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 14px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    backdrop-filter: blur(5px);
}

/* Mutation Popup */
#mutationPopup {
    position: fixed;
    top: 30%;
    left: 50%;
    /* Center ift skærmen, ignorerer sidebar for nu */
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #69F0AE;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: white;
    font-family: Arial, sans-serif;
    min-width: 300px;
    box-shadow: 0 0 20px rgba(105, 240, 174, 0.5);
    z-index: 1000;
    pointer-events: none;
    transition: opacity 0.5s;
}

#mutationPopup h2 {
    margin: 0 0 10px 0;
    color: #69F0AE;
    text-transform: uppercase;
}

#mutationPopup p {
    font-size: 16px;
    margin: 5px 0;
}

#mutationPopup .cost {
    color: #FF5252;
    font-weight: bold;
    font-size: 14px;
    margin-top: 10px;
}

.hidden {
    opacity: 0;
    display: none;
}

/* Inspector Modal -> Centered, Tabbed */
.inspector-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Centered */
    width: 600px;
    height: 500px;
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid #333;
    border-radius: 8px;
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

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

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #2196F3;
}

.close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
}

.close-btn:hover {
    color: #fff;
}

.modal-tabs {
    display: flex;
    background: #161b22;
    border-bottom: 1px solid #333;
}

.modal-tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #888;
    padding: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    border-bottom: 2px solid transparent;
    /* Highlight linje */
    transition: all 0.2s;
}

.modal-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
}

.modal-tab-btn.active {
    color: #69F0AE;
    /* Bright Green */
    border-bottom: 2px solid #69F0AE;
    background: rgba(105, 240, 174, 0.05);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

.modal-tab-content {
    display: none;
}

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

/* --- TAB 3: CELL LIST STYLING --- */
.cell-list-item {
    display: flex;
    align-items: center;
    background: #21262d;
    border: 1px solid #30363d;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.cell-list-item:hover {
    background: #30363d;
}

.cell-preview {
    width: 40px;
    height: 40px;
    background: #000;
    border-radius: 50%;
    border: 2px solid #555;
    margin-right: 15px;
    display: flex;
    /* Centering */
    align-items: center;
    justify-content: center;
}

.cell-info {
    flex: 1;
}

.cell-info h4 {
    margin: 0 0 4px 0;
    color: #e6edf3;
    font-size: 14px;
}

.cell-info p {
    margin: 0;
    color: #8b949e;
    font-size: 12px;
}

.cell-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: #238636;
    /* Green */
    border: 1px solid rgba(240, 246, 252, 0.1);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.action-btn.secondary {
    background: #30363d;
    color: #c9d1d9;
}

.dna-details {
    margin-top: 10px;
    padding: 10px;
    background: #161b22;
    border-radius: 4px;
    border: 1px solid #30363d;
    font-size: 12px;
}

/* Minimap styling */
#minimapCanvas {
    width: 100%;
    height: auto;
    /* Bevar aspect ratio */
    background: #000;
    border: 1px solid #444;
    margin-bottom: 15px;
    border-radius: 4px;
}

#inspectorSidebar h2 {
    font-size: 18px;
    color: #2196F3;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
    margin-top: 0;
    margin-bottom: 10px;
}

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

.stat-group label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.bar-container {
    width: 100%;
    height: 8px;
    /* Lidt tyndere */
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.bar {
    height: 100%;
    background: #FFEB3B;
    /* Glucose Yellow */
    width: 0%;
    transition: width 0.2s;
}

.bar.amino {
    background: #2196F3;
    /* Amino Blue */
}

.bar.nucleo {
    background: #F44336;
    /* Nucleotide Red */
}

button.active-observe {
    background: rgba(171, 71, 188, 0.3);
    box-shadow: 0 0 10px rgba(171, 71, 188, 0.5);
}

/* --- INSPECTOR TABS --- */
.inspector-tabs {
    display: flex;
    margin-bottom: 10px;
    border-bottom: 1px solid #444;
}

.tab-btn {
    flex: 1;
    background: #222;
    border: none;
    color: #888;
    padding: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.2s;
    border-radius: 4px 4px 0 0;
}

.tab-btn:hover {
    background: #333;
    color: #fff;
}

.tab-btn.active {
    background: #333;
    color: #69F0AE;
    /* Bright Green */
    border-bottom: 2px solid #69F0AE;
}

.tab-content {
    display: none;
    padding: 10px 0;
    flex: 1;
    overflow-y: auto;
}

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

/* --- MUTATION TREE VISUALIZATION --- */
.tree-node {
    margin-bottom: 8px;
    padding: 5px;
    border-left: 2px solid #444;
    padding-left: 10px;
}

.tree-node.acquired {
    border-left-color: #69F0AE;
    /* Green */
    background: rgba(105, 240, 174, 0.05);
}

.tree-node.locked {
    opacity: 0.5;
    border-left-color: #F44336;
    /* Red */
}

.tree-tier-title {
    font-size: 10px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 4px;
}

.tree-item {
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tree-icon {
    font-size: 14px;
    margin-right: 5px;
}

/* --- MISSION TO-DO --- */
.mission-item {
    background: #2a2a2a;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    border-left: 3px solid #FFEB3B;
    /* Yellow for pending */
}

/* --- PERSISTENT HUD (Right Panel) --- */
#gameHUD {
    position: fixed;
    right: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: rgba(13, 17, 23, 0.85);
    /* Slightly transparent */
    border-left: 1px solid #333;
    padding: 15px;
    color: white;
    z-index: 50;
    /* Below Modal (100) but above game (0) and UI layer (10) */
    display: flex;
    flex-direction: column;
}

#gameHUD canvas {
    width: 100%;
    margin-bottom: 20px;
    border: 1px solid #444;
    background: #000;
}

.hud-content {
    flex: 1;
}

/* --- GENERIC MODAL STYLES (Debug & Others) --- */
.modal {
    position: fixed;
    z-index: 200;
    /* High z-index to be on top of everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    /* Flex centering handled by JS toggling display:flex */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #161b22;
    padding: 20px;
    border: 1px solid #30363d;
    border-radius: 8px;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    color: #fff;
    max-height: 80vh;
    overflow-y: auto;
}

.debug-content {
    border: 1px solid #AB47BC;
    box-shadow: 0 0 15px rgba(171, 71, 188, 0.3);
}

.debug-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.debug-section h3 {
    color: #AB47BC;
    margin-top: 0;
    font-size: 16px;
}

.debug-controls button {
    margin: 3px;
    font-size: 12px;
}