:root {
  --red: #B70A0A;
  --red-dark: #8E0707;
  --red-soft: #F3E3E3;
  --ink: #1E1414;
  --muted: #6B5B5B;
  --line: #EEE3E3;
  --bg: #F6F3EF;
  --green: #1F7A3A;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Rubik, system-ui, -apple-system, sans-serif; }
body { min-height: 100dvh; }
button, input, select { font-family: inherit; }
h1, h2, p { margin: 0; }
.hidden { display: none !important; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; }

/* ---------- botones y campos ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 56px; width: 100%; border: 0; border-radius: 18px; background: var(--red); color: #fff; font-size: 17px; font-weight: 800; cursor: pointer; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.6; cursor: default; }
.btn.secondary { background: var(--red-soft); color: var(--red); }
.btn.link-btn { height: auto; width: auto; background: none; color: var(--red); font-size: 15px; font-weight: 700; padding: 0; }
.btn.ghost { background: transparent; color: var(--muted); font-weight: 500; height: 44px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 700; }
.input { height: 54px; border-radius: 16px; border: 2px solid #EADADA; padding: 0 16px; font-size: 17px; color: var(--ink); background: #fff; outline: none; width: 100%; }
.input:focus { border-color: var(--red); }
.row { display: flex; gap: 8px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.4; }
.error { color: var(--red); font-size: 14px; font-weight: 500; min-height: 18px; }
.devcode { background: #FFF4D6; color: #6A4B00; border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.4; }

/* ---------- ingreso ---------- */
.login { min-height: 100dvh; background: var(--red); display: flex; flex-direction: column; }
.login-top { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: calc(48px + var(--safe-top)) 28px 30px; color: #fff; text-align: center; }
.login-top img { width: 220px; max-width: 70%; }
.login-top p { font-size: 17px; line-height: 1.4; opacity: 0.92; }
.sheet { background: #fff; border-radius: 30px 30px 0 0; padding: 30px 24px calc(32px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 18px; }
.sheet h1 { font-size: 26px; font-weight: 900; letter-spacing: -0.3px; }
.code-input { letter-spacing: 10px; text-align: center; font-size: 26px; font-weight: 800; }

/* ---------- inicio ---------- */
.top { background: var(--red); padding: calc(20px + var(--safe-top)) 22px 96px; display: flex; flex-direction: column; gap: 18px; color: #fff; }
.top-bar { display: flex; align-items: center; justify-content: space-between; }
.top-bar img { width: 112px; }
.hello p { font-size: 16px; opacity: 0.85; }
.hello h1 { font-size: 32px; font-weight: 900; letter-spacing: -0.5px; margin-top: 2px; overflow-wrap: anywhere; }
.card { background: #fff; border-radius: 26px; padding: 22px; }
.points-card { margin: -78px 16px 0; box-shadow: 0 10px 30px rgba(80, 10, 10, 0.14); display: flex; flex-direction: column; gap: 14px; position: relative; }
.points-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.points { font-size: 56px; line-height: 1; font-weight: 900; color: var(--red); margin-top: 4px; }
.pill-btn { text-decoration: none; background: var(--red); color: #fff; font-weight: 700; font-size: 15px; border-radius: 16px; padding: 13px 16px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.bar { height: 10px; border-radius: 5px; background: var(--red-soft); overflow: hidden; }
.bar > div { height: 100%; background: var(--red); border-radius: 5px; transition: width 0.6s ease; }
.promo { margin: 18px 16px 0; min-height: 130px; border-radius: 22px; background: #2A1C1C center/cover no-repeat; display: flex; flex-direction: column; justify-content: flex-end; padding: 18px; color: #fff; }
.promo .tag { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #FFB4B4; }
.promo .title { font-size: 21px; font-weight: 800; margin-top: 4px; }
.section { margin: 20px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.section h2 { font-size: 18px; font-weight: 800; }
.list { background: #fff; border-radius: 18px; padding: 4px 16px; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #F0E6E6; }
.item:last-child { border-bottom: 0; }
.item .t { font-size: 15px; font-weight: 500; }
.item .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.item .p { font-size: 16px; font-weight: 800; color: var(--green); white-space: nowrap; }
.item .p.neg { color: var(--red); }
.item .p.void { color: var(--muted); text-decoration: line-through; }
.empty { padding: 18px 0; color: var(--muted); font-size: 15px; text-align: center; }
.page-pad { padding-bottom: calc(110px + var(--safe-bottom)); }

/* ---------- mi código ---------- */
.qr-page { min-height: 100dvh; background: var(--red); color: #fff; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: calc(20px + var(--safe-top)) 24px calc(110px + var(--safe-bottom)); }
.qr-page .top-bar { width: 100%; }
.qr-page h1 { font-size: 30px; font-weight: 900; text-align: center; }
.qr-page .sub { font-size: 16px; opacity: 0.9; text-align: center; margin-top: 6px; }
.qr-card { background: #fff; border-radius: 30px; padding: 26px; display: flex; flex-direction: column; align-items: center; gap: 16px; box-shadow: 0 16px 40px rgba(60, 0, 0, 0.3); color: var(--ink); }
.qr-card img { width: 250px; height: 250px; max-width: 70vw; max-height: 70vw; display: block; }
.qr-card .n { font-size: 20px; font-weight: 800; text-align: center; }
.qr-card .m { font-size: 15px; color: var(--muted); letter-spacing: 1px; text-align: center; margin-top: 4px; }
.tip { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.14); border-radius: 18px; padding: 14px 18px; font-size: 14px; line-height: 1.4; max-width: 360px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(255, 255, 255, 0.16); display: flex; align-items: center; justify-content: center; color: #fff; cursor: pointer; text-decoration: none; }

/* ---------- premios y perfil ---------- */
.plain-top { background: var(--red); color: #fff; padding: calc(20px + var(--safe-top)) 22px 26px; display: flex; flex-direction: column; gap: 16px; }
.plain-top h1 { font-size: 30px; font-weight: 900; }
.soon { margin: 20px 16px 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 34px 22px; }
.soon .big { width: 72px; height: 72px; border-radius: 36px; background: var(--red-soft); color: var(--red); display: flex; align-items: center; justify-content: center; }
.soon h2 { font-size: 20px; font-weight: 800; }
.soon p { color: var(--muted); font-size: 15px; line-height: 1.5; }
.profile { margin: 20px 16px 0; display: flex; flex-direction: column; gap: 16px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #F0E6E6; font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 500; text-align: right; }

/* ---------- barra de abajo ---------- */
.tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; background: #fff; border-top: 1px solid var(--line); padding: 8px 10px calc(10px + var(--safe-bottom)); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); z-index: 10; }
.tabs a { text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #8A7A7A; font-size: 11px; font-weight: 500; padding: 6px 0; }
.tabs a.on { color: var(--red); font-weight: 700; }

/* ---------- aviso ---------- */
.toast { position: fixed; left: 50%; top: calc(16px + var(--safe-top)); transform: translateX(-50%) translateY(-120px); background: #fff; color: var(--ink); border-radius: 18px; padding: 14px 20px; font-weight: 700; font-size: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); transition: transform 0.35s ease; z-index: 20; max-width: 90vw; text-align: center; }
.toast.show { transform: translateX(-50%) translateY(0); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; font-weight: 500; margin: 4px 0 -4px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* premios */
.ready { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); background: #E7F5EC; border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.ready svg { color: var(--green); flex: none; }
.ready span:nth-child(2) { flex: 1; }
.ready .go { color: var(--green); font-weight: 800; }
.my-pts { font-size: 15px; background: rgba(255,255,255,0.16); border-radius: 12px; padding: 8px 12px; white-space: nowrap; }
.how { margin: 18px 16px 0; display: flex; flex-direction: column; gap: 14px; font-size: 15px; line-height: 1.45; }
.rw-list { margin: 16px 16px 0; display: flex; flex-direction: column; gap: 14px; }
.rw-card { background: #fff; border-radius: 22px; overflow: hidden; }
.rw-img { height: 175px; background: var(--red-soft) center 62%/cover no-repeat; }
.rw-img.empty { height: 84px; display: flex; align-items: center; justify-content: center; color: var(--red); }
.rw-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.rw-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rw-name { font-size: 18px; font-weight: 800; }
.rw-pts { font-size: 16px; font-weight: 900; color: var(--red); white-space: nowrap; }
.rw-ok { color: var(--green); font-weight: 700; font-size: 15px; }
.promo { min-height: 150px; }
.promo.with-img { min-height: 240px; background-position: center 35%; }
.rw-img.empty:has(.badge) { height: 110px; background: var(--red); }
.badge { color: #fff; font-size: 46px; font-weight: 900; letter-spacing: -1px; display: flex; align-items: baseline; gap: 6px; }
.badge small { font-size: 20px; font-weight: 800; letter-spacing: 1px; }

/* detalle de la novedad (burger del mes) */
a.promo { text-decoration: none; -webkit-tap-highlight-color: transparent; }
a.promo:active { transform: scale(0.985); }
.promo .more { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 14px; font-weight: 700; color: #fff; opacity: 0.9; }
.nov { min-height: 100vh; background: #fff; padding-bottom: 110px; }
.nov-hero { position: relative; height: 58vh; max-height: 460px; min-height: 300px; background: #2A1C1C center 35%/cover no-repeat; }
.nov-hero.empty { background: var(--red); height: 160px; min-height: 0; }
.nov-back { position: absolute; top: calc(env(safe-area-inset-top) + 14px); left: 14px; width: 44px; height: 44px; border-radius: 22px; background: rgba(255,255,255,0.92); color: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,0.18); }
.nov-body { position: relative; margin-top: -26px; background: #fff; border-radius: 26px 26px 0 0; padding: 26px 22px 0; display: flex; flex-direction: column; gap: 12px; }
.nov-tag { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--red); }
.nov-body h1 { font-size: 28px; line-height: 1.15; }
.nov-desc { font-size: 17px; line-height: 1.55; color: var(--ink); white-space: pre-line; margin-bottom: 10px; }
