/* ============================================================================
   COMPONENTS  ·  Observatory layout, HUD, dome, transit theater, oracle
   Loaded after styles.css (the design-system tokens).
   ========================================================================== */

/* ---- script-visibility prefs ---- */
:root[data-dev="off"] .dev { display: none !important; }
:root[data-glow="soft"] { filter: none; }
:root[data-glow="soft"] .dome circle[filter] { filter: none !important; }

/* =============================================================== STARFIELD  */
.starfield { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.starfield span {
  position: absolute; border-radius: 50%; background: #fff;
  animation-name: twinkle; animation-iteration-count: infinite; animation-timing-function: ease-in-out;
}
:root[data-sky="day"] .starfield { opacity: 0; }

/* ================================================================== DOME    */
.dome-wrap {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center; pointer-events: none;
}
.dome {
  width: min(88vh, 800px); height: min(88vh, 800px);
  pointer-events: auto; cursor: grab; touch-action: none;
  user-select: none;
}
.dome:active { cursor: grabbing; }
.dome text { user-select: none; }
.planet:hover { filter: brightness(1.3) drop-shadow(0 0 5px var(--gold)); }
.dome-hint {
  position: absolute; bottom: 88px; left: 50%; transform: translateX(-50%);
  font-size: var(--t-micro); letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-faint); pointer-events: none; z-index: 2;
}

/* ================================================================== HUD     */
.hud { position: absolute; z-index: 6; border-radius: var(--r-lg); }

/* --- top status --- */
.top {
  top: 14px; left: 50%; transform: translateX(-50%);
  width: min(760px, 62vw); padding: var(--s3) var(--s5);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s5);
}
.top-cell { display: flex; flex-direction: column; gap: 2px; }
.top-cell.tithi { flex-direction: row; align-items: center; gap: var(--s3); }
.top-cell.center { align-items: center; text-align: center; }
.top-cell.right { align-items: flex-end; text-align: right; }
.top-main { font-size: var(--t-md); font-weight: 600; color: var(--ink); line-height: 1.15; }
.top-sub { font-size: var(--t-xs); color: var(--ink-faint); }
.top-cell.center::before, .top-cell.center::after {
  content: ""; position: absolute;
}

/* --- side panels --- */
.panel {
  top: 104px; width: 292px; max-height: calc(100vh - 320px);
  display: flex; flex-direction: column; padding: var(--s4);
}
.panel.left { left: 16px; }
.panel.right { right: 16px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: var(--s3); margin-bottom: var(--s2);
  border-bottom: 1px solid var(--glass-border);
}

/* graha dashboard */
.graha-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.graha-row {
  display: grid; grid-template-columns: 26px 1fr auto 30px; align-items: center; gap: var(--s2);
  padding: 7px var(--s2); border: 0; background: transparent; border-radius: var(--r-sm);
  cursor: pointer; text-align: left; color: var(--ink); transition: background var(--dur-fast);
  border: 1px solid transparent;
}
.graha-row:hover { background: rgba(212,168,67,0.08); }
.graha-row.hero { background: rgba(212,168,67,0.10); border-color: var(--glass-border); }
.graha-glyph { font-size: 1.15rem; text-align: center; line-height: 1; filter: drop-shadow(0 0 4px currentColor); }
.graha-name { display: flex; flex-direction: column; min-width: 0; }
.gn { font-size: var(--t-sm); font-weight: 600; }
.gd { font-size: var(--t-micro); color: var(--gold); opacity: 0.85; }
.graha-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.rashi-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-bottom: 1px; box-shadow: 0 0 5px currentColor; }
.gr { font-size: var(--t-micro); color: var(--ink-soft); letter-spacing: 0.05em; }
.gn2 { font-size: var(--t-micro); color: var(--ink-faint); }
.graha-flags { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.flag { font-style: normal; font-size: 0.7rem; line-height: 1; }
.flag.retro { color: var(--retro-purple); filter: brightness(1.7); }
.flag.fwd { color: var(--ink-faint); }
.flag.combust { color: var(--combust-orange); animation: soft-pulse 1.4s ease-in-out infinite; }
.combust-mark { display: inline-block; vertical-align: -1px; margin-left: 4px;
  filter: drop-shadow(0 0 3px var(--combust-orange)); animation: soft-pulse 1.6s ease-in-out infinite; }
.mark-retro { font-style: normal; color: var(--retro-purple); filter: brightness(1.9); margin-left: 4px; font-weight: 700; }
.pp-legend { display: flex; flex-wrap: wrap; gap: 22px; margin-bottom: 14px; font-size: 0.7rem; color: var(--ink-soft); }
.pp-legend span { display: flex; align-items: center; gap: 6px; }
.flag.live { color: var(--gold); animation: soft-pulse 1s ease-in-out infinite; }

/* muhurat timeline */
.muh-list { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.muh-row {
  display: grid; grid-template-columns: 4px 1fr auto; align-items: center; gap: var(--s3);
  padding: 6px var(--s2) 6px 0; border-radius: var(--r-sm); transition: opacity var(--dur-med);
}
.muh-bar { width: 4px; align-self: stretch; border-radius: 4px; min-height: 26px; }
.muh-row.green .muh-bar { background: var(--m-green); box-shadow: 0 0 8px -2px var(--m-green); }
.muh-row.red   .muh-bar { background: var(--m-red);   box-shadow: 0 0 8px -2px var(--m-red); }
.muh-row.amber .muh-bar { background: var(--m-amber); box-shadow: 0 0 8px -2px var(--m-amber); }
.muh-body { display: flex; flex-direction: column; }
.muh-name { font-size: var(--t-sm); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.muh-name .abhijit { color: var(--gold); font-style: normal; font-size: 0.7rem; }
.muh-nature { font-size: var(--t-micro); color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.12em; }
.muh-time { font-size: var(--t-xs); color: var(--ink-soft); }
.muh-row.past { opacity: 0.32; }
.muh-row.now {
  background: linear-gradient(90deg, rgba(212,168,67,0.16), transparent);
  box-shadow: inset 0 0 0 1px var(--glass-border);
}
.muh-row.now .muh-name { color: var(--gold-bright); }

/* --- bottom temporal anchor --- */
.bottom {
  left: 16px; right: 16px; bottom: 12px; border-radius: var(--r-lg);
  padding: var(--s3) var(--s6); display: flex; align-items: center; gap: var(--s8);
}
.anchor { display: flex; flex-direction: column; gap: 2px; }
.anchor-main { font-size: var(--t-sm); font-weight: 600; }
.anchor-sub { font-size: var(--t-micro); color: var(--ink-faint); }
.anchor.dates { gap: 4px; }
.d-row { display: flex; align-items: baseline; gap: 6px; }
.d-row .eyebrow { color: var(--ink-faint); }
.d-row b { font-size: var(--t-sm); color: var(--gold); margin-right: var(--s3); }
.greg { font-size: var(--t-xs); color: var(--ink-soft); }
.suntimes { display: flex; flex-direction: row; gap: var(--s5); margin-left: auto; }
.sun-cell { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.sun-ic { color: var(--gold); font-size: 0.8rem; }
.sun-cell .eyebrow { font-size: 0.5rem; }
.sun-cell .ephem { font-size: var(--t-xs); }
.anchor.ctrls { align-items: flex-end; gap: 6px; }
.live-clock { font-size: var(--t-sm); color: var(--gold); letter-spacing: 0.04em; }
.ctrl-btns { display: flex; gap: 6px; }
.pill {
  font-family: var(--font-data); font-size: var(--t-xs); font-weight: 600;
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink-soft); border: 1px solid var(--glass-border);
  transition: all var(--dur-fast);
}
.pill:hover { color: var(--ink); border-color: var(--gold); }
.pill.solid { background: var(--gold); color: #1a1407; border-color: var(--gold); }
.pill.solid:hover { background: var(--gold-bright); }

/* ============================================================ PLANET CARD   */
.planet-card {
  position: absolute; z-index: 9; left: 320px; top: 104px; width: 300px;
  border-radius: var(--r-lg); padding: var(--s5); animation: fade-up var(--dur-med) var(--ease-celestial);
}
.card-x {
  position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%;
  background: transparent; border: 1px solid var(--glass-border); color: var(--ink-soft);
  cursor: pointer; font-size: 0.7rem; line-height: 1; transition: all var(--dur-fast);
}
.card-x:hover { color: var(--ink); border-color: var(--gold); }
.card-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.card-glyph { font-size: 2rem; filter: drop-shadow(0 0 8px currentColor); }
.card-title { font-size: 1.4rem; font-weight: 600; line-height: 1; }
.card-title .dev { font-size: 1rem; color: var(--silver); margin-left: 6px; }
.card-sub { margin-top: 4px; }
.card-rows { margin: 0; display: flex; flex-direction: column; }
.cr { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4);
  padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.cr dt { color: var(--ink-faint); }
.cr dd { margin: 0; font-size: var(--t-sm); color: var(--ink); text-align: right; }
.card-transit {
  margin-top: var(--s4); padding: var(--s3); border-radius: var(--r-sm);
  background: rgba(212,168,67,0.10); border: 1px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 2px;
}
.ct-val { font-size: var(--t-lg); color: var(--gold-bright); }

/* ========================================================== TRANSIT THEATER */
.transit-theater {
  position: absolute;
  bottom: 92px; left: 50%; transform: translateX(-50%);
  width: min(840px, calc(100vw - 700px)); border-radius: var(--r-lg);
  padding: var(--s4) var(--s6);
  display: grid; grid-template-columns: 1.1fr 1fr 1.4fr; align-items: center; gap: var(--s6);
  z-index: 7;
  box-shadow: var(--glass-glow), 0 0 60px -20px rgba(212,168,67,0.4);
  opacity: 1;
}
.transit-theater.phase-imminent { box-shadow: var(--glass-glow), 0 0 80px -16px rgba(212,168,67,0.65); }
.transit-theater.phase-confirm { box-shadow: var(--glass-glow), 0 0 70px -18px rgba(46,139,87,0.5); }
.tt-left { display: flex; flex-direction: column; gap: 8px; }
.tt-alert { display: flex; align-items: center; gap: 8px; }
.tt-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold);
  animation: soft-pulse 1s ease-in-out infinite; }
.tt-route { display: flex; align-items: center; gap: 8px; font-size: var(--t-sm); }
.tt-from { color: var(--ink-faint); }
.tt-arrow { color: var(--gold); }
.tt-to { color: var(--gold-bright); font-weight: 600; }
.tt-nak-handoff { display: flex; align-items: center; gap: 8px; font-family: var(--font-sacred);
  font-style: italic; font-size: var(--t-sm); }
.nh.dim { color: var(--ink-faint); }
.nh.bright { color: var(--gold); }
.nh-stream { position: relative; width: 46px; height: 8px; overflow: hidden; }
.nh-stream i {
  position: absolute; top: 3px; width: 3px; height: 3px; border-radius: 50%; background: var(--gold-bright);
  animation: nh-flow 1.4s linear infinite;
}
.nh-stream i:nth-child(2) { animation-delay: 0.46s; }
.nh-stream i:nth-child(3) { animation-delay: 0.92s; }
@keyframes nh-flow { from { left: -4px; opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } to { left: 46px; opacity: 0; } }

.tt-count { text-align: center; }
.tt-label { display: block; margin-bottom: 4px; }
.tt-timer { display: flex; align-items: baseline; justify-content: center; }
.tt-mmss { font-size: 2.6rem; font-weight: 700; color: var(--gold);
  letter-spacing: 0.02em; line-height: 1; animation: count-flash 2s ease-in-out infinite; }
.phase-imminent .tt-mmss { font-size: 3rem; }
.tt-ms { font-size: 1.1rem; color: var(--ink-faint); align-self: flex-end; margin-left: 2px; }
.tt-timer.done .tt-mmss { font-size: 1.5rem; color: var(--m-green); animation: none; }
.tt-confirm { font-size: var(--t-xs); color: var(--ink-soft); margin-top: 4px; }

.tt-narration { border-left: 1px solid var(--glass-border); padding-left: var(--s5); }
.narr-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.oracle-mini { width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold-dim));
  box-shadow: 0 0 10px var(--gold); animation: soft-pulse 2.4s ease-in-out infinite; }
.narr-text { font-size: var(--t-md); line-height: 1.45; color: var(--ink-soft); margin: 0; font-style: italic; }
.narr-text em { color: var(--gold); font-style: italic; }

/* =============================================================== ORACLE     */
.oracle-orb {
  position: fixed; z-index: 12; right: 26px; bottom: 92px; width: 54px; height: 54px;
  border-radius: 50%; border: 0; background: transparent; cursor: pointer; padding: 0;
  display: grid; place-items: center;
}
.orb-core { position: absolute; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold-dim));
  box-shadow: 0 0 22px var(--gold); animation: bindu-morph 8s ease-in-out infinite; }
.orb-ring { position: absolute; inset: 6px; border-radius: 50%; border: 1px solid var(--gold); opacity: 0.5;
  animation: halo-breathe 3s ease-in-out infinite; }
.orb-ring.r2 { inset: 0; opacity: 0.25; animation-duration: 4s; }
.oracle-orb.active .orb-core { box-shadow: 0 0 30px var(--gold-bright); }

.oracle-panel {
  position: fixed; z-index: 12; right: 26px; bottom: 156px; width: 360px;
  border-radius: var(--r-lg); padding: var(--s5); animation: slide-in-right var(--dur-med) var(--ease-celestial);
}
.op-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.op-title { font-size: 1.4rem; }
.op-title em { color: var(--gold); font-style: italic; }
.op-intro { font-style: italic; color: var(--ink-soft); font-size: var(--t-md); margin: 0 0 var(--s4); }
.op-prompts { display: flex; flex-direction: column; gap: 6px; }
.op-prompt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px var(--s3); border-radius: var(--r-sm); cursor: pointer; text-align: left;
  background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); color: var(--ink);
  transition: all var(--dur-fast);
}
.op-prompt:hover { background: rgba(212,168,67,0.10); border-color: var(--gold); }
.opp-main { font-size: var(--t-sm); font-weight: 600; }
.opp-sub { font-size: var(--t-micro); color: var(--ink-faint); }
.op-wave { display: flex; align-items: center; justify-content: center; gap: 2px; height: 36px; margin-top: var(--s4); }
.op-wave i { width: 2.5px; background: var(--gold); border-radius: 2px; opacity: 0.7;
  animation: wave-bar 1.1s ease-in-out infinite; }
@keyframes wave-bar { 0%,100% { transform: scaleY(0.4); } 50% { transform: scaleY(1.3); } }

/* ============================================================ CROSSING FLASH */
.crossing-flash { position: fixed; inset: 0; z-index: 20; pointer-events: none; display: grid; place-items: center; }
.cf-wash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(212,168,67,0.5), transparent 60%);
  animation: gold-wash 2.4s var(--ease-celestial) forwards; }
.cf-ripple { width: 60vmin; height: 60vmin; animation: ripple-out 2s var(--ease-celestial) forwards; opacity: 0.8; }

/* ============================================================ RESPONSIVE     */
@media (max-width: 1180px) {
  .panel { width: 232px; }
  .planet-card { left: 256px; }
  .transit-theater { width: min(620px, 70vw); grid-template-columns: 1fr 1fr; }
  .tt-narration { display: none; }
}
@media (max-width: 880px) {
  .top { width: 92vw; grid-template-columns: 1fr; gap: 6px; text-align: center; }
  .top-cell.tithi, .top-cell.right { align-items: center; justify-content: center; }
  .panel { display: none; }
  .bottom { flex-wrap: wrap; gap: var(--s4); padding: var(--s3); }
  .suntimes { margin-left: 0; }
  .transit-theater { width: 92vw; bottom: 150px; grid-template-columns: 1fr; text-align: center; }
  .tt-left { align-items: center; }
}
