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

body {
    font-family: 'Space Mono', monospace;
    background: #000;
    color: #00ff00;
    overflow: hidden;
    height: 100vh;
}

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

#renderer {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    pointer-events: auto;
}

#company-logo {
    position: absolute;
    top: 20px;
    right: 20px;
    text-align: right;
    pointer-events: none;
    z-index: 50;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #00ffff;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.logo-subtext {
    font-size: 10px;
    color: #888;
    letter-spacing: 2px;
    margin-top: 2px;
}

.status-panel, .control-panel {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff00;
    border-radius: 8px;
    padding: 15px;
    min-width: 280px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.status-panel h2, .control-panel h2 {
    color: #00ffff;
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 2px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.label {
    color: #888;
}

.value {
    color: #00ff00;
    font-weight: bold;
}

.status-stable {
    color: #00ff00;
}

.status-warning {
    color: #ffff00;
}

.status-critical {
    color: #ff0000;
}

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

.control-group label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.slider {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    outline: none;
    margin-bottom: 5px;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #00ff00;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #00ff00;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.slider-value {
    font-size: 11px;
    color: #00ff00;
    float: right;
}

.emergency-btn {
    width: 100%;
    padding: 12px;
    background: #ff0000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.emergency-btn:hover {
    background: #cc0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

#controls-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 11px;
    color: #888;
    pointer-events: none;
}

.admin-btn {
    width: 100%;
    padding: 8px;
    background: #666;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    font-size: 10px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.admin-btn:hover {
    background: #888;
    box-shadow: 0 0 15px rgba(136, 136, 136, 0.3);
}

.admin-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ffaa00;
    border-radius: 8px;
    padding: 15px;
    min-width: 300px;
    max-width: 300px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(255, 170, 0, 0.4);
    pointer-events: auto;
}

.admin-panel::-webkit-scrollbar {
    width: 8px;
}

.admin-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.admin-panel::-webkit-scrollbar-thumb {
    background: #ffaa00;
    border-radius: 4px;
}

.admin-panel::-webkit-scrollbar-thumb:hover {
    background: #ff8800;
}

.admin-panel h2 {
    color: #ffaa00;
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 2px;
}

.admin-controls .control-group {
    margin-bottom: 12px;
}

.admin-controls .button-row {
    display: flex;
    gap: 4%;
    margin-bottom: 12px;
}

.admin-controls .button-row .danger-btn,
.admin-controls .button-row .warning-btn,
.admin-controls .button-row .critical-btn {
    width: 48%;
    margin-right: 0;
}

.danger-btn {
    width: 48%;
    padding: 8px;
    background: #cc0000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    font-size: 10px;
    cursor: pointer;
    letter-spacing: 1px;
    margin-right: 4%;
    transition: all 0.2s;
}

.danger-btn:hover {
    background: #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.warning-btn {
    width: 48%;
    padding: 8px;
    background: #cc6600;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    font-size: 10px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.warning-btn:hover {
    background: #ff8800;
    box-shadow: 0 0 15px rgba(255, 136, 0, 0.5);
}

.logout-btn {
    width: 100%;
    padding: 8px;
    background: #444;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    font-size: 10px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
    margin-top: 8px;
}

.logout-btn:hover {
    background: #666;
}

.critical-btn {
    width: 48%;
    padding: 8px;
    background: #660000;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    font-size: 10px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.critical-btn:hover {
    background: #990000;
    box-shadow: 0 0 15px rgba(153, 0, 0, 0.5);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #00ff00;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
    min-width: 300px;
}

.modal-content h2 {
    color: #00ffff;
    font-size: 16px;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.modal-content p {
    color: #888;
    font-size: 12px;
    margin-bottom: 15px;
}

#admin-code {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ff00;
    border-radius: 4px;
    color: #00ff00;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

#admin-code:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.submit-btn {
    flex: 1;
    padding: 10px;
    background: #00aa00;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.submit-btn:hover {
    background: #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.cancel-btn {
    flex: 1;
    padding: 10px;
    background: #666;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.cancel-btn:hover {
    background: #888;
}

.error-message {
    color: #ff0000;
    font-size: 11px;
    margin-top: 10px;
    letter-spacing: 1px;
}

.hidden {
    display: none !important;
}

.facility-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff00;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.4);
    pointer-events: auto;
    min-width: 350px;
}

.facility-panel h2 {
    color: #00ffff;
    font-size: 16px;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.facility-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.facility-btn {
    padding: 15px 25px;
    background: #004400;
    color: #00ff00;
    border: 1px solid #00ff00;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.facility-btn:hover {
    background: #006600;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.control-center {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #111;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.control-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ff00;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.company-name {
    font-size: 18px;
    font-weight: bold;
    color: #00ffff;
    letter-spacing: 2px;
}

.window-title {
    font-size: 14px;
    color: #888;
    letter-spacing: 1px;
}

.reactor-window {
    flex: 1;
    border: 1px solid #00ff00;
    border-top: none;
    background: #000;
    position: relative;
    min-height: 400px;
}

.reactor-window canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.warning-screens {
    height: 120px;
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.warning-screen {
    flex: 1;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff00;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
}

.warning-screen.warning {
    border-color: #ffaa00;
    background: rgba(255, 170, 0, 0.1);
}

.warning-screen.critical {
    border-color: #ff0000;
    background: rgba(255, 0, 0, 0.1);
    animation: criticalFlash 2s infinite;
}

@keyframes criticalFlash {
    0%, 50% { border-color: #ff0000; }
    25%, 75% { border-color: #ff4444; }
}

.warning-header {
    font-size: 12px;
    font-weight: bold;
    color: #00ffff;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.warning-content {
    flex: 1;
    font-size: 11px;
    color: #00ff00;
    line-height: 1.4;
    overflow-y: auto;
}

.warning-screen.warning .warning-content {
    color: #ffaa00;
}

.warning-screen.critical .warning-content {
    color: #ff4444;
    font-weight: bold;
}

.exit-control-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    padding: 10px 20px;
    background: #666;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.exit-control-btn:hover {
    background: #888;
    box-shadow: 0 0 15px rgba(136, 136, 136, 0.3);
}

@media (max-width: 768px) {
    #hud {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        top: auto;
        flex-direction: row;
        gap: 10px;
    }
    
    .status-panel, .control-panel {
        flex: 1;
        min-width: 0;
        font-size: 10px;
    }
    
    #controls-info {
        display: none;
    }
    
    #company-logo {
        top: 10px;
        right: 10px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .facility-panel {
        min-width: 280px;
        padding: 20px;
    }
    
    .control-window {
        padding: 10px;
    }
    
    .window-header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .warning-screens {
        height: 100px;
        flex-direction: column;
        gap: 5px;
    }
    
    .warning-screen {
        min-height: 60px;
    }
}