/* El Traje — interfaz mínima sobre el escaparate: arriba sólo la franja del título; abajo sólo el contador "2 de 5"
   con sus cinco puntitos. La fila de botones de piezas está oculta a la vista pero presente para teclado y lector de
   pantalla (aparece al recibir el foco). Tarjeta de la pieza puesta, pistas (burbuja, manita fantasma y "Arrastre cada
   pieza…" sólo al principio), destello de la transformación, resumen de la fiesta, barra de la vitrina de etiquetas,
   tarjetas de datos, "Toda la información" y confirmación. Cada bloque se muestra según la fase (clases en .app:
   is-dress, is-card, is-party, is-board…). Todo cabe en 360×640; se mide contra el marco (cqw/cqh), nunca la ventana. */

/* ---------- lo que aparece y desaparece ---------- */
.traje .hud-top, .traje .drag-hint, .traje .counter, .traje .panel, .traje .party, .traje .locker-bar, .traje .bubble { opacity: 0; visibility: hidden; transition: opacity .35s ease, transform .4s cubic-bezier(.2, .9, .25, 1.05), visibility 0s linear .4s; }
.traje .app:is(.is-dress, .is-card, .is-party, .is-board, .is-picking):not(.is-no-title) .hud-top { opacity: 1; visibility: visible; transition-delay: 0s; }
.traje .app.is-dress.is-hint:not(.is-dragging) .drag-hint, .traje .app.is-dress .counter { opacity: 1; visibility: visible; transform: translateX(-50%); transition-delay: 0s; }
.traje .app.is-card .panel, .traje .app.is-party .party, .traje .app.is-board:not(.is-picking) .locker-bar { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.traje .bubble.is-on { opacity: 1; visibility: visible; transition-delay: 0s; }
.traje .app.is-dragging .counter { opacity: .5; }
.traje .drag-hint { transition-duration: .8s, .4s, 0s; }

/* ---------- botones redondos de las esquinas ---------- */
.traje .info-btn { position: absolute; top: calc(var(--safe-t) + 14px); left: 12px; z-index: 8; }
.traje .sound-btn { position: absolute; top: calc(var(--safe-t) + 14px); right: 12px; z-index: 8; }

/* ---------- franja del título ---------- */
/* (franja crema casi opaca con canto del color del héroe: el texto nunca va directo sobre la escena; tinta 8.1:1 y el
   título del cumpleaños en el tono oscuro del héroe ≥ 4.8:1) */
.traje .hud-top { position: absolute; left: 62px; right: 62px; top: calc(var(--safe-t) + 10px); z-index: 6; padding: 9px 14px 10px; border-radius: 22px; background: linear-gradient(180deg, rgba(255, 252, 247, .96), rgba(255, 246, 236, .94)); box-shadow: 0 2px 0 rgba(255, 255, 255, .9) inset, 0 -3px 0 var(--hero-soft) inset, 0 8px 22px rgba(120, 70, 60, .16); text-align: center; pointer-events: none; transform: translateY(-10px); }
.traje .app:is(.is-dress, .is-card, .is-party, .is-board, .is-picking) .hud-top { transform: none; }
.traje .hd-sub:empty { display: none; }
.traje .hd-title { margin: 0; font: 400 clamp(19px, 6.1cqw, 26px)/1.1 var(--font-d); color: var(--ink); text-wrap: balance; }
.traje .app.is-party-title .hd-title { font-size: clamp(25px, 8cqw, 36px); color: var(--hero-ink); }
.traje .app.is-party-reveal .hud-top { animation: tj-pop .7s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes tj-pop { 0% { transform: scale(.7); opacity: 0; } 100% { transform: none; opacity: 1; } }
.traje .hd-sub { margin: 3px 0 0; font: 800 14px/1.3 var(--font-b); color: #56617C; }

/* ---------- contador "2 de 5" (abajo) ---------- */
.traje .counter { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 16px); z-index: 7; display: inline-flex; align-items: center; gap: 12px; padding: 8px 18px 8px 10px; border-radius: 999px; background: linear-gradient(180deg, rgba(255, 252, 247, .97), rgba(255, 244, 232, .95)); box-shadow: 0 2px 0 rgba(255, 255, 255, .9) inset, 0 8px 22px rgba(120, 70, 60, .18); transform: translate(-50%, 12px); pointer-events: none; }
.traje .ct-dots { display: inline-flex; gap: 6px; }
.traje .ct-dot { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #FFFFFF; color: #B9A79A; box-shadow: inset 0 0 0 2px #EADBCD; transition: background .3s, color .3s, box-shadow .3s, transform .3s cubic-bezier(.2, 1.6, .4, 1); }
.traje .ct-dot.is-done { background: radial-gradient(circle at 35% 30%, var(--hero-soft), var(--hero) 80%); color: #FFFFFF; box-shadow: 0 2px 6px var(--hero-shadow), inset 0 0 0 2px rgba(255, 255, 255, .55); transform: scale(1.08); }
.traje .ct-text { font: 400 21px/1 var(--font-d); color: var(--ink); white-space: nowrap; }

/* ---------- pista (sólo al principio) y fila de piezas (oculta salvo con el foco del teclado) ---------- */
.traje .drag-hint { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 76px); z-index: 6; display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 8px 15px; border-radius: 999px; background: rgba(255, 252, 247, .95); color: var(--ink); font: 800 14px/1.2 var(--font-b); white-space: nowrap; transform: translate(-50%, 6px); box-shadow: 0 6px 16px rgba(120, 70, 60, .16); pointer-events: none; }
.traje .drag-hint span:first-child { display: inline-grid; color: var(--hero-ink); }
.traje .deck { position: absolute; left: 10px; right: 10px; bottom: calc(var(--safe-b) + 10px); z-index: 9; padding: 8px; border-radius: 26px; background: rgba(255, 252, 247, .97); box-shadow: 0 10px 26px rgba(120, 70, 60, .2); }
.traje .deck:not(:focus-within) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; box-shadow: none; }
.traje .deck-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.traje .ui:has(.deck:focus-within) :is(.drag-hint, .counter) { opacity: 0; }
.traje .dslot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 6px 2px; border: 2px dashed #D9C8BA; border-radius: 18px; background: #FFFFFF; color: var(--ink-2); cursor: pointer; transition: background .2s, border-color .2s, transform .12s; }
.traje .dslot:active { transform: scale(.96); }
.traje .ds-ic { display: grid; place-items: center; }
.traje .ds-label { font: 800 11.5px/1.1 var(--font-b); }
.traje .ds-check { position: absolute; top: -6px; right: -4px; display: none; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #2EAF6E; color: #FFFFFF; box-shadow: 0 2px 0 #1E8A54; }
.traje .dslot.is-done { border-style: solid; border-color: transparent; background: linear-gradient(180deg, #FFF3C9, #FFE59A); color: var(--ink); box-shadow: 0 3px 0 #E8C25A; }
.traje .dslot.is-done .ds-check { display: grid; }
.traje .dslot.is-on { outline: 3px solid var(--sky); outline-offset: 1px; }

/* ---------- tarjeta de la pieza puesta (abajo, en lugar del contador) ---------- */
/* (acabado de juguetería: crema cálida, bordes muy redondeados, sombra suave y el ícono de la pieza que la reveló en
   una burbuja del color del héroe) */
.traje .panel { position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px); z-index: 8; display: flex; flex-direction: column; max-height: min(48cqh, 440px); padding: 14px 16px 12px; border-radius: 30px; background: linear-gradient(180deg, #FFFCF8, #FFF5EA); box-shadow: 0 2px 0 rgba(255, 255, 255, .9) inset, 0 16px 40px rgba(120, 70, 60, .22), 0 2px 6px rgba(120, 70, 60, .08); transform: translateY(18px) scale(.97); }
.traje .p-top { display: flex; align-items: flex-start; gap: 10px; }
.traje .p-head { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.traje .p-ic { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--hero-soft), var(--hero) 80%); color: #FFFFFF; box-shadow: 0 4px 10px var(--hero-shadow), inset 0 0 0 2px rgba(255, 255, 255, .5); }
.traje .app.is-card .p-ic { animation: tj-pop .55s cubic-bezier(.2, 1.5, .4, 1) both; }
.traje .p-kick { margin: 0; font: 800 12.5px/1.2 var(--font-b); color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.traje .p-title { margin: 1px 0 0; font: 400 23px/1.1 var(--font-d); color: var(--hero-ink); }
.traje .p-close { flex: none; width: 40px; height: 40px; box-shadow: none; background: var(--cream-2); }
.traje .p-body { flex: 1; min-height: 0; overflow: auto; margin-top: 8px; overscroll-behavior: contain; }
.traje .p-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.traje .p-next { min-height: 46px; }

/* ---------- burbuja (elegir con un toque) y manita fantasma ---------- */
.traje .bubble { position: absolute; left: 0; top: 0; z-index: 9; max-width: 240px; padding: 9px 14px; border-radius: 16px; background: var(--ink); color: #FFFFFF; font: 800 14px/1.3 var(--font-b); text-align: center; pointer-events: none; box-shadow: 0 6px 18px rgba(47, 59, 87, .3); }
.traje .bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 3px; }
.traje .ghost { position: absolute; left: 0; top: 0; z-index: 9; width: 46px; height: 46px; color: #FFFFFF; filter: drop-shadow(0 3px 6px rgba(47, 59, 87, .45)); opacity: 0; pointer-events: none; transform: translate(var(--x0, 0), var(--y0, 0)); }
.traje .ghost svg { display: block; }
.traje .ghost.is-on { animation: tj-ghost 2.5s cubic-bezier(.45, 0, .3, 1) 2; }
@keyframes tj-ghost {
  0% { opacity: 0; transform: translate(calc(var(--x0) - 8px), calc(var(--y0) + 14px)) scale(1); }
  12% { opacity: 1; transform: translate(calc(var(--x0) - 8px), calc(var(--y0) + 10px)) scale(1); }
  22% { opacity: 1; transform: translate(calc(var(--x0) - 8px), calc(var(--y0) + 10px)) scale(.86); }
  72% { opacity: 1; transform: translate(calc(var(--x1) - 8px), calc(var(--y1) + 10px)) scale(.86); }
  82% { opacity: 1; transform: translate(calc(var(--x1) - 8px), calc(var(--y1) + 10px)) scale(1); }
  100% { opacity: 0; transform: translate(calc(var(--x1) - 8px), calc(var(--y1) + 10px)) scale(1); }
}
.rm.traje .ghost.is-on { animation: tj-ghost-rm 2.5s ease 1; }
@keyframes tj-ghost-rm { 0%, 100% { opacity: 0; transform: translate(var(--x1), var(--y1)); } 20%, 80% { opacity: 1; transform: translate(var(--x1), var(--y1)); } }

/* ---------- destello de la transformación ---------- */
.traje .flash { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(60% 45% at 50% 50%, #FFFFFF 0%, #FFF6D8 45%, rgba(255, 246, 216, .85) 100%); opacity: 0; transition: opacity .7s ease-out; will-change: opacity; }
.traje .flash.is-on { opacity: 1; transition: opacity .25s ease-in; }
.rm.traje .flash.is-on { opacity: .7; }

/* ---------- resumen de la fiesta ---------- */
.traje .party .toy-map { height: 84px; }
.traje .party .map-wrap { margin-top: 8px; }
.traje .party .pa-facts small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.traje .party { position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px); z-index: 7; display: flex; flex-direction: column; max-height: min(50cqh, 480px); padding: 12px 14px 12px; border-radius: 30px; background: linear-gradient(180deg, #FFFCF8, #FFF5EA); box-shadow: 0 2px 0 rgba(255, 255, 255, .9) inset, 0 16px 40px rgba(120, 70, 60, .22); transform: translateY(20px); }
.traje .pa-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 2px 2px 6px; }
.traje .pa-facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.traje .pa-facts li { display: flex; gap: 10px; align-items: flex-start; }
.traje .pa-facts strong { display: block; font: 400 18px/1.15 var(--font-d); color: var(--ink); }
.traje .pa-facts small { display: block; font: 700 13.5px/1.35 var(--font-b); color: var(--ink-2); }
.traje .pa-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--hero-soft), var(--hero) 80%); color: #FFFFFF; box-shadow: 0 3px 8px var(--hero-shadow); }
.traje .pa-maps { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.traje .pa-maps .gbtn { flex: 1; }
.traje .pa-dead { margin: 8px 0 0; text-align: center; font: 800 13px/1.3 var(--font-b); color: var(--accent-2); }
.traje .pa-actions { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.traje .pa-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.traje .pa-row .gbtn { padding: 0 6px; font-size: 14px; gap: 5px; white-space: nowrap; }
.traje .map-wrap { margin-top: 10px; border-radius: 18px; overflow: hidden; box-shadow: inset 0 0 0 2px #D6E6F7; line-height: 0; }
.traje .toy-map { width: 100%; height: auto; display: block; }

/* ---------- barra de la vitrina de etiquetas ---------- */
.traje .locker-bar { position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px); z-index: 7; display: grid; gap: 8px; padding: 12px; border-radius: 30px; background: linear-gradient(180deg, #FFFCF8, #FFF5EA); box-shadow: 0 2px 0 rgba(255, 255, 255, .9) inset, 0 16px 40px rgba(120, 70, 60, .22); transform: translateY(20px); }

/* ---------- cuerpo de las tarjetas ---------- */
.traje .cbody { display: grid; gap: 8px; }
.traje .cbody.is-compact { gap: 6px; }
.traje .big { margin: 0; font: 400 24px/1.12 var(--font-d); color: var(--ink); }
.traje .big.is-name { font-size: 34px; color: var(--accent); }
.traje .lead { margin: 0; font: 700 16px/1.35 var(--font-b); }
.traje .note { margin: 0; font: 700 14.5px/1.4 var(--font-b); color: var(--ink-2); }
.traje .chip { display: inline-block; margin: 0; padding: 4px 12px; border-radius: 999px; background: var(--soft); color: var(--accent-2); font: 800 14px/1.3 var(--font-b); justify-self: start; }
.traje .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.traje .row .gbtn { flex: 1 1 auto; }
.traje .steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.traje .steps li { display: flex; align-items: baseline; gap: 10px; padding: 6px 10px; border-radius: 12px; background: #FFFFFF; }
.traje .st-time { flex: none; min-width: 64px; font: 400 15px/1.2 var(--font-d); color: var(--sky-2); }
.traje .st-title { font: 700 15px/1.3 var(--font-b); }
.traje .quote { margin: 0; padding: 12px 14px; border-radius: 18px; background: #FFFFFF; box-shadow: inset 4px 0 0 var(--sun); }
.traje .quote p { margin: 0; font: 400 20px/1.3 var(--font-d); color: var(--ink); }
.traje .quote footer { margin-top: 6px; font: 800 14px/1.2 var(--font-b); color: var(--accent); }
.traje .gifts { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.traje .gifts li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #FFFFFF; }
.traje .gifts li.is-fav { box-shadow: inset 0 0 0 2px var(--sun); }
.traje .g-dot { flex: none; display: grid; place-items: center; color: var(--accent); }
.traje .g-text { flex: 1; min-width: 0; display: grid; }
.traje .g-text small { color: var(--ink-2); font-weight: 700; }
.traje .g-text em { font-style: normal; font-weight: 800; font-size: 13px; color: var(--accent-2); }
.traje .g-link { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--soft); color: var(--accent-2); font-weight: 800; text-decoration: none; }
.traje .check { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.traje .check li { display: flex; gap: 8px; align-items: flex-start; font-weight: 700; }
.traje .check li > span:first-child { flex: none; color: #2EAF6E; }
.traje .thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.traje .thumb { padding: 0; border: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 1; background: var(--cream-2); cursor: pointer; }
.traje .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- "Toda la información" ---------- */
.traje .chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: none; }
.traje .chips::-webkit-scrollbar { display: none; }
.traje .chips .chip { flex: none; border: 0; cursor: pointer; background: var(--cream-2); color: var(--ink); }
.traje .chips .chip.is-on { background: var(--accent); color: #FFFFFF; }
.traje .dcard { margin: 0 0 12px; padding: 14px; border-radius: 20px; background: #FFFFFF; box-shadow: 0 2px 0 rgba(47, 59, 87, .06); }
.traje .dcard .cbody .steps li, .traje .dcard .gifts li, .traje .dcard .quote { background: var(--cream); }
.traje .dcard h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 400 19px/1.2 var(--font-d); }
.traje .dic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--soft); color: var(--accent); }
.traje .faq details { padding: 8px 0; border-bottom: 1px solid var(--line); }
.traje .faq summary { font-weight: 800; cursor: pointer; }
.traje .faq p { margin: 6px 0 0; color: var(--ink-2); }

/* ---------- confirmación ---------- */
.traje .rv-top { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.traje .tag-preview { flex: none; width: 112px; line-height: 0; filter: drop-shadow(0 4px 6px rgba(47, 59, 87, .2)); transform: rotate(-4deg); }
.traje .rv-kick { margin: 0; font: 400 20px/1.15 var(--font-d); color: var(--accent); }
.traje .rv-intro p:last-child { margin: 2px 0 0; font-size: 14.5px; color: var(--ink-2); }
.traje .flabel { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 0 6px; font: 800 14px/1.2 var(--font-b); color: var(--ink); }
.traje .count { font-weight: 700; color: var(--ink-2); font-size: 12.5px; }
.traje .swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.traje .swatch { width: 44px; height: 44px; padding: 0; border: 3px solid #FFFFFF; border-radius: 14px; background: var(--c); cursor: pointer; box-shadow: 0 0 0 2px var(--line), 0 3px 0 rgba(47, 59, 87, .12); }
.traje .swatch[aria-checked="true"] { box-shadow: 0 0 0 3px var(--ink), 0 3px 0 rgba(47, 59, 87, .12); }
.traje .rv-body input, .traje .rv-body textarea { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: #FFFFFF; color: var(--ink); font: 700 16px/1.3 var(--font-b); }
.traje .rv-body textarea { resize: none; }
.traje .rv-body input:focus, .traje .rv-body textarea:focus { outline: none; border-color: var(--sky); }
.traje .steps-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.traje .stepper { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 16px; background: #FFFFFF; border: 2px solid var(--line); }
.traje .slabel { font: 800 13.5px/1.2 var(--font-b); color: var(--ink-2); }
.traje .sctrl { display: flex; align-items: center; justify-content: space-between; }
.traje .sctrl output { font: 400 22px/1 var(--font-d); }
.traje .step { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--soft); color: var(--accent-2); font: 800 22px/1 var(--font-b); cursor: pointer; }
.traje .step[disabled] { opacity: .35; cursor: default; }
.traje .err { min-height: 1.2em; margin: 8px 0 0; color: #B0233F; font-weight: 800; font-size: 14px; }
.traje .decline { margin-top: 6px; }
.traje .fb-tag { flex: none; line-height: 0; }

/* ---------- teléfonos bajitos (≤ 680 de alto) ---------- */
@container (max-height: 680px) {
  .traje .hd-title { font-size: clamp(18px, 5.8cqw, 23px); }
  .traje .dslot { min-height: 56px; }
  .traje .ct-dot { width: 30px; height: 30px; }
  .traje .drag-hint { bottom: calc(var(--safe-b) + 66px); }
  .traje .panel { max-height: 54cqh; }
  .traje .party { max-height: 58cqh; }
}
