:root {
  --bg-dark: #0a0a0c;
  --bg-panel: rgba(15, 15, 20, 0.85);
  --neon-red: #ff2a2a;
  --neon-orange: #ff6200;
  --neon-yellow: #ffcc00;
  --border-light: rgba(255, 42, 42, 0.2);
  --text-main: #f0f0f0;
  --text-dim: #a0a0a0;
  --font-title: 'Orbitron', sans-serif;
  --font-body: 'Roboto', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at center, #1a0a0a 0%, #0a0a0c 100%),
    url('https://www.transparenttextures.com/patterns/carbon-fibre.png');
  color: var(--text-main);
  font-family: var(--font-body);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Explosion Flash Overlay */
#explosion-flash {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle, #fff 0%, #ff6200 30%, #ff2a2a 60%, transparent 100%);
  z-index: 1000; opacity: 0; pointer-events: none; mix-blend-mode: screen;
}

.app-container {
  width: 95vw; max-width: 1400px; height: 90vh;
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 4px; border-left: 4px solid var(--neon-red);
  display: flex; flex-direction: column;
  box-shadow: 0 0 50px rgba(255, 0, 0, 0.1);
  backdrop-filter: blur(15px);
}

header {
  padding: 20px 40px; border-bottom: 1px solid var(--border-light);
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(to right, rgba(255,0,0,0.05), transparent);
}

.back-link { text-decoration: none; color: var(--neon-red); font-family: var(--font-title); font-size: 0.8rem; letter-spacing: 1px; }

.neon-text.red {
  color: #fff; text-shadow: 0 0 10px var(--neon-red), 0 0 20px var(--neon-red);
  font-family: var(--font-title); font-size: 1.5rem; letter-spacing: 4px;
}

.status-monitor { text-align: right; }
.monitor-label { font-size: 0.7rem; color: var(--text-dim); margin-bottom: 5px; letter-spacing: 2px; }
.monitor-value { font-family: var(--font-title); font-size: 1.2rem; padding: 5px 15px; border-radius: 4px; }
.monitor-value.safe { color: #00ff73; border: 1px solid #00ff73; box-shadow: inset 0 0 10px rgba(0,255,115,0.2); }
.monitor-value.critical { color: var(--neon-red); border: 1px solid var(--neon-red); box-shadow: 0 0 15px var(--neon-red); animation: blink 0.5s infinite; }

@keyframes blink { 50% { opacity: 0.5; } }

main { flex: 1; display: flex; overflow: hidden; }

.simulation-view { flex: 1; position: relative; background: #000; border: 2px solid #111; margin: 20px; border-radius: 8px;}
canvas { width: 100%; height: 100%; cursor: crosshair; }

.ui-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; border: 20px solid transparent;
  box-shadow: inset 0 0 100px rgba(255,0,0,0.1); display: flex; align-items: center; justify-content: center;
}

.warning-text {
  font-family: var(--font-title); font-size: 3rem; color: var(--neon-red);
  text-shadow: 0 0 20px var(--neon-red); opacity: 0; transition: 0.3s;
}

/* Sidebar Controls */
.controls-sidebar {
  width: 350px; margin: 20px 20px 20px 0; border: 1px solid var(--border-light);
  display: flex; flex-direction: column; gap: 30px; padding: 25px;
}

.control-section h3 {
  font-family: var(--font-title); font-size: 0.9rem; color: var(--neon-red);
  margin-bottom: 20px; border-bottom: 1px solid var(--border-light); padding-bottom: 10px;
}

.slider-group { margin-bottom: 25px; }
.slider-info { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 10px; color: var(--text-dim); }
.slider-info span { color: #fff; font-weight: bold; }

.neon-slider {
  -webkit-appearance: none; width: 100%; height: 4px; background: #222; border-radius: 2px;
}
.neon-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; background: #fff;
  border: 2px solid var(--neon-red); border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 10px var(--neon-red);
}

.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.data-item { background: rgba(0,0,0,0.3); padding: 15px; border-radius: 4px; border: 1px solid #222; }
.data-item .label { display: block; font-size: 0.7rem; color: var(--text-dim); margin-bottom: 5px; }
.data-item .value { font-family: var(--font-title); font-size: 1.2rem; color: #fff; }

.action-buttons { margin-top: auto; display: flex; flex-direction: column; gap: 15px; }

.fire-btn {
  height: 60px; border: none; background: #300; position: relative;
  cursor: pointer; overflow: hidden; border-radius: 4px; border: 1px solid #600;
}
.fire-btn .btn-text {
  position: relative; z-index: 2; font-family: var(--font-title);
  font-weight: bold; color: #ff9999; letter-spacing: 2px;
}
.fire-btn .btn-glow {
  position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,0,0,0.3), transparent);
  transition: 0.5s;
}
.fire-btn:hover .btn-glow { left: 150%; }
.fire-btn:active { transform: scale(0.98); background: #500; }

.reset-btn {
  background: transparent; color: var(--text-dim); border: 1px solid #333;
  padding: 12px; cursor: pointer; font-family: var(--font-title); font-size: 0.8rem;
  letter-spacing: 1px; transition: 0.3s;
}
.reset-btn:hover { border-color: #666; color: #fff; }

.shake { animation: shake-anim 0.1s infinite; }
@keyframes shake-anim {
  0% { transform: translate(2px, 2px); }
  50% { transform: translate(-2px, -2px); }
  100% { transform: translate(2px, -2px); }
}

@media (max-width: 1000px) {
  body { height: auto; overflow: auto; padding: 10px; }
  .app-container { height: auto; }
  main { flex-direction: column; }
  .controls-sidebar { width: 100%; margin: 0 0 20px 0; }
  .simulation-view { height: 400px; }
}
