/* ═══════════════════════════════════════════════════════════
   LA MÁQUINA DE MIMOS — estilos
   App premium + videojuego romántico + regalo personalizado
   ═══════════════════════════════════════════════════════════ */

:root {
  --cream: #fff6f0;
  --ink: #43262e;
  --ink-soft: #7a5a63;
  --rose: #ef5d7d;
  --rose-deep: #d94f70;
  --coral: #ff8d7a;
  --gold: #d9a441;
  --gold-soft: #f0cf8f;
  --card: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.9);
  --shadow: 0 12px 32px -12px rgba(190, 90, 110, 0.35);
  --shadow-sm: 0 6px 18px -8px rgba(190, 90, 110, 0.28);
  --radius: 24px;
  --font-body: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(165deg, #ffe3dd 0%, var(--cream) 42%, #ffeee2 78%, #ffe4e7 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; touch-action: manipulation; }

/* El atributo hidden debe poder con cualquier display de clase (.notif-badge, .final-phase...) */
[hidden] { display: none !important; }

/* ───────── Fondo decorativo ───────── */
.bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; }
.blob-1 { width: 60vw; height: 60vw; top: -15vw; left: -15vw; background: #ffc3cf; animation: drift 26s ease-in-out infinite alternate; }
.blob-2 { width: 55vw; height: 55vw; top: 35%; right: -18vw; background: #ffd9bf; animation: drift 32s ease-in-out infinite alternate-reverse; }
.blob-3 { width: 50vw; height: 50vw; bottom: -12vw; left: 10vw; background: #ffccd6; animation: drift 29s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(4vw, 3vh) scale(1.08); } }

#fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; }

#ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient-heart {
  position: absolute; bottom: -24px; color: rgba(233, 100, 128, 0.35);
  animation: floatUp linear forwards;
}
@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(-115vh) translateX(6vw) rotate(24deg); opacity: 0; }
}

/* ───────── Pantallas ───────── */
#app {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px; margin: 0 auto;
  padding: 16px 18px calc(28px + env(safe-area-inset-bottom));
}

.screen { display: none; }
.screen.is-active { display: block; animation: screenIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.screen--center.is-active { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100dvh - 44px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); text-align: center; position: relative; }
@keyframes screenIn { from { opacity: 0; transform: translateY(18px) scale(0.985); } to { opacity: 1; transform: none; } }

/* ───────── Tipografía ───────── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: 0.01em; }
p { margin: 0; }

.eyebrow {
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 18px;
}

.title-glow { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 14px; }
.title-main {
  font-family: var(--font-display); font-size: clamp(2rem, 9.5vw, 2.7rem); line-height: 1.08; font-weight: 600;
  background: linear-gradient(120deg, var(--rose-deep), var(--coral) 55%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo-heart {
  font-size: 2.6rem; line-height: 1; padding: 4px 14px;
  animation: heartbeat 2.4s ease-in-out infinite;
  transition: transform 0.15s;
}
.logo-heart:active { transform: scale(1.25); }
.title-sub { font-size: 1rem; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 8% { transform: scale(1.14); } 16% { transform: scale(1); } 24% { transform: scale(1.1); } 32% { transform: scale(1); } }

.start-subtitle { font-size: 1.05rem; color: var(--ink); margin-bottom: 26px; }
.start-subtitle strong { color: var(--rose-deep); font-weight: 600; }
.start-note { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.55; margin: 22px 0 26px; }

.footer-credit { margin-top: 26px; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); opacity: 0.75; }

/* ───────── La máquina (ilustración CSS) ───────── */
.machine { display: flex; flex-direction: column; align-items: center; margin: 6px auto 0; width: 210px; }
.machine.is-working { animation: shake 0.5s ease-in-out 2; }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2.5deg); } 75% { transform: rotate(2.5deg); } }

.machine-dome {
  position: relative; width: 150px; height: 108px; overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.85), rgba(255, 214, 222, 0.65));
  border: 3px solid #f7b8c4; border-bottom: none;
  border-radius: 80px 80px 12px 12px;
  box-shadow: inset -8px -6px 18px rgba(255, 255, 255, 0.65), inset 6px 8px 16px rgba(233, 150, 165, 0.25);
}
.mini-heart { position: absolute; color: #ef5d7d; }
.mh-1 { font-size: 20px; left: 24px; bottom: 20px; animation: bob 3s ease-in-out infinite; }
.mh-2 { font-size: 14px; left: 62px; bottom: 44px; color: #ff8d7a; animation: bob 3.8s ease-in-out 0.4s infinite; }
.mh-3 { font-size: 16px; left: 98px; bottom: 24px; color: #e9b44c; animation: bob 3.4s ease-in-out 0.8s infinite; }
.mh-4 { font-size: 12px; left: 56px; bottom: 10px; color: #f3a9bb; animation: bob 4.2s ease-in-out 0.2s infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.machine-body {
  width: 190px; height: 122px; border-radius: 14px 14px 22px 22px; margin-top: -2px;
  background: linear-gradient(150deg, #ff97a8 0%, #f0637f 55%, #e04a6c 100%);
  box-shadow: var(--shadow), inset 0 3px 8px rgba(255, 255, 255, 0.45), inset 0 -6px 12px rgba(150, 40, 65, 0.35);
  position: relative; display: flex; align-items: center; justify-content: center; gap: 18px;
}
.machine-knob {
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff7e0, var(--gold) 62%, #b8862f);
  box-shadow: 0 3px 8px rgba(120, 60, 30, 0.4), inset 0 2px 3px rgba(255, 255, 255, 0.8);
  position: relative; transition: transform 0.3s;
}
.machine-knob::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 5px; height: 15px;
  background: rgba(120, 70, 20, 0.55); border-radius: 3px; transform: translate(-50%, -120%);
}
.machine-knob.is-turning { animation: turn 0.9s cubic-bezier(0.3, 0, 0.4, 1); }
@keyframes turn { to { transform: rotate(720deg); } }

.machine-slot {
  width: 62px; height: 15px; border-radius: 8px;
  background: #8e2f4a; box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.35);
}
.machine-led {
  position: absolute; top: 12px; right: 16px; width: 9px; height: 9px; border-radius: 50%;
  background: #7dffd0; box-shadow: 0 0 8px #7dffd0;
  animation: blink 1.6s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

/* ───────── Botones ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; font-weight: 600; font-size: 0.95rem; letter-spacing: 0.04em;
  padding: 14px 26px; min-height: 52px; transition: transform 0.12s ease, box-shadow 0.2s, filter 0.2s;
}
.btn:active { transform: scale(0.96); }
.btn--primary {
  color: #fff;
  background: linear-gradient(130deg, var(--rose) 10%, var(--coral) 90%);
  box-shadow: 0 10px 24px -8px rgba(239, 93, 125, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn--ghost {
  color: var(--rose-deep); background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid rgba(239, 93, 125, 0.4);
}
.btn--gold {
  color: #5c3d10;
  background: linear-gradient(130deg, #ffe9b8, var(--gold-soft) 55%, #e8b95e);
  box-shadow: 0 10px 26px -8px rgba(217, 164, 65, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.btn--xl { font-size: 1.06rem; padding: 17px 40px; }
.btn--sm { min-height: 42px; padding: 9px 20px; font-size: 0.85rem; }

/* ───────── Barra superior ───────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(6px + env(safe-area-inset-top)) 2px 14px;
}
.topbar--abs { position: absolute; top: 0; left: 0; right: 0; width: 100%; max-width: 480px; padding-inline: 18px; }
.topbar-logo { font-size: 1.5rem; line-height: 1; padding: 6px; }
.topbar-logo:active { transform: scale(1.2); }
.topbar-title {
  font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink);
}
.topbar-spacer { width: 38px; }
.back-btn {
  width: 42px; height: 42px; border-radius: 50%; font-size: 1.6rem; line-height: 1;
  display: grid; place-items: center; padding-bottom: 4px;
  background: rgba(255, 255, 255, 0.7); color: var(--rose-deep);
  box-shadow: var(--shadow-sm);
}
.heart-chip {
  min-width: 58px; text-align: center; padding: 7px 13px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; color: var(--rose-deep);
  background: rgba(255, 255, 255, 0.75); box-shadow: var(--shadow-sm);
}

/* ───────── Tarjetas genéricas ───────── */
.card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px 22px; margin-bottom: 14px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

.welcome-card h2 { font-size: 1.5rem; margin-bottom: 4px; }
.welcome-card p { color: var(--ink-soft); }

.milestone-card {
  border: 1.5px solid var(--gold-soft);
  background: linear-gradient(140deg, rgba(255, 245, 220, 0.85), rgba(255, 236, 240, 0.85));
  font-size: 0.92rem; line-height: 1.5; color: #6b4a17;
}

/* ───────── Progreso ───────── */
.progress-card { text-align: center; }
.progress-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-soft); margin-bottom: 12px; }
.heart-strip { display: flex; justify-content: center; gap: 4px; font-size: 1.25rem; margin-bottom: 8px; }
.heart-strip .h { transition: transform 0.25s; }
.h-full { color: var(--rose); text-shadow: 0 0 10px rgba(239, 93, 125, 0.55); }
.h-empty { color: rgba(217, 120, 140, 0.28); }
.hearts-text { font-size: 0.9rem; font-weight: 600; color: var(--rose-deep); margin-bottom: 10px; }
.progress-track {
  height: 12px; border-radius: 999px; background: rgba(233, 140, 155, 0.18);
  overflow: hidden; box-shadow: inset 0 1px 3px rgba(150, 60, 80, 0.12);
}
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--rose), var(--coral) 60%, var(--gold-soft));
  box-shadow: 0 0 12px rgba(239, 93, 125, 0.5);
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
.progress-fill::after {
  content: ''; position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shine 2.6s linear infinite;
}
@keyframes shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ───────── Menú principal ───────── */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.menu-card {
  grid-column: span 1;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  text-align: left; padding: 18px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform 0.15s ease, box-shadow 0.2s;
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.menu-card:nth-child(1) { animation-delay: 0.05s; }
.menu-card:nth-child(2) { animation-delay: 0.12s; }
.menu-card:nth-child(3) { animation-delay: 0.19s; }
.menu-card:nth-child(4) { animation-delay: 0.26s; }
.menu-card:nth-child(5) { animation-delay: 0.33s; }
.menu-card:active { transform: scale(0.96); }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }

.menu-emoji { font-size: 1.9rem; margin-bottom: 4px; }
.menu-title { font-weight: 700; font-size: 0.82rem; letter-spacing: 0.05em; }
.menu-desc { font-size: 0.72rem; color: var(--ink-soft); line-height: 1.35; }

.menu-card--final { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; }
.menu-card--final .menu-desc { display: block; }
.menu-card--final.is-locked { opacity: 0.65; filter: saturate(0.6); }
.menu-card--final.is-ready {
  background: linear-gradient(130deg, #fff2d8, #ffe3ea 60%, #ffedd5);
  border: 1.5px solid var(--gold-soft);
  animation: cardIn 0.5s both, goldenPulse 2.2s ease-in-out 0.6s infinite;
}
@keyframes goldenPulse {
  0%, 100% { box-shadow: var(--shadow-sm); }
  50% { box-shadow: 0 8px 30px -6px rgba(217, 164, 65, 0.65); }
}

/* ───────── Lista de mimos ───────── */
.screen-lead { font-family: var(--font-display); font-size: 1.35rem; padding: 6px 4px 16px; }
.mimo-list { display: flex; flex-direction: column; gap: 11px; }
.mimo-btn {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  padding: 15px 18px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform 0.14s ease;
  animation: cardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.mimo-list .mimo-btn:nth-child(n) { animation-delay: calc(min(var(--i, 6), 10) * 0.04s); }
.mimo-btn:nth-child(1) { animation-delay: 0.03s; } .mimo-btn:nth-child(2) { animation-delay: 0.06s; }
.mimo-btn:nth-child(3) { animation-delay: 0.09s; } .mimo-btn:nth-child(4) { animation-delay: 0.12s; }
.mimo-btn:nth-child(5) { animation-delay: 0.15s; } .mimo-btn:nth-child(6) { animation-delay: 0.18s; }
.mimo-btn:nth-child(7) { animation-delay: 0.21s; } .mimo-btn:nth-child(8) { animation-delay: 0.24s; }
.mimo-btn:nth-child(9) { animation-delay: 0.27s; } .mimo-btn:nth-child(10) { animation-delay: 0.3s; }
.mimo-btn:active { transform: scale(0.97); background: rgba(255, 240, 244, 0.9); }
.mimo-emoji { font-size: 1.75rem; width: 46px; height: 46px; display: grid; place-items: center; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.65); border-radius: 14px; box-shadow: var(--shadow-sm); }
.mimo-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.mimo-label { font-weight: 700; font-size: 0.94rem; }
.mimo-desc { font-size: 0.76rem; color: var(--ink-soft); line-height: 1.35; }
.mimo-arrow { color: rgba(217, 79, 112, 0.5); font-size: 1.5rem; }

/* ───────── Premios ───────── */
.rewards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reward-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px;
  padding: 20px 14px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: cardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.reward-card:nth-child(2n) { animation-delay: 0.08s; }
.reward-emoji { font-size: 2.2rem; }
.reward-card h4 { font-size: 0.82rem; letter-spacing: 0.04em; font-family: var(--font-body); font-weight: 700; }
.reward-card p { font-size: 0.74rem; color: var(--ink-soft); line-height: 1.4; flex: 1; }
.reward-card.is-locked { opacity: 0.62; }
.reward-card.is-locked .reward-emoji { filter: grayscale(0.9); opacity: 0.55; }
.reward-lock {
  font-size: 0.68rem; font-weight: 700; color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.8); padding: 5px 11px; border-radius: 999px;
  border: 1px dashed rgba(150, 100, 110, 0.4);
}
.reward-done { font-size: 0.75rem; font-weight: 700; color: #2c8a5b; }
.reward-card.is-opened .reward-emoji { opacity: 0.85; }
.reward-card.is-unlocked { border: 1.5px solid rgba(239, 93, 125, 0.35); }

/* ───────── Logros ───────── */
.ach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ach-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 18px 13px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow-sm);
  animation: cardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ach-card:nth-child(2n) { animation-delay: 0.08s; }
.ach-emoji { font-size: 2rem; }
.ach-card h4 { font-size: 0.84rem; font-family: var(--font-body); font-weight: 700; }
.ach-card p { font-size: 0.73rem; color: var(--ink-soft); line-height: 1.4; flex: 1; }
.ach-state { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; }
.ach-card.is-got { border: 1.5px solid var(--gold-soft); background: linear-gradient(140deg, rgba(255, 246, 225, 0.88), var(--card)); }
.ach-card.is-got .ach-state { color: var(--gold); }
.ach-card.is-secret .ach-emoji { color: #ff6b35; }

/* ───────── Mensaje secreto ───────── */
.letter {
  width: min(100%, 380px);
  background: linear-gradient(160deg, rgba(255, 252, 245, 0.92), rgba(255, 238, 240, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.95); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 34px 26px 24px; text-align: center;
  position: relative;
}
.letter::before { content: ''; position: absolute; inset: 6px; border: 1px dashed rgba(217, 164, 65, 0.45); border-radius: 18px; pointer-events: none; }
.letter-icon { font-size: 2.4rem; margin-bottom: 14px; animation: bob 3s ease-in-out infinite; }
.letter-text {
  font-family: var(--font-display); font-style: italic; font-size: 1.15rem; line-height: 1.6;
  opacity: 0; transform: translateY(8px); transition: opacity 0.6s ease, transform 0.6s ease;
  min-height: 3.2em;
}
.letter-text.is-revealed { opacity: 1; transform: none; }
.letter-sign { margin-top: 18px; font-size: 0.85rem; color: var(--ink-soft); letter-spacing: 0.1em; }
#btn-new-msg { margin-top: 22px; }

/* ───────── Gran final ───────── */
.final-phase { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 30px 0; }
.final-lock-icon { font-size: 3.4rem; animation: bob 3s ease-in-out infinite; }
.final-title { font-size: 1.9rem; line-height: 1.15; text-align: center; }
.final-sub { color: var(--ink-soft); text-align: center; }
.final-trophy { font-size: 3.6rem; animation: trophyPop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes trophyPop { from { transform: scale(0) rotate(-18deg); } to { transform: scale(1) rotate(0); } }
.final-text { max-width: 340px; }
.final-text p { font-family: var(--font-display); font-size: 1.12rem; line-height: 1.85; text-align: center; }
.final-sign { margin-top: 20px; font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; color: var(--rose-deep); text-align: center; }
.final-loop { font-size: 0.8rem; color: var(--ink-soft); margin-top: 10px; }
.final-phase.is-active-anim { animation: screenIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ───────── Overlays / modales ───────── */
#overlay-root { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.overlay {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 24px;
  background: rgba(70, 30, 42, 0.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.25s ease; pointer-events: auto;
}
.overlay.is-open { opacity: 1; }
.overlay.is-closing { opacity: 0; }
.ov-card {
  width: min(100%, 380px); max-height: 86dvh; overflow-y: auto;
  background: linear-gradient(160deg, rgba(255, 251, 248, 0.97), rgba(255, 240, 243, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.95); border-radius: 28px;
  box-shadow: 0 24px 60px -18px rgba(120, 40, 60, 0.45);
  padding: 30px 24px 26px; text-align: center;
  transform: translateY(16px) scale(0.96); transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.overlay.is-open .ov-card { transform: none; }
.ov-card h3 { font-size: 1.3rem; line-height: 1.25; margin-bottom: 12px; }
.ov-card p { font-size: 0.92rem; color: var(--ink); line-height: 1.55; margin-bottom: 8px; }
.ov-card p:last-of-type { margin-bottom: 0; }
.ov-actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 22px; }
.ov-actions .btn { width: 100%; }

.confirm-emoji { font-size: 3rem; margin-bottom: 10px; }
.confirm-quote { font-family: var(--font-display); font-style: italic; color: var(--ink-soft) !important; font-size: 0.88rem !important; }

.pair-code {
  font-family: var(--font-display);
  font-size: 2.1rem;
  letter-spacing: 0.3em;
  text-align: center;
  color: var(--ink) !important;
  background: rgba(255, 255, 255, 0.65);
  border: 2px dashed var(--gold);
  border-radius: 16px;
  padding: 12px 4px 12px calc(4px + 0.3em);
  margin: 10px 0;
}

.confirm-field { margin: 14px 0 4px; text-align: left; }
.confirm-field label {
  display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--rose-deep); margin-bottom: 7px;
}
.confirm-field textarea {
  width: 100%; font-family: inherit; font-size: 0.95rem; color: var(--ink);
  background: rgba(255, 255, 255, 0.75); border: 1.5px solid rgba(239, 93, 125, 0.35);
  border-radius: 14px; padding: 12px 14px; resize: none; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.confirm-field textarea::placeholder { color: rgba(122, 90, 99, 0.55); }
.confirm-field textarea:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(239, 93, 125, 0.14);
}

/* Confirmación / celebración */
.celebrate-card .celebrate-icon { font-size: 3.2rem; margin-bottom: 10px; animation: trophyPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.celebrate-reward { font-weight: 700; font-size: 1.05rem; color: var(--rose-deep); letter-spacing: 0.03em; }
.plus-big { font-size: 1.5rem !important; font-weight: 700; color: var(--rose-deep); }

/* Transmisión */
.radar { position: relative; width: 96px; height: 96px; margin: 0 auto 18px; display: grid; place-items: center; }
.radar-core { font-size: 2.5rem; z-index: 1; animation: bob 2s ease-in-out infinite; }
.radar-wave {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(239, 93, 125, 0.55);
  animation: wave 2s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
}
.radar-wave.w2 { animation-delay: 0.55s; }
.radar-wave.w3 { animation-delay: 1.1s; }
@keyframes wave { from { transform: scale(0.35); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.tx-title { letter-spacing: 0.08em; }
.tx-state { font-weight: 700; }
.tx-ok { font-weight: 700; color: var(--rose-deep); font-size: 1.02rem !important; margin-top: 12px; }
.tx-error-icon { font-size: 3rem; margin-bottom: 12px; }
.tx-error { font-size: 1rem; line-height: 1.6; }

/* ───────── Toasts ───────── */
#toasts {
  position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); left: 0; right: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
  padding: 0 18px;
}
.toast {
  background: rgba(67, 38, 46, 0.92); color: #fff; font-size: 0.85rem; line-height: 1.45;
  padding: 11px 20px; border-radius: 999px; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; text-align: center;
}
.toast strong { color: #ffc9d4; }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity 0.4s, transform 0.4s; }
.toast--trophy {
  background: linear-gradient(130deg, #5c3a12, #8a5a1d);
  border: 1px solid rgba(240, 207, 143, 0.6);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.94); } to { opacity: 1; transform: none; } }

.float-plus {
  position: fixed; z-index: 85; transform: translate(-50%, -50%);
  font-weight: 700; font-size: 1.15rem; color: var(--rose-deep); pointer-events: none;
  text-shadow: 0 2px 10px rgba(239, 93, 125, 0.4);
  animation: floatPlus 1.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes floatPlus {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.6); }
  18% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -230%) scale(1); }
}

/* ───────── Microanimaciones ───────── */
.is-pop { animation: pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.1); } 100% { transform: scale(1); } }
.is-shake { animation: shakeX 0.4s ease-in-out; }
@keyframes shakeX { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* ───────── Límites y cooldowns de mimos ───────── */
.mimo-limit { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.mimo-limit.is-ok { color: #2c8a5b; }
.mimo-limit.is-wait { color: #c77b1f; }
.mimo-btn.is-waiting { opacity: 0.68; }
.confirm-limit { font-size: 0.76rem; color: var(--ink-soft); }

/* ───────── Premios con coste ───────── */
.reward-card.is-poor { opacity: 0.75; }
.reward-cost {
  font-size: 0.7rem; font-weight: 800; color: var(--rose-deep);
  background: rgba(255, 255, 255, 0.85); padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(239, 93, 125, 0.35);
}
.reward-times { font-size: 0.68rem; color: var(--ink-soft); }

/* ───────── Campana de notificaciones (header) ───────── */
.topbar-right { display: flex; align-items: center; gap: 8px; }
.notif-bell {
  position: relative; width: 42px; height: 42px; border-radius: 50%;
  font-size: 1.15rem; line-height: 1; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.75); box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}
.notif-bell:active { transform: scale(0.9); }
.notif-badge {
  position: absolute; top: -3px; right: -3px;
  font-size: 0.58rem; line-height: 1; color: #e01b4d;
  background: #fff; border-radius: 50%; width: 17px; height: 17px;
  display: grid; place-items: center;
  box-shadow: 0 2px 8px -2px rgba(217, 79, 112, 0.9);
  animation: badgePulse 1.6s ease-in-out infinite;
}
@keyframes badgePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.22); } }

.notif-enable-card { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.notif-status { font-size: 0.84rem; color: var(--ink-soft); line-height: 1.45; margin: 0; }

.inbox-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.inbox-swipe { position: relative; overflow: hidden; border-radius: 18px; animation: cardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
.inbox-del-bg {
  position: absolute; inset: 0; z-index: 0; border-radius: 18px;
  background: linear-gradient(135deg, #ff6b6b, #e0483f);
  opacity: 0; transition: opacity 0.18s ease;
}
.inbox-swipe.swiping .inbox-del-bg { opacity: 1; }
.inbox-item {
  position: relative; z-index: 1; touch-action: pan-y; transition: transform 0.2s ease;
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  padding: 14px 16px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow-sm);
}
.inbox-item.removing { transform: translateX(-115%); opacity: 0; transition: transform 0.24s ease-in, opacity 0.24s; pointer-events: none; }
.inbox-item.is-unread { border: 1.5px solid rgba(239, 93, 125, 0.55); background: linear-gradient(140deg, rgba(255, 240, 245, 0.95), var(--card)); }
.inbox-item.is-read { opacity: 0.72; }
.inbox-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rose); flex-shrink: 0; margin-top: 6px; box-shadow: 0 0 0 4px rgba(239, 93, 125, 0.18); }
.inbox-body { display: flex; flex-direction: column; gap: 4px; }
.inbox-text { font-size: 0.9rem; line-height: 1.45; }
.inbox-date { font-size: 0.68rem; color: var(--ink-soft); }
.inbox-date strong { color: var(--rose-deep); }

/* ───────── Histórico ───────── */
.stats-card { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; text-align: center; margin-bottom: 14px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; }
.stat-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 15px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--card-border);
  font-size: 0.8rem; animation: cardIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.history-row.spend { background: rgba(255, 250, 244, 0.8); }
.history-label { line-height: 1.35; }
.history-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.history-amount { font-weight: 800; font-variant-numeric: tabular-nums; }
.history-amount.is-plus { color: #2c8a5b; }
.history-amount.is-minus { color: #c05a3f; }
.history-date { font-size: 0.62rem; color: var(--ink-soft); }
.history-empty { text-align: center; color: var(--ink-soft); font-size: 0.84rem; padding: 24px 10px; }

/* ───────── Ruleta de la suerte ───────── */
.roulette-lead { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink-soft); margin: 2px 0 14px; }
.roulette-wrap { position: relative; --wheel-r: min(76vw, 330px); width: var(--wheel-r); height: var(--wheel-r); margin: 0 auto 6px; }
.roulette-pointer {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  font-size: 1.6rem; color: var(--rose-deep); z-index: 3;
  filter: drop-shadow(0 3px 6px rgba(217, 79, 112, 0.5));
}
.roulette-wheel {
  position: absolute; inset: 0; border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 40px -12px rgba(190, 90, 110, 0.5), inset 0 0 0 3px rgba(217, 164, 65, 0.35);
  transform: rotate(0deg);
}
.roulette-labels { position: absolute; inset: 0; }
.roulette-seg-label {
  position: absolute; top: 50%; left: 50%;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  transform-origin: 0 0; width: 92px; margin-left: -46px; margin-top: -17px;
}
.rseg-emoji { font-size: 1.35rem; line-height: 1; }
.rseg-text { font-size: 0.52rem; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); letter-spacing: 0.02em; white-space: nowrap; }
.roulette-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 62px; height: 62px; border-radius: 50%; z-index: 2;
  background: linear-gradient(140deg, #fff, #ffe9df);
  border: 3px solid var(--gold-soft);
  display: grid; place-items: center; font-size: 1.6rem;
  box-shadow: 0 8px 22px -6px rgba(150, 100, 40, 0.45);
}
.roulette-status { font-size: 0.85rem; font-weight: 700; color: var(--rose-deep); text-align: center; margin: 16px 0 4px; }
.roulette-note { font-size: 0.72rem; color: var(--ink-soft); text-align: center; line-height: 1.5; }
#btn-spin:disabled { opacity: 0.55; filter: saturate(0.5); }
.roulette-win .celebrate-icon.big { font-size: 3.6rem; animation: rouletteWinPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes rouletteWinPop { 0% { transform: scale(0.2) rotate(-20deg); opacity: 0; } 60% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }

/* Animación de entrada para más tarjetas de menú */
.menu-card:nth-child(6) { animation-delay: 0.4s; }
.menu-card:nth-child(7) { animation-delay: 0.47s; }
.menu-card:nth-child(8) { animation-delay: 0.54s; }

/* ───────── Escritorio ───────── */
@media (min-width: 720px) {
  #app { max-width: 520px; padding-top: 26px; }
  .rewards-grid, .ach-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ───────── Accesibilidad: movimiento reducido ───────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .screen.is-active { animation: none; }
  .blob { animation: none; }
}
