/* 3D supernova viewer – (c) Michael Gabler.  Colours follow www.uv.es/miga */
:root {
  --accent: #33B8FF;
  --accent-dark: #0a8fd6;
  --bg: #000;
  --panel: #1b1d20;
  --panel-line: #2c2f33;
  --text: #e8e8e8;
  --muted: #a0a4a8;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: "Open Sans", sans-serif; }
body { display: grid; grid-template-columns: 1fr 300px; grid-template-rows: 56px 1fr; height: 100vh; overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #99dbff; }

.bar { grid-column: 1 / 3; display: flex; align-items: center; gap: 24px; padding: 0 18px;
  background: #fff; color: #545454; box-shadow: 0 2px 12px rgba(0, 0, 0, .3); z-index: 2; }
.bar .brand { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 19px; color: var(--accent); }
.bar .brand span { color: inherit; }
.bar .title { font-family: "Poppins", sans-serif; font-size: 16px; flex: 1; }
.bar select { font: 15px "Poppins", sans-serif; padding: 5px 10px; border: 1px solid var(--accent); border-radius: 50px;
  color: var(--accent-dark); background: #fff; }

#stage { position: relative; overflow: hidden; min-height: 0; }
#c { width: 100%; height: 100%; display: block; touch-action: none; }
#labels { position: absolute; inset: 0; pointer-events: none; }
.ptr { position: absolute; font-size: 14px; color: #fff; white-space: nowrap; text-shadow: 0 0 4px #000, 0 0 2px #000;
  border-bottom: 1px solid #fff; padding: 0 2px 1px; transform: translateY(-100%); }
.ptr-line { position: absolute; height: 1px; background: #fff; transform-origin: 0 0; opacity: .9; }
.ptr-dot { position: absolute; width: 7px; height: 7px; border: 1.5px solid #fff; border-radius: 50%; transform: translate(-50%, -50%); }

#hud-time { position: absolute; left: 22px; top: 16px; font-size: 30px; line-height: 1.25; text-shadow: 0 0 6px #000; }
#hud-model { font-size: 30px; }
#hud-scale { position: absolute; right: 26px; top: 22px; display: flex; align-items: center; gap: 10px; flex-direction: row-reverse; }
#hud-scale .bar-line { height: 2px; background: #fff; width: 120px; }
#scale-text { font-size: 18px; }
#hud-cbar { position: absolute; left: 22px; bottom: 20px; width: 300px; font-size: 13px; }
.cbar { height: 12px; border-radius: 2px; margin: 4px 0 2px;
  background: linear-gradient(90deg, #3b4cc0, #6f92f3, #aac7fd, #dddcdc, #f7b89c, #e7745b, #b40426); }
.cbar-ticks { display: flex; justify-content: space-between; }
#loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 18px; color: var(--muted); display: none; }
.credit { position: absolute; right: 16px; bottom: 12px; font-size: 13px; color: rgba(255, 255, 255, .55); }

#panel { background: var(--panel); border-left: 1px solid var(--panel-line); overflow-y: auto; padding: 8px 18px 20px; }
#panel section { border-bottom: 1px solid var(--panel-line); padding: 12px 0 14px; }
#panel h3 { font: 600 15px "Poppins", sans-serif; color: var(--accent); margin: 0 0 10px; }
.time-row { display: flex; align-items: center; gap: 10px; }
#play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 14px; cursor: pointer; }
#play:hover { background: var(--accent-dark); }
input[type=range] { flex: 1; accent-color: var(--accent); }
#epoch-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin: 4px 0 0 44px; }
#epoch-caption { font-size: 14px; margin-top: 10px; min-height: 40px; color: var(--text); }
.layer { display: grid; grid-template-columns: 20px 14px 1fr 70px; align-items: center; gap: 8px; margin-bottom: 9px; font-size: 14px; }
.layer .sw { width: 14px; height: 14px; border-radius: 3px; }
.layer input[type=range] { width: 70px; }
.layer.missing { opacity: .35; }
.check { display: block; font-size: 14px; margin: 8px 0 0; }
.help, .about p { font-size: 13px; color: var(--muted); line-height: 1.55; }
.about p { margin: 0; }

@media (max-width: 800px) {
  body { grid-template-columns: 1fr; grid-template-rows: 56px 58vh auto; overflow: auto; height: auto; }
  .bar { grid-column: 1; gap: 12px; }
  .bar .title { display: none; }
  #panel { border-left: 0; }
  #hud-time, #hud-model { font-size: 20px; }
  #hud-cbar { width: 200px; }
}
