/* =============================================================
   Pixel Forge - hoja de estilos unica
   1 Tokens · 2 Reset · 3 Utilidades · 4 Cielo animado · 5 Cabecera
   6 Hero y zona de subida · 7 Botones y controles · 8 Espacio de trabajo
   9 Visor · 10 Inspector · 11 Materiales · 12 Construccion
   13 Contenido y FAQ · 14 Mas herramientas · 16 Footer
   17 Responsive · 18 Reduced-motion
   ============================================================= */

/* ===================== 1. TOKENS ===================== */
:root {
  --bg: #0a1024;
  --panel: rgba(16, 24, 48, .72);
  --panel-solid: #131c38;
  --panel-2: rgba(23, 33, 62, .82);
  --line: rgba(148, 179, 255, .18);
  --line-strong: rgba(148, 179, 255, .34);
  --ink: #f2f5ff;
  --ink-2: #c3ccec;
  --muted: #8e9ac2;

  --accent: #ffb454;         /* sol del amanecer */
  --accent-2: #6ad0ff;       /* cielo claro */
  --accent-3: #7bd66a;       /* hierba */
  --accent-ink: #21160a;
  --accent-soft: rgba(255, 180, 84, .16);

  --ok: #6ee7a8;
  --warn: #ffcc66;
  --bad: #ff8080;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow: 0 14px 40px -18px rgba(0, 0, 0, .8), 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-lg: 0 34px 80px -30px rgba(0, 0, 0, .85);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Outfit", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(1rem, 4vw, 2rem);
  --maxw: 1400px;
  --cycle: 150s;
}

/* ===================== 2. RESET ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  min-height: 100vh;
}
img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea, output { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.08; letter-spacing: -.015em; font-family: var(--display); font-weight: 700; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
details > summary { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }

/* ===================== 3. UTILIDADES ===================== */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 999;
  padding: .6rem 1rem; background: var(--accent); color: var(--accent-ink);
  border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 1rem; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section > h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
.section-sub { color: var(--muted); margin-top: .4rem; margin-bottom: 1.75rem; max-width: 62ch; }
.field-note { color: var(--muted); font-size: .82rem; margin-top: .4rem; line-height: 1.45; }
.empty-note {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 2rem 1.5rem; color: var(--muted); text-align: center;
  background: rgba(10, 16, 36, .5);
}
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
.swatch {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px;
  border: 1px solid rgba(255,255,255,.35); vertical-align: -2px; margin-right: .4rem;
}

/* ===================== 4. CIELO ANIMADO ===================== */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.sky-layer { position: absolute; inset: 0; opacity: 0; animation: skyPhase var(--cycle) linear infinite; }

/* amanecer */
.sky-dawn {
  background:
    linear-gradient(180deg, #1a2560 0%, #4a3a86 28%, #b4628f 52%, #ec8a5e 72%, #ffc46b 100%);
  animation-delay: calc(var(--cycle) * -0.02);
}
/* dia */
.sky-day {
  background: linear-gradient(180deg, #1f6fd0 0%, #47a6e8 45%, #93d3f5 78%, #cfeaff 100%);
  animation-delay: calc(var(--cycle) * 0.23);
}
/* atardecer */
.sky-dusk {
  background: linear-gradient(180deg, #16224f 0%, #5b3a7a 30%, #c85f6d 58%, #f08b52 80%, #ffb85e 100%);
  animation-delay: calc(var(--cycle) * 0.48);
}
/* noche */
.sky-night {
  background: linear-gradient(180deg, #05081c 0%, #0b1236 45%, #14205a 78%, #1d2c6e 100%);
  animation-delay: calc(var(--cycle) * 0.73);
}
@keyframes skyPhase {
  0%   { opacity: 0; }
  4%   { opacity: 1; }
  21%  { opacity: 1; }
  27%  { opacity: 0; }
  100% { opacity: 0; }
}

.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 28% 42%, #fff, transparent),
    radial-gradient(1px 1px at 47% 12%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 63% 31%, #fff, transparent),
    radial-gradient(1px 1px at 78% 16%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 88% 38%, #fff, transparent),
    radial-gradient(1px 1px at 35% 8%, #fff, transparent),
    radial-gradient(1px 1px at 71% 47%, #fff, transparent);
  opacity: 0;
  animation: starsFade var(--cycle) linear infinite;
}
@keyframes starsFade {
  0%, 62% { opacity: 0; }
  76%, 94% { opacity: .85; }
  100% { opacity: 0; }
}

/* Sol y luna en orbita: giran 360 grados por ciclo, en extremos opuestos. */
.orbit {
  position: absolute; left: 50%; top: 78%;
  width: min(150vw, 1500px); height: min(150vw, 1500px);
  transform: translate(-50%, -50%);
  animation: orbitSpin var(--cycle) linear infinite;
}
@keyframes orbitSpin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }

.sun, .moon {
  position: absolute; left: 50%; width: 84px; height: 84px; margin-left: -42px;
  image-rendering: pixelated;
  /* Contrarrotacion: la orbita gira, pero el sol y la luna se mantienen
     rectos como en el juego, en vez de volverse rombos. */
  animation: counterSpin var(--cycle) linear infinite;
}
@keyframes counterSpin { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
.sun {
  top: -42px;
  background: #ffd66b;
  box-shadow: 0 0 90px 30px rgba(255, 196, 92, .5), 0 0 34px 10px rgba(255, 214, 107, .7);
  border: 6px solid #ffe9a8;
}
.moon {
  bottom: -42px;
  background: #e9eeff;
  border: 6px solid #ffffff;
  box-shadow: 0 0 70px 22px rgba(190, 210, 255, .35);
}
.moon::before, .moon::after {
  content: ""; position: absolute; background: rgba(160, 175, 220, .55);
}
.moon::before { width: 16px; height: 16px; top: 12px; left: 14px; }
.moon::after { width: 12px; height: 12px; bottom: 14px; right: 16px; }

/* Nubes pixeladas en dos capas de parallax */
.clouds {
  position: absolute; left: 0; width: 300%; height: 120px;
  background-repeat: repeat-x;
  background-size: 420px 120px;
  opacity: .75;
}
.clouds-far {
  top: 14%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='120'%3E%3Cg fill='%23ffffff' fill-opacity='.55'%3E%3Crect x='40' y='40' width='120' height='20'/%3E%3Crect x='60' y='20' width='80' height='20'/%3E%3Crect x='20' y='60' width='160' height='20'/%3E%3Crect x='250' y='50' width='100' height='20'/%3E%3Crect x='270' y='30' width='60' height='20'/%3E%3C/g%3E%3C/svg%3E");
  animation: drift 190s linear infinite;
}
.clouds-near {
  top: 26%;
  opacity: .5;
  background-size: 560px 120px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='120'%3E%3Cg fill='%23ffffff' fill-opacity='.7'%3E%3Crect x='80' y='50' width='180' height='24'/%3E%3Crect x='120' y='26' width='100' height='24'/%3E%3Crect x='360' y='60' width='140' height='24'/%3E%3Crect x='390' y='36' width='80' height='24'/%3E%3C/g%3E%3C/svg%3E");
  animation: drift 120s linear infinite;
}
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-33.33%); } }

/* Montanas escalonadas, estilo terreno de bloques */
.ridge { position: absolute; left: 0; right: 0; bottom: 0; background-repeat: repeat-x; }
.ridge-far {
  height: 260px; opacity: .55;
  background-size: 800px 260px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='260'%3E%3Cpath fill='%231b2a52' d='M0 180h60v-30h60v-30h60v-40h60v40h60v30h60v40h60v-60h60v60h60v-30h60v30h60v40h60v50H0z'/%3E%3C/svg%3E");
}
.ridge-near {
  height: 180px; opacity: .9;
  background-size: 640px 180px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='180'%3E%3Cpath fill='%230c1330' d='M0 120h40v-20h40v-30h40v30h40v-50h40v50h40v20h40v-40h40v40h40v-20h40v20h40v30h40v-30h40v60H0z'/%3E%3C/svg%3E");
}

/* ===================== 5. CABECERA ===================== */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(8, 13, 30, .78);
  backdrop-filter: saturate(1.5) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  background: rgba(255, 255, 255, .08); border: 1px solid var(--line-strong);
}
.brand-name { font-family: var(--display); font-size: 1.12rem; letter-spacing: -.01em; }
.site-nav { display: none; gap: 1.35rem; font-size: .92rem; color: var(--ink-2); }
.site-nav a { padding: .3rem 0; border-bottom: 2px solid transparent; transition: color .2s var(--ease-out), border-color .2s var(--ease-out); }
.site-nav a:hover, .site-nav a.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.nav-toggle { display: grid; gap: 5px; padding: .55rem; border-radius: 8px; }
.nav-toggle-bar { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .28s var(--ease-out), opacity .2s; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: grid; gap: .2rem; padding: .5rem var(--gutter) 1rem;
  background: rgba(8, 13, 30, .96); border-bottom: 1px solid var(--line);
  animation: menuIn .26s var(--ease-out);
}
.mobile-nav[hidden] { display: none; }
.mobile-nav a { padding: .8rem .4rem; border-radius: 8px; font-weight: 500; }
.mobile-nav a:hover { background: rgba(255, 255, 255, .06); color: var(--accent); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ===================== 6. HERO Y ZONA DE SUBIDA ===================== */
.hero { padding-block: clamp(2rem, 5vw, 3.5rem) 1.5rem; text-align: center; }
/* Rotulo de seccion en mono, sin pastilla flotante (lenguaje de la red). */
.section-kicker {
  display: block; font-family: var(--mono); font-size: .78rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
  margin-bottom: .6rem;
}
.hero h1 { font-size: clamp(2rem, 5.6vw, 3.4rem); font-weight: 800; }
.hero-accent { color: var(--accent); }
.hero-facts {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .5rem 1.4rem; margin-top: 1.1rem;
}
.hero-fact {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .85rem; color: var(--ink-2);
}
.hero-fact svg { color: var(--accent-3); flex-shrink: 0; }
.h1-sub {
  display: block; margin-top: .7rem; font-family: var(--sans); font-weight: 500;
  font-size: clamp(.98rem, 2.1vw, 1.2rem); color: var(--ink-2); letter-spacing: 0;
  line-height: 1.5; text-wrap: balance;
}

.tool-card {
  margin: 1.75rem auto 0; max-width: 760px; text-align: left;
  background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); padding: clamp(1rem, 3vw, 1.6rem);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: var(--shadow-lg);
}
.drop-zone { border-radius: var(--radius); }
.drop-inner {
  display: flex; flex-direction: column; align-items: center; gap: .55rem;
  padding: clamp(1.6rem, 5vw, 2.8rem) 1rem; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-strong); border-radius: var(--radius);
  background: rgba(255, 255, 255, .03);
  transition: border-color .22s var(--ease-out), background .22s var(--ease-out), transform .22s var(--ease-out);
}
.drop-inner:hover { border-color: var(--accent); background: rgba(255, 180, 84, .07); }
.drop-zone.is-dragover .drop-inner { border-color: var(--accent-3); background: rgba(123, 214, 106, .12); transform: scale(1.01); }
.drop-icon { color: var(--accent); }
.drop-title { font-family: var(--display); font-size: 1.2rem; font-weight: 700; }
.drop-or { color: var(--muted); font-size: .84rem; }
.drop-hint { color: var(--muted); font-size: .82rem; }

.loaded-bar { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.loaded-bar[hidden] { display: none; }
.thumb {
  width: 62px; height: 62px; object-fit: cover; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: rgba(0,0,0,.3);
}
.loaded-meta { flex: 1; min-width: 140px; display: grid; }
.loaded-meta strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loaded-meta span { color: var(--muted); font-size: .82rem; }
.loaded-actions { display: flex; gap: .5rem; }

.progress { margin-top: 1rem; }
.progress[hidden] { display: none; }
.progress-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-3)); transition: width .3s var(--ease-out); }
.progress-label { margin-top: .5rem; color: var(--ink-2); font-size: .88rem; }

.alert { margin-top: 1rem; padding: .85rem 1rem; border-radius: var(--radius-sm); font-size: .9rem; }
.alert[hidden] { display: none; }
.alert strong { display: block; }
.alert-error { background: rgba(255, 128, 128, .12); border: 1px solid rgba(255, 128, 128, .4); color: #ffd7d7; }
.alert-warn { background: rgba(255, 204, 102, .12); border: 1px solid rgba(255, 204, 102, .4); color: #ffe9bd; }

.privacy-badge { margin-top: 1rem; font-size: .88rem; color: var(--ink-2); }
.honest-limit { margin-top: .35rem; font-size: .82rem; color: var(--muted); }

.hero-stats {
  list-style: none; padding: 0; margin: 1.75rem auto 0; display: flex;
  justify-content: center; flex-wrap: wrap; gap: clamp(1.2rem, 5vw, 3rem);
}
.hero-stats li { display: grid; }
.hero-stats strong { font-family: var(--display); font-size: clamp(1.3rem, 3vw, 1.7rem); color: var(--accent); }
.hero-stats span { color: var(--muted); font-size: .82rem; }

/* ===================== 7. BOTONES Y CONTROLES ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .72rem 1.15rem; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .92rem; text-align: center;
  transition: transform .2s var(--ease-out), background .2s var(--ease-out), border-color .2s var(--ease-out);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-1px); background: #ffc477; }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--ink); }
.btn-sm { padding: .45rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink-2);
  font-size: 1rem; line-height: 1;
}
.icon-btn:hover { border-color: var(--accent); color: var(--ink); }

.field { margin-bottom: 1.35rem; }
.field-label { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }

.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  padding: .45rem .7rem; border-radius: 99px; font-size: .84rem; font-weight: 600;
  border: 1px solid var(--line-strong); color: var(--ink-2);
  transition: all .2s var(--ease-out);
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.seg-btn {
  display: grid; gap: .1rem; padding: .6rem .7rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); color: var(--ink-2); text-align: center;
  transition: all .2s var(--ease-out);
}
.seg-btn strong { font-family: var(--display); font-size: 1rem; }
.seg-btn span { font-size: .74rem; color: var(--muted); }
.seg-btn:hover { border-color: var(--accent); }
.seg-btn.is-active { background: rgba(255, 180, 84, .16); border-color: var(--accent); color: var(--ink); }
.seg-btn.is-active span { color: var(--ink-2); }
.seg-sm .seg-btn { padding: .4rem .6rem; font-size: .84rem; font-weight: 600; }

select, input[type="number"] {
  width: 100%; padding: .55rem .7rem; border-radius: var(--radius-sm);
  background: rgba(8, 13, 30, .7); border: 1px solid var(--line-strong); color: var(--ink);
}
select:hover, input[type="number"]:hover { border-color: var(--accent); }

input[type="range"] {
  width: 100%; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 99px;
  background: rgba(255,255,255,.16); margin: .55rem 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%;
  background: var(--accent); border: 2px solid #2a1c08; cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%; background: var(--accent);
  border: 2px solid #2a1c08; cursor: pointer;
}
.slider-label { display: block; font-size: .84rem; color: var(--ink-2); margin-top: .5rem; }
.slider-label output { font-family: var(--mono); color: var(--accent); font-weight: 700; }

.check { display: flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

.switch { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative; width: 42px; height: 23px; border-radius: 99px; flex-shrink: 0;
  background: rgba(255,255,255,.16); border: 1px solid var(--line-strong);
  transition: background .22s var(--ease-out);
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--ink-2); transition: transform .22s var(--ease-out), background .22s;
}
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(19px); background: var(--accent-ink); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.switch-text { font-size: .86rem; color: var(--ink-2); }

.custom-size { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; align-items: end; }
.custom-size[hidden] { display: none; }
.custom-size label { font-size: .78rem; color: var(--muted); display: grid; gap: .25rem; }
.custom-size input { width: 88px; }
.custom-size .check { align-self: center; }

.depth-control[hidden], .dither-strength[hidden], .max-colors[hidden], .options-3d[hidden] { display: none; }
.depth-control, .dither-strength, .max-colors { margin-top: .7rem; }

.advanced summary { font-size: .84rem; color: var(--ink-2); padding: .5rem 0; font-weight: 600; }
.advanced summary:hover { color: var(--accent); }
.adv-body { padding-top: .5rem; display: grid; gap: .3rem; }
.cat-list { display: grid; gap: .3rem; margin: .4rem 0 .7rem; max-height: 190px; overflow-y: auto; padding-right: .3rem; }
.cat-list .check { font-size: .82rem; }
.cat-count { color: var(--muted); font-size: .76rem; margin-left: auto; font-family: var(--mono); }

/* ===================== 8. ESPACIO DE TRABAJO ===================== */
.workspace { padding-block: 1rem clamp(2rem, 5vw, 3rem); }
.workspace-empty {
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 5vw, 3rem); text-align: center;
  background: rgba(10, 16, 36, .55); backdrop-filter: blur(8px);
}
.workspace-empty h2 { font-size: 1.3rem; margin-bottom: .5rem; }
.workspace-empty p { color: var(--muted); max-width: 56ch; margin-inline: auto; }
.workspace-empty[hidden], .workspace-grid[hidden] { display: none; }

.workspace-grid { display: grid; gap: 1rem; }
.panel {
  background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); padding: clamp(.9rem, 2.5vw, 1.35rem);
  backdrop-filter: blur(14px) saturate(1.3); box-shadow: var(--shadow);
}
.panel-title { font-size: 1.05rem; margin-bottom: 1rem; }

/* ===================== 9. VISOR ===================== */
.panel-view { display: flex; flex-direction: column; gap: .7rem; min-height: 420px; }
.view-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; align-items: center; }
.view-toolbar .seg { grid-template-columns: auto auto; }
.tool-buttons { display: flex; align-items: center; gap: .35rem; }
.zoom-read { font-family: var(--mono); font-size: .78rem; color: var(--muted); min-width: 52px; text-align: right; }

.view-stage {
  position: relative; flex: 1; min-height: 340px; border-radius: var(--radius);
  overflow: hidden; background:
    linear-gradient(135deg, rgba(8,13,30,.9), rgba(16,26,54,.9));
  border: 1px solid var(--line);
}
.art-canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.art-canvas:active { cursor: grabbing; }
.stage-3d { position: absolute; inset: 0; }
.stage-3d[hidden] { display: none; }
.stage-note {
  position: absolute; inset: auto 0 0 0; padding: .6rem .9rem;
  background: rgba(8, 13, 30, .88); color: var(--ink-2); font-size: .82rem;
  border-top: 1px solid var(--line);
}
.stage-note[hidden] { display: none; }

.view-options { display: flex; flex-wrap: wrap; gap: .8rem 1.1rem; align-items: center; }
.options-3d { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.inline-select { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--ink-2); }
.inline-select select { width: auto; padding: .3rem .5rem; font-size: .82rem; }

/* ===================== 10. INSPECTOR ===================== */
.panel-inspect .inspect-empty p { color: var(--muted); font-size: .88rem; }
.inspect-body[hidden], .inspect-empty[hidden] { display: none; }
.block-hero { display: flex; gap: .8rem; align-items: center; margin-bottom: .9rem; }
.block-tex {
  width: 62px; height: 62px; border-radius: 8px; image-rendering: pixelated;
  border: 1px solid var(--line-strong); flex-shrink: 0;
}
.block-hero strong { display: block; font-family: var(--display); font-size: 1.02rem; }
.block-hero code { display: block; font-family: var(--mono); font-size: .72rem; color: var(--muted); word-break: break-all; }
.block-cat { font-size: .74rem; color: var(--accent-2); }

.inspect-stats { display: grid; gap: .4rem; margin-bottom: .9rem; }
.inspect-stats > div { display: flex; justify-content: space-between; gap: .6rem; font-size: .84rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line); }
.inspect-stats dt { color: var(--muted); }
.inspect-stats dd { margin: 0; font-weight: 600; text-align: right; }
.inspect-stats code { font-family: var(--mono); font-size: .78rem; }

.match-quality { font-size: .82rem; padding: .5rem .7rem; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.match-quality.great { background: rgba(110, 231, 168, .14); color: #b7f4d4; }
.match-quality.good  { background: rgba(110, 231, 168, .1); color: #a9e8c8; }
.match-quality.ok    { background: rgba(255, 204, 102, .12); color: #ffe1a8; }
.match-quality.meh   { background: rgba(255, 180, 84, .14); color: #ffd6a0; }
.match-quality.bad   { background: rgba(255, 128, 128, .14); color: #ffc4c4; }

.inspect-sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1rem 0 .5rem; }
.alt-list { list-style: none; padding: 0; display: grid; gap: .4rem; }
.alt-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.alt-item img { width: 30px; height: 30px; border-radius: 5px; image-rendering: pixelated; flex-shrink: 0; }
.alt-item .alt-meta { flex: 1; min-width: 0; }
.alt-item .alt-name { display: block; font-size: .84rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alt-item .alt-delta { font-size: .74rem; color: var(--muted); font-family: var(--mono); }
.alt-pairs .alt-item img + img { margin-left: -14px; }
.pair-mix { width: 18px; height: 30px; border-radius: 4px; flex-shrink: 0; }

/* ===================== 11. MATERIALES ===================== */
.summary-cards { list-style: none; padding: 0; display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 1.25rem; }
.summary-cards li {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: .9rem 1rem; display: grid; gap: .15rem; backdrop-filter: blur(10px);
}
.summary-cards strong { font-family: var(--display); font-size: 1.5rem; color: var(--accent); }
.summary-cards span { font-size: .78rem; color: var(--muted); }

.warnings { display: grid; gap: .5rem; margin-bottom: 1.25rem; }
.warn-item { padding: .7rem .9rem; border-radius: var(--radius-sm); font-size: .85rem; border: 1px solid; }
.warn-item strong { display: block; margin-bottom: .15rem; }
.warn-gravity { background: rgba(255, 204, 102, .1); border-color: rgba(255, 204, 102, .35); color: #ffe6b8; }
.warn-flammable { background: rgba(255, 140, 90, .1); border-color: rgba(255, 140, 90, .35); color: #ffd4bd; }
.warn-rare { background: rgba(106, 208, 255, .1); border-color: rgba(106, 208, 255, .3); color: #c5e9ff; }
.warn-translucent { background: rgba(148, 179, 255, .1); border-color: rgba(148, 179, 255, .3); color: #d5e0ff; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(10,16,36,.5); }
.materials-table { min-width: 460px; font-size: .88rem; }
.materials-table th, .materials-table td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); }
.materials-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: rgba(255,255,255,.03); position: sticky; top: 0; }
.materials-table tbody tr:last-child td { border-bottom: 0; }
.materials-table tbody tr:hover { background: rgba(255, 180, 84, .06); }
.mat-block { display: flex; align-items: center; gap: .6rem; }
.mat-block img { width: 28px; height: 28px; border-radius: 5px; image-rendering: pixelated; flex-shrink: 0; }
.mat-name { display: grid; }
.mat-name strong { font-size: .87rem; font-weight: 600; }
.mat-name span { font-size: .72rem; color: var(--muted); }
.mat-qty { font-family: var(--mono); font-weight: 700; }
.mat-stacks { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); }
.mat-bar { position: relative; min-width: 90px; }
.mat-bar-track { height: 6px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; margin-bottom: .2rem; }
.mat-bar-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-3)); }
.mat-pct { font-family: var(--mono); font-size: .76rem; color: var(--muted); }

.export-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }

/* ===================== 12. CONSTRUCCION ===================== */
.build-tips { background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-bottom: 1.25rem; backdrop-filter: blur(10px); }
.build-tips h3 { font-size: .95rem; margin-bottom: .6rem; }
.build-tips ol { margin: 0; padding-left: 1.2rem; color: var(--ink-2); font-size: .88rem; display: grid; gap: .3rem; }

.row-picker { display: grid; gap: .6rem; margin-bottom: 1.25rem; }
.row-picker label { font-size: .88rem; color: var(--ink-2); }
.row-picker output, .row-picker span { font-family: var(--mono); color: var(--accent); font-weight: 700; }
.row-nav { display: flex; flex-wrap: wrap; gap: .5rem; }

.row-detail { display: grid; gap: .5rem; }
.row-strip { display: flex; flex-wrap: wrap; gap: .3rem; }
.run-chip {
  display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .6rem;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(255,255,255,.03);
  font-size: .82rem;
}
.run-chip img { width: 22px; height: 22px; border-radius: 4px; image-rendering: pixelated; }
.run-chip .run-count { font-family: var(--mono); font-weight: 700; color: var(--accent); }
.run-chip .run-range { color: var(--muted); font-family: var(--mono); font-size: .74rem; }
.row-summary { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.row-empty { color: var(--muted); font-size: .88rem; }

/* ===================== 13. CONTENIDO Y FAQ ===================== */
.steps { list-style: none; padding: 0; display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 2.5rem; }
.step { background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 1.2rem; backdrop-filter: blur(10px); }
.step-n { font-family: var(--mono); font-size: .78rem; color: var(--accent); font-weight: 700; }
.step h3 { font-size: 1rem; margin: .4rem 0 .35rem; }
.step p { font-size: .86rem; color: var(--muted); }

.prose { max-width: 74ch; margin-bottom: 2.5rem; }
.prose h3 { font-size: 1.15rem; margin: 1.75rem 0 .6rem; }
.prose p { color: var(--ink-2); margin-bottom: .9rem; }
.prose strong { color: var(--ink); }

.faq-title { margin-bottom: 1.25rem; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.faq-list { display: grid; gap: .5rem; max-width: 74ch; }
.faq-item { background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .9rem 1.1rem; backdrop-filter: blur(10px); }
.faq-item summary { font-weight: 600; display: flex; justify-content: space-between; gap: 1rem; align-items: center; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent); font-size: 1.25rem; flex-shrink: 0; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin-top: .6rem; color: var(--ink-2); font-size: .9rem; }

/* ===================== 14. MAS HERRAMIENTAS ===================== */
.more-tools-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.more-tool-card {
  display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.1rem;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius);
  backdrop-filter: blur(10px);
  transition: transform .2s var(--ease-out), border-color .2s var(--ease-out);
}
.more-tool-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.more-tool-name { font-family: var(--display); font-weight: 700; font-size: 1rem; }
.more-tool-desc { color: var(--muted); font-size: .82rem; }

/* ===================== 16. FOOTER ===================== */
.site-footer { border-top: 1px solid var(--line); background: rgba(6, 10, 24, .82); backdrop-filter: blur(10px); padding-block: 2rem 1.5rem; margin-top: 2rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.footer-brand { color: var(--ink-2); font-size: .88rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: .86rem; color: var(--ink-2); }
.footer-nav a:hover { color: var(--accent); }
.disclaimer { margin-top: 1.25rem; color: var(--muted); font-size: .76rem; max-width: 88ch; line-height: 1.55; }

.to-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 70;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: 1.2rem; font-weight: 700;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(12px);
  transition: opacity .28s var(--ease-out), transform .28s var(--ease-out);
}
.to-top[hidden] { display: none; }
.to-top.is-visible { opacity: 1; transform: none; }
.to-top:hover { background: #ffc477; }

/* ===================== 17. RESPONSIVE ===================== */
@media (min-width: 720px) {
  .custom-size input { width: 100px; }
}
@media (min-width: 960px) {
  .site-nav { display: flex; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
  .workspace-grid { grid-template-columns: 300px minmax(0, 1fr); }
  .panel-inspect { grid-column: 1 / -1; }
}
@media (min-width: 1280px) {
  .workspace-grid { grid-template-columns: 310px minmax(0, 1fr) 320px; }
  .panel-inspect { grid-column: auto; }
  .panel-view { min-height: 560px; }
  .view-stage { min-height: 480px; }
}

/* ===================== 18. REDUCED-MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Se congela el ciclo dia/noche y el movimiento de fondo, que son los
     unicos efectos realmente intrusivos. Los fundidos suaves se mantienen. */
  .sky-layer, .stars, .orbit, .clouds, .sun, .moon { animation: none !important; }
  .sky-dawn { opacity: 1; }
  .orbit { transform: translate(-50%, -50%) rotate(-28deg); }
  .sun, .moon { transform: rotate(28deg); }
  .reveal { transition-duration: .01ms; }
  .mobile-nav { animation: none; }
}
