:root {
  --blue: #0039b5;
  --blue-deep: #002a86;
  --lime: #dafb06;
  --red: #f70000;
  --green: #0b7a43;
  --white: #ffffff;
  --ink: #0b1020;
  --ink-soft: #4a5470;
  --paper: #f5f7fb;
  --stage: #e9edf5;
  --line: #dde3f0;
  --line-strong: var(--ink);
  --blue-tint: #e8eefb;
  --lime-tint: #fbffe0;
  --on-blue-soft: #b8c7f0;
  --danger-text: #d10000;
  /* Verde de marca de WhatsApp (MASTER §2.6): solo el botón "Pedir por WhatsApp". */
  --whatsapp: #25d366;
  --scrim: rgb(11 16 32 / 0.6);
  --shadow-dialog: 0 24px 64px rgb(11 16 32 / 0.24);
  --shadow-text: 0 1px 2px rgb(11 16 32 / 0.3);
  --font-ui: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  /* Colores de marca de Google (MASTER §2.5), exclusivos del botón de
     "Continuar con Google" (§6.12); no se usan en nada más. */
  --google-text: #1f1f1f;
  --google-stroke: #747775;
  --font-google: 'Google Sans', var(--font-ui);
  --radius: 4px;
  --radius-sm: 2px;
  --grid-size: 24px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
}
button,
input {
  font: inherit;
}
button,
a,
input,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--lime);
}
a {
  color: inherit;
  text-decoration: none;
}
header {
  max-width: 1440px;
  margin: auto;
  height: 72px;
  padding: 0 5%;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line-strong);
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-height: 44px;
}
.brand-chile {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}
.brand-logo {
  height: 30px;
  width: auto;
  flex-shrink: 0;
}
.header-label {
  font-size: 12px;
  letter-spacing: 1.6px;
  color: var(--ink-soft);
  border-left: 1px solid var(--line);
  padding-left: 28px;
}
.nav-link {
  margin-left: auto;
  font-size: 14px;
  font-weight: 800;
}
.nav-link span {
  padding-left: 15px;
}
main {
  max-width: 1320px;
  margin: auto;
  padding: 42px 40px 0;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  color: var(--blue);
}
.eyebrow::before {
  content: '// ';
  color: var(--ink-soft);
}
h1 {
  font-size: clamp(30px, 3.4vw, 46px);
  letter-spacing: -1.8px;
  line-height: 1.2;
  margin: 10px 0 9px;
  font-weight: 900;
}
h1 span {
  color: var(--blue);
}
.intro p {
  color: var(--ink-soft);
  margin: 0;
}
.studio-pill {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--white);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 26px;
}
.viewer {
  background: var(--stage);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 620px;
  overflow: hidden;
  position: relative;
}
.viewer-top {
  padding: 25px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border-bottom: 1px solid var(--line-strong);
}
.preview-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 8px;
}
.preview-label i {
  width: 8px;
  height: 8px;
  background: var(--green);
}
.material {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-soft);
}
.canvas-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 300px;
}
#preview {
  width: 100%;
  height: auto;
  display: block;
}
#empty {
  position: absolute;
  inset: 0;
  align-content: center;
  text-align: center;
  color: var(--ink-soft);
  padding: 30px;
}
.viewer-bottom {
  padding: 10px 25px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.view-buttons {
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: var(--radius);
}
.view-buttons button {
  background: transparent;
  border: 0;
  color: var(--ink);
  padding: 9px 15px;
  font-family: var(--font-mono);
  font-size: 14px;
  border-radius: var(--radius-sm);
  min-height: 44px;
}
.view-buttons button:not(.selected):hover {
  background: var(--paper);
}
.view-buttons button.selected {
  color: var(--lime);
  background: var(--ink);
}
.reset {
  border: 0;
  background: none;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}
.reset:hover {
  color: var(--blue);
}
.reset span {
  font-size: 13px;
}
.preview-foot {
  border-top: 1px solid var(--line-strong);
  display: flex;
  justify-content: space-between;
  padding: 16px 25px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--white);
}
.controls {
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 24px;
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 13px;
}
.step:not(:first-child) {
  margin-top: 24px;
}
.step > span {
  color: var(--white);
  background: var(--blue);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.6px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}
.name-field {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}
.name-field:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--lime);
}
.name-field input {
  border: 0;
  outline: 0;
  min-width: 0;
  width: 100%;
  padding: 13px;
  background: transparent;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}
.name-field > span {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 0 12px 0 0;
  white-space: nowrap;
}
.name-field > span.is-max {
  color: var(--ink);
  font-weight: 700;
}
.hint {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 8px 0 0;
}
.hint b {
  color: var(--ink);
}
.styles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.style-card {
  border: 1px solid var(--line-strong);
  background: white;
  border-radius: var(--radius);
  min-height: 87px;
  color: var(--ink);
  padding: 8px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.style-card:not(.selected):hover {
  background: var(--paper);
}
.style-card.selected {
  background: var(--blue-tint);
  border: 1.5px solid var(--blue);
  color: var(--blue);
}
.style-card b {
  font-size: 26px;
  line-height: 1.3;
}
.style-card span {
  font-size: 12px;
  font-weight: 800;
}
.sample-script {
  font-family: Pacifico, cursive;
}
.style-card .sample-pixel {
  font-family: 'Press Start 2P', monospace;
  font-size: 20px;
}
.sample-block {
  font-family: Nunito;
  font-weight: 900;
  text-shadow: 1px 2px 0 var(--line);
}
.color-label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  margin: 15px 0 10px;
}
.color-label span:last-child {
  font-size: 12px;
  color: var(--ink-soft);
}
.swatches {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.swatch {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  position: relative;
  padding: 0;
}
.swatch.selected {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.swatch.selected:after {
  content: '✓';
  color: var(--check);
  font-size: 17px;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.swap {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 14px 0 0;
  border: 0;
  border-bottom: 2px solid var(--blue);
  background: none;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}
.swap:hover {
  background: var(--lime);
}
.swap:disabled {
  color: var(--ink-soft);
  border-bottom-color: var(--ink-soft);
  cursor: not-allowed;
}
.swap:disabled:hover {
  background: none;
}
.skeleton-swatch {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
}
.swatches-message {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.download {
  margin-top: 24px;
  width: 100%;
  background: var(--blue);
  color: var(--white);
  border: 1.5px solid var(--blue);
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition:
    background-color 120ms linear,
    border-color 120ms linear;
}
.download:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}
.download:active {
  transform: translateY(1px);
}
.download:disabled {
  background: var(--paper);
  color: var(--ink-soft);
  border: 1.5px dashed var(--ink-soft);
  cursor: not-allowed;
  transition: none;
}
.download-note {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  text-align: center;
  margin: 10px 0 0;
}
.inspiration {
  margin-top: 43px;
  scroll-margin-top: 20px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 20px;
}
.section-heading h2 {
  font-size: 25px;
  letter-spacing: -0.6px;
  margin-top: 7px;
}
.section-heading p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
}
.presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.preset {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
  color: var(--ink);
}
.preset canvas {
  width: 100%;
  height: auto;
  display: block;
}
.preset > div {
  display: flex;
  justify-content: space-between;
  padding: 14px 19px;
  font-size: 14px;
  background: var(--white);
  border-top: 1px solid var(--line-strong);
  font-weight: 500;
}
.preset:hover > div {
  background: var(--lime);
  color: var(--ink);
}
.pink,
.green,
.yellow {
  background: var(--stage);
}
footer {
  padding: 36px 0;
  display: flex;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line-strong);
}
footer > span {
  font-size: 13px;
  color: var(--ink-soft);
}
footer p {
  margin-left: auto;
  text-align: right;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.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;
}
@media (min-width: 1400px) {
  main {
    padding-top: 50px;
  }
  .viewer {
    min-height: 665px;
  }
}
@media (max-width: 900px) {
  header {
    height: 80px;
  }
  .header-label {
    display: none;
  }
  main {
    padding: 28px 22px 0;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 16px;
  }
  .controls {
    padding: 20px;
  }
  .studio-pill {
    display: none;
  }
  .viewer-top {
    padding: 20px 16px;
  }
  .material {
    display: none;
  }
  .viewer-bottom {
    padding: 15px;
  }
  .preview-foot {
    padding: 15px;
    gap: 10px;
  }
  .reset span {
    display: none;
  }
  .reset {
    min-width: 44px;
    justify-content: center;
  }
}
@media (max-width: 680px) {
  header {
    height: 72px;
    padding: 0 20px;
  }
  .nav-link {
    font-size: 13px;
  }
  main {
    padding: 25px 16px 0;
  }
  h1 {
    font-size: 32px;
    letter-spacing: -1.2px;
  }
  .intro p {
    font-size: 14px;
  }
  .eyebrow {
    font-size: 12px;
  }
  .intro {
    margin-bottom: 22px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .viewer {
    min-height: 0;
    border-radius: var(--radius);
  }
  .viewer-top {
    padding: 17px;
  }
  .canvas-wrap {
    min-height: 0;
  }
  #preview {
    aspect-ratio: 1.9;
    object-fit: contain;
  }
  .data-error.stage-error {
    padding: 16px;
  }
  .data-error.stage-error .data-error-label {
    margin-bottom: 4px;
  }
  .data-error.stage-error p:not(.data-error-label) {
    font-size: 13px;
    margin-bottom: 10px;
  }
  .data-error.stage-error p.data-error-title {
    font-size: 16px;
    margin-bottom: 4px;
  }
  .viewer-bottom {
    padding: 0 14px 14px;
  }
  .preview-foot {
    font-size: 11px;
    padding: 12px 14px;
  }
  .controls {
    padding: 22px;
  }
  .swatches {
    justify-content: start;
    gap: 14px;
  }
  .style-card {
    min-height: 90px;
  }
  .section-heading {
    display: block;
  }
  .section-heading p {
    margin-top: 8px;
  }
  .presets {
    grid-template-columns: 1fr;
    gap: 13px;
  }
  .preset {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
  }
  .preset > div {
    height: 100%;
    align-items: center;
    padding: 15px;
    font-size: 13px;
    gap: 8px;
  }
  footer {
    flex-wrap: wrap;
    gap: 13px;
    padding: 28px 2px;
  }
  footer p {
    width: 100%;
    text-align: left;
    margin: 0;
  }
  .inspiration {
    margin-top: 30px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.shape-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.shape-options button {
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  padding: 9px 6px;
}
.shape-options button:hover {
  background: var(--paper);
}
.shape-options button.selected {
  background: var(--blue-tint);
  border: 1.5px solid var(--blue);
  color: var(--blue);
}

.styles {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.style-card {
  grid-column: span 2;
}
.style-card.themed {
  grid-column: span 3;
}
.sample-minecraft {
  font-family: Monocraft, monospace;
  font-weight: 700;
}
.sample-lego {
  font-family: 'Lilita One', sans-serif;
  font-weight: 400 !important;
  font-style: italic;
}
.style-card .sample-minecraft {
  font-size: 27px;
}
.style-card .sample-lego {
  font-size: 30px;
}

.view-buttons button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sample-minecraft {
  font-weight: 900 !important;
}

.swatches {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
}
.layer-colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}
.layer-colors label {
  font-size: 13px;
}
.layer-colors input {
  display: block;
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 3px;
  background: var(--white);
  margin-top: 7px;
}

.sample-fortnite {
  font-family: Anton, sans-serif;
  font-weight: 400 !important;
}
.style-card .sample-disney {
  font-family: 'Mouse Memoirs', sans-serif;
  font-weight: 400;
  font-size: 34px;
}
/* Keep the design independent of the growing control panel. */
main {
  padding-top: 24px;
}
.intro {
  margin-bottom: 22px;
}
h1 {
  font-size: clamp(30px, 3vw, 40px);
}
.viewer {
  align-self: start;
  width: 100%;
  min-height: 0;
  height: clamp(340px, calc(100dvh - 240px), 560px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  position: sticky;
  top: 20px;
}
.viewer-top {
  padding: 18px 22px;
}
.canvas-wrap {
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
#preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: fill;
}
.viewer-bottom {
  padding: 10px 20px 16px;
}
.preview-foot {
  padding: 12px 20px;
}
@media (max-width: 680px) {
  main {
    padding-top: 20px;
  }
  .intro {
    margin-bottom: 18px;
  }
  .viewer {
    position: relative;
    top: auto;
    height: clamp(260px, 44svh, 360px);
  }
  .viewer-top {
    padding: 14px;
  }
  .viewer-bottom {
    padding: 8px 12px 12px;
  }
  .preview-foot {
    padding: 10px 12px;
  }
}

@media (max-width: 680px) {
  header {
    gap: 12px;
  }
  .nav-link span {
    padding-left: 5px;
  }
}
@media (max-width: 480px) {
  .brand {
    gap: 8px;
  }
  .brand-chile {
    height: 34px;
  }
  .brand-logo {
    height: 26px;
  }
}
