/* Amigo Secreto · Pascua de verano */
:root {
  --cereza: #C8102E; --cereza-dark: #8E0B20; --cereza-soft: #FFE1E4;
  --hoja: #1F6B4A; --hoja-dark: #134430; --hoja-soft: #DFF2E6;
  --sol: #FFC23D; --sol-soft: #FFF3C4; --sol-ink: #6B4A00;
  --sandia: #FF7A8A;
  --crema: #FFF3E2; --crema-2: #FFF9F1; --borde: #EBD5BC; --borde-2: #E3CBB0; --sombra: #F1DCC2;
  --cafe: #8A5A3B; --cafe-2: #6B3F26; --tinta: #3A1F14;
  --radius: 22px;
  --tab-h: 84px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #F6E5CC; }
body {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif; color: var(--tinta);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--cereza); }
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
.shell {
  max-width: 480px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: var(--crema);
  position: relative; overflow-x: hidden;
}
@media (min-width: 520px) { .shell { box-shadow: 0 0 0 1px #EAD3B5, 0 20px 60px rgba(58,31,20,.12); } }
.page { padding: calc(28px + env(safe-area-inset-top)) 22px calc(var(--tab-h) + 28px); display: flex; flex-direction: column; gap: 16px; }
.page.no-tabs { padding-bottom: 40px; }
.hand { font-family: 'Caveat Brush', 'Marker Felt', 'Comic Sans MS', cursive; font-weight: 400; }
.muted { color: var(--cafe-2); }
.small { font-size: 13px; }
h1, h2, h3 { margin: 0; }
.h1 { font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -1px; }
.h2 { font-size: 26px; line-height: 1.05; font-weight: 800; letter-spacing: -.5px; }
.h3 { font-size: 18px; font-weight: 800; }
.eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; }
p { margin: 0; line-height: 1.45; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Avatares */
.av { display: inline-block; flex-shrink: 0; line-height: 0; }
.av svg { width: 100%; height: 100%; display: block; }
.stack { display: flex; }
.stack > * { margin-right: -12px; border: 3px solid var(--cereza); border-radius: 50%; }
.stack .more { width: 42px; height: 42px; border-radius: 50%; background: var(--crema); color: var(--cereza); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }

/* Tarjetas y botones */
.card { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: 0 5px 0 var(--sombra); }
.card.red { background: var(--cereza); color: #fff; box-shadow: 0 8px 0 var(--cereza-dark); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px;
  border-radius: 18px; border: 0; font-size: 17px; font-weight: 800; text-decoration: none; text-align: center;
  background: var(--cereza); color: #fff; box-shadow: 0 5px 0 var(--cereza-dark); transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--cereza-dark); }
.btn.green { background: var(--hoja); box-shadow: 0 5px 0 var(--hoja-dark); }
.btn.green:active { box-shadow: 0 2px 0 var(--hoja-dark); }
.btn.ghost { background: transparent; color: var(--cereza); border: 2.5px dashed var(--cereza); box-shadow: none; }
.btn.light { background: #fff; color: var(--tinta); box-shadow: 0 4px 0 var(--sombra); }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; font-size: 14px; padding: 0 14px; border-radius: 12px; box-shadow: none; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; border: 0; background: #fff; color: var(--tinta);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 0 var(--sombra); flex-shrink: 0; text-decoration: none;
}
.icon-btn.flat { box-shadow: none; background: var(--crema); }
.link-btn { background: none; border: 0; padding: 8px 4px; font-weight: 800; color: var(--cereza); font-size: 15px; text-decoration: none; }
.pill { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; border: 0; }
.pill.ok { background: var(--hoja-soft); color: var(--hoja-dark); }
.pill.wait { background: var(--cereza-soft); color: var(--cereza-dark); }
.pill.tbc { background: var(--sol-soft); color: var(--sol-ink); }
.pill.out { background: #EFE6DA; color: var(--cafe-2); }
.chip { height: 38px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--borde-2); background: var(--crema-2); font-size: 14px; font-weight: 700; }
.chip.on { background: var(--tinta); color: var(--crema); border-color: var(--tinta); }
.sticker { align-self: flex-start; background: var(--sol); font-family: 'Caveat Brush', cursive; font-size: 22px; line-height: 1.1; padding: 4px 14px 6px; border-radius: 12px; transform: rotate(-2deg); }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 14px; font-weight: 700; }
.input, .textarea, .select {
  width: 100%; min-height: 50px; border-radius: 14px; border: 2px solid var(--borde); background: var(--crema-2);
  padding: 0 14px; font-size: 16px; outline: none;
}
.textarea { padding: 10px 14px; resize: vertical; min-height: 70px; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--cereza); }
.input.pin { font-size: 24px; letter-spacing: 14px; text-align: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.error { color: var(--cereza-dark); font-weight: 700; font-size: 14px; }

/* Barra inferior */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 20;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 10px 10px env(safe-area-inset-bottom);
  background: #fff; border-radius: 26px 26px 0 0; box-shadow: 0 -6px 0 var(--sombra);
  display: flex; justify-content: space-around; align-items: flex-start;
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 14px; border-radius: 16px; text-decoration: none; font-size: 12px; font-weight: 700; color: #7A4F36; }
.tab.on { color: var(--cereza); background: var(--cereza-soft); }

/* Inicio / login */
.logo { position: relative; }
.logo .w { font-size: 76px; line-height: .88; font-weight: 800; letter-spacing: -2.5px; }
.logo .shh { position: absolute; right: 6px; top: 58px; transform: rotate(-9deg); background: var(--sol); font-family: 'Caveat Brush', cursive; font-size: 26px; padding: 2px 14px 4px; border-radius: 10px; }
.sun { position: absolute; top: -70px; right: -70px; width: 220px; height: 220px; pointer-events: none; }
.garland { position: absolute; top: 0; left: 0; width: 100%; height: 120px; pointer-events: none; }

/* Cuenta regresiva */
.countdown { background: var(--sol); border-radius: 28px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.countdown .num { font-size: 64px; font-weight: 800; line-height: .9; letter-spacing: -2px; }
.countdown .unit { font-size: 13px; font-weight: 700; }
.info3 .card { padding: 12px; display: flex; flex-direction: column; gap: 6px; border-radius: 18px; box-shadow: 0 4px 0 var(--sombra); }
.info3 .k { font-size: 12px; color: var(--cafe-2); font-weight: 600; }
.info3 .v { font-size: 15px; font-weight: 800; line-height: 1.15; word-break: break-word; }

/* Regalo */
@keyframes wiggle { 0%,100% { transform: rotate(0) } 20% { transform: rotate(-6deg) } 40% { transform: rotate(5deg) } 60% { transform: rotate(-3deg) } 80% { transform: rotate(2deg) } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0 } 70% { transform: scale(1.08); opacity: 1 } 100% { transform: scale(1) } }
@keyframes fall { 0% { transform: translateY(-60px) rotate(0); opacity: 0 } 15% { opacity: 1 } 100% { transform: translateY(260px) rotate(260deg); opacity: 0 } }
@keyframes lid { 0% { transform: translateY(0) rotate(0) } 100% { transform: translateY(-40px) rotate(-18deg); opacity: 0 } }
.wiggle { animation: wiggle 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.pop { animation: pop .55s cubic-bezier(.2,.9,.3,1.3) both; }
.confetti { position: absolute; top: 40px; left: 0; width: 100%; pointer-events: none; }
.confetti i { position: absolute; width: 10px; height: 16px; border-radius: 2px; animation: fall 2.2s ease-out both; }
.gift-btn { background: none; border: 0; padding: 0; }
.gift-btn svg .lid { transform-box: fill-box; transform-origin: center; }
.gift-btn.opening svg .lid { animation: lid .5s ease-in forwards; transform-origin: 50% 50%; }
.center { text-align: center; align-items: center; }
.tagnote { border: 2px dashed var(--cereza); border-radius: 18px; padding: 10px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.38; text-align: left; }

/* Listas */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wish { background: #fff; border-radius: 20px; padding: 12px 12px 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 4px 0 var(--sombra); }
.wish .n { width: 36px; height: 36px; border-radius: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wish-soft { display: flex; align-items: flex-start; gap: 10px; background: var(--crema-2); border-radius: 16px; padding: 11px 14px; }
.t { font-size: 16px; font-weight: 700; line-height: 1.3; word-break: break-word; }
.d { font-size: 13px; color: var(--cafe-2); }
.empty { background: var(--crema-2); border: 2px dashed var(--borde-2); border-radius: 18px; padding: 20px 16px; text-align: center; display: flex; flex-direction: column; gap: 6px; }

/* Pistas */
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; background: var(--sombra); padding: 4px; border-radius: 16px; }
.seg button { min-height: 44px; border-radius: 12px; border: 0; font-size: 14px; font-weight: 800; background: transparent; color: var(--cafe-2); }
.seg button.on { background: #fff; color: var(--cereza); }
.banner { display: flex; align-items: center; gap: 10px; border-radius: 16px; padding: 10px 12px; font-size: 14px; line-height: 1.35; }
.bubbles { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 80%; padding: 10px 14px; font-size: 15px; line-height: 1.35; word-break: break-word; white-space: pre-wrap; }
.bubble.me { align-self: flex-end; color: #fff; border-radius: 18px 18px 4px 18px; }
.bubble.them { align-self: flex-start; background: #fff; border-radius: 18px 18px 18px 4px; box-shadow: 0 3px 0 var(--sombra); }
.composer { position: sticky; bottom: calc(var(--tab-h) + 10px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; padding-top: 10px; background: linear-gradient(to bottom, rgba(255,243,226,0), var(--crema) 18px); }
.qmark { width: 40px; height: 40px; border-radius: 50%; background: var(--tinta); color: var(--sol); font-size: 22px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Perfiles */
.who { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.who::-webkit-scrollbar { display: none; }
.who button { padding: 2px; border-radius: 50%; border: 3px solid transparent; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0; }
.who button.on { border-color: var(--cereza); }

/* Panel */
.person-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #F5E6D3; }
.person-row:last-child { border-bottom: 0; }
.switch { width: 56px; height: 32px; border-radius: 999px; border: 0; padding: 3px; display: flex; background: #CDB79E; flex-shrink: 0; }
.switch span { width: 26px; height: 26px; border-radius: 50%; background: #fff; display: block; transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--hoja); }
.switch[aria-checked="true"] span { transform: translateX(24px); }
.pick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.pick button { border: 3px solid transparent; border-radius: 50%; padding: 2px; background: none; line-height: 0; }
.pick button.on { border-color: var(--cereza); }
.motivo { border-radius: 22px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; border: 3px solid var(--borde); background: #fff; }
.motivo.on { border-color: var(--cereza); background: var(--cereza-soft); }
details.year { background: #fff; border-radius: 18px; box-shadow: 0 4px 0 var(--sombra); }
details.year summary { list-style: none; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
details.year summary::-webkit-details-marker { display: none; }
.pair { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid #F5E6D3; font-size: 14px; flex-wrap: wrap; }

/* Modal y toast */
.modal-bg { position: fixed; inset: 0; background: rgba(58,31,20,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--crema); width: 100%; max-width: 480px; border-radius: 28px 28px 0 0; padding: 22px 22px calc(26px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; max-height: 88vh; overflow: auto; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0 } to { transform: none; opacity: 1 } }
#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px); transform: translateX(-50%) translateY(20px); background: var(--tinta); color: var(--crema); padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 15px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 60; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }
.loading { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
