@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  --paper: #f8f1e3;
  --paper-2: #f0e6d2;
  --card: #fffaf0;
  --ink: #22332b;
  --muted: #68716a;
  --line: #dfd2b9;
  --pine: #1f4a3c;
  --pine-2: #2f6b55;
  --pine-3: #6d9a84;
  --berry: #b3202f;
  --berry-2: #8d1522;
  --gold: #c8963e;
  --gold-2: #e8c67e;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.5; overflow-x: hidden;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .35 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
body:not([data-mode]) .intro, body:not([data-mode]) .globe-mount { visibility: hidden; }

.page { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: calc(34px + env(safe-area-inset-top)) 20px 28px; text-align: center; position: relative; z-index: 2; }

/* ---------- CABECERA ---------- */
.eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--pine-2); }
h1 {
  margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(44px, 13.5vw, 72px); line-height: 1.02;
  letter-spacing: -.02em; color: var(--pine); font-variation-settings: "SOFT" 100;
}
h1 em { font-style: italic; font-weight: 500; color: var(--berry); }
h1.small { font-size: clamp(34px, 10vw, 52px); }
.lead { margin: 12px auto 0; max-width: 24em; color: var(--muted); font-size: 18px; }
.intro { animation: rise .7s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- BOLA DE NIEVE ---------- */
.globe-mount { margin: 24px auto 0; width: min(310px, 82vw); animation: rise .8s .12s cubic-bezier(.2, .8, .3, 1) both; }
.globe { position: relative; transform-origin: 50% 88%; }
.glass {
  display: block; position: relative; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; overflow: hidden; cursor: pointer;
  background: #17404a; z-index: 2; isolation: isolate;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 0 0 5px rgba(34, 51, 43, .14), inset 0 0 34px rgba(4, 22, 28, .55);
}
.glass:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; }
.glass svg, .glass canvas, .whiteout, .glare { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
.glass canvas { pointer-events: none; }
.whiteout { background: #fbfdfc; opacity: 0; transition: opacity .25s linear; pointer-events: none; }
.whiteout.on { opacity: .97; transition-duration: 1s; }
.whiteout.off { opacity: 0; transition-duration: 1.3s; }
.glare {
  pointer-events: none;
  background:
    radial-gradient(24% 13% at 30% 15%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 72%),
    radial-gradient(14% 8% at 76% 80%, rgba(255, 255, 255, .25), rgba(255, 255, 255, 0) 70%),
    radial-gradient(closest-side, rgba(255, 255, 255, 0) 84%, rgba(255, 255, 255, .26) 98%);
}
.window { animation: glow 3.4s ease-in-out infinite; }
@keyframes glow { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }
.hidden-gift { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(0); }
.globe.has-gift .hidden-gift { transform: scale(1); transition: transform .7s cubic-bezier(.3, 1.7, .5, 1) .5s; }

.base { position: relative; z-index: 1; display: block; width: 66%; margin: -24px auto 0; filter: drop-shadow(0 12px 12px rgba(50, 35, 15, .28)); }
.base text { font: 700 11.5px var(--body); letter-spacing: .2em; fill: #fbe9bf; text-anchor: middle; }
.ground-shadow { height: 18px; width: 72%; margin: -2px auto 0; background: radial-gradient(closest-side, rgba(60, 40, 15, .22), transparent); }

.globe.rock { animation: rock .55s cubic-bezier(.36, .07, .19, .97); }
.globe.storm { animation: rock .32s linear infinite; --amp: 8deg; }
@keyframes rock {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(calc(var(--amp, 5deg) * -1)) translateX(-3px); }
  45% { transform: rotate(var(--amp, 5deg)) translateX(3px); }
  70% { transform: rotate(calc(var(--amp, 5deg) * -.5)); }
  85% { transform: rotate(calc(var(--amp, 5deg) * .25)); }
}

/* ---------- INDICACIÓN ---------- */
.prompt { min-height: 54px; margin-top: 6px; }
.dots { display: flex; justify-content: center; gap: 10px; list-style: none; margin: 0 0 6px; padding: 0; }
.dots li { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--berry); position: relative; transition: background .2s, transform .3s cubic-bezier(.3, 1.8, .5, 1); }
.dots li::before { content: ""; position: absolute; left: 50%; top: -6px; width: 4px; height: 4px; margin-left: -2px; border-radius: 1px; background: var(--gold); }
.dots li.on { background: var(--berry); transform: scale(1.18); }
.hint { margin: 0; font-family: var(--display); font-style: italic; font-size: 21px; color: var(--pine); font-variation-settings: "SOFT" 100; }

/* ---------- RESULTADO ---------- */
.result { margin-top: 4px; }
.result-to { margin: 0; font-family: var(--display); font-style: italic; font-size: 22px; color: var(--pine-2); font-variation-settings: "SOFT" 100; animation: rise .6s both; }
.result-name {
  margin: 2px 0 8px; font-family: var(--display); font-weight: 700; font-size: clamp(50px, 16vw, 86px); line-height: 1.02;
  letter-spacing: -.02em; color: var(--berry); font-variation-settings: "SOFT" 100;
}
.result-name .word { display: inline-block; white-space: nowrap; margin: 0 .1em; }
.result-name i { display: inline-block; font-style: normal; animation: letter .6s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes letter { from { opacity: 0; transform: translateY(26px) rotate(7deg) scale(.8); } to { opacity: 1; transform: none; } }
.result-quip { margin: 0 auto 18px; max-width: 24em; color: var(--muted); animation: rise .6s 1s both; }
.result .btn { animation: rise .6s 1.2s both; }

/* ---------- BOTONES ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 12px 26px; border-radius: 999px; border: 0;
  font: 700 16px/1.1 var(--body); text-decoration: none; cursor: pointer; transition: transform .15s, background .2s, box-shadow .2s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, .chip:focus-visible, .mute:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-berry { color: #fff8e9; background: var(--berry); box-shadow: 0 4px 0 var(--berry-2); }
.btn-berry:hover { background: #c22836; }
.btn-pine { color: #f7f3e6; background: var(--pine); box-shadow: 0 4px 0 #12302a; }
.btn-quiet { color: var(--pine); background: transparent; box-shadow: inset 0 0 0 2px var(--pine); }
.btn-quiet:hover { background: rgba(31, 74, 60, .07); }
.btn-small { min-height: 42px; padding: 8px 15px; font-size: 14px; }

/* ---------- ETIQUETAS ---------- */
.people { margin-top: 26px; position: relative; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 10px; }
.tags li {
  position: relative; padding: 9px 16px 9px 28px; background: var(--card); color: var(--pine); font-weight: 600; font-size: 15.5px;
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%);
  filter: drop-shadow(0 2px 2px rgba(60, 40, 15, .25));
  transform-origin: 0 50%; animation: sway 5s ease-in-out infinite;
}
.tags li::before { content: ""; position: absolute; left: 13px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--paper-2); box-shadow: inset 0 0 0 1.5px var(--gold); }
.tags li:nth-child(2n) { animation-delay: -1.8s; }
.tags li:nth-child(3n) { animation-delay: -3.1s; }
@keyframes sway { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }

.secret { margin: 20px auto 0; max-width: 26em; font-size: 14px; color: var(--muted); }

/* ---------- BOSQUE DE PAPEL ---------- */
.forest { position: relative; z-index: 1; height: 118px; margin-top: 8px; overflow: hidden; pointer-events: none; }
.forest svg { position: absolute; bottom: 0; left: 50%; width: max(100%, 760px); height: 118px; transform: translateX(-50%); display: block; }

.flakes { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

.mute {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 30; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; display: grid; place-items: center; color: var(--pine); padding: 0;
}
.mute svg { width: 20px; height: 20px; }

/* ---------- PANEL DE BABA ---------- */
.panel { text-align: left; padding-top: calc(24px + env(safe-area-inset-top)); }
.hello { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.mono { flex: none; width: 92px; height: 92px; transform-origin: 50% 90%; animation: nod 4.5s ease-in-out infinite; }
@keyframes nod { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(4deg); } }
.hello h1 { font-size: clamp(32px, 9.5vw, 44px); }
.hello p { margin: 4px 0 0; color: var(--muted); }

.step { position: relative; margin-top: 16px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 22px rgba(70, 50, 20, .07); }
.step.locked { background: transparent; box-shadow: none; }
.step h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; font-family: var(--display); font-weight: 600; font-size: 25px; line-height: 1.15; color: var(--pine); font-variation-settings: "SOFT" 100; }
.step h2 span { font-style: italic; color: var(--gold); font-weight: 500; }
.step > p { margin: 0 0 12px; color: var(--muted); font-size: 16px; }
.field { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=password] { width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 16px var(--body); }
input[type=password]:focus { outline: 2px solid var(--pine-2); border-color: transparent; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.msg { min-height: 1.4em; margin: 12px 0 0; font-weight: 600; font-size: 15.5px; }
.msg.err { color: var(--berry); }
.msg.ok { color: var(--pine-2); }

.who { padding: 12px 0; border-top: 1px solid var(--line); }
.who:first-of-type { border-top: 0; }
.who-name { display: block; margin-bottom: 7px; font-weight: 600; }
.who-name small { font-weight: 400; color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  min-height: 38px; padding: 6px 13px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font: 500 14.5px var(--body); cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.chip:active { transform: scale(.95); }
.chip[aria-pressed=true] { background: var(--berry); border-color: var(--berry); color: #fff8e9; text-decoration: line-through; }
.chip:disabled { cursor: default; opacity: .75; }
.chip:disabled:active { transform: none; }

.switch { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 15.5px; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--pine); margin: 0; }
.combos { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--paper-2); font-size: 15.5px; }
.combos b { font-family: var(--display); font-size: 28px; line-height: 1; color: var(--pine); font-variation-settings: "SOFT" 100; }
.combos.warn { background: #f8e3c6; }
.combos.warn b { color: var(--berry); }

.links { list-style: none; margin: 8px 0 0; padding: 0; }
.links li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 11px 0; border-top: 1px solid var(--line); }
.links li:first-child { border-top: 0; }
.links b { flex: 1 0 100%; font-size: 17px; font-weight: 600; }
.btn-wa { color: #fff; background: #1f8f53; }

@media (prefers-reduced-motion: reduce) {
  .tags li, .mono, .window { animation: none; }
  .globe.rock, .globe.storm { animation: none; }
}
