@font-face { font-family: Geist; font-weight: 400; font-display: swap; src: url(fonts/Geist-400.woff2) format("woff2"); }
@font-face { font-family: Geist; font-weight: 600; font-display: swap; src: url(fonts/Geist-600.woff2) format("woff2"); }
@font-face { font-family: Geist; font-weight: 800; font-display: swap; src: url(fonts/Geist-800.woff2) format("woff2"); }

:root {
  --tinta: #f2f2f0;
  --gris: #9b9b98;
  --suave: #1f1f1e;
  --fondo: #121212;
  --preview: #1c1c1b;
  --linea: #2a2a29;
  --borde-color: rgba(255, 255, 255, 0.18);
  --menta: #dbfff0;
  --sombra-fija: rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* Modo claro: solo si el cliente lo elige con el botón. */
:root[data-theme="light"] {
  --tinta: #141414;
  --gris: #7d7d7a;
  --suave: #f3f3f1;
  --fondo: #ffffff;
  --preview: #f3f3f1;
  --linea: #ececea;
  --borde-color: rgba(0, 0, 0, 0.08);
  --sombra-fija: rgba(0, 0, 0, 0.18);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font-family: Geist, system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip; /* la franja del llavero usa 100vw */
}

button { font: inherit; color: inherit; cursor: pointer; }

.app {
  max-width: 440px;
  margin: 0 auto;
  padding: 20px 20px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* Encabezado */
.header { text-align: center; }
.bar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 36px;
}
.logo { width: 64px; height: auto; display: block; color: var(--tinta); }
.ig { color: var(--gris); font-size: 13px; font-weight: 400; text-decoration: none; }
.acciones { display: flex; align-items: center; gap: 12px; }
.tema {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--suave);
  display: grid;
  place-items: center;
}
.tema[hidden] { display: none; }
.tema .luna { display: none; }
:root[data-theme="light"] .tema .luna { display: block; }
:root[data-theme="light"] .tema .sol { display: none; }
h1 { font-weight: 800; font-size: 40px; line-height: 1.05; letter-spacing: -1px; margin: 0; }
.sub { margin: 6px 0 0; font-size: 14px; color: var(--gris); }

/* Vista previa: queda fija arriba al bajar. Al fijarse se achica y
   proyecta una sombra, para que se vea que el resto pasa por debajo. */
.preview-fija {
  position: sticky;
  top: 0;
  z-index: 2;
  /* Franja a todo el ancho de la pantalla, aunque el contenido sea angosto. */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--preview);
  transition: box-shadow 0.25s;
}
.preview-fija.fija { box-shadow: 0 12px 20px -14px var(--sombra-fija); }
.preview {
  max-width: 440px;
  margin: 0 auto;
  padding: 10px 20px 14px;
  text-align: center;
}
.stage { height: 230px; touch-action: pan-y; cursor: grab; transition: height 0.25s; }
.fija .stage { height: 150px; }
.fija .hint, .fija .nota-foto { display: none; }
.stage:active { cursor: grabbing; }
.stage canvas, .stage svg { display: block; width: 100%; height: 100%; }
.eleccion {
  margin-bottom: -14px; /* lo acerca al botón de WhatsApp */
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--suave);
  text-align: center;
}
.eleccion-titulo { margin: 0 0 2px; font-size: 12px; color: var(--gris); }
.caption { margin: 0; font-size: 15px; font-weight: 600; }
/* "Gíralo con el dedo" como etiqueta, porque invita a una acción.
   La nota de la foto queda como texto simple debajo. */
.hint {
  display: flex;
  width: fit-content;
  margin: 0 auto;
  padding: 5px 12px;
  border: 1px solid var(--borde-color);
  border-radius: 999px;
  font-size: 12px;
  color: var(--tinta);
}
.nota-foto { margin: 10px 0 0; font-size: 11px; font-style: italic; color: var(--gris); }

/* Pasos */
.step { display: block; margin: 0 0 12px; font-size: 16px; font-weight: 800; }
.step .val { color: var(--gris); font-weight: 400; }

.letra {
  width: 100%;
  border: 1px solid var(--borde-color);
  border-radius: 16px;
  padding: 8px;
  background: var(--suave);
  color: var(--tinta);
  font: 800 30px Geist, system-ui, sans-serif;
  text-align: center;
  outline: none;
}
.letra:focus-visible { box-shadow: 0 0 0 2px var(--tinta); }
.note { margin: 8px 0 0; font-size: 12px; color: var(--gris); }
.note.aviso { color: var(--tinta); font-weight: 600; }

.tipos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tipo {
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--tinta);
  border-radius: 14px;
  background: var(--fondo);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tipo svg { max-width: 80%; height: auto; }
.tipo[aria-checked="true"] { background: var(--menta); color: #141414; border-color: var(--menta); }
:root[data-theme="light"] .tipo[aria-checked="true"] { border-color: var(--tinta); box-shadow: 3px 3px 0 var(--tinta); }

.colores { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px 8px; justify-items: center; }
.color {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--borde-color);
}
.color[aria-checked="true"] { box-shadow: 0 0 0 2px var(--fondo), 0 0 0 4px var(--tinta); }

.tipo:focus-visible, .color:focus-visible, .wa:focus-visible { outline: 2px solid var(--tinta); outline-offset: 3px; }

/* WhatsApp */
.wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px;
  border-radius: 999px;
  background: var(--tinta);
  color: var(--fondo);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}
.wa svg { color: #25d366; }
.wa[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

.footer { text-align: center; font-size: 12px; color: var(--gris); display: flex; flex-direction: column; gap: 18px; }
.footer p { margin: 0; }
.footer .ig { font-size: 12px; color: var(--tinta); }
