:root {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --text: #0e1a14;
  --muted: #5b6b63;
  --line: #dde5e0;
  --accent: #25d366;
  --accent-ink: #063d1d;
  --accent-soft: #dcf8e7;
  --radius: 18px;
  --shadow: 0 6px 20px rgb(10 30 20 / .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1410;
    --surface: #13201a;
    --text: #e9f3ee;
    --muted: #93a79c;
    --line: #22342b;
    --accent-soft: #143d26;
    --shadow: 0 6px 20px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }
img, video { display: block; max-width: 100%; }
main { max-width: 1080px; margin: 0 auto; padding: 0 16px 40px; }
h1, h2 { line-height: 1.15; letter-spacing: -.02em; }
h2 { font-size: 1.35rem; margin: 36px 0 14px; }
.muted { color: var(--muted); }

/* Cabecera */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; text-decoration: none; }
.top nav { display: flex; gap: 14px; align-items: center; }
.install {
  padding: 5px 10px; border-radius: 99px; border: 0;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer;
}
.top nav a { font-size: .9rem; font-weight: 600; color: var(--muted); text-decoration: none; }
@media (max-width: 560px) { .brand span { display: none; } .top nav { gap: 12px; } }
.install { white-space: nowrap; }

/* Creador */
.maker { padding-top: 22px; scroll-margin-top: 60px; }
.maker__head { text-align: center; }
.maker__head h1 { font-size: clamp(1.8rem, 6vw, 2.9rem); margin: 8px 0 8px; }
.maker__panel {
  display: grid; gap: 18px; margin-top: 20px; grid-template-columns: minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 14px; box-shadow: var(--shadow);
}
.maker__panel > * { min-width: 0; }
@media (min-width: 820px) { .maker__panel { grid-template-columns: 420px minmax(0, 1fr); padding: 20px; gap: 24px; } }
.maker__stage {
  position: relative; aspect-ratio: 1; width: 100%; max-width: 420px; margin: 0 auto;
  border-radius: 16px; overflow: hidden;
  background: repeating-conic-gradient(var(--line) 0 25%, transparent 0 50%) 0 0 / 24px 24px;
}
.maker__stage.is-over { outline: 3px dashed var(--accent); outline-offset: -3px; }
.maker__stage canvas { width: 100%; height: 100%; display: block; }
.drop {
  position: absolute; inset: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; padding: 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 2px dashed var(--accent); border-radius: 16px;
}
.drop[hidden] { display: none; }
.drop__plus {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 2rem; font-weight: 800;
}
.drop small { color: var(--muted); }
.mk-change {
  position: absolute; top: 10px; right: 10px;
  padding: 7px 12px; border-radius: 99px; border: 0;
  background: rgb(0 0 0 / .65); color: #fff; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
}
.maker__controls { display: flex; flex-direction: column; gap: 16px; }
.mk-group { display: flex; flex-direction: column; gap: 8px; }
.mk-label { font-weight: 800; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mk-label small { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.mk-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mk-row--between { justify-content: space-between; }
.mk-row .btn { flex: 1 1 auto; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.seg button {
  padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line);
  background: transparent; color: var(--text); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
}
.seg button.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.swatch { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; border: 1px solid var(--line); cursor: pointer; }
.swatch input { width: 150%; height: 150%; margin: -25%; border: 0; padding: 0; cursor: pointer; }
.trim { display: flex; flex-direction: column; gap: 8px; }
.trim[hidden] { display: none; }
.trim canvas { display: block; width: 100%; max-width: 100%; height: 64px; border-radius: 10px; background: var(--bg); cursor: pointer; }
.trim label { display: grid; grid-template-columns: 96px 1fr; align-items: center; font-size: .9rem; color: var(--muted); }
.trim input[type=range] { width: 100%; accent-color: var(--accent); touch-action: pan-y; }
.trim canvas, .gain input { touch-action: pan-y; }
.mk-hint { margin: 0; font-size: .8rem; color: var(--muted); }
.gain { display: flex; gap: 10px; align-items: center; }
.gain b { min-width: 44px; text-align: right; color: var(--text); font-size: .85rem; }
.btn--sm { padding: 6px 12px; font-size: .85rem; flex: none !important; }
.btn--block { width: 100%; }
#mk-mic.is-rec { border-color: #e63946; color: #e63946; }
.mk-msg { margin: 0; padding: 10px 14px; border-radius: 12px; background: #ffe5e5; color: #8a1c1c; font-weight: 600; }
.result {
  margin-top: 18px; padding: 18px; border-radius: 22px;
  border: 2px solid var(--accent); background: var(--surface);
  display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center;
  scroll-margin-top: 70px;
}
.result[hidden] { display: none; }
.result h2 { margin: 0; }
.result video { width: 100%; max-width: 320px; border-radius: 16px; background: #000; }
.steps--compact { margin-top: 0; width: 100%; grid-template-columns: minmax(0, 1fr); }
.result .mk-row { width: 100%; max-width: 420px; }
.fineprint { font-size: .8rem; color: var(--muted); text-align: center; margin: 12px 0 0; }
.catalog h2 { text-align: center; }

/* Portada */
.hero { text-align: center; padding: 32px 0 8px; }
.hero--small { padding-bottom: 0; }
.hero h1 { font-size: clamp(1.9rem, 6vw, 3rem); margin: 6px 0 10px; }
.eyebrow {
  display: inline-block; margin: 0;
  padding: 4px 12px; border-radius: 99px;
  background: var(--accent-soft); color: var(--text);
  font-weight: 700; font-size: .85rem;
}
.lead { color: var(--muted); font-size: 1.08rem; max-width: 560px; margin: 0 auto; }
.steps {
  counter-reset: s; list-style: none; padding: 0; margin: 22px auto 0;
  display: grid; gap: 10px; max-width: 860px; text-align: left;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.steps li {
  counter-increment: s; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px 12px 50px; font-size: .95rem;
}
.steps li::before {
  content: counter(s); position: absolute; left: 12px; top: 12px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800;
}

/* Buscador y filtros */
.toolbar { margin-top: 18px; }
.search {
  width: 100%; padding: 14px 16px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text);
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap;
}
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Cuadrícula de stickers */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); margin-top: 14px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow);
}
.card[hidden] { display: none; }
.card__title { font-weight: 700; font-size: .95rem; text-decoration: none; line-height: 1.25; }
.card__actions { display: flex; gap: 6px; margin-top: auto; }
.card__actions .btn { flex: 1; padding: 9px 8px; font-size: .88rem; }

.sticker {
  position: relative; display: block; width: 100%; aspect-ratio: 1;
  padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: pointer;
  background: var(--line);
}
.sticker img, .sticker video { width: 100%; height: 100%; object-fit: cover; }
.sticker video { position: absolute; inset: 0; }
.sound {
  position: absolute; right: 8px; bottom: 8px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgb(0 0 0 / .6);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H2v6h4l5 4z' fill='white'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M19 5a10 10 0 0 1 0 14'/%3E%3C/svg%3E");
  background-size: 18px; background-repeat: no-repeat; background-position: center;
  transition: transform .2s;
}
.sticker:hover .sound { transform: scale(1.1); }
.is-playing .sound { background-color: var(--accent); animation: pulse .7s infinite alternate; }
@keyframes pulse { to { transform: scale(1.18); } }
.empty { text-align: center; color: var(--muted); padding: 24px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn--save { background: var(--accent); color: var(--accent-ink); }
.btn--save:disabled { opacity: .6; }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--wa { background: var(--text); color: var(--bg); }
.btn--lg { padding: 15px 22px; font-size: 1.05rem; }

/* Página de sticker */
.crumbs { font-size: .88rem; color: var(--muted); padding-top: 16px; }
.crumbs a { color: var(--muted); }
.detail { display: grid; gap: 20px; margin-top: 14px; align-items: center; }
@media (min-width: 720px) { .detail { grid-template-columns: 340px 1fr; } }
.sticker--big { max-width: 340px; margin: 0 auto; }
.detail__info h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); margin: 0 0 4px; }
.detail__info { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.howto .steps { margin-left: 0; }

/* Texto largo */
.prose { max-width: 720px; margin: 0 auto; padding-top: 18px; }
.prose h1 { font-size: clamp(1.7rem, 5vw, 2.5rem); }
.prose li { margin-bottom: 6px; }
.prose a:not(.btn) { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* FAQ y CTA */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 8px; }
.faq summary { font-weight: 700; cursor: pointer; }
.cta { text-align: center; margin-top: 30px; }

/* Anuncios */
.ad { margin: 24px auto; min-height: 100px; }
.ad--placeholder {
  display: grid; place-items: center;
  border: 2px dashed var(--line); border-radius: 14px;
  color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
}

/* Aviso */
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 50;
  transform: translate(-50%, 200%); visibility: hidden;
  width: min(92vw, 440px); padding: 14px 16px; border-radius: 14px;
  background: var(--text); color: var(--bg); font-weight: 600; text-align: center;
  box-shadow: var(--shadow); transition: transform .3s, visibility .3s;
}
.toast.is-on { transform: translate(-50%, 0); visibility: visible; }

/* Pie */
.foot { border-top: 1px solid var(--line); padding: 24px 16px 40px; text-align: center; font-size: .9rem; }
.foot p { margin: 6px 0; }
.foot__links a { color: var(--muted); }
