/* ============================================================
   UNIVERSO INTERACTIVO — estilos
   ============================================================ */
:root {
  --bg: #04060f;
  --bg2: #090e1e;
  --panel: rgba(13, 20, 42, 0.78);
  --panel-solid: #0d1428;
  --line: rgba(120, 150, 220, 0.18);
  --txt: #e8eefc;
  --dim: #9aa8c8;
  --acc: #5eb8ff;
  --acc2: #a78bfa;
  --warn: #ffd166;
  --ok: #6ee7a0;
  --bad: #ff7a7a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--txt);
  font: 15px/1.55 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
h1, h2, h3 { font-weight: 650; letter-spacing: 0.2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a3a60; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- layout ---------- */
#sidebar {
  position: fixed; inset: 0 auto 0 0; width: 232px; z-index: 30;
  background: linear-gradient(180deg, #070c1c, #050814);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px 12px;
}
.brand { font-size: 19px; font-weight: 700; padding: 0 10px 14px; letter-spacing: .3px; }
.brand small { display: block; color: var(--dim); font-size: 11.5px; font-weight: 400; }
.brand .logo { color: var(--acc); }
#navlist { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 9px 10px; border-radius: 10px; color: var(--dim); font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-btn:hover { background: rgba(94, 184, 255, 0.08); color: var(--txt); }
.nav-btn.sel { background: linear-gradient(90deg, rgba(94,184,255,.16), rgba(167,139,250,.12)); color: #fff; }
.nb-i { width: 22px; text-align: center; flex: none; }
.nav-foot { margin-top: auto; padding: 10px; color: #5f6f92; font-size: 11px; line-height: 1.5; }
.install-btn {
  width: 100%; margin-bottom: 9px; padding: 8px 10px; border-radius: 9px;
  color: #dff2ff; background: rgba(94,184,255,.12); border: 1px solid rgba(94,184,255,.35);
  font-size: 12px; font-weight: 650;
}
.install-btn:hover { background: rgba(94,184,255,.22); }

#main { position: fixed; inset: 0 0 0 232px; overflow: hidden; }
.module { position: absolute; inset: 0; display: none; overflow-y: auto; overflow-x: hidden; }
.module.on { display: block; }
.module.fill { overflow: hidden; }

/* cabecera común de módulo */
.mod-head { padding: 18px 26px 6px; position: relative; z-index: 5; }
.mod-head h1 { font-size: 22px; }
.mod-head .sub { color: var(--dim); max-width: 900px; margin-top: 3px; font-size: 14px; }
.honesty {
  margin: 10px 26px 0; padding: 9px 14px; border-radius: 10px; font-size: 13px;
  background: rgba(255, 209, 102, 0.09); border: 1px solid rgba(255, 209, 102, 0.35);
  color: #ffe1a0; max-width: 980px; position: relative; z-index: 5;
}
.honesty.good { background: rgba(110,231,160,.08); border-color: rgba(110,231,160,.35); color: #b8f0cf; }
.honesty b { color: inherit; }

/* ---------- controles genéricos ---------- */
.btn {
  padding: 9px 16px; border-radius: 999px; font-size: 14px;
  background: rgba(94, 184, 255, 0.1); border: 1px solid rgba(94, 184, 255, 0.35);
  transition: background .15s, transform .1s;
}
.btn:hover { background: rgba(94, 184, 255, 0.22); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(90deg, #2f7fd4, #7c5fd8); border-color: transparent; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.15); }
.btn.mini { padding: 5px 11px; font-size: 12.5px; }
.seg { display: inline-flex; background: rgba(10,16,34,.85); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { padding: 6px 13px; border-radius: 999px; font-size: 13px; color: var(--dim); white-space: nowrap; }
.seg button.sel { background: linear-gradient(90deg, #2f7fd4, #7c5fd8); color: #fff; }
input[type=range] { -webkit-appearance: none; height: 4px; border-radius: 4px; background: #24345c; outline: none; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--acc); border: 2px solid #fff; cursor: pointer;
}
label.ctl { font-size: 12.5px; color: var(--dim); display: flex; align-items: center; gap: 8px; }

/* superposición de controles sobre canvas */
.overlay-ctl {
  position: absolute; z-index: 8; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--panel); backdrop-filter: blur(8px); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 14px;
}
.canvas-holder { position: absolute; inset: 0; }
.canvas-holder canvas { display: block; width: 100%; height: 100%; }

/* ---------- portada ---------- */
#mod-home { background: radial-gradient(1200px 700px at 70% -10%, #101a3a 0%, var(--bg) 55%); }
#home-stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.home-wrap { position: relative; max-width: 1060px; margin: 0 auto; padding: 46px 30px 40px; }
.home-hero h1 { font-size: 46px; line-height: 1.1; }
.home-hero h1 span { background: linear-gradient(90deg, var(--acc), var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-hero .tag { color: var(--dim); max-width: 640px; margin: 12px 0 20px; font-size: 16px; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.fact-box {
  margin: 30px 0 8px; padding: 14px 18px; border-radius: 14px;
  background: rgba(167, 139, 250, 0.08); border: 1px solid rgba(167, 139, 250, 0.3);
}
.fact-tag { font-size: 12px; color: var(--acc2); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.fact-box p { margin-top: 4px; font-size: 15px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 22px; }
.card {
  text-align: left; padding: 18px; border-radius: 16px; display: flex; flex-direction: column; gap: 7px;
  background: var(--panel); border: 1px solid var(--line);
  transition: transform .15s, border-color .15s, background .15s;
}
.card:hover { transform: translateY(-3px); border-color: rgba(94,184,255,.5); background: rgba(20,30,60,.85); }
.card-icon { font-size: 26px; }
.card-t { font-weight: 650; font-size: 15.5px; }
.card-d { color: var(--dim); font-size: 13px; line-height: 1.5; }
.home-foot { margin-top: 34px; color: var(--dim); font-size: 13px; border-top: 1px solid var(--line); padding-top: 18px; }
.home-foot .dim { margin-top: 8px; color: #5f6f92; }

/* ---------- panel de información ---------- */
#infopanel {
  position: fixed; top: 0; right: -400px; bottom: 0; width: 384px; z-index: 40;
  background: rgba(9, 14, 30, 0.96); backdrop-filter: blur(10px);
  border-left: 1px solid var(--line); transition: right .25s ease;
  display: flex; flex-direction: column;
}
#infopanel.open { right: 0; }
.ip-close { position: absolute; top: 10px; right: 12px; font-size: 22px; color: var(--dim); z-index: 2; padding: 6px 10px; }
.ip-close:hover { color: #fff; }
.ip-body { overflow-y: auto; padding: 22px 22px 30px; }
.ip-body h2 { font-size: 23px; margin-bottom: 2px; }
.ip-body .ip-type { color: var(--acc); font-size: 13px; margin-bottom: 12px; }
.ip-dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 13.5px; margin: 10px 0; }
.ip-dl dt { color: var(--dim); white-space: nowrap; }
.ip-dl dd { }
.ip-sec { margin-top: 14px; font-size: 13px; color: var(--acc2); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.ip-cur { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; display: flex; flex-direction: column; gap: 7px; }
.ip-note { margin-top: 12px; font-size: 12.5px; color: var(--warn); }

/* ---------- barra de escala ---------- */
#scalebar {
  position: fixed; left: 262px; bottom: 18px; z-index: 25; display: none;
  flex-direction: column; gap: 4px; pointer-events: none;
  background: rgba(6, 10, 24, 0.75); padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--line); backdrop-filter: blur(6px);
}
.sb-line { height: 0; border-bottom: 2px solid #fff; position: relative; transition: width .15s; }
.sb-line::before, .sb-line::after {
  content: ''; position: absolute; top: -4px; width: 2px; height: 10px; background: #fff;
}
.sb-line::before { left: 0; } .sb-line::after { right: 0; }
.sb-label { font-size: 12.5px; color: var(--txt); }

/* ---------- sistema solar ---------- */
#solar-ui-top     { top: 14px;  right: 20px; max-width: min(420px, 46vw); }
#solar-ui-scale   { top: 70px;  right: 20px; width: 306px; }
#solar-ui-planets { top: 214px; right: 20px; width: 306px; }
#solar-ui-deep    { top: 330px; right: 20px; width: 322px; }
#solar-ui-time    { bottom: 18px; right: 20px; width: 350px; }
#earth-ui         { bottom: 214px; right: 20px; width: 350px; }
#solar-honesty    { position: absolute; left: 26px; bottom: 76px; z-index: 8; max-width: min(44vw, 600px); margin: 0; }

#solar-ui-planets .seg { flex-wrap: wrap; border-radius: 14px; }
#solar-ui-planets .seg button { padding: 4px 9px; font-size: 12px; }
.scale-hint { color: #8fa3c8; font-size: 10.5px; line-height: 1.4; }
.deep-cats { flex-wrap: wrap; border-radius: 14px; }
.deep-cats button { padding: 4px 8px; font-size: 11px; }
.deep-cat-note { color: #8fa3c8; font-size: 10.5px; line-height: 1.4; }
#solar-ui-deep #solar-deep-goto { flex-wrap: wrap; border-radius: 14px; max-height: 148px; overflow-y: auto; }
#solar-ui-deep #solar-deep-goto button { padding: 4px 9px; font-size: 12px; }
.time-row { display: grid; grid-template-columns: 86px 1fr 96px; align-items: center; gap: 9px; }
.time-row input { width: 100%; }
.time-row > span:first-child { font-size: 11.5px; color: var(--dim); }
.time-lab { font-size: 11.5px; color: #d9e9ff; text-align: right; white-space: nowrap; }
.time-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 7px; }
#solar-date { font-size: 12px; color: var(--acc); text-align: right; }
#earth-ui[hidden] { display: none; }
.earth-ui-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.earth-ui-head strong { color: #dff6ff; }
.earth-ui-head span { color: var(--acc); font-size: 11.5px; }
.earth-ui-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
#earth-readout { color: #afbdd5; font-size: 11.5px; line-height: 1.45; }

/* ---------- módulos con lienzo a pantalla completa ---------- */
.fill .mod-head { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }
.fill .mod-head h1, .fill .mod-head .sub { text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.fill .honesty { pointer-events: auto; display: inline-block; max-width: min(58vw, 980px); }

/* ---------- escalas ---------- */
#scales-ui { bottom: 18px; left: 50%; transform: translateX(-50%); }
#scales-obj {
  position: absolute; top: 86px; right: 20px; width: 300px; z-index: 8;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  backdrop-filter: blur(8px);
}
#scales-obj h3 { font-size: 17px; margin-bottom: 3px; }
#scales-obj .so-size { color: var(--acc); font-size: 13px; margin-bottom: 6px; }
#scales-obj p { font-size: 13px; color: #c8d4ec; }

/* ---------- constelaciones ---------- */
#const-ui { top: 14px; left: 26px; }
#const-slider-box { bottom: 18px; left: 50%; transform: translateX(-50%); width: min(560px, 80%); }
#const-slider-box input { width: 100%; }
#const-info {
  position: absolute; top: 86px; right: 20px; width: 300px; z-index: 8;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
}
#const-info h3 { font-size: 16px; }
#const-info p { font-size: 12.5px; color: #c8d4ec; margin-top: 6px; }
#const-info .star-list { margin-top: 8px; font-size: 12px; color: var(--dim); display: grid; gap: 3px; }
#const-info .star-list b { color: var(--txt); font-weight: 600; }

/* ---------- galaxias ---------- */
#galaxy-ui { top: 14px; left: 26px; }
#galaxy-stage {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 8;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 18px; width: min(680px, 90%); backdrop-filter: blur(8px);
}
#galaxy-stage h3 { font-size: 15px; color: var(--acc); }
#galaxy-stage p { font-size: 13px; color: #c8d4ec; margin-top: 3px; min-height: 40px; }
#galaxy-stage input { width: 100%; margin-top: 8px; }

/* ---------- contenido tipo página (espacio, tiempo, extras, quiz) ---------- */
.page { max-width: 1020px; margin: 0 auto; padding: 0 30px 60px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 20px; }
.tabs button {
  padding: 8px 16px; border-radius: 999px; font-size: 13.5px; color: var(--dim);
  background: rgba(10, 16, 34, 0.85); border: 1px solid var(--line);
}
.tabs button.sel { background: linear-gradient(90deg, #2f7fd4, #7c5fd8); color: #fff; border-color: transparent; }
.tabpane { display: none; }
.tabpane.on { display: block; animation: fadein .25s; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
.demo-box {
  position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line);
  background: #060a18; margin: 14px 0;
}
.demo-box canvas { display: block; width: 100%; }
.demo-ctl { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); background: rgba(10,16,34,.6); }
.explain { color: #c8d4ec; font-size: 14px; margin: 10px 0; max-width: 860px; }
.explain b { color: var(--txt); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.info-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 10px 0;
}
.info-card h3 { font-size: 15.5px; margin-bottom: 4px; color: var(--txt); }
.info-card .meta { font-size: 12.5px; color: var(--acc); margin-bottom: 6px; }
.info-card p { font-size: 13.5px; color: #c2cee8; }

/* ---------- estrellas ---------- */
.stars-page { padding-top: 8px; }
.star-lab, .star-destiny {
  background: linear-gradient(145deg, rgba(14,23,48,.92), rgba(7,12,29,.94));
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden; margin: 12px 0 18px;
}
.star-lab-head { display: grid; grid-template-columns: 1fr minmax(280px, .72fr); gap: 28px; align-items: end; padding: 20px 22px 16px; }
.star-lab-head h2, .star-destiny h2 { font-size: 22px; }
.star-lab-head p { color: var(--dim); font-size: 13px; }
.eyebrow { display: block; color: var(--acc); text-transform: uppercase; letter-spacing: 1.4px; font-size: 10.5px; font-weight: 750; margin-bottom: 4px; }
.star-mass-control { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.star-mass-control label { color: var(--dim); font-size: 12px; }
.star-mass-control strong { color: #fff; text-align: right; }
.star-mass-control input, .range-ends { grid-column: 1 / -1; width: 100%; }
.range-ends { display: flex; justify-content: space-between; color: #7181a2; font-size: 10.5px; }
#star-lab-cv { display: block; width: 100%; height: 360px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.star-stats { display: grid; grid-template-columns: repeat(5, 1fr); }
.star-stats > div { padding: 13px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.star-stats > div:last-child { border-right: 0; }
.star-stats span { color: var(--dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; }
.star-stats strong { margin: 2px 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star-stats small { color: #7181a2; font-size: 10.5px; }
.star-destiny { padding: 20px 22px; overflow: visible; }
.star-path { display: flex; align-items: stretch; gap: 22px; margin: 18px 0 12px; overflow-x: auto; padding: 2px; }
.star-path > div { position: relative; flex: 1 0 120px; min-width: 120px; padding: 13px 12px; background: rgba(94,184,255,.07); border: 1px solid rgba(94,184,255,.24); border-radius: 12px; }
.star-path > div:not(:last-child)::after { content: '→'; position: absolute; right: -19px; top: 50%; color: var(--acc); transform: translateY(-50%); }
.star-path span { display: block; color: var(--acc); font-size: 11px; }
.star-path b { font-size: 12.5px; }
.star-knowledge { margin-top: 24px; }
.spectral-strip { display: grid; grid-template-columns: repeat(7, 1fr); margin: 22px 0 10px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.spectral-strip > div { min-height: 150px; padding: 15px 11px; background: linear-gradient(180deg, color-mix(in srgb, var(--star) 22%, #0a1022), #080d1b); border-right: 1px solid var(--line); }
.spectral-strip > div:last-child { border-right: 0; }
.spectral-strip b { display: block; color: var(--star); font-size: 27px; line-height: 1; text-shadow: 0 0 18px var(--star); }
.spectral-strip span { display: block; margin: 8px 0; color: #dce6f8; font-size: 10.5px; }
.spectral-strip small { color: var(--dim); font-size: 10.5px; line-height: 1.35; }
.source-note { color: #7181a2; font-size: 11.5px; }
.source-note a { color: var(--acc); }

/* ---------- línea de tiempo ---------- */
#tl-ruler-box { position: relative; margin: 18px 0 8px; }
#tl-ruler { width: 100%; height: 96px; display: block; cursor: pointer; }
.tl-detail {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; margin-top: 10px; min-height: 130px;
}
.tl-detail h3 { font-size: 19px; }
.tl-detail .when { color: var(--acc); font-size: 13px; margin-bottom: 8px; }
.tl-detail p { color: #c8d4ec; font-size: 14.5px; }
.tl-nav { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; margin-top: 14px; }
.cal-item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.cal-item .cd { color: var(--acc2); font-size: 12px; font-weight: 700; }
.cal-item .ct { font-weight: 650; font-size: 14px; margin: 2px 0; }
.cal-item .cx { color: var(--dim); font-size: 12.5px; }
.cosmic-clocks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
.cosmic-clocks article { position: relative; min-height: 150px; padding: 18px 20px; overflow: hidden; background: linear-gradient(140deg, rgba(18,30,61,.92), rgba(9,15,34,.92)); border: 1px solid var(--line); border-radius: 16px; }
.cosmic-clocks article::after { content:''; position:absolute; width:130px; height:130px; border:1px solid rgba(94,184,255,.12); border-radius:50%; right:-48px; top:-48px; box-shadow: 0 0 0 18px rgba(94,184,255,.025), 0 0 0 36px rgba(94,184,255,.018); }
.cosmic-clocks span { color: var(--acc); font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; }
.cosmic-clocks strong { display: block; margin: 5px 0 9px; font-size: 20px; }
.cosmic-clocks p { color: var(--dim); font-size: 12.5px; max-width: 370px; }
.lookback-lab { display: grid; grid-template-columns: 1fr 270px; gap: 16px 30px; align-items: end; margin: 18px 0; padding: 22px; background: linear-gradient(120deg, rgba(42,28,79,.55), rgba(12,24,50,.85)); border: 1px solid rgba(167,139,250,.3); border-radius: 18px; }
.lookback-lab h2 { font-size: 20px; }
.lookback-lab p { color: var(--dim); font-size: 12.5px; margin-top: 4px; }
.lookback-output { display: flex; flex-direction: column; text-align: right; }
.lookback-output span { color: var(--dim); font-size: 10.5px; text-transform: uppercase; }
.lookback-output strong { color: #fff; font-size: 20px; }
.lookback-output small { color: var(--acc2); }
.lookback-lab input, .lookback-scale { grid-column: 1 / -1; width: 100%; }
.lookback-scale { display: flex; justify-content: space-between; gap: 8px; color: #7181a2; font-size: 10px; }
.lookback-scale span { max-width: 90px; text-align: center; }
.relativity-note { border-color: rgba(255,209,102,.28); }

/* ---------- quiz: selección de nivel ---------- */
.lvl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 20px 0 18px; }
.lvl-card {
  --lvl: var(--acc);
  position: relative; text-align: left; display: flex; flex-direction: column; gap: 5px;
  padding: 20px 20px 18px; border-radius: 18px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--lvl) 12%, rgba(13,20,42,.85)), rgba(9,14,30,.9));
  border: 1px solid color-mix(in srgb, var(--lvl) 34%, transparent);
  transition: transform .15s, box-shadow .15s;
}
.lvl-card:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.lvl-card.passed::after {
  content: '✓'; position: absolute; top: 16px; right: 18px;
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: #05210f; background: var(--ok);
}
.lvl-icon { font-size: 30px; line-height: 1; }
.lvl-tag { color: var(--lvl); font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: 1.2px; }
.lvl-name { font-size: 19px; font-weight: 700; }
.lvl-desc { color: var(--dim); font-size: 13px; line-height: 1.45; }
.lvl-meta { color: #7181a2; font-size: 11.5px; margin-top: 2px; }
.lvl-bar { display: block; height: 5px; border-radius: 999px; background: rgba(255,255,255,.09); overflow: hidden; margin-top: 6px; }
.lvl-bar i { display: block; height: 100%; background: var(--lvl); border-radius: 999px; transition: width .3s; }
.lvl-bar.big { height: 7px; margin: 8px 0 12px; --lvl: var(--acc); }
.lvl-best { font-size: 11.5px; color: #b6c6e4; margin-top: 4px; }
.quiz-global {
  max-width: 720px; margin: 0 auto; padding: 16px 20px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
}
.quiz-global > div:first-child { display: flex; justify-content: space-between; align-items: baseline; }
.quiz-global span { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; }
.quiz-global strong { font-size: 18px; }

/* ---------- quiz ---------- */
.quiz-box { --lvl: var(--acc); max-width: 720px; margin: 20px auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px 30px; }
.quiz-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.quiz-lvl { color: var(--lvl); font-size: 12.5px; font-weight: 700; letter-spacing: .5px; }
.quiz-track { height: 4px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin-bottom: 12px; }
.quiz-track i { display: block; height: 100%; background: var(--lvl); transition: width .3s; }
.quiz-weak { margin: 16px 0 4px; }
.quiz-weak span { display: block; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 7px; }
.quiz-weak div { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.quiz-end-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.quiz-prog { font-size: 13px; color: var(--dim); margin-bottom: 10px; display: flex; justify-content: space-between; }
.quiz-q { font-size: 19px; font-weight: 650; margin-bottom: 16px; }
.quiz-opts { display: grid; gap: 9px; }
.quiz-opt {
  text-align: left; padding: 12px 16px; border-radius: 12px; font-size: 14.5px;
  background: rgba(20, 30, 60, 0.6); border: 1px solid var(--line); transition: background .12s, border-color .12s;
}
.quiz-opt:hover:not(:disabled) { background: rgba(94, 184, 255, 0.12); border-color: rgba(94,184,255,.4); }
.quiz-opt.ok { background: rgba(110, 231, 160, 0.15); border-color: var(--ok); }
.quiz-opt.bad { background: rgba(255, 122, 122, 0.13); border-color: var(--bad); }
.quiz-why { margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: rgba(94,184,255,.07); border: 1px solid rgba(94,184,255,.25); font-size: 13.5px; color: #cfe0ff; }
.quiz-end { text-align: center; padding: 20px 0; }
.quiz-end .score { font-size: 44px; font-weight: 800; background: linear-gradient(90deg, var(--acc), var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }


.earth-zoom-meter {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px;
  color: var(--acc); font-size: 11.5px;
}
.earth-zoom-meter i {
  display: block; height: 5px; width: 20%; border-radius: 999px;
  background: linear-gradient(90deg, var(--acc), var(--acc2)); box-shadow: 0 0 12px rgba(94,184,255,.35);
  transition: width .18s ease;
}
body.info-open #solar-ui-top,
body.info-open #solar-ui-scale,
body.info-open #solar-ui-planets,
body.info-open #solar-ui-deep,
body.info-open #solar-ui-time,
body.info-open #earth-ui { right: 416px; }

/* ============================================================
   PANELES OCULTABLES / PLEGABLES
   ============================================================ */
.ui-panel { position: relative; }
.ui-panel.is-hidden { display: none !important; }

.ui-panel-bar.overlay-ctl { flex-direction: column; align-items: stretch; gap: 8px; }
.panel-bar {
  display: flex; align-items: center; gap: 6px;
  margin: -2px -4px 0; padding: 0 2px 6px;
  border-bottom: 1px solid rgba(120,150,220,.16);
  cursor: default; user-select: none;
}
.panel-ttl {
  flex: 1; min-width: 0; font-size: 10.5px; font-weight: 750; letter-spacing: 1px;
  text-transform: uppercase; color: var(--acc2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.panel-fold, .panel-x {
  flex: none; width: 20px; height: 20px; border-radius: 6px; line-height: 1;
  font-size: 13px; color: var(--dim); display: grid; place-items: center;
  transition: background .12s, color .12s;
}
.panel-fold:hover, .panel-x:hover { background: rgba(94,184,255,.18); color: #fff; }
.panel-x:hover { background: rgba(255,122,122,.2); color: #ffd7d7; }
.panel-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-body.col { flex-direction: column; align-items: stretch; gap: 8px; }
.ui-panel.is-collapsed .panel-body { display: none; }
.ui-panel.is-collapsed { padding-bottom: 6px; width: auto !important; min-width: 168px; }
.ui-panel.is-collapsed .panel-bar { border-bottom: 0; padding-bottom: 0; cursor: pointer; }

/* modo esquina: avisos y textos que solo llevan la X */
.ui-panel-corner { padding-right: 30px !important; }
.panel-x.corner {
  position: absolute; top: 5px; right: 6px; width: 20px; height: 20px;
  border-radius: 6px; font-size: 12px; color: var(--dim); pointer-events: auto;
  display: grid; place-items: center;
}
.fill .mod-head.ui-panel-corner { pointer-events: none; }
.fill .mod-head.ui-panel-corner .panel-x.corner { pointer-events: auto; right: 20px; top: 16px; }

/* dock de paneles ocultos */
#panel-dock {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 12px; z-index: 60; display: none;
  align-items: center; gap: 8px; max-width: min(680px, calc(100vw - 320px));
  background: rgba(8,13,28,.92); border: 1px solid var(--line); border-radius: 12px;
  padding: 7px 10px; backdrop-filter: blur(10px);
}
#panel-dock.on { display: flex; }
.dock-title { color: var(--dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; white-space: nowrap; }
.dock-list { display: flex; gap: 6px; overflow-x: auto; }
.dock-chip {
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px; color: #cfe0ff;
  background: rgba(94,184,255,.10); border: 1px solid rgba(94,184,255,.30);
}
.dock-chip:hover { background: rgba(94,184,255,.24); }
.dock-all {
  flex: none; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650;
  color: #dff2ff; background: rgba(110,231,160,.14); border: 1px solid rgba(110,231,160,.35);
}
.dock-all:hover { background: rgba(110,231,160,.26); }

/* conmutador global: siempre visible, incluso en pantalla limpia */
#ui-toggle-all {
  position: fixed; right: 14px; bottom: 14px; z-index: 90;
  width: 40px; height: 40px; border-radius: 50%; font-size: 17px;
  background: rgba(8,13,28,.88); border: 1px solid rgba(94,184,255,.35);
  color: #cfe0ff; backdrop-filter: blur(8px); display: grid; place-items: center;
  box-shadow: 0 8px 26px rgba(0,0,0,.45);
}
#ui-toggle-all:hover { background: rgba(94,184,255,.24); color: #fff; }
#ui-toggle-all[aria-pressed="true"] { border-color: rgba(255,209,102,.5); color: var(--warn); }

/* PANTALLA LIMPIA: se va absolutamente todo menos el lienzo */
body.ui-all-hidden #sidebar,
body.ui-all-hidden .mod-head,
body.ui-all-hidden .honesty,
body.ui-all-hidden .overlay-ctl,
body.ui-all-hidden #scalebar,
body.ui-all-hidden #panel-dock,
body.ui-all-hidden #infopanel { display: none !important; }
body.ui-all-hidden #main { inset: 0 !important; }

/* ---------- narrador: solo un icono dentro de la ficha ---------- */
.ip-narrate { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ip-speak {
  width: 32px; height: 32px; border-radius: 50%; font-size: 15px; flex: none;
  display: grid; place-items: center;
  background: rgba(94,184,255,.12); border: 1px solid rgba(94,184,255,.38); color: #dff2ff;
  transition: background .15s, transform .1s;
}
.ip-speak:hover { background: rgba(94,184,255,.28); }
.ip-speak:active { transform: scale(.94); }
.ip-speak.speaking { background: rgba(110,231,160,.2); border-color: rgba(110,231,160,.55); color: #d7ffe8; }
.ip-narrate span { color: var(--dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: .8px; }

/* ---------- controles de sonido (barra lateral) ---------- */
#audio-ctl { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
#audio-ctl .au-btn {
  width: 26px; height: 26px; border-radius: 8px; font-size: 13px; flex: none;
  display: grid; place-items: center;
  background: rgba(94,184,255,.10); border: 1px solid rgba(94,184,255,.28); color: #cfe0ff;
}
#audio-ctl .au-btn:hover { background: rgba(94,184,255,.24); }
#audio-ctl .au-btn.off { opacity: .5; }
#audio-ctl .au-btn.on { background: rgba(110,231,160,.18); border-color: rgba(110,231,160,.45); }
#audio-ctl input[type=range] { flex: 1; min-width: 0; }
#audio-ctl .au-off { font-size: 10.5px; color: #5f6f92; }

/* ---------- comparación de tamaño con el Sol ---------- */
.size-cmp {
  margin: 12px 0 14px; padding: 10px 12px 8px; border-radius: 12px;
  background: rgba(255,176,58,.06); border: 1px solid rgba(255,176,58,.22);
}
.size-cmp svg { display: block; width: 100%; height: auto; border-radius: 8px; background: #05070f; }
.size-cmp-note { margin-top: 7px; font-size: 11.5px; color: #ffd9a0; line-height: 1.45; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  #sidebar { inset: auto 0 0 0; width: auto; height: 62px; flex-direction: row; align-items: center; padding: 0 8px; border-right: none; border-top: 1px solid var(--line); }
  .brand, .nav-foot { display: none; }
  #navlist { flex-direction: row; overflow-x: auto; width: 100%; }
  .nav-btn span:last-child { display: none; }
  .nav-btn { padding: 10px; font-size: 18px; }
  #main { inset: 0 0 62px 0; }
  #scalebar { left: 14px; bottom: 156px; }
  #infopanel { width: 100%; right: -100%; }
  .home-hero h1 { font-size: 32px; }
  .fill .mod-head .sub { display: none; }
  .fill .mod-head h1 { font-size: 17px; }
  .fill .honesty { max-width: none; font-size: 11.5px; margin: 6px 12px 0; }
  #scales-obj, #const-info {
    position: absolute; left: 10px; right: 10px; top: auto; bottom: 96px;
    width: auto; margin: 0; max-height: 30vh; overflow-y: auto;
  }
  #scales-ui { left: 10px; right: 10px; transform: none; width: auto; }
  #solar-ui-top { top: 8px; right: 10px; left: 10px; max-width: none; }
  body.info-open #solar-ui-top, body.info-open #solar-ui-scale, body.info-open #solar-ui-planets,
  body.info-open #solar-ui-deep, body.info-open #solar-ui-time, body.info-open #earth-ui { right: 10px; }
  #solar-ui-scale { top: 62px; left: 10px; right: 10px; width: auto; }
  #solar-ui-planets { top: 178px; bottom: auto; left: 10px; right: 10px; width: auto; overflow-x: auto; }
  #solar-ui-planets .seg { flex-wrap: nowrap; }
  #solar-ui-deep { top: 250px; left: 10px; right: 10px; width: auto; }
  #solar-ui-deep #solar-deep-goto { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; max-height: none; width: 100%; }
  #solar-ui-time { left: 10px; right: 10px; width: auto; }
  #earth-ui { left: 10px; right: 10px; bottom: 178px; width: auto; }
  #solar-honesty { left: 10px; right: 10px; bottom: 214px; max-width: none; }
  #panel-dock { left: 10px; right: 10px; transform: none; max-width: none; bottom: 70px; }
  #ui-toggle-all { bottom: 74px; right: 10px; }
  .star-lab-head { grid-template-columns: 1fr; }
  .star-stats { grid-template-columns: repeat(2, 1fr); }
  .star-stats > div { border-bottom: 1px solid var(--line); }
  .spectral-strip { grid-template-columns: repeat(2, 1fr); }
  .spectral-strip > div { min-height: 110px; }
  .cosmic-clocks { grid-template-columns: 1fr; }
  .lookback-lab { grid-template-columns: 1fr; }
  .lookback-output { text-align: left; }
}

@media (max-width: 560px) {
  .page { padding-left: 16px; padding-right: 16px; }
  .time-row { grid-template-columns: 72px 1fr 78px; }
  #solar-ui-top #solar-orbits, #solar-ui-top #solar-labels { display: none; }
  #earth-ui { bottom: 178px; }
  #earth-ui .seg button { padding-inline: 8px; }
  #star-lab-cv { height: 420px; }
  .star-stats { grid-template-columns: 1fr 1fr; }
}
