body { min-height: 100dvh; }
.view {
  max-width: 480px; margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px calc(110px + env(safe-area-inset-bottom));
  outline: none; display: grid; gap: 22px; align-content: start;
  view-transition-name: view;
}
::view-transition-old(view) { animation: vt-out .18s ease-in both; }
::view-transition-new(view) { animation: vt-in .32s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- bienvenida ---------- */
.welcome { min-height: calc(100dvh - 60px); display: grid; align-content: center; gap: 18px; text-align: center; padding-bottom: 20px; }
.welcome__logo { display: grid; place-items: center; margin-bottom: -6px; }
.welcome__brand { font-size: clamp(4.4rem, 22vw, 6.6rem); color: var(--crema); letter-spacing: .005em; }
.welcome__tag { text-transform: uppercase; letter-spacing: .32em; font-size: .78rem; color: var(--mostaza); margin-top: -10px; }
.welcome__card { border-radius: var(--r-l); padding: 22px 20px; text-align: left; transform: rotate(-1.2deg); margin: 8px 6px 6px; box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.welcome__lead { font-family: var(--display); text-transform: uppercase; font-size: 1.55rem; line-height: 1; }
.welcome__perks { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; font-size: .95rem; }
.welcome__perks li { display: grid; grid-template-columns: 86px 1fr; border-top: 1.5px dashed rgba(20,20,20,.25); padding-top: 8px; }
.welcome__perks b { color: var(--ketchup); }
.fine { font-size: .8rem; color: var(--ink-3); }
.center { text-align: center; }

/* ---------- acceso ---------- */
.auth { display: grid; gap: 18px; padding-top: 8px; }
.auth h1 { font-size: 3.4rem; outline: none; }
.auth__lead { color: var(--ink-2); margin-top: -8px; }
.auth form { display: grid; gap: 18px; }
.back { justify-self: start; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: none; font-size: 1.2rem; }
.phone-input { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.phone-input__cc { display: grid; place-items: center; padding: 0 14px; border-radius: var(--r-m); background: var(--carbon-2); border: 1.5px solid var(--line); font-weight: 600; }
.otp { text-align: center; font-size: 2rem; letter-spacing: .6em; padding-left: .6em; font-family: var(--display); }
.field__error { color: #ff8a80; font-size: .85rem; min-height: 1em; margin-top: -2px; }
.field__error:empty { display: none; }
.opt { color: var(--ink-3); font-weight: 400; }
.demo-note { font-size: .85rem; background: rgba(255,197,49,.1); color: var(--mostaza); border-radius: 12px; padding: 10px 14px; }
.link { background: none; border: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; padding: 10px; font-size: .92rem; justify-self: center; }
.link:disabled { text-decoration: none; color: var(--ink-3); cursor: default; }
.link--danger { color: #ff8a80; }
.link-inline { background: none; border: 0; padding: 0; color: var(--mostaza); text-decoration: underline; font-size: inherit; }

/* ---------- cabecera ---------- */
.top { display: flex; justify-content: space-between; align-items: center; }
.top__brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); text-transform: uppercase; font-size: 1.35rem; letter-spacing: .02em; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--mostaza); color: var(--carbon); font-family: var(--display); font-size: 1.25rem; text-decoration: none; }
.avatar--big { width: 64px; height: 64px; font-size: 2rem; flex: none; }
.hello { font-size: clamp(3rem, 15vw, 4.2rem); outline: none; margin-bottom: -12px; }
.hello__sub { color: var(--ink-2); }
.page-title { font-size: 3.6rem; outline: none; }
.sec { font-size: 1.5rem; margin-bottom: 12px; color: var(--crema); }

/* ---------- tarjeta de sellos ---------- */
.card { border-radius: var(--r-l); padding: 18px 16px 18px; box-shadow: 0 22px 50px rgba(0,0,0,.45), inset 0 0 0 1px rgba(0,0,0,.04); position: relative; }
.card::before, .card::after { content: ''; position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--carbon); transform: translateY(-50%); }
.card::before { left: -9px; } .card::after { right: -9px; }
.card__head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1.5px dashed rgba(20,20,20,.22); }
.card__brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); text-transform: uppercase; font-size: 1.1rem; }
.card__count { font-family: var(--display); font-size: 1.1rem; color: rgba(20,20,20,.5); }
.card__count b { font-weight: 400; color: var(--ketchup); font-size: 1.7rem; }
.slots { list-style: none; margin: 16px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
.slot { display: grid; justify-items: center; gap: 6px; }
.slot__ring { width: min(84px, 22vw); aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(20,20,20,.28); display: grid; place-items: center; position: relative; }
.slot.is-big .slot__ring { border-color: var(--ketchup); border-style: solid; }
.slot__n { font-family: var(--display); font-size: 1.6rem; color: rgba(20,20,20,.28); }
.slot__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: rgba(20,20,20,.55); }
.slot.is-filled .slot__ring { border-color: transparent; }
.slot.is-filled .slot__label { color: var(--carbon); }
.ink { width: 112%; height: 112%; transform: rotate(var(--rot)); mix-blend-mode: multiply; }
.slot.is-new .ink { animation: smash .55s var(--ease-smash) both; animation-delay: calc(var(--i) * 220ms + 250ms); }
.slot.is-new .slot__ring::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 3px solid var(--ketchup); opacity: 0; animation: ripple .7s ease-out both; animation-delay: calc(var(--i) * 220ms + 420ms); }
@keyframes smash {
  0% { transform: rotate(var(--rot)) scale(2.4) translateY(-30px); opacity: 0; }
  55% { transform: rotate(var(--rot)) scale(.86); opacity: 1; }
  75% { transform: rotate(var(--rot)) scale(1.06); }
  100% { transform: rotate(var(--rot)) scale(1); }
}
@keyframes ripple { 0% { opacity: .8; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.35); } }
.card:has(.is-new) { animation: card-shake .4s ease-out both; animation-delay: .42s; }
@keyframes card-shake { 30% { transform: translateY(3px) rotate(.4deg); } 60% { transform: translateY(-1px) rotate(-.3deg); } }
.card__msg { font-size: .95rem; text-align: center; padding-top: 12px; border-top: 1.5px dashed rgba(20,20,20,.22); }
.card__msg b { color: var(--ketchup); }

/* ---------- bloques de inicio ---------- */
.ready { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r-m); background: var(--mostaza); color: var(--carbon); text-decoration: none; }
.ready__n { width: 42px; height: 42px; border-radius: 50%; background: var(--carbon); color: var(--mostaza); display: grid; place-items: center; font-family: var(--display); font-size: 1.4rem; }
.ready small { font-size: .8rem; opacity: .75; }
.tuesday { display: flex; gap: 14px; align-items: center; padding: 12px 16px; border-radius: var(--r-m); border: 1.5px dashed var(--line); color: var(--ink-2); font-size: .92rem; }
.tuesday.is-today { border: 0; background: var(--ketchup); color: var(--crema); }
.tuesday__x { font-family: var(--display); font-size: 2rem; color: var(--mostaza); }
.tuesday.is-today .tuesday__x { color: var(--crema); }
.promo { position: relative; overflow: hidden; border-radius: var(--r-l); padding: 22px 20px; background: var(--carbon-2); border: 1px solid var(--line); display: grid; gap: 8px; }
.promo__art { position: absolute; right: -60px; top: -50px; width: 220px; opacity: .9; }
.promo h2 { font-size: 2.1rem; max-width: 75%; position: relative; }
.promo p { color: var(--ink-2); max-width: 85%; position: relative; }
.promo__kicker { font-size: .75rem; text-transform: uppercase; letter-spacing: .2em; color: var(--mostaza); font-weight: 600; position: relative; }
.promo__cta { font-weight: 700; text-decoration: none; position: relative; margin-top: 4px; }
.how { padding: 4px 2px; }
.how h2 { font-size: 1.4rem; margin-bottom: 10px; }
.how ol { margin: 0; padding: 0; list-style: none; counter-reset: how; display: grid; gap: 10px; }
.how li { counter-increment: how; display: grid; grid-template-columns: 30px 1fr; color: var(--ink-2); font-size: .95rem; }
.how li::before { content: counter(how); font-family: var(--display); color: var(--mostaza); font-size: 1.2rem; }
.how b { color: var(--ink); }

/* ---------- premios ---------- */
.rewards { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.reward { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding: 14px; border-radius: var(--r-m); background: var(--carbon-2); border: 1.5px solid var(--mostaza); }
.reward__icon { width: 64px; height: 64px; display: grid; place-items: center; }
.reward__icon .ink { mix-blend-mode: normal; }
.reward h3, .step h3 { font-family: var(--text); text-transform: none; font-size: 1.05rem; font-weight: 700; line-height: 1.2; }
.reward p, .step p { color: var(--ink-2); font-size: .88rem; margin: 2px 0 6px; }
.hint { font-size: .85rem; color: var(--ink-3); margin-top: 10px; }
.empty { color: var(--ink-3); padding: 18px; border-radius: var(--r-m); border: 1.5px dashed var(--line); }
.path { list-style: none; padding: 0; margin: 0; display: grid; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding-bottom: 18px; position: relative; }
.step:not(:last-child)::before { content: ''; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--line); }
.step.is-done:not(:last-child)::before { background: var(--mostaza); }
.step__n { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); font-family: var(--display); font-size: 1.1rem; color: var(--ink-3); }
.step.is-done .step__n { background: var(--mostaza); border-color: var(--mostaza); color: var(--carbon); }
.step.is-next .step__n { border-color: var(--mostaza); color: var(--mostaza); }
.step:not(.is-done):not(.is-next) h3 { color: var(--ink-2); }
.extras { display: grid; gap: 10px; }
.extras .sec { margin-bottom: 2px; }
.extra { padding: 14px 16px; border-radius: var(--r-m); background: var(--carbon-2); font-size: .92rem; }
.extra p { color: var(--ink-2); margin-top: 2px; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { display: flex; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.history time, .history li > span:last-child { color: var(--ink-3); }

/* ---------- carta ---------- */
.monthly { border-radius: var(--r-l); padding: 22px 20px; background: var(--ketchup); color: var(--crema); display: grid; gap: 6px; }
.monthly__img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: calc(var(--r-l) - 6px); margin-bottom: 8px; }
.monthly .promo__kicker { color: var(--crema); opacity: .85; }
.monthly h2 { font-size: 2.6rem; }
.monthly .price { font-family: var(--display); font-size: 1.6rem; color: var(--mostaza); }
.cats { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 10px 18px; margin: 0 -18px; background: linear-gradient(var(--carbon) 75%, transparent); scrollbar-width: none; }
.cats .chip { text-decoration: none; padding: 8px 14px; font-size: .85rem; white-space: nowrap; }
.menu-sec { scroll-margin-top: 60px; }
.menu-note { color: var(--ink-3); font-size: .88rem; margin: -6px 0 14px; }
.dishes { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.dish { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; padding: 10px; border-radius: var(--r-m); background: var(--carbon-2); }
.dish__img { width: 112px; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--carbon-3); }
.dish__img img { width: 100%; height: 100%; object-fit: cover; }
.dish__ph { width: 100%; height: 100%; display: grid; place-items: center; position: relative; }
.dish__ph > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dish__ph > svg path { fill: #322f2a; }
.dish__ph > span { position: relative; opacity: .8; }
.dish__body h3 { font-family: var(--text); text-transform: none; font-size: 1.05rem; font-weight: 700; line-height: 1.2; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dish__body p { color: var(--ink-2); font-size: .86rem; margin: 4px 0 8px; }
.price { font-weight: 700; color: var(--mostaza); }
.dish.is-secret { background: linear-gradient(135deg, #2b2112, var(--carbon-2)); box-shadow: inset 0 0 0 1.5px var(--mostaza); }
.dish__lock { width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 8px; text-align: center; font-size: .68rem; color: var(--mostaza); font-weight: 600; background: repeating-linear-gradient(-45deg, #1b1914 0 8px, #221f18 8px 16px); }

/* ---------- perfil ---------- */
.me { display: flex; gap: 16px; align-items: center; }
.me h2 { font-size: 1.9rem; }
.me p { color: var(--ink-2); }
.invite { border-radius: var(--r-l); padding: 20px; display: grid; gap: 8px; }
.invite .promo__kicker { color: var(--ketchup); }
.invite h2 { font-size: 1.8rem; }
.invite p { color: rgba(20,20,20,.75); font-size: .92rem; margin-bottom: 6px; }
.invite .btn { background: var(--carbon); color: var(--crema); }
.settings { display: grid; gap: 16px; }
.danger { display: grid; gap: 6px; padding-top: 6px; }

/* ---------- barra de pestañas ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom));
  width: min(456px, calc(100% - 24px)); height: 68px; border-radius: 22px;
  background: rgba(29, 28, 26, .86); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; z-index: 20;
  view-transition-name: tabbar;
}
.tabbar[hidden] { display: none; }
.tabbar a { display: grid; justify-items: center; gap: 3px; color: var(--ink-3); text-decoration: none; font-size: .68rem; font-weight: 600; position: relative; padding: 6px 0; }
.tabbar a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tabbar a[aria-current] { color: var(--mostaza); }
.tabbar .dot { position: absolute; top: 4px; right: calc(50% - 16px); width: 9px; height: 9px; border-radius: 50%; background: var(--ketchup); border: 2px solid var(--carbon-2); }
.tab-qr { justify-self: center; width: 62px; height: 62px; margin-top: -26px; border-radius: 20px; border: 0; background: var(--mostaza); color: var(--carbon); display: grid; place-items: center; box-shadow: 0 10px 26px rgba(255,197,49,.35), 0 0 0 5px var(--carbon); transition: transform .15s; }
.tab-qr:active { transform: scale(.94); }
.tab-qr svg { width: 28px; height: 28px; fill: currentColor; }

/* ---------- hojas inferiores ---------- */
.sheet { margin: auto auto 0; width: 100%; max-width: 480px; }
.sheet__body { background: var(--carbon-2); border-radius: 28px 28px 0 0; padding: 12px 22px calc(22px + env(safe-area-inset-bottom)); display: grid; gap: 14px; text-align: center; border: 1px solid var(--line); border-bottom: 0; }
.sheet[open] .sheet__body { animation: sheet-up .38s var(--ease-out) both; }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet__grip { justify-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet h2 { font-size: 2.2rem; }
.sheet__lead { color: var(--ink-2); font-size: .92rem; margin-top: -6px; }
.qr-box { justify-self: center; width: min(270px, 72vw); aspect-ratio: 1; padding: 18px; background: #fff; border-radius: 22px; }
.qr-box svg, #qr-img { width: 100%; height: 100%; display: block; }
.qr-code { font-family: var(--display); font-size: 2rem; letter-spacing: .12em; color: var(--mostaza); }
.qr-name { color: var(--ink-3); margin-top: -12px; font-size: .9rem; }
.legal { text-align: left; }
.legal p { color: var(--ink-2); font-size: .9rem; }

/* ---------- celebración ---------- */
.celebrate { margin: auto; width: min(92vw, 400px); }
.celebrate__body { background: var(--crema); color: var(--carbon); border-radius: 28px; padding: 28px 24px 22px; display: grid; gap: 10px; text-align: center; }
.celebrate[open] .celebrate__body { animation: pop .45s var(--ease-smash) both; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
.celebrate__stamp { width: 150px; height: 150px; justify-self: center; }
.celebrate__stamp .ink { width: 100%; height: 100%; }
.celebrate__stamp.go .ink { animation: smash .6s var(--ease-smash) .15s both; }
.celebrate__kicker { text-transform: uppercase; letter-spacing: .2em; font-size: .78rem; color: var(--ketchup); font-weight: 700; }
.celebrate h2 { font-size: 2.3rem; }
.celebrate p:not(.celebrate__kicker) { color: rgba(20,20,20,.75); }
.celebrate .btn { margin-top: 8px; background: var(--carbon); color: var(--crema); }
