:root {
  --bg: #0b0d12;
  --panel: #151922;
  --border: #272c38;
  --text: #e8eaf0;
  --muted: #8a93a6;
  --safe: #2e7d32;
  --armed: #c62828;
  --triggered: #ff6d00;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.clock {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 24px 0 8px;
  font-variant-numeric: tabular-nums;
}
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 640px;
  padding: 0 16px 48px;
}
.status {
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 16px;
}
.status.armed { color: var(--armed); }
.status.triggered { color: var(--triggered); animation: flash 1s infinite; }
@keyframes flash { 50% { opacity: 0.3; } }

.switch {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 48px;
  width: 96px;
  height: 230px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.switch-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.switch-thumb {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 72px;
  height: 72px;
  margin-left: -36px;
  border-radius: 50%;
  background: var(--safe);
  transition: bottom 0.25s ease, background 0.25s ease;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}
.switch.armed .switch-thumb {
  bottom: calc(100% - 72px);
  background: var(--armed);
  box-shadow: 0 0 30px rgba(198, 40, 40, 0.6);
}
.switch.triggered .switch-thumb {
  background: var(--triggered);
  box-shadow: 0 0 30px rgba(255, 109, 0, 0.7);
}

.deadline-info {
  margin-top: 16px;
  min-height: 1.5em;
  text-align: center;
  color: var(--muted);
}

.explosions { width: 100%; margin-top: 32px; }
.explosions h2 { text-align: center; }
.hint { color: var(--muted); font-size: 0.9rem; text-align: center; }
#explosionList { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#explosionList li {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
#explosionList li.active { border-color: var(--armed); }
.ex-type { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); }
.ex-desc { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--panel);
  border-radius: 12px;
  padding: 24px;
  width: min(90vw, 380px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); }
.modal input, .modal select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  font-size: 1rem;
}
.selected-description { color: var(--muted); font-size: 0.85rem; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions button {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.modal-actions button.danger { background: var(--armed); color: white; }
.modal-actions button:not(.danger) { background: var(--border); color: var(--text); }
