/* Jurassic Lab · Creature Lab */
:root {
  --bg: #0b0d10; --bg-2: #101317; --panel: #14181d; --panel-2: #1a1f25; --panel-3: #222830;
  --line: #242a32; --line-2: #313944;
  --text: #eef1f5; --muted: #a2acb8; --faint: #6e7986;
  --amber: #f6a723; --amber-2: #ffc95e; --amber-ink: #1d1300; --amber-soft: rgba(246, 167, 35, .13);
  --good: #4ade80; --warn: #facc15; --bad: #fb923c; --crit: #ef4444;
  --r: 14px; --r-s: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--font);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button svg, a svg { pointer-events: none; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.fill { fill: currentColor; stroke: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---- barra de arriba */
.top { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: rgba(11, 13, 16, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand img { height: 22px; width: auto; }
.brand .ico { display: none; height: 34px; border-radius: 9px; }
.brand .sub { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  padding-left: 12px; border-left: 1px solid var(--line-2); }
.top .spacer { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 600; font-size: 14px; transition: background .15s, border-color .15s, transform .15s; white-space: nowrap; }
.btn:hover { border-color: #46505d; background: var(--panel-3); }
.btn-primary { background: linear-gradient(180deg, var(--amber-2), var(--amber)); border-color: transparent; color: var(--amber-ink); }
.btn-primary:hover { background: linear-gradient(180deg, #ffd47a, #ffb238); border-color: transparent; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }

/* ---- etiquetas */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--panel-3);
  color: var(--muted); font-size: 12px; font-weight: 500; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, #7b8592); }
.tag[data-t="Carnivore"] { --c: #f05a4f; } .tag[data-t="Herbivore"] { --c: #5fcf6a; } .tag[data-t="Flying"] { --c: #7cc4ff; }
.tag[data-t="Aquatic"] { --c: #3b82f6; } .tag[data-t="Mammal"] { --c: #c08a5a; } .tag[data-t="Bird"] { --c: #f4c542; }
.tag[data-t="Hybrid"] { --c: #b07cff; } .tag[data-t="Amorphous mass"] { --c: #f472b6; }

/* ================= PORTADA ================= */
.menu { display: flex; gap: 4px; margin-left: 18px; }
.menu a { height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; }
.menu a:hover { color: var(--text); background: var(--panel-2); }
.kicker { display: block; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--amber); margin-bottom: 8px; }
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line);
  background: radial-gradient(46% 60% at 76% 48%, rgba(246, 167, 35, .17), transparent 70%),
              radial-gradient(40% 50% at 8% 0%, rgba(88, 101, 242, .12), transparent 70%), var(--bg); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 48px 48px; -webkit-mask-image: radial-gradient(75% 80% at 60% 45%, #000 25%, transparent 75%); mask-image: radial-gradient(75% 80% at 60% 45%, #000 25%, transparent 75%); }
.hero-in { position: relative; max-width: 1240px; margin: 0 auto; padding: 76px 20px 72px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 52px; align-items: center; }
.grad { background: linear-gradient(92deg, var(--amber-2), var(--amber) 50%, #ff7b2e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.cifras { display: flex; flex-wrap: wrap; gap: 14px 40px; margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--line); }
.cifra b { display: block; font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.cifra span { color: var(--faint); font-size: 13px; }
.escenario { position: relative; aspect-ratio: 6 / 5; max-height: 560px; width: 100%; border-radius: 26px; overflow: hidden; border: 1px solid var(--line-2);
  background: radial-gradient(55% 45% at 50% 58%, rgba(246, 167, 35, .2), transparent 70%), linear-gradient(180deg, #161b22, #0e1115);
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .05); }
.escenario::before { content: ""; position: absolute; left: 14%; right: 14%; bottom: 20%; height: 15%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(246, 167, 35, .3), rgba(246, 167, 35, .08) 60%, transparent); }
.escenario iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; z-index: 1; opacity: 0; transition: opacity .8s; }
.escenario.listo iframe { opacity: 1; }
.escenario .foto { position: absolute; left: 10%; top: 14%; width: 80%; height: 64%; object-fit: contain; filter: drop-shadow(0 20px 18px rgba(0, 0, 0, .55)); transition: opacity .6s; }
.escenario.listo .foto { opacity: 0; }
.escenario-pie { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-radius: 14px; font-size: 13.5px; font-weight: 600; }
.escenario-pie .suave { color: #b7c0cb; font-weight: 500; }
.escenario-nombre { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vivo { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fca5a5; flex: none; }
.vivo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: pulso 1.8s infinite; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); } 70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.abrir { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px; background: rgba(255, 255, 255, .1); flex: none; }
.abrir:hover { background: rgba(255, 255, 255, .18); }
.abrir svg.i { width: 15px; height: 15px; }
.seccion { max-width: 1240px; margin: 0 auto; padding: 96px 20px 0; }
.seccion-h { display: flex; align-items: end; justify-content: space-between; gap: 18px 24px; flex-wrap: wrap; margin-bottom: 26px; }
.seccion-h > div:first-child { max-width: 640px; }
.seccion h2 { font-family: var(--display); font-size: clamp(28px, 3.4vw, 38px); letter-spacing: -.03em; line-height: 1.1; margin: 0; }
.seccion .lead { color: var(--muted); margin: 10px 0 0; font-size: 16px; }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; }
.filtro { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-weight: 500; font-size: 14px; }
.filtro:hover { color: var(--text); border-color: #46505d; }
.filtro.on { background: var(--text); color: #0b0d10; border-color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); border-color: rgba(246, 167, 35, .55); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8), 0 0 0 1px rgba(246, 167, 35, .15); }
.card-img { position: relative; aspect-ratio: 4 / 3;
  background: radial-gradient(60% 38% at 50% 88%, rgba(246, 167, 35, .16), transparent 70%), linear-gradient(180deg, #1a2028, #12161b); }
.card-img img { position: absolute; left: 7%; top: 8%; width: 86%; height: 84%; object-fit: contain; filter: drop-shadow(0 14px 12px rgba(0, 0, 0, .5)); transition: transform .3s; }
.card:hover .card-img img { transform: scale(1.05); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { margin: 0; font-family: var(--display); font-size: 18px; letter-spacing: -.015em; }
.card .meta { margin-top: auto; color: var(--faint); font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .ir { color: var(--amber); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; opacity: 0; transform: translateX(-4px); transition: .2s; }
.card:hover .ir { opacity: 1; transform: none; }
.vacio { color: var(--faint); padding: 40px 0; text-align: center; grid-column: 1 / -1; }
.funciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.funcion { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.funcion .ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); margin-bottom: 16px; }
.funcion h3 { margin: 0 0 6px; font-family: var(--display); font-size: 17px; letter-spacing: -.01em; }
.funcion p { margin: 0; color: var(--muted); font-size: 14px; }
.autor { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.autor-media { position: relative; border-radius: 22px; overflow: hidden; border: 1px solid var(--line-2); aspect-ratio: 4 / 3; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .8); }
.autor-media img { width: 100%; height: 100%; object-fit: cover; object-position: 38% 60%; }
.autor-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(11, 13, 16, .55)); }
.autor-texto h2 { margin-bottom: 18px; }
.autor-texto p { color: var(--muted); font-size: 16px; line-height: 1.7; margin: 0 0 14px; }
.firma { font-family: "Caveat", cursive; font-size: 52px; line-height: 1; color: var(--amber-2); margin-top: 22px; transform: rotate(-4deg); transform-origin: left; display: inline-block; }
.equipo { display: flex; flex-wrap: wrap; gap: 18px 56px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.miembro .firma { margin-top: 0; }
.miembro span { display: block; color: var(--faint); font-size: 13px; margin-top: 10px; }
footer.pie { max-width: 1240px; margin: 80px auto 0; padding: 40px 20px 36px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13.5px; }
.pie-in { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
.pie-marca img { height: 22px; width: auto; margin-bottom: 14px; }
.pie-marca p { margin: 0; max-width: 360px; }
.pie-links { display: flex; flex-direction: column; gap: 8px; }
.pie-links b { color: var(--text); font-weight: 600; margin-bottom: 4px; }
.pie-links a:hover { color: var(--text); }
.pie-base { display: flex; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); }

/* ================= PAGINA DEL BICHO ================= */
body.viewer { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.switcher { display: flex; align-items: center; gap: 6px; min-width: 0; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); flex: none; }
.icon-btn:hover { background: var(--panel-3); border-color: #46505d; }
.select { position: relative; min-width: 0; }
.select select { appearance: none; -webkit-appearance: none; height: 40px; padding: 0 38px 0 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); font-weight: 600; max-width: 280px; min-width: 0; width: 100%; text-overflow: ellipsis; cursor: pointer; }
.select select:hover { border-color: #46505d; }
.select svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
#app { flex: 1; display: flex; min-height: 0; }
#vista { flex: 1; position: relative; min-width: 0; background: #8fb4ff; overflow: hidden; }
#vista canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#vista canvas:active { cursor: grabbing; }
.hud { position: absolute; z-index: 3; }
.cristal { background: rgba(10, 13, 17, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .08); color: #fff; }
.sonando { left: 14px; top: 14px; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; max-width: calc(100% - 28px); }
.sonando i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(74, 222, 128, .22); flex: none; }
.sonando.herido i { background: var(--crit); box-shadow: 0 0 0 3px rgba(239, 68, 68, .25); }
.sonando span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar { left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; border-radius: 14px; }
.toolbar button { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: #e9edf2; position: relative; }
.toolbar button:hover { background: rgba(255, 255, 255, .1); }
.toolbar button.on { background: var(--amber); color: var(--amber-ink); }
.toolbar .sep { width: 1px; background: rgba(255, 255, 255, .12); margin: 8px 3px; }
#pausa .play, #pausa.on .pause { display: none; }
#pausa.on .play { display: block; }
#pausa.on { background: rgba(255, 255, 255, .14); color: #fff; }
.ayuda { right: 14px; top: 14px; font-size: 12px; padding: 6px 10px; border-radius: 8px; transition: opacity .6s; }
.ayuda.fuera { opacity: 0; pointer-events: none; }
.cargando { inset: 0; display: grid; place-items: center; background: #0b0d10; z-index: 6; transition: opacity .45s; }
.cargando.fuera { opacity: 0; pointer-events: none; }
.cargando .caja { text-align: center; color: var(--muted); font-size: 14px; }
.cargando img { width: 260px; max-width: 70vw; height: auto; margin: 0 auto 22px; }
.barra-carga { width: 180px; height: 4px; border-radius: 4px; background: var(--panel-3); margin: 14px auto 0; overflow: hidden; }
.barra-carga i { display: block; height: 100%; width: 40%; border-radius: 4px; background: var(--amber); animation: carga 1.1s ease-in-out infinite; }
@keyframes carga { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
.cargando .error { color: #fca5a5; max-width: 340px; }
.destello { inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 4; }
.destello.on { animation: destello .45s ease-out; }
@keyframes destello { 0% { opacity: .65; } 100% { opacity: 0; } }

.cargando .por { color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin: -10px 0 18px; }
.credito { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 20px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--faint); background: var(--bg-2); }
.credito b { color: var(--muted); font-weight: 600; }
.credito a { color: var(--muted); font-weight: 600; white-space: nowrap; }
.credito a:hover { color: var(--amber); }

/* panel */
#lado { width: 390px; flex: none; display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); min-height: 0; }
.ficha { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.ficha h1 { margin: 0 0 8px; font-family: var(--display); font-size: 24px; letter-spacing: -.025em; line-height: 1.15; }
.ficha .desc { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ficha .desc.abierta { -webkit-line-clamp: unset; display: block; }
.ficha .desc strong { color: var(--text); font-weight: 600; }
.mas { margin-top: 4px; border: 0; background: none; padding: 0; color: var(--amber); font-size: 13px; font-weight: 600; }
.tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); background: var(--panel); }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 10px; border: 0; background: none; color: var(--faint);
  font-size: 12px; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--muted); }
.tabs button.on { color: var(--text); border-bottom-color: var(--amber); }
.tabs button.on svg { color: var(--amber); }
.tab-body { flex: 1; overflow: auto; padding: 6px 20px 28px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.grupo { padding: 16px 0; border-bottom: 1px solid var(--line); }
.grupo:last-child { border-bottom: 0; }
.grupo-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.grupo h3 { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.grupo-h h3 { margin: 0; }
.nota { color: var(--faint); font-size: 12.5px; margin: -4px 0 12px; }
.nota:empty { display: none; }

/* chips (botones del motor) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button, #adornosLista button { height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 13px; font-weight: 500;
  transition: background .12s, border-color .12s, color .12s; }
.chips button:hover, #adornosLista button:hover { border-color: #4b5562; background: var(--panel-3); }
.chips button.on, #adornosLista button.on { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 600; }
#anims button[data-n=""] { display: none; }
#versiones button { height: 38px; padding: 0 14px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.cajita { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.cajita:empty { display: none; }

/* segmentados */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; padding: 0 6px; }
.seg button:hover { color: var(--text); background: var(--panel-2); }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 2px 8px rgba(0, 0, 0, .3); }
#sangreBotones button { height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
#sangreBotones b { font-size: 14px; color: var(--text); }
#sangreBotones span { font-size: 11px; font-weight: 500; }

/* colores por zona */
.zonas { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.zcol { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; min-width: 0; }
.zcol:hover { border-color: #4b5562; }
.zcol input[type=color] { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; flex: none; }
.zcol input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.zcol input[type=color]::-webkit-color-swatch { border: 1px solid rgba(255, 255, 255, .18); border-radius: 8px; }
.zcol input[type=color]::-moz-color-swatch { border: 1px solid rgba(255, 255, 255, .18); border-radius: 8px; }
.zcol span { font-size: 12.5px; font-weight: 500; line-height: 1.25; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.zcol code { display: none; }

/* adornos */
.ranura { margin: 0 0 12px; }
.ranura > span { display: block; font-size: 12px; color: var(--faint); margin-bottom: 6px; font-weight: 600; }
.ranura .anims { display: flex; flex-wrap: wrap; gap: 6px; }
.mini { display: flex; gap: 6px; }
.mini button { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.mini button:hover { background: var(--panel-3); }
.mini svg.i { width: 15px; height: 15px; }

/* campos */
.campo { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 12px; margin: 6px 0 10px; font-size: 13px; color: var(--muted); }
.campo output { min-width: 44px; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.campo select { grid-column: 2 / 4; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); padding: 0 10px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: var(--panel-3); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--panel-3); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; margin-top: -6px; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); border: 0; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.interruptor { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-size: 14px; cursor: pointer; }
.interruptor input { position: absolute; opacity: 0; width: 0; height: 0; }
.interruptor .t { width: 38px; height: 22px; border-radius: 22px; background: var(--panel-3); border: 1px solid var(--line-2); position: relative; flex: none; transition: background .15s; }
.interruptor .t::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #c9d0d8; transition: transform .15s, background .15s; }
.interruptor input:checked + .t { background: var(--amber); border-color: var(--amber); }
.interruptor input:checked + .t::after { transform: translateX(16px); background: #fff; }
.interruptor input:focus-visible + .t { outline: 2px solid var(--amber); outline-offset: 2px; }
.interruptor small { display: block; color: var(--faint); font-size: 12px; }

/* salud */
.salud { padding: 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.salud-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.salud-top output { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.estado { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(74, 222, 128, .14); color: var(--good); }
.estado[data-n="warn"] { background: rgba(250, 204, 21, .14); color: var(--warn); }
.estado[data-n="bad"] { background: rgba(251, 146, 60, .15); color: var(--bad); }
.estado[data-n="crit"] { background: rgba(239, 68, 68, .16); color: #f87171; }
#vida { --v: 100%; --c: var(--good); height: 26px; }
#vida[data-n="warn"] { --c: var(--warn); } #vida[data-n="bad"] { --c: var(--bad); } #vida[data-n="crit"] { --c: var(--crit); }
#vida::-webkit-slider-runnable-track { height: 10px; background: linear-gradient(90deg, var(--c) var(--v), var(--panel-3) var(--v)); }
#vida::-moz-range-track { height: 10px; background: linear-gradient(90deg, var(--c) var(--v), var(--panel-3) var(--v)); }
#vida::-webkit-slider-thumb { margin-top: -5px; width: 20px; height: 20px; }
.fila { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.fila .btn { height: 38px; font-size: 13px; flex: 1; }

/* datos */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stats .dato { padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column-reverse; gap: 2px; }
.stats .dato span { color: var(--faint); font-size: 11.5px; font-weight: 500; }
.stats .dato b { font-size: 15px; font-weight: 700; }

/* ?embed (el marco de la portada) */
html.embed, body.embed { background: transparent !important; }
body.embed .top, body.embed #lado, body.embed .toolbar, body.embed .sonando, body.embed .ayuda { display: none !important; }
body.embed #vista { background: transparent; }
body.embed #vista canvas { cursor: grab; }
body.embed .cargando { background: transparent; }
body.embed .cargando img, body.embed #cargaTexto { display: none; }

@media (max-width: 1100px) { #lado { width: 350px; } .brand .sub { display: none; } }
@media (max-width: 980px) {
  .menu { display: none; }
  .hero-in { grid-template-columns: 1fr; padding-top: 52px; gap: 40px; }
  .escenario { aspect-ratio: 4 / 3; }
  .autor { grid-template-columns: 1fr; gap: 32px; }
  .pie-in { grid-template-columns: 1fr 1fr; }
  .pie-marca { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  body.viewer { height: auto; overflow: auto; }
  #app { flex-direction: column; }
  #vista { flex: none; height: 58vh; min-height: 320px; }
  #lado { width: 100%; border-left: 0; }
  .tabs { position: sticky; top: 60px; z-index: 5; }
  .tab-body { overflow: visible; }
  .ayuda { display: none; }
}
@media (max-width: 640px) {
  .top { padding: 0 12px; gap: 10px; }
  .brand .logo { display: none; }
  .brand .ico { display: block; }
  .select select { max-width: none; width: 100%; }
  body.viewer .top .spacer { display: none; }
  .switcher { flex: 1; }
  .select { flex: 1; }
  body.home .top .btn { display: none; }
  .toolbar { bottom: 10px; }
  .toolbar button { width: 38px; height: 38px; }
  .seccion { padding-top: 56px; }
  .cifras { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .hero-in { padding-top: 40px; padding-bottom: 48px; }
  .zonas { grid-template-columns: 1fr; }
  .tab-body { padding: 4px 16px 24px; }
  .ficha { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
