:root {
  --bg: #eef4ff;
  --card: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --border: #dbe3f0;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 90% -10%, rgba(14, 165, 233, 0.12), transparent 55%),
    radial-gradient(800px 360px at 10% -10%, rgba(59, 130, 246, 0.1), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

.wrap {
  width: min(1100px, 100% - 24px);
  margin: 16px auto 40px;
}

.sim-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 16px;
  align-items: stretch;
}

.stage-column {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 10px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.star-stage {
  width: 100%;
  min-height: 560px;
  border-radius: 14px;
  border: 1px solid #111827;
  background: #000;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.star-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 8, 22, 0.05) 0%, rgba(6, 12, 24, 0.08) 48%, rgba(8, 18, 34, 0.14) 100%),
    radial-gradient(900px 360px at 50% 82%, rgba(37, 99, 235, 0.06), transparent 58%);
}

.star-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 14px;
}

.star-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.star-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 28px rgba(255,255,255,0.35);
}

.input-card h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.input-card {
  height: 100%;
}

.input-form {
  display: grid;
  gap: 10px;
}

.input-form label {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
}

.input-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
}

.input-form select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
}

.input-form input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.input-form select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.speed-control {
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fbff;
}

.speed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #1f2937;
}

.speed-slider {
  width: 100%;
  accent-color: #2563eb;
  cursor: pointer;
}
.calc-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.sim-icon-btn {
  width: 40px;
  height: 40px;
  object-fit: contain;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease, filter 0.12s ease;
}

.sim-icon-btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.sim-icon-btn:active { transform: translateY(0); }

.result-box {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fbff;
  color: #1f2937;
  padding: 12px;
  font-size: 14px;
  line-height: 1.45;
}

.stellar-report-card {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f8ff 100%);
  padding: 12px;
}

.stellar-report-head {
  margin-bottom: 10px;
}

.stellar-report-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #1f2937;
}

.stellar-report-shell {
  border: 1px solid #d7e4f6;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.stellar-report-box {
  min-height: 110px;
  border: 1px dashed #c7d7ef;
  border-radius: 8px;
  background: #fbfdff;
  color: #1f2937;
  padding: 12px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-line;
}

.timebar-card {
  border-radius: 12px;
  border: 1px solid #1f2937;
  background: #0b1020;
  color: #e5e7eb;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.timebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 8px;
}

.timebar-slider {
  width: 100%;
  accent-color: #38bdf8;
  cursor: pointer;
}

.timebar-slider:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.timebar-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #93c5fd;
}
.timebar-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.timebar-btn {
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.timebar-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.timebar-btn:hover:not(:disabled) {
  background: #1e293b;
}

@media (max-width: 900px) {
  .sim-grid {
    grid-template-columns: 1fr;
  }

  .star-stage {
    min-height: 380px;
  }
}

.nebula-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #030814 0%, #030916 46%, #071225 100%),
    radial-gradient(1200px 480px at 50% 40%, rgba(70, 72, 92, 0.28), rgba(0, 0, 0, 0) 65%),
    radial-gradient(900px 420px at 20% 60%, rgba(40, 45, 60, 0.3), rgba(0, 0, 0, 0) 68%),
    radial-gradient(850px 420px at 80% 65%, rgba(34, 38, 52, 0.28), rgba(0, 0, 0, 0) 68%),
    #000;
}

.nebula-cloud {
  position: absolute;
  border-radius: 999px;
  filter: blur(42px);
  pointer-events: none;
}

.cloud-a {
  width: 72%;
  height: 42%;
  left: 6%;
  top: 18%;
  background: rgba(92, 98, 120, 0.24);
}

.cloud-b {
  width: 64%;
  height: 36%;
  right: 4%;
  top: 40%;
  background: rgba(70, 76, 98, 0.22);
}

.cloud-c {
  width: 46%;
  height: 28%;
  left: 30%;
  bottom: 8%;
  background: rgba(54, 60, 80, 0.2);
}

.nebula-dust {
  position: absolute;
  inset: 0;
  background-color: rgba(6, 12, 24, 0.08);
  background-image:
    radial-gradient(rgba(218, 228, 255, 0.34) 0.85px, rgba(218, 228, 255, 0.12) 1.4px, transparent 1.9px);
  background-size: 7px 7px;
  opacity: 0.22;
  mix-blend-mode: screen;
  filter: contrast(1.12);
}

.nebula-rotor {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
}

.proto-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  filter: blur(6px);
  pointer-events: none;
  mix-blend-mode: screen;
}

.proto-disk {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  pointer-events: none;
  border: 1px solid rgba(180, 196, 230, 0.26);
  background:
    radial-gradient(ellipse at center, rgba(180, 200, 235, 0.25) 0%, rgba(140, 156, 190, 0.14) 45%, rgba(0, 0, 0, 0) 85%);
  filter: blur(2px);
}

.proto-clump {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  pointer-events: none;
  background:
    radial-gradient(circle at 35% 35%, rgba(186, 197, 226, 0.68) 0%, rgba(120, 132, 162, 0.4) 50%, rgba(40, 46, 64, 0.18) 100%);
  filter: blur(1.2px);
}

.proto-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.28);
}

.remnant-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 460px at 52% 45%, rgba(34, 42, 66, 0.26), rgba(0, 0, 0, 0) 62%),
    #000;
}

.remnant-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  filter: blur(4px);
  pointer-events: none;
  mix-blend-mode: screen;
}

.remnant-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}

.wd-core {
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #dbeafe 52%, #9cc7ff 100%);
  box-shadow: 0 0 22px rgba(169, 208, 255, 0.55);
}

.ns-core {
  background: radial-gradient(circle at 35% 35%, #f8fbff 0%, #7fb9ff 58%, #2f5dff 100%);
  box-shadow: 0 0 18px rgba(66, 131, 255, 0.65);
}

.remnant-beam {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 220px;
  transform-origin: center center;
  border-radius: 999px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(180, 225, 255, 0), rgba(180, 225, 255, 0.85), rgba(180, 225, 255, 0));
  filter: blur(0.6px);
}

.bh-core {
  background: #000;
  box-shadow:
    0 0 0 2px rgba(255, 160, 70, 0.28),
    0 0 18px rgba(255, 130, 45, 0.18);
}

.remnant-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  pointer-events: none;
  border: 2px solid rgba(255, 185, 86, 0.58);
  box-shadow: 0 0 22px rgba(255, 136, 48, 0.35);
}

.stage-hud {
  position: absolute;
  left: 12px;
  top: 10px;
  z-index: 20;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.death-shockwave {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}

.death-shockwave.soft {
  border: 2px solid rgba(190, 220, 255, 0.5);
  box-shadow: 0 0 22px rgba(170, 210, 255, 0.2);
}

.death-shockwave.hard {
  border: 2px solid rgba(255, 190, 120, 0.75);
  box-shadow: 0 0 30px rgba(255, 110, 60, 0.36);
}

.death-fragment {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
}

.death-fragment.pale {
  background: radial-gradient(circle, rgba(226, 240, 255, 0.95) 0%, rgba(170, 200, 235, 0.4) 70%, rgba(0, 0, 0, 0) 100%);
  filter: blur(0.4px);
}

.death-fragment.hot {
  background: radial-gradient(circle, rgba(255, 236, 188, 0.95) 0%, rgba(255, 140, 74, 0.5) 70%, rgba(0, 0, 0, 0) 100%);
  filter: blur(0.45px);
}

.death-collapse {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  border: 2px solid rgba(255, 170, 90, 0.5);
  box-shadow:
    inset 0 0 20px rgba(255, 130, 50, 0.22),
    0 0 24px rgba(255, 140, 66, 0.3);
}

.hr-card {
  border-radius: 12px;
  border: 1px solid #334155;
  background: #020617;
  color: #e2e8f0;
  padding: 10px 12px 12px;
  box-shadow: var(--shadow);
}

.hr-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 8px;
}

.hr-canvas {
  display: block;
  width: 100%;
  height: 260px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: #040816;
}

.hr-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #93c5fd;
}

@media (max-width: 900px) {
  .hr-canvas {
    height: 220px;
  }
}

/* Stellar simulator visual refresh */
:root {
  --bg: #07111f;
  --card: rgba(8, 18, 34, 0.84);
  --card-soft: rgba(255, 255, 255, 0.92);
  --text: #f7fbff;
  --muted: #d8e6f6;
  --border: rgba(154, 182, 214, 0.22);
  --shadow: 0 24px 60px rgba(2, 8, 22, 0.34);
}

body {
  background:
    radial-gradient(1000px 520px at 90% -10%, rgba(14, 165, 233, 0.18), transparent 55%),
    radial-gradient(860px 420px at 10% -10%, rgba(59, 130, 246, 0.14), transparent 55%),
    linear-gradient(180deg, #06101d, #030914),
    var(--bg);
  color: var(--text);
}

.card,
.timebar-card,
.hr-card {
  border-radius: 24px;
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)), var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.star-stage {
  border-radius: 24px;
  border-color: rgba(154, 182, 214, 0.24);
}

.input-form label,
.speed-head,
.stellar-report-head h3 {
  color: #eff6ff;
}

.input-form input,
.input-form select {
  border: 1px solid rgba(154, 182, 214, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
}

.speed-control,
.stellar-report-card {
  border: 1px solid rgba(154, 182, 214, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.sim-icon-btn {
  border: 1px solid rgba(154, 182, 214, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.result-box,
.stellar-report-shell {
  border: 1px solid rgba(154, 182, 214, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(241,245,249,0.98));
  color: #0f172a;
}

.stellar-report-box {
  border: 1px dashed rgba(154, 182, 214, 0.22);
  border-radius: 12px;
  color: #0f172a;
}

.timebar-card,
.hr-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)), rgba(8, 18, 34, 0.84);
}

.hr-canvas {
  border-radius: 14px;
  border-color: rgba(148, 163, 184, 0.24);
}

.input-card,
.input-card h2,
.input-card label,
.input-card .speed-head,
.input-card .stellar-report-head h3 {
  color: #0f172a !important;
}
