
/* Layout: una columna tipo app sobre blanco; cada pregunta es una pantalla que entra deslizándose.
   Tema único claro por decisión: la marca es una web blanca y alegre. */
:root {
  --bg: #FFFFFF;
  --soft: #F4F6FB;
  --ink: #13151D;
  --muted: #5D6375;
  --line: #E3E6EF;
  --blue: #2F5BFF;
  --blue-deep: #1D3FD0;
  --blue-soft: #EAF0FF;
  --sun: #FFD23F;
  --sun-deep: #E5B000;
  --sun-soft: #FFF7DA;
  --pink: #FF6B8B;
  --good: #13955B;
  --white: #FFFFFF;
  --display: "Fredoka", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 40px;
}
.app { max-width: 540px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

/* Cabecera y logo */
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 16px 0; }
.logo { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); min-width: 0; }
.logo svg { width: 30px; height: 40px; flex: none; transform: rotate(-10deg); transition: transform .3s; }
.logo:hover svg { transform: rotate(6deg) scale(1.05); }
.wm { font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; white-space: nowrap; }
.wm b { color: var(--blue); font-weight: 700; }
.wm i { font-style: normal; color: var(--muted); font-weight: 600; }
.progress { display: flex; gap: 5px; flex: none; }
.progress span { width: 16px; height: 8px; border-radius: 4px; background: var(--line); transition: background .3s, width .3s; }
.progress span.on { background: var(--blue); width: 26px; }

.screen { display: flex; flex-direction: column; gap: 18px; animation: enter .45s cubic-bezier(.2,.8,.2,1); }
@keyframes enter { from { transform: translateX(26px); opacity: .25; } to { transform: none; opacity: 1; } }

h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.3rem, 10vw, 3.3rem); line-height: 1.02; }
h1 .mark { display: inline-block; background: var(--sun); padding: 0 .22em .04em; border-radius: .25em; transform: rotate(-2deg); }
h2 { font-size: clamp(1.7rem, 7vw, 2.15rem); line-height: 1.08; }
.lead { color: var(--muted); font-size: 1.06rem; margin: 0; max-width: 60ch; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin: 0; }
.hint { font-size: .92rem; color: var(--muted); margin: 0; }
.hint b { color: var(--ink); }
.center { text-align: center; }

/* Ilustración: móvil animado */
.art { position: relative; height: 330px; display: grid; place-items: center; }
.art .blob { position: absolute; width: 270px; height: 270px; border-radius: 50%; background: var(--blue-soft); }
.art .ring { position: absolute; width: 318px; height: 318px; max-width: 100%; border-radius: 50%; border: 2px dashed var(--line); animation: spin 40s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mock { position: relative; width: 156px; height: 300px; background: var(--ink); border-radius: 34px; padding: 8px; box-shadow: 0 22px 40px rgba(19,21,29,.18); animation: float 4.5s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
.mock::after { content: ""; position: absolute; right: -3px; top: 70px; width: 3px; height: 34px; border-radius: 2px; background: var(--ink); }
.mock-screen { height: 100%; background: var(--white); border-radius: 27px; padding: 30px 9px 10px; display: flex; flex-direction: column; gap: 7px; overflow: hidden; position: relative; font-size: 11px; line-height: 1.25; }
.island { position: absolute; top: 9px; left: 50%; width: 46px; height: 13px; margin-left: -23px; border-radius: 8px; background: var(--ink); }
.bub { padding: 7px 9px; border-radius: 14px; max-width: 90%; font-weight: 600; animation: nudge 6s ease-in-out infinite; transform-origin: left bottom; }
.bub.l { background: var(--soft); align-self: flex-start; border-bottom-left-radius: 4px; }
.bub.r { background: var(--blue); color: var(--white); align-self: flex-end; border-bottom-right-radius: 4px; transform-origin: right bottom; animation-delay: 1.4s; }
.chips-mini { display: flex; gap: 4px; align-self: flex-end; animation: nudge 6s ease-in-out infinite; animation-delay: 2.4s; transform-origin: right center; }
.chips-mini span { background: var(--blue-soft); border: 1.5px solid var(--blue); border-radius: 999px; padding: 2px 6px; font-size: 12px; }
.res-mini { margin-top: auto; background: var(--sun-soft); border: 1.5px solid var(--sun); border-radius: 14px; padding: 8px; display: flex; gap: 7px; align-items: center; font-weight: 700; animation: nudge 6s ease-in-out infinite; animation-delay: 3.6s; transform-origin: center bottom; }
.res-mini small { display: block; font-weight: 500; color: var(--muted); }
@keyframes nudge { 0%, 14%, 100% { transform: none; } 5% { transform: scale(1.1) rotate(-2deg); } 9% { transform: scale(.97); } }
.fl { position: absolute; width: 50px; height: 50px; border-radius: 16px; background: var(--white); box-shadow: 0 8px 18px rgba(19,21,29,.12); display: grid; place-items: center; font-size: 25px; animation: bob 3.4s ease-in-out infinite; }
.f1 { top: 22px; left: calc(50% - 150px); }
.f2 { top: 54px; left: calc(50% + 100px); animation-delay: .6s; }
.f3 { top: 196px; left: calc(50% - 160px); animation-delay: 1.2s; }
.f4 { top: 232px; left: calc(50% + 106px); animation-delay: 1.8s; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-12px) rotate(6deg); } }
.art.search .mock { animation: wiggle .5s ease-in-out infinite; }
@keyframes wiggle { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.slot { font-family: var(--display); font-weight: 700; font-size: 17px; text-align: center; margin: auto 0; line-height: 1.15; }
.lupa { font-size: 30px; text-align: center; margin-top: 30px; animation: bob 1.2s ease-in-out infinite; }

/* Botones */
.btn { font: 600 1.15rem/1 var(--display); border: 0; border-radius: 999px; padding: 17px 24px; cursor: pointer; background: var(--blue); color: var(--white); box-shadow: 0 5px 0 var(--blue-deep); transition: transform .1s, box-shadow .1s; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; gap: 8px; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 0 var(--blue-deep); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--blue-deep); }
.btn:disabled { background: var(--line); color: var(--muted); box-shadow: 0 5px 0 #CBD0DC; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--white); color: var(--ink); box-shadow: 0 5px 0 var(--line), inset 0 0 0 2px var(--line); }
.btn.sun { background: var(--sun); color: var(--ink); box-shadow: 0 5px 0 var(--sun-deep); }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row .btn { flex: 1 1 150px; }

/* Prioridades */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.pick { position: relative; text-align: left; background: var(--white); color: var(--ink); border: 2px solid var(--line); border-radius: 20px; padding: 14px 12px 13px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; font: inherit; box-shadow: 0 4px 0 var(--line); transition: border-color .15s, box-shadow .15s, background .15s; min-width: 0; }
.pick:last-child:nth-child(odd) { grid-column: 1 / -1; }
.pick:hover { border-color: #C9CEDC; }
.pick .ico { align-self: flex-start; font-size: 1.8rem; line-height: 1; transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.pick:hover .ico { transform: rotate(-10deg); }
.pick .name { font-family: var(--display); font-weight: 700; font-size: 1.12rem; }
.pick .joke { font-size: .86rem; color: var(--muted); line-height: 1.3; }
.pick .rank { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: var(--white); font: 700 .85rem/26px var(--display); text-align: center; transform: scale(0); transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.pick.on { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 4px 0 var(--blue); animation: pop .3s; }
.pick.on .rank { transform: scale(1); }
@keyframes pop { 50% { transform: scale(1.04) rotate(-1deg); } }

/* Presupuesto y sistema */
.list { display: flex; flex-direction: column; gap: 10px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--white); color: var(--ink); border: 2px solid var(--line); border-radius: 20px; padding: 15px 16px; cursor: pointer; font: inherit; text-align: left; box-shadow: 0 4px 0 var(--line); transition: border-color .15s, transform .15s; }
.opt:hover { border-color: #C9CEDC; transform: translateX(3px); }
.opt.on { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 4px 0 var(--blue); }
.opt .big { font-family: var(--display); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.opt .sub { color: var(--muted); font-size: .88rem; }
.opt .ico { font-size: 1.7rem; }
.opt .arrow { color: var(--blue); font-family: var(--display); font-size: 1.3rem; }

/* Resultado */
.winner { background: var(--white); border: 2px solid var(--sun); border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 6px 0 var(--sun); animation: land .6s cubic-bezier(.2,1.4,.4,1); }
.winner.second { border-color: var(--blue); box-shadow: 0 6px 0 var(--blue); animation-delay: .15s; animation-fill-mode: backwards; }
@keyframes land { from { transform: translateY(30px) rotate(2deg) scale(.95); opacity: 0; } }
.w-head { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.w-head > div { min-width: 0; }
.badge { display: inline-block; background: var(--sun); color: var(--ink); font: 700 .78rem/1 var(--body); letter-spacing: .06em; text-transform: uppercase; padding: 7px 11px; border-radius: 999px; transform: rotate(-2deg); }
.second .badge { background: var(--blue); color: var(--white); }
.w-name { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 6.5vw, 2rem); line-height: 1.05; margin: 8px 0 4px; }
.price { font-weight: 600; font-variant-numeric: tabular-nums; }
.price .left { color: var(--good); font-size: .86rem; font-weight: 600; display: block; margin-top: 2px; }
.meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.match { font-family: var(--display); font-weight: 700; font-size: 2.6rem; line-height: 1; color: var(--blue); font-variant-numeric: tabular-nums; }
.match small { font: 500 .85rem var(--body); color: var(--muted); display: block; }
.stars { color: var(--sun-deep); font-size: 1.2rem; letter-spacing: 2px; text-align: right; }
.stars span { color: var(--line); }
.stars small { display: block; color: var(--muted); font-size: .8rem; letter-spacing: 0; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 8.6em minmax(0,1fr) 2.2em; gap: 10px; align-items: center; font-size: .9rem; }
.bar .track { height: 10px; border-radius: 5px; background: var(--soft); overflow: hidden; }
.bar .fill { display: block; height: 100%; border-radius: 5px; background: var(--blue); width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.bar .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.why { margin: 0; padding-left: 1.1em; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.why b { color: var(--ink); font-weight: 600; }
.empty { background: var(--soft); border-radius: 20px; padding: 18px; color: var(--muted); }

/* Dibujo de móvil en los resultados */
.phone { width: 70px; height: 128px; border-radius: 17px; border: 3px solid var(--ink); position: relative; flex: none; background: linear-gradient(160deg, var(--c1), var(--c2)); animation: float 4.5s ease-in-out infinite; }
.phone::before { content: ""; position: absolute; top: 8%; left: 11%; width: 40%; height: 24%; border-radius: 10px; background: rgba(0,0,0,.25); }
.phone::after { content: ""; position: absolute; top: 11%; left: 17%; width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,.8); box-shadow: 0 16px 0 rgba(255,255,255,.6); }
.phone.sm { width: 22px; height: 38px; border-radius: 6px; border-width: 2px; animation: none; }
.phone.sm::before { border-radius: 3px; }
.phone.sm::after { width: 4px; height: 4px; top: 12%; left: 18%; box-shadow: 0 6px 0 rgba(255,255,255,.6); }

/* Horquilla de precio */
.range-box { background: var(--soft); border-radius: 22px; padding: 18px 16px 14px; display: flex; flex-direction: column; gap: 4px; }
.range-val { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 6.5vw, 1.9rem); font-variant-numeric: tabular-nums; }
.range-sub { color: var(--muted); font-size: .9rem; }
.dual { position: relative; height: 44px; margin-top: 8px; }
.dual-track { position: absolute; left: 0; right: 0; top: 50%; height: 8px; margin-top: -4px; border-radius: 4px; background: var(--line); }
.dual-fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--blue); left: calc(15px + (100% - 30px) * var(--a, 0)); width: calc((100% - 30px) * (var(--b, 1) - var(--a, 0))); }
.dual input[type=range] { position: absolute; inset: 0; width: 100%; height: 44px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; z-index: 2; }
.dual input[type=range]::-webkit-slider-runnable-track { background: none; height: 44px; }
.dual input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 30px; height: 30px; margin-top: 7px; border-radius: 50%; background: var(--white); border: 3px solid var(--blue); box-shadow: 0 3px 0 var(--blue-deep); cursor: grab; }
.dual input[type=range]::-moz-range-track { background: none; }
.dual input[type=range]::-moz-range-thumb { pointer-events: auto; width: 24px; height: 24px; border-radius: 50%; background: var(--white); border: 3px solid var(--blue); box-shadow: 0 3px 0 var(--blue-deep); cursor: grab; }
.dual input[type=range]:focus-visible { outline: none; }
.dual input[type=range]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--pink); outline-offset: 2px; }
.dual-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.hq { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hq-chip { font: 600 .92rem/1.2 var(--body); color: var(--ink); background: var(--white); border: 2px solid var(--line); border-radius: 14px; padding: 11px 6px; cursor: pointer; box-shadow: 0 3px 0 var(--line); font-variant-numeric: tabular-nums; }
.hq-chip:hover { border-color: #C9CEDC; }
.hq-chip.on { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 3px 0 var(--blue); }
@media (max-width: 370px) { .hq { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

footer.note { font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 370px) { .grid { grid-template-columns: minmax(0,1fr); } .pick:last-child:nth-child(odd) { grid-column: auto; } .bar { grid-template-columns: 7.4em minmax(0,1fr) 2em; font-size: .84rem; } .fl { display: none; } }

/* Fuentes servidas desde la propia web (sin llamadas a Google) */
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(/fuentes/fredoka.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap; src: url(/fuentes/figtree.woff2) format("woff2"); }

a { color: var(--blue); }
.logo { text-decoration: none; }

/* Dónde comprarlo */
.shops { display: flex; flex-direction: column; gap: 10px; border-top: 2px dashed var(--line); padding-top: 14px; }
.shops-title { font-family: var(--display); font-weight: 700; font-size: 1.05rem; margin: 0; }
.shop-list { display: flex; flex-wrap: wrap; gap: 8px; }
.shop { flex: 1 1 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--white); color: var(--ink); text-decoration: none; font-weight: 600; box-shadow: 0 3px 0 var(--line); transition: border-color .15s, transform .1s; }
.shop:hover { border-color: var(--blue); }
.shop:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.shop b { color: var(--blue); font-family: var(--display); flex: none; }
.shops-note { font-size: .8rem; color: var(--muted); margin: 0; }
.shop small { color: var(--muted); font-weight: 500; }

/* Aviso de iPhone al mejor precio */
.deal { display: flex; flex-direction: column; gap: 10px; background: var(--sun-soft); border: 2px solid var(--sun); border-radius: 22px; padding: 16px; }
.deal > p { margin: 0; }
.deal-title { font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.price .desde { color: var(--muted); font-weight: 600; }
.price .cifra { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 7vw, 1.9rem); line-height: 1.1; color: var(--ink); }
.price small, .price .left { flex-basis: 100%; }
.price small { color: var(--muted); font-weight: 500; font-size: .8rem; }
.share { align-self: center; }

/* Texto de la portada para Google y para quien quiera leer */
.info { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 22px; }
.info[hidden] { display: none; }
.info h2 { font-size: clamp(1.4rem, 6vw, 1.7rem); }
.info h3 { font-family: var(--display); font-weight: 700; font-size: 1.15rem; margin: 8px 0 0; }
.info p { margin: 0; color: var(--muted); }
.info details { background: var(--soft); border-radius: 16px; padding: 12px 14px; }
.info summary { cursor: pointer; font-weight: 600; }
.info details p { margin-top: 8px; }

/* Pie */
footer.site { font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
footer.site p { margin: 0; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
footer.site a { color: var(--muted); }

/* Páginas de texto (aviso legal, privacidad, cómo elegimos) */
.doc { display: flex; flex-direction: column; gap: 12px; }
.doc h1 { font-size: clamp(2rem, 8vw, 2.6rem); }
.doc h2 { font-size: clamp(1.25rem, 5vw, 1.45rem); margin-top: 10px; }
.doc p, .doc li { color: var(--ink); }
.doc ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.doc .lead { color: var(--muted); }
.doc .box { background: var(--soft); border-radius: 16px; padding: 14px 16px; }
.doc dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.doc dt { font-weight: 600; }
.doc dd { margin: 0; overflow-wrap: anywhere; }

/* Página intermedia que abre la tienda */
.ir-box { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; text-align: center; }
.ir-box p { font-size: 1.1rem; margin: 0; max-width: 30ch; }
.ir-box .lupa { margin: 0; }
