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

body {
    font-family: 'Courier New', monospace;
    background: radial-gradient(ellipse at center, #0a0a0a 0%, #000000 100%);
    color: #00ffcc;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #00ffcc;
    padding: 15px 20px;
    z-index: 100;
    text-align: center;
}

.title-section h1 {
    font-size: 1.8em;
    letter-spacing: 4px;
    text-shadow: 0 0 10px #00ffcc;
}

.subtitle {
    font-family: Arial, sans-serif;
    font-size: 0.9em;
    margin-top: 5px;
    color: #cccccc;
}

.subtitle em {
    font-style: italic;
    color: #00ffcc;
}

.security-warning {
    color: #ff3333;
    font-size: 0.8em;
    margin-top: 5px;
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.panel {
    position: fixed;
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid #00ffcc;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
    z-index: 10;
    max-height: 80vh;
    overflow-y: auto;
}

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

.panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}

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

#control-panel {
    top: 120px;
    right: 20px;
    width: 280px;
}

#state-cards {
    bottom: 80px;
    left: 20px;
    width: 320px;
    max-height: 300px;
}

#info-panel {
    bottom: 80px;
    right: 20px;
    width: 350px;
    max-height: 200px;
}

#settings-panel {
    top: 120px;
    left: 20px;
    width: 260px;
}

.panel h3 {
    font-size: 0.9em;
    margin-bottom: 10px;
    color: #00ffcc;
    border-bottom: 1px solid #00ffcc;
    padding-bottom: 5px;
}

.control-group {
    margin: 10px 0;
}

.control-group label {
    display: block;
    margin: 5px 0;
    font-size: 0.85em;
    color: #cccccc;
    font-family: Arial, sans-serif;
}

.control-group input[type="checkbox"] {
    margin-right: 8px;
}

.slider-control {
    margin: 10px 0;
}

.slider-control label {
    display: block;
    font-size: 0.85em;
    color: #cccccc;
    margin-bottom: 5px;
    font-family: Arial, sans-serif;
}

.slider-control input[type="range"] {
    width: 100%;
    accent-color: #00ffcc;
}

.slider-control select {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ffcc;
    color: #00ffcc;
    padding: 5px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.btn-primary, .btn-danger, .btn-secondary {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border: none;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #00ffcc, #00cc99);
    color: #0a0a0a;
}

.btn-primary:hover {
    box-shadow: 0 0 20px #00ffcc;
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ff3333, #cc0000);
    color: #ffffff;
    animation: pulse-danger 1.5s infinite;
}

@keyframes pulse-danger {
    0%, 100% { box-shadow: 0 0 10px #ff3333; }
    50% { box-shadow: 0 0 25px #ff3333; }
}

.btn-danger:hover {
    transform: scale(1.05);
}

.btn-secondary {
    background: rgba(0, 255, 204, 0.2);
    border: 1px solid #00ffcc;
    color: #00ffcc;
}

.btn-secondary:hover {
    background: rgba(0, 255, 204, 0.3);
}

.probability-bar {
    margin: 8px 0;
}

.prob-label {
    font-size: 0.75em;
    color: #cccccc;
    margin-bottom: 3px;
    font-family: Arial, sans-serif;
}

.prob-bar-container {
    width: 100%;
    height: 18px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 9px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 204, 0.3);
}

.prob-bar-fill {
    height: 100%;
    transition: width 0.5s, background 0.5s;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    color: #fff;
    font-weight: bold;
}

.sensor-readout {
    margin: 10px 0;
}

.sensor-readout label {
    display: block;
    font-size: 0.85em;
    color: #cccccc;
    margin-bottom: 5px;
    font-family: Arial, sans-serif;
}

.meter-container {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 204, 0.3);
}

.meter {
    height: 100%;
    background: linear-gradient(90deg, #00ffcc, #00ff66);
    border-radius: 10px;
    transition: width 0.3s;
    animation: pulse-meter 2s infinite;
}

.meter.risk {
    background: linear-gradient(90deg, #ffcc00, #ff3333);
}

@keyframes pulse-meter {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

#energy-spectrum {
    width: 100%;
    height: 60px;
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
}

#cards-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.state-card {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: Arial, sans-serif;
}

.state-card:hover {
    border-color: #00ffcc;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
    transform: translateY(-2px);
}

.state-card.active {
    border-color: #00ffcc;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.7);
    background: rgba(0, 255, 204, 0.1);
}

.state-card-title {
    font-size: 0.75em;
    font-weight: bold;
    margin-bottom: 3px;
}

.state-card-desc {
    font-size: 0.65em;
    color: #999;
}

#log-container {
    font-size: 0.75em;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    color: #00ffcc;
}

.log-entry {
    margin: 5px 0;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#interaction-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 255, 204, 0.95);
    color: #0a0a0a;
    padding: 20px 30px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    z-index: 1000;
    display: none;
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.8);
    animation: popIn 0.3s;
}

@keyframes popIn {
    from { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

#collapse-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 51, 51, 0.95);
    color: #ffffff;
    padding: 30px 40px;
    border-radius: 10px;
    font-size: 1.3em;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 0 40px rgba(255, 51, 51, 0.8);
    text-align: center;
    animation: collapseFlash 0.5s;
}

@keyframes collapseFlash {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #00ffcc;
    padding: 10px;
    text-align: center;
    z-index: 100;
    font-family: Arial, sans-serif;
    font-size: 0.8em;
}

footer p {
    margin: 3px 0;
    color: #cccccc;
}

footer a {
    color: #00ffcc;
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    text-decoration: underline;
}

.disclaimer {
    color: #ff6666;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .panel {
        width: 90% !important;
        max-width: none;
        left: 5% !important;
        right: 5% !important;
    }
    
    #control-panel {
        top: 100px;
    }
    
    #state-cards {
        bottom: 140px;
    }
    
    #info-panel {
        bottom: auto;
        top: 400px;
    }
    
    #settings-panel {
        top: auto;
        bottom: 380px;
    }
}

body.quantum-theme {
    background: radial-gradient(ellipse at center, #0a0a2a 0%, #000011 100%);
}

body.quantum-theme .panel {
    border-color: #6699ff;
    box-shadow: 0 0 20px rgba(102, 153, 255, 0.3);
}

body.quantum-theme h1, 
body.quantum-theme h3, 
body.quantum-theme .btn-primary {
    color: #6699ff;
    text-shadow: 0 0 10px #6699ff;
}

body.quantum-theme .btn-primary {
    background: linear-gradient(135deg, #6699ff, #4477cc);
}