:root {
  --bg: #04060c;
  --panel: rgba(14, 18, 32, 0.78);
  --card: rgba(22, 28, 48, 0.72);
  --card2: rgba(30, 38, 64, 0.65);
  --line: rgba(120, 150, 220, 0.16);
  --line2: rgba(120, 150, 220, 0.3);
  --text: #e6ecf8;
  --muted: #8f9cb8;
  --accent: #ffd36b;
  --accent2: #6cc8ff;
  --accent3: #b48cff;
  --flash: #ff5a4e;
  --ok: #57e3a1;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "PingFang TC", "Microsoft YaHei", "Microsoft JhengHei", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; color: var(--text); font: 13px/1.45 var(--font); }
body {
  display: flex; overflow: hidden; background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(108, 200, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(180, 140, 255, 0.10), transparent 60%);
}
/* Twinkling starfield behind everything */
body::before, body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-repeat: repeat;
}
body::before {
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff9, transparent), radial-gradient(1px 1px at 120px 80px, #fff7, transparent),
    radial-gradient(1.5px 1.5px at 200px 150px, #cfe3ff, transparent), radial-gradient(1px 1px at 300px 40px, #fff8, transparent),
    radial-gradient(1px 1px at 380px 220px, #fff6, transparent), radial-gradient(1.5px 1.5px at 60px 260px, #ffe9c4, transparent);
  background-size: 420px 300px; opacity: .55; animation: twinkle 7s ease-in-out infinite alternate;
}
body::after {
  background-image:
    radial-gradient(1px 1px at 90px 120px, #fff8, transparent), radial-gradient(1px 1px at 250px 260px, #fff6, transparent),
    radial-gradient(1.5px 1.5px at 330px 90px, #d7e6ff, transparent);
  background-size: 360px 330px; opacity: .4; animation: twinkle 11s ease-in-out infinite alternate-reverse;
}
@keyframes twinkle { from { opacity: .25; } to { opacity: .7; } }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
.small { font-size: 11px; }
.warn { color: #ffb36b; }

/* ------------------------------------------------------------------ panel */
#panel {
  position: relative; z-index: 2; width: 380px; min-width: 320px; height: 100%; overflow-y: auto;
  padding: 14px 14px 30px; background: var(--panel); backdrop-filter: blur(14px);
  border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: #33405f transparent;
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo { position: relative; width: 46px; height: 46px; flex: none; }
.logo-moon {
  position: absolute; inset: 6px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6dc, #d9cfb4 45%, #8d8573 75%, #3d3a33);
  box-shadow: 0 0 18px rgba(255, 220, 150, .55), inset -6px -4px 10px rgba(0, 0, 0, .55);
}
.logo-orbit {
  position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(108, 200, 255, .5);
  border-top-color: transparent; border-left-color: transparent; animation: spin 6s linear infinite;
}
.logo-orbit::after {
  content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent2); box-shadow: 0 0 8px var(--accent2);
}
@keyframes spin { to { transform: rotate(360deg); } }
.brand h1 {
  margin: 0; font-size: 20px; letter-spacing: .01em;
  background: linear-gradient(90deg, #fff3c8, var(--accent) 40%, var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.langbar { display: inline-flex; margin: 10px 0 4px; padding: 3px; border-radius: 999px; background: #0b0f1c; border: 1px solid var(--line); }
.langbar button { border: 0; background: transparent; padding: 4px 12px; border-radius: 999px; color: var(--muted); }
.langbar button.on { background: linear-gradient(135deg, #2f4a85, #4b3a8c); color: #fff; box-shadow: 0 0 10px rgba(108, 200, 255, .25); }

/* hero: live Moon thumbnail + stat tiles */
.hero {
  display: grid; grid-template-columns: 116px 1fr; gap: 12px; align-items: center; margin: 10px 0 12px;
  padding: 12px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(40, 60, 110, .45), rgba(60, 40, 100, .35));
}
.thumb-wrap { position: relative; width: 116px; height: 116px; }
#moonThumb { width: 116px; height: 116px; border-radius: 50%; background: radial-gradient(circle, #1a2035, #05070d); display: block; }
.thumb-ring {
  position: absolute; inset: -4px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent, rgba(108, 200, 255, .6), transparent 40%, rgba(255, 211, 107, .55), transparent 75%);
  -webkit-mask: radial-gradient(circle, transparent 60px, #000 61px); mask: radial-gradient(circle, transparent 60px, #000 61px);
  animation: spin 9s linear infinite; opacity: .35;
}
.hero.ready .thumb-ring { opacity: 1; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tile { background: rgba(5, 8, 16, .45); border: 1px solid var(--line); border-radius: 9px; padding: 5px 8px; min-width: 0; }
.tile .k { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tile .v { display: block; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v small { display: block; font-weight: 400; color: var(--muted); font-size: 10px; }
.meter { display: inline-block; vertical-align: middle; width: 42px; height: 6px; margin-right: 6px; border-radius: 3px; background: #1d2438; overflow: hidden; position: relative; }
.meter::after { content: ""; position: absolute; inset: 0; width: calc(var(--v, 0) * 100%); border-radius: 3px; background: var(--muted); transition: width .6s; }
.meter.good::after { background: linear-gradient(90deg, #2bbf7f, var(--ok)); }
.meter.fair::after { background: linear-gradient(90deg, #c99a2e, var(--accent)); }
.meter.weak::after { background: linear-gradient(90deg, #b8453b, var(--flash)); }

/* collapsible cards */
details.card {
  margin: 10px 0; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25); overflow: hidden;
}
details.card > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  font-weight: 600; font-size: 13px; letter-spacing: .02em; user-select: none;
  background: linear-gradient(90deg, rgba(108, 200, 255, .08), transparent);
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
details.card:not([open]) > summary::after { transform: rotate(-90deg); }
details.card > :not(summary) { margin-left: 12px; margin-right: 12px; }
details.card > :last-child { margin-bottom: 12px; }
.step {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px;
  background: linear-gradient(135deg, var(--accent), #ff9f5a); color: #241600; font-weight: 700;
}
.ico { font-size: 14px; }
.sub-details summary { cursor: pointer; color: var(--accent2); margin: 8px 0 4px; }

.row { display: flex; gap: 6px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.row.tight { margin: 0; flex-wrap: nowrap; }
.field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; margin: 8px 0; }
.field > label { color: var(--muted); }

/* controls */
button, .btn, select, input[type=number], input[type=search], input[type=datetime-local] {
  background: #141a2c; color: var(--text); border: 1px solid #2a3554; border-radius: 8px;
  padding: 6px 10px; font: inherit; transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
}
button, .btn { cursor: pointer; }
button:hover:not(:disabled), .btn:hover { border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(108, 200, 255, .12); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: linear-gradient(135deg, #2b4f96, #4a3b94); border-color: #5b72c8; color: #fff; }
button.primary:hover:not(:disabled) { box-shadow: 0 0 16px rgba(108, 140, 255, .45); }
button.wide { width: 100%; padding: 9px; margin: 2px 0 6px; font-weight: 600; }
button.small { padding: 4px 9px; font-size: 12px; }
.pill { border-radius: 999px; }
.pill.accent { background: linear-gradient(135deg, #5a3b1a, #7a5222); border-color: #b07a32; }
.num { width: 76px; }
input[type=datetime-local] { color-scheme: dark; }
select { color-scheme: dark; }
.flashbtn { background: linear-gradient(135deg, #8a2b2b, #9a4a1e) !important; border-color: #d06b3c !important; }
.flashbtn.scanning { animation: pulseBtn 1.1s ease-in-out infinite; }
@keyframes pulseBtn { 50% { box-shadow: 0 0 18px rgba(255, 90, 78, .7); } }

/* toggle switches */
.switch { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
.switch.inline { display: inline-flex; margin: 0 4px; }
.switch input { display: none; }
.switch > span {
  position: relative; flex: none; width: 30px; height: 17px; border-radius: 999px; background: #262f48; transition: background .2s;
  box-shadow: inset 0 0 0 1px #34405f;
}
.switch > span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%;
  background: #c9d2e6; transition: transform .2s, background .2s;
}
.switch input:checked + span { background: linear-gradient(90deg, #2f6fd0, #6cc8ff); }
.switch input:checked + span::after { transform: translateX(13px); background: #fff; }
.switch em { font-style: normal; }

/* sliders */
.slider { display: grid; grid-template-columns: 96px 1fr 46px; gap: 8px; align-items: center; margin: 6px 0; }
.slider label { color: var(--muted); }
.slider output { text-align: right; font-variant-numeric: tabular-nums; color: var(--accent2); font-size: 12px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(90deg, #2f6fd0, #6cc8ff); opacity: .85; }
input[type=range]::-moz-range-track { height: 5px; border-radius: 3px; background: linear-gradient(90deg, #2f6fd0, #6cc8ff); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; margin-top: -5px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent2); box-shadow: 0 0 8px rgba(108, 200, 255, .6);
}
input[type=range]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 2px solid var(--accent2); }
.slider.color input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(90deg, #555, #6a7fd8, #d8a85a, #c75b5b); }
.slider.geo input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(90deg, #555, #d33d7c, #7b5bd6, #e7d040, #4aa3e0); }

/* features */
.search { display: flex; gap: 6px; margin: 6px 0; }
.search input { flex: 1; min-width: 0; border-radius: 999px; padding-left: 14px; }
.search button { border-radius: 999px; }
.quick { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.qp {
  font-size: 11px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .04);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); color: var(--text);
}
.qp:hover { background: color-mix(in srgb, var(--c) 18%, transparent) !important; }
.cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.catchip {
  display: inline-flex; gap: 6px; align-items: center; cursor: pointer; padding: 3px 10px 3px 6px; border-radius: 999px;
  border: 1px solid #2a3554; background: #121828; font-size: 12px; transition: background .15s, border-color .15s;
}
.catchip input { display: none; }
.catchip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); opacity: .35; transition: opacity .15s, box-shadow .15s; }
.catchip:has(input:checked) { border-color: color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 12%, #121828); }
.catchip:has(input:checked) .dot { opacity: 1; box-shadow: 0 0 8px var(--c); }
.card-in {
  margin: 8px 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line2);
  background: linear-gradient(160deg, var(--card2), rgba(10, 14, 26, .6));
}
.card-in p { margin: 6px 0; }
.card-in.pop { animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.97); opacity: .4; } to { transform: none; opacity: 1; } }
.fi-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 4px; flex-wrap: wrap; }
.fi-head b { color: var(--accent); }
.fi-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--accent)); box-shadow: 0 0 8px var(--c, var(--accent)); flex: none; }
.pick-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 10px var(--accent2); }
.chip {
  display: inline-block; font-size: 10px; padding: 1px 8px; border-radius: 999px; letter-spacing: .03em;
  border: 1px solid color-mix(in srgb, var(--c, #888) 60%, transparent); color: var(--c, var(--text));
}
.chip.lit { --c: var(--accent); }
.chip.night { --c: #8ea2ff; }
.coords { color: var(--accent2); font-variant-numeric: tabular-nums; }
.nn-title { margin: 6px 0 2px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
a.nn {
  display: flex; align-items: center; gap: 7px; padding: 4px 6px; margin: 1px -6px; border-radius: 6px;
  color: var(--text); text-decoration: none;
}
a.nn:hover { background: rgba(108, 200, 255, .1); }
a.nn em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0; }

/* flash detection */
.prog { height: 8px; margin: 8px 0; border-radius: 4px; background: #1a2034; overflow: hidden; }
#flashProgBar {
  height: 100%; width: 0; border-radius: 4px; transition: width .2s;
  background: linear-gradient(90deg, #ff9f5a, var(--flash), #ff9f5a); background-size: 200% 100%; animation: flow 1.2s linear infinite;
}
@keyframes flow { to { background-position: -200% 0; } }
.flash-count { color: var(--flash); }
.flashlist { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.flashcard {
  display: flex; gap: 10px; align-items: stretch; text-align: left; padding: 8px 10px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(90, 30, 30, .35), rgba(30, 20, 40, .5)); border: 1px solid rgba(255, 90, 78, .3);
}
.flashcard.on { border-color: var(--flash); box-shadow: 0 0 14px rgba(255, 90, 78, .35); }
.fc-badge {
  flex: none; display: grid; place-items: center; width: 40px; border-radius: 8px; font-weight: 700;
  background: radial-gradient(circle, rgba(255, 220, 150, .9), rgba(255, 90, 78, .8) 60%, rgba(120, 20, 20, .8));
  color: #2a0800; text-shadow: 0 0 4px #fff8;
}
.fc-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fc-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fc-near { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-bar { position: relative; height: 12px; border-radius: 6px; background: #1a1424; overflow: hidden; margin-top: 2px; }
.fc-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff9f5a, var(--flash)); border-radius: 6px; }
.fc-bar em { position: relative; font-style: normal; font-size: 9px; padding-left: 6px; color: #fff; line-height: 12px; }

.foot { color: #5d6884; font-size: 11px; margin-top: 14px; padding: 12px 4px 4px; border-top: 1px solid rgba(255,255,255,.07); }
.foot .credit { text-align: center; font-size: 12px; font-weight: 600; color: #9aa6c4; letter-spacing: .02em; margin-bottom: 10px; }
.foot .refs-title { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; color: #6f7a96; margin-bottom: 4px; }
.foot .refs { list-style: none; margin: 0; padding: 0; line-height: 1.6; }
.foot .refs a { color: #8fb4ff; text-decoration: none; }
.foot .refs a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ stage */
#stage { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; min-width: 0; }
#toolbar, #transport {
  display: flex; gap: 8px; align-items: center; padding: 7px 10px; flex-wrap: wrap;
  background: rgba(12, 16, 28, .8); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
#transport { border-top: 1px solid var(--line); border-bottom: 0; gap: 10px; }
.grow { flex: 1; text-align: right; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: #0b0f1c; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; border-radius: 7px; padding: 5px 11px; color: var(--muted); }
.seg button.on { background: linear-gradient(135deg, #2f4a85, #4b3a8c); color: #fff; box-shadow: 0 0 12px rgba(108, 140, 255, .3); }
.inline-sel { display: inline-flex; gap: 5px; align-items: center; color: var(--muted); }
.inline-sel select { padding: 3px 6px; }

#canvasWrap { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #000; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
#canvasWrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(circle at 50% 50%, rgba(255, 230, 190, .18), transparent 60%);
  box-shadow: inset 0 0 120px rgba(255, 90, 78, .55);
}
#canvasWrap.impact::after { opacity: 1; transition: opacity .05s; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lbl {
  position: absolute; transform: translate(7px, -50%); white-space: nowrap; font-size: 11.5px; font-weight: 500;
  color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000, 0 1px 2px #000; pointer-events: none;
}
.lbl::before {
  content: ""; position: absolute; left: -9px; top: 50%; width: 6px; height: 6px; margin-top: -3px;
  border-radius: 50%; background: var(--c, #ffc94d); box-shadow: 0 0 0 1px #000, 0 0 6px var(--c, #ffc94d);
}
.lbl.grid { color: #ffe9a6; font-size: 10px; font-weight: 400; opacity: .85; transform: translate(-50%, -50%); }
.lbl.grid::before { display: none; }
.lbl.focus { font-size: 15px; font-weight: 700; color: var(--accent); z-index: 2; }
.lbl.focus::before {
  width: 14px; height: 14px; margin-top: -7px; left: -16px; background: transparent;
  border: 2px solid var(--accent); box-shadow: 0 0 10px var(--accent); animation: ping 1.6s ease-out infinite;
}
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 211, 107, .7); } 100% { box-shadow: 0 0 0 14px rgba(255, 211, 107, 0); } }
.lbl.flash { color: #ff8a80; font-weight: 700; font-size: 13px; z-index: 3; }
.lbl.flash::before {
  background: rgba(255, 90, 78, .25); border: 2px solid var(--flash); width: 18px; height: 18px; margin-top: -9px; left: -20px;
  box-shadow: 0 0 12px var(--flash);
}
.lbl.flash.live::before { animation: burst .7s ease-out infinite; }
@keyframes burst {
  0% { transform: scale(.6); box-shadow: 0 0 0 0 rgba(255, 90, 78, .9), 0 0 20px #fff; }
  100% { transform: scale(1.4); box-shadow: 0 0 0 22px rgba(255, 90, 78, 0), 0 0 6px var(--flash); }
}
.lbl.pick { color: var(--accent2); }
.lbl.pick::before { background: var(--accent2); box-shadow: 0 0 0 1px #000, 0 0 8px var(--accent2); }

.viewtitle {
  position: absolute; top: 0; padding: 7px 12px; font-size: 12px; font-weight: 600; letter-spacing: .03em;
  pointer-events: none; box-sizing: border-box; color: #fff; text-shadow: 0 1px 3px #000;
  background: linear-gradient(rgba(4, 6, 12, .85), rgba(4, 6, 12, 0));
}
.viewtitle::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.viewtitle.overlay::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.viewtitle.lroc::before { background: var(--accent2); box-shadow: 0 0 8px var(--accent2); }
.viewtitle.geo::before { background: #e0458a; box-shadow: 0 0 8px #e0458a; }
.viewtitle.sep { border-left: 1px solid var(--line2); }

#compass { position: absolute; width: 104px; height: 104px; pointer-events: none; filter: drop-shadow(0 0 4px #000); }
#compass .c-ring { fill: rgba(8, 12, 22, .55); stroke: rgba(255, 255, 255, .25); stroke-width: 1; }
#compass .c-ring2 { fill: none; stroke: rgba(255, 255, 255, .12); stroke-dasharray: 2 4; }
#compass line { stroke-width: 2.5; stroke-linecap: round; }
#cmpN line, #cmpN path { stroke: var(--accent); fill: var(--accent); }
#cmpE line, #cmpE path { stroke: var(--accent2); fill: var(--accent2); }
#compass text { font: 700 11px var(--font); }
#cmpNt { fill: var(--accent); }
#cmpEt { fill: var(--accent2); }
#compass .c-dot { fill: #fff; }

#hud {
  position: absolute; left: 10px; bottom: 10px; color: #cfd8ea; font-size: 12px; pointer-events: none; padding: 4px 10px;
  border-radius: 999px; background: rgba(8, 12, 22, .6); font-variant-numeric: tabular-nums;
}
#hud:empty { display: none; }
#texInfo { position: absolute; right: 10px; bottom: 10px; color: var(--muted); font-size: 11px; pointer-events: none; text-shadow: 0 0 3px #000; }
#dropHint {
  position: absolute; inset: 20px; border: 2px dashed var(--accent2); border-radius: 16px; display: flex; z-index: 5;
  align-items: center; justify-content: center; font-size: 20px; background: rgba(4, 6, 12, .85); text-align: center;
}
.drop-ico { font-size: 54px; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }

#busy {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 4; display: flex; gap: 14px; align-items: center;
  padding: 14px 20px; border-radius: 14px; background: rgba(12, 16, 28, .88); border: 1px solid var(--line2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6); font-size: 14px;
}
.spinner { position: relative; width: 38px; height: 38px; }
.sp-moon { position: absolute; inset: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6dc, #9a917d 70%, #3d3a33); box-shadow: 0 0 12px rgba(255, 220, 150, .6); }
.sp-orbit { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent2); border-right-color: var(--accent2); animation: spin .9s linear infinite; }

#toasts { position: absolute; top: 44px; right: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 6; pointer-events: none; }
.toast {
  padding: 9px 14px; border-radius: 10px; background: rgba(16, 22, 38, .92); border: 1px solid var(--line2); font-weight: 600;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .5); animation: slideIn .35s ease-out; transition: opacity .5s, transform .5s;
}
.toast.ok { border-color: rgba(87, 227, 161, .6); }
.toast.flash { border-color: var(--flash); background: linear-gradient(135deg, rgba(120, 30, 25, .95), rgba(40, 18, 30, .95)); }
.toast.err { border-color: #ffb36b; }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } }

/* transport */
.round { width: 36px; height: 36px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; font-size: 14px; }
#btnPlay { background: linear-gradient(135deg, #2b4f96, #4a3b94); border-color: #5b72c8; }
.round.sm { width: 30px; height: 30px; font-size: 12px; }
#seekWrap { position: relative; flex: 1; display: flex; align-items: center; }
#seekWrap input { width: 100%; }
#seekMarks { position: absolute; inset: 0; pointer-events: none; }
.seekmark {
  position: absolute; top: 50%; width: 12px; height: 12px; padding: 0; margin: -6px 0 0 -6px; border-radius: 50%;
  pointer-events: auto; border: 2px solid #fff; background: var(--flash); box-shadow: 0 0 10px var(--flash);
}
.seekmark.on, .seekmark:hover { transform: scale(1.3); }
#timeLbl { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 140px; text-align: right; }

@media (max-width: 860px) {
  body { flex-direction: column-reverse; overflow: auto; }
  #panel { width: 100%; height: auto; }
  #stage { height: 70vh; flex: none; }
}

/* ------------------------------------------------------------------ flash replay */
.replay {
  position: absolute; left: 14px; top: 44px; z-index: 6; width: 324px; padding: 10px 12px;
  border-radius: 14px; background: rgba(14, 18, 32, .93); border: 1px solid rgba(255, 90, 78, .5);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .6), 0 0 22px rgba(255, 90, 78, .18); animation: slideIn .3s ease-out;
}
.replay.on-flash { box-shadow: 0 12px 40px rgba(0, 0, 0, .6), 0 0 34px rgba(255, 90, 78, .7); border-color: var(--flash); }
.rp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; cursor: move; user-select: none; touch-action: none; }
.rp-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: radial-gradient(circle, rgba(255, 220, 150, .9), rgba(255, 90, 78, .85) 60%, rgba(120, 20, 20, .85)); }
.rp-titles { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rp-titles b { color: #ff9a8f; }
.rp-titles .muted { font-size: 11px; }
.rp-x { padding: 2px 8px; border-radius: 50%; }
.rp-view { position: relative; width: 300px; height: 300px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line2); }
#rpInset { display: block; width: 300px; height: 300px; }
.rp-badge {
  position: absolute; top: 8px; left: 8px; padding: 2px 10px; border-radius: 999px; font-weight: 800; letter-spacing: .1em;
  background: var(--flash); color: #fff; box-shadow: 0 0 16px var(--flash); animation: pulseBtn .4s ease-in-out infinite;
}
.rp-frame { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: #cfd8ea; text-shadow: 0 0 3px #000; font-variant-numeric: tabular-nums; }
.rp-prog { position: relative; height: 6px; margin: 8px 0 4px; border-radius: 3px; background: #1a2034; }
#rpProgBar { height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #2f6fd0, #6cc8ff); }
#rpProgMark { position: absolute; top: -3px; width: 4px; height: 12px; margin-left: -2px; border-radius: 2px; background: var(--flash); box-shadow: 0 0 8px var(--flash); }
.rp-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.seg.mini button { padding: 3px 9px; font-size: 12px; }
