/* Makmal Jatuh Bebas — Tema Makmal STEM (Kiri: Simulasi, Kanan: Panel Kawalan, Bawah: Data & Graf) */
.fall-module {
  --fall-ink: #252137;
  --fall-mut: #645a7a;
  --fall-line: #dcd5e8;
  --fall-tint: #f5f1fb;
  --fall-accent: #634395;
  --fall-accent-dark: #4b2f79;
  --fall-green: #0f766e;
  --fall-amber: #d97706;
  --fall-blue: #0284c7;
  --fall-rose: #e11d48;
}
.fall-module .lab-module-logo { color:#3730a3; background:#eef2ff; }
.fall-module .lab-wrap { width: min(100% - 32px, 1320px); }

/* ===== Main 2-column workspace: Simulasi Kiri, Panel Kawalan Kanan ===== */
.fall-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 390px);
  gap: 14px;
  align-items: stretch;
}
.fall-stage-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.fall-ctrl-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== Left: Interactive Drop Stage ===== */
.fall-stage-card {
  flex: 1 1 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1px solid var(--fall-line);
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(37, 33, 55, 0.04);
}
#stageWrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 450px;
  height: clamp(450px, calc(100svh - 155px), 680px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #d5cce6;
  background: #0d1024;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
  cursor: default;
}
.fall-hud {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  pointer-events: none;
  gap: 10px;
  z-index: 6;
}

/* ===== Top-Left Rotating Planet Orb + Gravity Info + Drawer ===== */
.fall-loc-hud {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}
.fall-loc-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
  flex: none;
}
.fall-planet-orb-btn {
  position: relative;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(99, 67, 149, 0.25), 0 8px 20px rgba(15, 23, 42, 0.45);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.fall-planet-orb-btn:hover {
  transform: scale(1.06);
  border-color: #fde047;
  box-shadow: 0 0 0 4px rgba(253, 224, 71, 0.28), 0 10px 24px rgba(15, 23, 42, 0.5);
}
.fall-planet-orb-btn:focus-visible {
  outline: 2px solid #fde047;
  outline-offset: 3px;
}
.fall-planet-orb-btn::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.32);
  animation: fallOrbitRing 18s linear infinite;
  pointer-events: none;
}
@keyframes fallOrbitRing {
  to { transform: rotate(360deg); }
}

.fall-planet-sphere {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.45);
}
.fall-planet-sphere.is-mini {
  width: 34px;
  height: 34px;
  flex: none;
}
.fall-planet-sphere::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  animation: fallPlanetSpin 7.5s linear infinite;
}
.fall-planet-sphere::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.1) 28%, transparent 55%),
    radial-gradient(circle at 75% 75%, rgba(2, 6, 23, 0.65) 0%, transparent 62%);
  pointer-events: none;
}
@keyframes fallPlanetSpin {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Bumi texture */
.fall-planet-sphere.is-bumi {
  background: linear-gradient(180deg, #60a5fa 0%, #1d4ed8 100%);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}
.fall-planet-sphere.is-bumi::before {
  background-image:
    radial-gradient(ellipse 14px 10px at 14% 44%, #4ade80 96%, transparent 100%),
    radial-gradient(ellipse 10px 13px at 32% 62%, #22c55e 96%, transparent 100%),
    radial-gradient(ellipse 12px 9px at 42% 30%, #86efac 96%, transparent 100%),
    radial-gradient(ellipse 14px 10px at 64% 44%, #4ade80 96%, transparent 100%),
    radial-gradient(ellipse 10px 13px at 82% 62%, #22c55e 96%, transparent 100%),
    radial-gradient(ellipse 12px 9px at 92% 30%, #86efac 96%, transparent 100%),
    radial-gradient(ellipse 16px 5px at 22% 20%, rgba(255, 255, 255, 0.72) 90%, transparent 100%),
    radial-gradient(ellipse 16px 5px at 72% 20%, rgba(255, 255, 255, 0.72) 90%, transparent 100%);
}

/* Bulan texture */
.fall-planet-sphere.is-bulan {
  background: linear-gradient(180deg, #e2e8f0 0%, #64748b 100%);
  box-shadow: 0 0 12px rgba(226, 232, 240, 0.35);
}
.fall-planet-sphere.is-bulan::before {
  animation-duration: 10s;
  background-image:
    radial-gradient(circle 6px at 15% 38%, rgba(71, 85, 105, 0.55) 85%, transparent 100%),
    radial-gradient(circle 4px at 30% 65%, rgba(71, 85, 105, 0.48) 85%, transparent 100%),
    radial-gradient(circle 7px at 43% 46%, rgba(51, 65, 85, 0.45) 85%, transparent 100%),
    radial-gradient(circle 6px at 65% 38%, rgba(71, 85, 105, 0.55) 85%, transparent 100%),
    radial-gradient(circle 4px at 80% 65%, rgba(71, 85, 105, 0.48) 85%, transparent 100%),
    radial-gradient(circle 7px at 93% 46%, rgba(51, 65, 85, 0.45) 85%, transparent 100%);
}

/* Marikh texture */
.fall-planet-sphere.is-marikh {
  background: linear-gradient(180deg, #fb923c 0%, #9a3412 100%);
  box-shadow: 0 0 12px rgba(251, 146, 60, 0.42);
}
.fall-planet-sphere.is-marikh::before {
  animation-duration: 8.5s;
  background-image:
    radial-gradient(ellipse 14px 7px at 18% 48%, rgba(124, 45, 18, 0.65) 90%, transparent 100%),
    radial-gradient(ellipse 12px 6px at 38% 34%, rgba(254, 215, 170, 0.48) 90%, transparent 100%),
    radial-gradient(ellipse 14px 7px at 68% 48%, rgba(124, 45, 18, 0.65) 90%, transparent 100%),
    radial-gradient(ellipse 12px 6px at 88% 34%, rgba(254, 215, 170, 0.48) 90%, transparent 100%);
}

.fall-loc-caption {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .01em;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.3);
}
#planetCaption::after {
  content: " ▾";
  font-size: 9px;
  opacity: 0.88;
}
#modeCaption::after {
  content: " ⇄";
  font-size: 9px;
  opacity: 0.88;
}

/* Circular Environment Mode Orb beside Planet Orb */
.fall-mode-trigger {
  margin-top: 0;
}
.fall-mode-orb-btn {
  position: relative;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: radial-gradient(circle at 30% 25%, #38bdf8 0%, #0284c7 55%, #0c4a6e 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22), 0 8px 18px rgba(15, 23, 42, 0.42);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .2s ease;
}
.fall-mode-orb-btn::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.32);
  animation: fallOrbitRing 18s linear infinite;
  pointer-events: none;
}
.fall-mode-orb-btn.is-udara {
  background: radial-gradient(circle at 30% 25%, #34d399 0%, #059669 55%, #064e3b 100%);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.24), 0 8px 18px rgba(15, 23, 42, 0.42);
}
.fall-mode-orb-btn:hover {
  transform: scale(1.06);
  border-color: #fde047;
}
.fall-mode-orb-btn:focus-visible {
  outline: 2px solid #fde047;
  outline-offset: 3px;
}
.fall-mode-orb-btn svg {
  width: 26px;
  height: 26px;
  display: block;
}

/* Planet Selection Drawer */
.fall-planet-drawer {
  position: absolute;
  top: 90px;
  left: 10px;
  z-index: 12;
  width: min(295px, calc(100% - 20px));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #d5cce6;
  border-radius: 16px;
  padding: 11px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.34);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.fall-planet-drawer.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.fall-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}
.fall-drawer-head b {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--fall-ink);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.fall-drawer-close {
  border: 1px solid var(--fall-line);
  background: var(--fall-tint);
  color: var(--fall-ink);
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.fall-drawer-list {
  display: grid;
  gap: 6px;
}
.fall-planet-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--fall-line);
  background: #faf8fe;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.fall-planet-opt:hover {
  background: #ffffff;
  border-color: var(--fall-accent);
  box-shadow: 0 4px 12px rgba(99, 67, 149, 0.12);
}
.fall-planet-opt.on {
  background: #f2ebfc;
  border-color: var(--fall-accent);
  box-shadow: inset 0 0 0 1px var(--fall-accent);
}
.fall-planet-opt .po-meta {
  flex: 1;
  min-width: 0;
}
.fall-planet-opt .po-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.fall-planet-opt .po-top strong {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--fall-ink);
}
.fall-planet-opt .po-top span {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--fall-accent);
  font-variant-numeric: tabular-nums;
}
.fall-planet-opt small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--fall-mut);
  font-weight: 600;
}

.fall-badge {
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: 6px 11px;
  color: #f8fafc;
  font-weight: 750;
  font-size: 12px;
  line-height: 1.35;
}
.fall-timer {
  text-align: right;
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  padding: 7px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
}
.fall-timer .st {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #cbd5e1;
  margin-top: 0;
}
.fall-timer .st::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  flex: none;
}
.fall-timer .st.run { color: #6ee7b7; }
.fall-timer .st.run::before {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.85);
}
.fall-timer .st.pause { color: #fdba74; }
.fall-timer .st.pause::before {
  background: #fb923c;
  box-shadow: 0 0 8px rgba(251, 146, 60, 0.8);
}
.fall-timer .st.done { color: #93c5fd; }
.fall-timer .st.done::before {
  background: #60a5fa;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.8);
}
.fall-timer .t-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.fall-timer .t-ico {
  width: 15px;
  height: 15px;
  color: #94a3b8;
  flex: none;
}
.fall-timer .t {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

#toast {
  position: absolute;
  left: 50%;
  top: 76px;
  transform: translate(-50%, -10px);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255,255,255,0.2);
  color: #f8fafc;
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  opacity: 0;
  transition: .25s;
  pointer-events: none;
  max-width: 88%;
  text-align: center;
  z-index: 15;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

#hint {
  position: absolute;
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  color: #252137;
  border: 1px solid rgba(99, 67, 149, 0.25);
  font-weight: 800;
  font-size: 13px;
  padding: 8px 15px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
  animation: fallBob 1.7s ease-in-out infinite;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  z-index: 5;
}
#hint.hide { display: none; }
@keyframes fallBob { 50% { transform: translate(-50%, -6px); } }

#result {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid #d7cde8;
  border-radius: 14px;
  padding: 10px 13px;
  color: var(--fall-ink);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.28);
  transform: translateY(calc(100% + 24px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform .36s cubic-bezier(.2, 1.15, .35, 1), opacity .22s ease, visibility .22s ease;
  max-height: 84%;
  overflow: auto;
  z-index: 10;
}
#result:empty { display: none; }
#result.show {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
#result h4 {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fall-ink);
}
#result .x {
  margin-left: auto;
  border: 1px solid var(--fall-line);
  background: var(--fall-tint);
  color: var(--fall-ink);
  border-radius: 8px;
  width: 26px;
  height: 26px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
#result .rank {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 6px;
  margin-bottom: 7px;
}
#result .rank div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  background: #f8f6fc;
  border: 1px solid #e6dff2;
  border-radius: 10px;
  padding: 6px 8px;
  font-weight: 750;
  font-size: 12px;
  min-width: 0;
}
#result .rank .r-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
}
#result .rank .pos {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  flex: none;
}
#result .rank .v {
  margin-left: 0;
  color: var(--fall-mut);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  text-align: left;
  line-height: 1.3;
  font-weight: 650;
}
#result p { margin: 4px 0; font-size: 12px; line-height: 1.4; color: #3d3652; }
#result p b { color: var(--fall-accent-dark); }
#result .impact-box {
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
  font-size: 11.5px;
  line-height: 1.4;
}
#result .impact-box strong { color: #92400e; }
#result .pred {
  padding: 5px 10px;
  border-radius: 9px;
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 6px;
}
#result .pred.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
#result .pred.no { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }

/* ===== Action Bar below stage ===== */
.fall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--fall-line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 33, 55, 0.04);
}
.fall-btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 15px;
  min-height: 40px;
  font: 750 13.5px/1 inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform .1s, background .15s, border-color .15s;
}
.fall-btn:active { transform: scale(.97); }
.fall-btn.go {
  background: var(--fall-accent);
  color: #ffffff;
  min-width: 122px;
  box-shadow: 0 4px 12px rgba(99, 67, 149, 0.26);
}
.fall-btn.go:hover { background: var(--fall-accent-dark); }
.fall-btn.go.pause {
  background: #d97706;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}
.fall-btn.go.pulse { animation: fallPulse 1.1s ease-in-out 2; }
@keyframes fallPulse { 50% { transform: scale(1.05); } }
.fall-btn.sec {
  background: var(--fall-tint);
  color: var(--fall-ink);
  border-color: var(--fall-line);
}
.fall-btn.sec:hover { border-color: var(--fall-accent); background: #ece4f8; }

.fall-chips {
  display: inline-flex;
  gap: 3px;
  background: var(--fall-tint);
  border: 1px solid var(--fall-line);
  padding: 3px;
  border-radius: 10px;
}
.fall-chips button {
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 6px 9px;
  min-height: 32px;
  font: 750 12.5px/1 inherit;
  color: var(--fall-mut);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.fall-chips button:hover { color: var(--fall-ink); }
.fall-chips button.on { background: var(--fall-ink); color: #ffffff; }

.fall-tog {
  border: 1px solid var(--fall-line);
  background: var(--fall-tint);
  border-radius: 10px;
  padding: 7px 11px;
  min-height: 40px;
  font: 700 12.5px/1 inherit;
  color: var(--fall-mut);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.fall-tog:hover { border-color: var(--fall-accent); color: var(--fall-ink); }
.fall-tog.on {
  background: #ede6fa;
  color: var(--fall-accent-dark);
  border-color: var(--fall-accent);
  font-weight: 800;
}
/* Top Floating Prediction Popup inside Simulation Stage */
.fall-pred-popup {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 14;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 280px);
  padding: 6px 8px 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f8fafc;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.34);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.fall-pred-popup.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.fall-pred-popup:empty { display: none; }
.fall-pred-popup .pred-head { display: contents; }
.fall-pred-popup .pred-head > span {
  order: 1;
  font-size: 12px;
  font-weight: 750;
  color: #e2e8f0;
  white-space: nowrap;
}
.fall-pred-popup .fall-chips {
  order: 2;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  padding: 2px;
  gap: 3px;
}
.fall-pred-popup .fall-chips button {
  min-width: 30px;
  min-height: 26px;
  padding: 4px 8px;
  font-size: 12px;
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.fall-pred-popup .fall-chips button:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}
.fall-pred-popup .fall-chips button.on {
  background: var(--fall-accent);
  color: #ffffff;
}
.fall-pred-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.fall-pred-popup .pred-close {
  order: 3;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  transition: background .15s, color .15s;
}
.fall-pred-popup .pred-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* ===== Right: Control Panel (Compact, Lab-Template Typography) ===== */
.fall-ctrl-card {
  flex: 1 1 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid var(--fall-line);
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(37, 33, 55, 0.04);
}
.fall-ctrl-card .lab-control-title {
  margin: 0;
  font-size: 1.075rem;
  letter-spacing: -.015em;
}
.fall-ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fall-lbl {
  font-size: .875rem;
  color: var(--fall-ink);
  font-weight: 750;
  line-height: 1.3;
  margin: 0;
}

/* Single-row Symbol Playback & Speed Strip */
.fall-play-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}
.fall-btn-sym {
  width: 38px;
  min-width: 38px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  border-radius: 9px;
}
.fall-play-row .fall-btn.go {
  min-width: 42px;
  width: 42px;
}
.fall-play-row .fall-chips {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  min-width: 0;
  padding: 2px;
  gap: 2px;
}
.fall-play-row .fall-chips button {
  padding: 4px 2px;
  min-height: 30px;
  font-size: .75rem;
  text-align: center;
}

/* Live Parameter Summary & Tip Card inside Control Panel */
.fall-status-card {
  background: #f8f6fc;
  border: 1px solid #e7e1f2;
  border-radius: 11px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fall-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.fall-stat-item {
  background: #ffffff;
  border: 1px solid #eae4f5;
  border-radius: 8px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1px;
  min-width: 0;
}
.fall-stat-item small {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #645c82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fall-stat-item b {
  font-size: 12px;
  font-weight: 800;
  color: var(--fall-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fall-mini-tip {
  font-size: 11px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--fall-mut);
  border-top: 1px dashed #e2daef;
  padding-top: 5px;
}
.fall-mini-tip[hidden] { display: none; }
.fall-reopen-btn {
  width: 100%;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(99, 67, 149, 0.35);
  background: #ede6fa;
  color: var(--fall-accent-dark);
  font: 750 12px/1 inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s, border-color .15s, transform .15s;
}
.fall-reopen-btn:hover {
  background: #e2d5f8;
  border-color: var(--fall-accent);
}
.fall-reopen-btn[hidden] { display: none; }

/* Bottom Display & Audio Section inside Control Panel */
.fall-toggles-wrap {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #ede8f6;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fall-ctrl-toggles {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fall-ctrl-toggles .fall-tog {
  flex: 1;
  min-height: 34px;
  padding: 5px 8px;
  font-size: .78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}
.fall-ctrl-toggles #togSound {
  flex: none;
  width: 42px;
  padding: 0;
}

.fall-seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  background: var(--fall-tint);
  border: 1px solid var(--fall-line);
  padding: 3px;
  border-radius: 10px;
}
.fall-seg button {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 10px;
  min-height: 36px;
  border-radius: 8px;
  font: 700 .8125rem/1.1 inherit;
  color: var(--fall-mut);
  cursor: pointer;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: .15s;
}
.fall-seg button:hover { color: var(--fall-ink); }
.fall-seg button.on {
  background: #ffffff;
  color: var(--fall-accent-dark);
  border-color: rgba(99, 67, 149, 0.35);
  box-shadow: 0 2px 6px rgba(99, 67, 149, 0.12);
}
.fall-seg.mode button.on[data-mode="udara"] {
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.35);
}

.fall-note {
  font-size: .78rem;
  color: var(--fall-mut);
  margin: 0;
  line-height: 1.4;
}
.fall-note b { color: var(--fall-ink); }

/* Circular Tower Height (+/-) Buttons on Canvas Ruler */
.fall-h-btn {
  position: absolute;
  z-index: 6;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  transform: translateX(-50%);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.fall-h-btn svg {
  width: 14px;
  height: 14px;
  display: block;
  flex: none;
  pointer-events: none;
}
.fall-h-btn:hover:not(:disabled) {
  background: var(--fall-accent);
  border-color: #fde047;
  transform: translateX(-50%) scale(1.1);
  box-shadow: 0 6px 16px rgba(99, 67, 149, 0.4);
}
.fall-h-btn:focus-visible {
  outline: 2px solid #fde047;
  outline-offset: 2px;
}
.fall-h-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.fall-h-lbl {
  position: absolute;
  z-index: 6;
  transform: translateX(-50%);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.5px 6px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.25);
}

/* 2x3 visual icon cards inside right control panel */
.fall-presets-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 0;
}
.fall-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.fall-preset {
  border: 1px solid var(--fall-line);
  background: #faf8fe;
  border-radius: 10px;
  padding: 6px 6px;
  min-height: 50px;
  text-align: center;
  font: 700 .78rem/1.2 inherit;
  color: var(--fall-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: .15s;
  min-width: 0;
}
.fall-preset:hover {
  background: #ffffff;
  border-color: var(--fall-accent);
  box-shadow: 0 3px 10px rgba(99, 67, 149, 0.1);
}
.fall-preset.on {
  border-color: var(--fall-accent);
  background: #efe8fc;
  box-shadow: 0 0 0 2px rgba(99, 67, 149, 0.16);
}
.fall-preset-icons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
}
.fall-preset-icons canvas {
  display: block;
  width: 22px;
  height: 20px;
  flex: none;
}
.fall-preset-vs {
  font-size: .65rem;
  font-weight: 800;
  color: var(--fall-mut);
  text-transform: lowercase;
  padding: 0 1px;
  flex: none;
}
.fall-preset-lvl {
  font-size: .65rem;
  font-weight: 800;
  color: var(--fall-accent);
  margin-left: -1px;
  margin-right: 1px;
  flex: none;
}
.fall-preset-tag {
  font-size: .69rem;
  font-weight: 700;
  color: var(--fall-mut);
  background: #f0ebf8;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ===== Bottom: Data & Bacaan + Graf ===== */
.fall-bottom-section {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fall-panel-card {
  padding: 16px 18px;
  border: 1px solid var(--fall-line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(37, 33, 55, 0.04);
}
.fall-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.fall-panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--fall-ink);
}
.fall-panel-head small {
  font-size: 12px;
  font-weight: 700;
  color: var(--fall-mut);
  background: var(--fall-tint);
  padding: 4px 10px;
  border-radius: 999px;
}

.fall-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.fall-lane {
  border-radius: 14px;
  background: #faf8fe;
  border: 1px solid var(--fall-line);
  padding: 11px 12px;
  position: relative;
  overflow: hidden;
}
.fall-lane::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--lc);
}
.fall-lane .top { display: flex; align-items: center; gap: 9px; }
.fall-lane .top canvas { width: 38px; height: 34px; flex: none; }
.fall-lane .nm { font-weight: 800; font-size: 13.5px; line-height: 1.2; color: var(--fall-ink); min-width: 0; }
.fall-lane .nm small { display: block; color: var(--fall-mut); font-weight: 600; font-size: 11px; margin-top: 2px; }
.fall-pill {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ebe6f6;
  color: var(--fall-mut);
  white-space: nowrap;
}
.fall-pill.fall { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.fall-pill.land { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

.fall-vals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}
.fall-vals div {
  background: #ffffff;
  border: 1px solid #eae4f4;
  border-radius: 9px;
  padding: 6px 8px;
  text-align: center;
}
.fall-vals i {
  display: block;
  font-style: normal;
  font-size: 10px;
  color: var(--fall-mut);
  font-weight: 750;
}
.fall-vals b {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 800;
  color: var(--fall-ink);
}
.fall-vals b u {
  text-decoration: none;
  font-size: 10px;
  color: var(--fall-mut);
  font-weight: 650;
  margin-left: 2px;
}
.fall-lane-impact {
  margin-top: 8px;
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #f3effa;
  color: var(--fall-mut);
  border: 1px solid #e6dff2;
}
.fall-lane-impact.extreme { background: #ffe4e6; color: #881337; border-color: #fda4af; }
.fall-lane-impact.high { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.fall-lane-impact.med { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.fall-lane-impact.low { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }

.fall-impact-banner {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8f5fc 0%, #fffbeb 100%);
  border: 1px solid #e5dcf3;
  font-size: 12.5px;
  line-height: 1.55;
  color: #3d3652;
}
.fall-impact-banner strong { color: var(--fall-ink); }

.fall-lane.empty {
  display: grid;
  place-items: center;
  min-height: 126px;
  color: var(--fall-mut);
  font-weight: 650;
  font-size: 12.5px;
  text-align: center;
  padding: 16px;
  border-style: dashed;
  background: #fcfbfe;
}

#graphWrap {
  position: relative;
  height: 240px;
  border-radius: 12px;
  background: #fcfbfe;
  border: 1px solid #eae4f4;
}
#graph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ===== Picker Bottom Sheet ===== */
.fall-item {
  position: relative;
  background: #faf8fe;
  border: 1px solid var(--fall-line);
  border-radius: 12px;
  padding: 7px 6px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .15s, border-color .15s, box-shadow .15s, background .15s;
}
.fall-item:hover {
  transform: translateY(-2px);
  background: #ffffff;
  border-color: var(--fall-accent);
  box-shadow: 0 6px 14px rgba(99, 67, 149, 0.12);
}
.fall-item canvas { width: 52px; height: 44px; pointer-events: none; }
.fall-item b { font-size: 12px; font-weight: 750; color: var(--fall-ink); text-align: center; line-height: 1.15; }
.fall-item span { font-size: 10.5px; color: var(--fall-mut); font-weight: 650; }

.fall-sheet {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: .22s;
}
.fall-sheet.show { opacity: 1; pointer-events: auto; }
.fall-sheet-body {
  background: #ffffff;
  border: 1px solid var(--fall-line);
  border-radius: 22px 22px 0 0;
  width: min(560px, 100%);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.2);
  transform: translateY(36px);
  transition: .26s;
}
.fall-sheet.show .fall-sheet-body { transform: none; }
.fall-sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.fall-sheet-head b { font-size: 16px; color: var(--fall-ink); }
.fall-sheet-head small { display: block; color: var(--fall-mut); font-weight: 600; font-size: 12px; }
.fall-sheet-head button {
  margin-left: auto;
  border: 1px solid var(--fall-line);
  background: var(--fall-tint);
  color: var(--fall-ink);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.fall-pick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fall-pick-grid .fall-item { touch-action: manipulation; cursor: pointer; }
.fall-pick-grid .fall-item.cur { box-shadow: inset 0 0 0 2px var(--fall-accent); background: #f3ecfc; }
#sheetRemove {
  margin-top: 12px;
  width: 100%;
  justify-content: center;
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

/* ===== Responsive ===== */
@media (max-width: 1040px) {
  .fall-workspace { grid-template-columns: minmax(0, 1fr); }
  .fall-lanes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .fall-pred-popup {
    top: 86px;
    max-width: calc(100% - 20px);
    flex-wrap: wrap;
    justify-content: center;
  }
}
@media (max-width: 640px) {
  #stageWrap { height: 58svh; min-height: 430px; }
  .fall-planet-orb-btn { width: 46px; height: 46px; }
  .fall-planet-sphere { width: 38px; height: 38px; }
  .fall-mode-orb-btn { width: 46px; height: 46px; }
  .fall-mode-orb-btn svg { width: 22px; height: 22px; }
  .fall-planet-drawer { top: 82px; left: 10px; width: min(280px, calc(100% - 20px)); }
  .fall-pred-popup {
    top: auto;
    bottom: 52px;
    width: calc(100% - 20px);
    max-width: 340px;
    padding: 7px 9px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    transform: translateX(-50%) translateY(8px);
  }
  .fall-pred-popup.show { transform: translateX(-50%) translateY(0); }
  .fall-pred-popup .pred-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .fall-pred-popup .pred-head > span { order: 0; font-size: 11.5px; }
  .fall-pred-popup .pred-close { order: 0; }
  .fall-pred-popup .fall-chips {
    order: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    width: 100%;
  }
  .fall-timer { padding: 6px 10px; }
  .fall-timer .t { font-size: 16px; }
  .fall-pick-grid { grid-template-columns: repeat(2, 1fr); }
  /* Mobile-friendly touch targets (>= 34–42px) without changing desktop */
  .fall-btn-sym { width: 42px; min-width: 42px; height: 42px; min-height: 42px; font-size: 16px; }
  .fall-play-row .fall-btn.go { width: 46px; min-width: 46px; }
  .fall-play-row .fall-chips button { min-height: 36px; font-size: .8rem; }
  .fall-ctrl-toggles .fall-tog { min-height: 40px; }
  .fall-ctrl-toggles #togSound { width: 46px; }
  .fall-h-btn { width: 34px; height: 34px; }
  .fall-h-btn svg { width: 16px; height: 16px; }
  .fall-pred-popup .fall-chips button { min-height: 34px; font-size: 12.5px; }
  .fall-pred-popup .pred-close { width: 28px; height: 28px; font-size: 12px; }
}
