/* =========================================================
   COMPONENTES · botones, chips, muestras, modales, avisos
   ========================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 22px; border-radius: 999px;
    font-weight: 700; color: #fff; text-align: center; text-decoration: none;
    background: linear-gradient(135deg, var(--rosa), var(--lila));
    box-shadow: 0 6px 18px rgba(224, 69, 123, .35);
    transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn.suave { color: var(--tinta); background: var(--vidrio-fuerte); box-shadow: inset 0 0 0 1.5px var(--borde), var(--sombra-suave); }
.btn.grande { width: 100%; min-height: 52px; font-size: 1.05rem; }
.btn small { font-weight: 500; opacity: .8; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.btn-icono {
    width: 40px; height: 40px; flex: none; border-radius: 50%; font-size: 1.05rem;
    background: var(--vidrio-fuerte); box-shadow: inset 0 0 0 1.5px var(--borde);
    display: grid; place-items: center; transition: transform .15s;
}
.btn-icono:active { transform: scale(.92); }
.btn-icono.apagado { opacity: .45; filter: grayscale(1); }

.btn-reinicio {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px;
    font-weight: 700; font-size: .9rem; color: var(--rosa-fuerte);
    background: #fff; box-shadow: inset 0 0 0 1.5px rgba(224, 69, 123, .35);
}
.btn-reinicio:hover { background: var(--rosa-claro); }
@media (max-width: 380px) { .btn-reinicio .txt { display: none; } .btn-reinicio { width: 40px; padding: 0; justify-content: center; } }

/* Chips de sección (fila deslizable) */
.chip {
    flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-width: 70px; height: 62px; padding: 6px 10px; border-radius: 18px;
    font-size: .72rem; font-weight: 700; color: var(--tinta-suave); line-height: 1.1; text-align: center;
    background: var(--vidrio); box-shadow: inset 0 0 0 1.5px var(--borde);
    transition: transform .15s, background .2s, color .2s;
}
.chip i { font-style: normal; font-size: 1.35rem; line-height: 1; }
.chip.activo { color: #fff; background: linear-gradient(135deg, var(--rosa), var(--lila)); box-shadow: 0 6px 14px rgba(224, 69, 123, .3); transform: translateY(-2px); }
.chip .punto { position: absolute; }

/* Grupos de opciones */
.grupo { margin-bottom: 16px; }
.grupo > h4 {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
    font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--tinta-suave); font-weight: 700;
}
.grupo > h4::after { content: ""; flex: 1; height: 1px; background: var(--borde); }
.grupo > p.nota { font-size: .85rem; color: var(--tinta-suave); margin-bottom: 8px; }

.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 76px; padding: 8px 6px; border-radius: var(--radio-s);
    font-size: .76rem; font-weight: 600; line-height: 1.15; text-align: center;
    background: var(--vidrio-fuerte); box-shadow: inset 0 0 0 1.5px var(--borde);
    transition: transform .15s, box-shadow .2s;
}
.item i { font-style: normal; font-size: 1.5rem; line-height: 1; }
.item:hover { transform: translateY(-2px); }
.item.activo { box-shadow: inset 0 0 0 2.5px var(--rosa), 0 6px 14px rgba(224, 69, 123, .22); background: #fff; color: var(--rosa-fuerte); }
.item.destacado { background: linear-gradient(135deg, #fff, var(--lila-claro)); }

.pildoras { display: flex; flex-wrap: wrap; gap: 8px; }
.pildora {
    min-height: 38px; padding: 6px 14px; border-radius: 999px; font-size: .84rem; font-weight: 600;
    background: var(--vidrio-fuerte); box-shadow: inset 0 0 0 1.5px var(--borde);
}
.pildora.activo { color: #fff; background: var(--tinta); box-shadow: none; }
.pildora .mini { display: inline-block; width: 22px; height: 22px; border-radius: 6px; vertical-align: middle; margin-right: 6px; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }

.muestras { display: flex; flex-wrap: wrap; gap: 8px; }
.muestra {
    width: 36px; height: 36px; border-radius: 50%; flex: none; position: relative;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.9), 0 0 0 1px rgba(60, 20, 70, .16), 0 2px 6px rgba(60, 20, 70, .12);
    transition: transform .15s;
}
.muestra:hover { transform: scale(1.1); }
.muestra.activo { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--rosa); transform: scale(1.08); }
.muestra.libre { background: conic-gradient(#f66, #fc6, #9e6, #6cf, #96f, #f6c, #f66); overflow: hidden; }
.muestra.libre input { position: absolute; inset: -8px; width: 60px; height: 60px; opacity: 0; cursor: pointer; }

.deslizador { display: flex; align-items: center; gap: 12px; font-size: .86rem; font-weight: 600; min-height: 40px; }
.deslizador span { flex: none; min-width: 78px; color: var(--tinta-suave); }
input[type=range] { flex: 1; min-width: 0; height: 28px; accent-color: var(--rosa); }

.campo { display: block; }
.campo input[type=text] {
    width: 100%; min-height: 46px; padding: 8px 16px; border-radius: 999px; border: 0;
    background: #fff; box-shadow: inset 0 0 0 1.5px var(--borde); font-weight: 600; font-size: 1rem;
}
.campo input[type=text]:focus { outline: none; box-shadow: inset 0 0 0 2.5px var(--rosa); }

.fila { display: flex; flex-wrap: wrap; gap: 8px; }
.fila > .btn { flex: 1 1 140px; }

/* Modal */
.modal {
    position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
    background: rgba(59, 29, 66, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: aparecer .25s ease both;
}
.modal-caja {
    width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
    padding: 24px 20px calc(20px + var(--seguro-abajo)); border-radius: 28px; text-align: center;
    background: linear-gradient(180deg, #fff, #fff6fa); box-shadow: 0 30px 80px rgba(59, 29, 66, .35);
}
.modal-caja h3 { font-family: var(--titulo); font-size: 1.5rem; margin-bottom: 6px; }
.modal-caja p { color: var(--tinta-suave); margin-bottom: 12px; line-height: 1.45; }
.modal-caja .gran-emoji { font-size: 3rem; line-height: 1.1; display: block; margin-bottom: 6px; }
.modal-botones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.modal-botones .btn { flex: 1 1 130px; }
.modal-caja img.foto-final { width: 100%; border-radius: 18px; box-shadow: var(--sombra); display: block; }
.estrellas { font-size: 2.2rem; letter-spacing: 4px; margin: 6px 0; }
.estrellas span { display: inline-block; color: #e3d5e6; }
.estrellas span.on { color: #f6b93b; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: calc(var(--i) * .16s); text-shadow: 0 2px 10px rgba(246, 185, 59, .6); }
@keyframes pop { from { transform: scale(0) rotate(-90deg); } }
.lista-retos { text-align: left; margin: 10px 0; display: grid; gap: 6px; }
.lista-retos li { padding: 8px 12px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--borde); font-size: .9rem; display: flex; gap: 8px; }
.lista-retos li.ok { background: #effaf2; box-shadow: inset 0 0 0 1px #bfe6cb; }

/* Avisos */
.tostadas { position: fixed; left: 0; right: 0; bottom: calc(18px + var(--seguro-abajo)); z-index: 95; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.tostada {
    padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: .92rem; color: #fff; text-align: center;
    background: rgba(59, 29, 66, .92); box-shadow: var(--sombra); animation: subir .3s ease both;
}
.tostada.fuera { opacity: 0; transform: translateY(10px); transition: .3s; }
@keyframes subir { from { opacity: 0; transform: translateY(14px); } }

/* ---------- v2 · cabecera: destellos y buzón ---------- */
a.btn-icono { text-decoration: none; }
.chip-destellos { height: 34px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; font-weight: 700; font-size: .84rem; color: var(--tinta); text-decoration: none; background: linear-gradient(135deg, #fff7d6, #ffe3f0); box-shadow: inset 0 0 0 1.5px rgba(201, 138, 107, .35); white-space: nowrap; }
.btn-icono.con-globo { position: relative; }
.btn-icono.con-globo[data-nuevos]:not([data-nuevos=""])::after { content: attr(data-nuevos); position: absolute; right: -3px; top: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; font-size: .68rem; font-weight: 700; color: #fff; background: var(--rosa); display: grid; place-items: center; animation: latido 1.4s ease-in-out infinite; }
@keyframes latido { 50% { transform: scale(1.25); } }
@media (max-width: 430px) { .chip-destellos { padding: 0 9px; font-size: .78rem; } .cabecera { gap: 6px; } .btn-icono { width: 36px; height: 36px; } .btn-reinicio .txt { display: none; } .btn-reinicio { width: 36px; height: 36px; padding: 0; justify-content: center; } }

.nota { font-size: .86rem; color: var(--tinta-suave); margin: 0 0 10px; line-height: 1.4; }
.conmutador { display: flex; gap: 6px; margin-bottom: 12px; }
.conmutador .modo { flex: 1; min-height: 40px; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--tinta-suave); background: rgba(142, 91, 214, .08); }
.conmutador .modo.activo { color: #fff; background: var(--tinta); }
.pildoras.centradas { justify-content: center; margin-bottom: 16px; }
.chip.tapada { opacity: .45; }

/* Galería de modelos */
.modelos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.modelo { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 0 8px; border-radius: 18px; overflow: hidden; text-align: center; background: #fff; box-shadow: inset 0 0 0 1.5px var(--borde), var(--sombra-suave); transition: transform .15s, box-shadow .2s; }
.modelo:hover { transform: translateY(-3px); }
.modelo.activo { box-shadow: inset 0 0 0 3px var(--rosa), 0 8px 18px rgba(224, 69, 123, .25); }
.modelo-foto { width: 100%; aspect-ratio: 11 / 14; object-fit: cover; display: block; background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--piel) 80%, #fff) 0 20%, transparent 21%), radial-gradient(circle at 50% 36%, var(--pelo) 0 30%, transparent 31%), linear-gradient(180deg, #ffe9f1, #eadcff); }
.modelo-foto.lista { background: radial-gradient(circle at 50% 100%, #fff 0, #ffe6f0 50%, #e9dcff 100%); }
.modelo-foto:not([src]) { color: transparent; }
.modelo strong { font-family: var(--titulo); font-size: .98rem; line-height: 1.1; margin-top: 6px; }
.modelo small { font-size: .68rem; color: var(--tinta-suave); padding: 0 6px; line-height: 1.2; }

.guardados { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.guardado { padding: 8px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--borde); display: grid; gap: 6px; text-align: center; }
.guardado img { width: 100%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 10px; background: var(--rosa-claro); }
.guardado strong { font-size: .84rem; line-height: 1.15; }
.guardado .fila { gap: 6px; justify-content: center; }
.guardado .pildora { min-height: 32px; padding: 4px 12px; font-size: .78rem; }

/* Carta de bienvenida y buzón */
.carta-bienvenida { text-align: left; padding: 16px 18px; border-radius: 18px; background: repeating-linear-gradient(#fffdf8 0 30px, #f9e9ee 30px 31px); box-shadow: inset 0 0 0 1px #f3d6de; font-family: var(--titulo); margin-bottom: 12px; }
.carta-bienvenida p { color: var(--tinta); line-height: 31px; margin: 0; font-size: 1rem; }
.carta-bienvenida .saludo { font-style: italic; font-weight: 700; color: var(--rosa-fuerte); font-size: 1.2rem; }
.carta-bienvenida .firma { text-align: right; font-style: italic; color: var(--rosa-fuerte); }
.buzon { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; text-align: left; }
.carta { position: relative; padding: 18px 16px 14px; border-radius: 18px; background: linear-gradient(160deg, #fff, #fff3f7); box-shadow: var(--sombra-suave), inset 0 0 0 1.5px #f7d3de; }
.carta p { font-family: var(--titulo); font-size: 1.04rem; line-height: 1.4; margin: 6px 0 10px; color: var(--tinta); }
.carta-n { font-size: .68rem; font-weight: 700; letter-spacing: .12em; color: var(--rosa); text-transform: uppercase; }
.carta-firma { display: block; text-align: right; font-family: var(--titulo); font-style: italic; color: var(--rosa-fuerte); font-size: .9rem; }
.carta.nueva { animation: abrirCarta .7s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: calc(var(--i) * .25s); box-shadow: 0 0 0 3px rgba(224, 69, 123, .35), 0 12px 30px rgba(224, 69, 123, .25); }
.carta.nueva::after { content: "✦ nuevo"; position: absolute; right: 12px; top: 12px; font-size: .68rem; font-weight: 700; color: #fff; background: var(--rosa); padding: 2px 8px; border-radius: 999px; }
@keyframes abrirCarta { from { opacity: 0; transform: scale(.7) rotate(-4deg); } }
.carta.cerrada { background: rgba(255, 255, 255, .5); box-shadow: inset 0 0 0 1.5px var(--borde); text-align: center; }
.carta.cerrada p { font-family: var(--texto); font-size: .82rem; color: var(--tinta-suave); margin: 4px 0 0; }
.carta-sello { font-size: 1.8rem; filter: grayscale(.6); opacity: .7; }

.medallas { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; text-align: left; }
.medalla { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1.5px var(--borde); opacity: .62; }
.medalla-ico { font-size: 1.8rem; filter: grayscale(1); }
.medalla strong { display: block; font-size: .95rem; } .medalla small { color: var(--tinta-suave); font-size: .8rem; line-height: 1.25; display: block; }
.medalla.ok { opacity: 1; background: linear-gradient(135deg, #fffbe9, #fff0f6); box-shadow: inset 0 0 0 1.5px #f3d9a0, var(--sombra-suave); }
.medalla.ok .medalla-ico { filter: none; }
