/* ── DIN Pro (fonte Carris) ────────────────────────────────────
   Colocar os ficheiros .woff2 em /fonts com estes nomes.
   Se não existirem, usa Barlow (Google Fonts), da mesma família visual. */
@font-face { font-family: "DIN Pro"; font-weight: 400; font-display: swap; src: local("DIN Pro"), local("DINPro-Regular"), url("../fonts/DINPro-Regular.woff2") format("woff2"); }
@font-face { font-family: "DIN Pro"; font-weight: 500; font-display: swap; src: local("DIN Pro Medium"), local("DINPro-Medium"), url("../fonts/DINPro-Medium.woff2") format("woff2"); }
@font-face { font-family: "DIN Pro"; font-weight: 700; font-display: swap; src: local("DIN Pro Bold"), local("DINPro-Bold"), url("../fonts/DINPro-Bold.woff2") format("woff2"); }
@font-face { font-family: "DIN Pro"; font-weight: 900; font-display: swap; src: local("DIN Pro Black"), local("DINPro-Black"), url("../fonts/DINPro-Black.woff2") format("woff2"); }
@font-face { font-family: "DIN Pro Cond"; font-weight: 700; font-display: swap; src: local("DIN Pro Condensed Bold"), local("DINPro-CondensedBold"), url("../fonts/DINPro-CondensedBold.woff2") format("woff2"); }

:root {
  --blue: #003F8F;
  --blue-d: #002E6B;
  --navy: #0B2545;
  --yellow: #FBD700;
  --yellow-d: #D9BA00;
  --paper: #FBF6EA;
  --paper-d: #EFE6CF;
  --red: #E30613;
  --green: #2E8A2A;
  --ink: #0B2545;
  --muted: #5B6B82;
  --line: #E3E8EF;
  --bg: #F3F5F8;
  --font: "DIN Pro", "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-cond: "DIN Pro Cond", "Barlow Condensed", "Arial Narrow", sans-serif;
  --r: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tab-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
#app { max-width: 540px; margin: 0 auto; min-height: 100dvh; background: #fff; position: relative; box-shadow: 0 0 0 1px var(--line); }
@media (min-width: 600px) { body { background: linear-gradient(180deg, var(--blue-d), var(--navy)); } }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.05; letter-spacing: -.01em; }
p { line-height: 1.45; }
button { font: inherit; color: inherit; cursor: pointer; }
.ico { width: 1.25em; height: 1.25em; flex: none; }
.ico.big { width: 44px; height: 44px; }
.ui { width: 22px; height: 22px; flex: none; }

/* ── botões ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0;
  font-weight: 700; font-size: 16px; text-decoration: none; letter-spacing: .01em;
  transition: transform .12s, filter .12s;
}
.btn:active { transform: scale(.97); }
.btn-big { width: 100%; min-height: 56px; font-size: 18px; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-yellow { background: var(--yellow); color: var(--navy); box-shadow: 0 4px 0 var(--yellow-d); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-ghost { background: transparent; color: var(--blue); box-shadow: inset 0 0 0 2px currentColor; }
.btn-danger { background: transparent; color: var(--red); box-shadow: inset 0 0 0 2px currentColor; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.btn-row.center { justify-content: center; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 50%; color: var(--blue); }
.icon-btn:active { background: var(--bg); }

/* ── topo / tabs ───────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: calc(8px + var(--safe-t)) 8px 8px 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand img { height: 22px; width: auto; }
.topbar-title { flex: 1; font-weight: 700; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding-top: 2px; }
.demo-bar { background: #FFF6BF; color: #6b5800; font-size: 13px; padding: 6px 16px; text-align: center; }
.campaign-note { background: #FFF6BF; color: #6b5800; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 10px; text-align: center; margin: 10px 0 0; }
.view { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); animation: in .25s ease; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 540px; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b); height: calc(var(--tab-h) + var(--safe-b));
}
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 500; }
.tab.on { color: var(--blue); font-weight: 700; }
.tab.on::before { content: ""; position: absolute; top: 0; width: 32px; height: 3px; border-radius: 0 0 3px 3px; background: var(--yellow); }
.tab .dot { position: absolute; top: 10px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #fff; }

/* ── luzes ─────────────────────────────────────────────────── */
.lights { position: absolute; top: 0; left: 0; width: 100%; height: 40px; pointer-events: none; }
.lights .bulb ellipse { animation: glow 2.2s ease-in-out infinite; animation-delay: var(--d); }
@keyframes glow { 0%, 100% { opacity: 1; filter: drop-shadow(0 0 4px currentColor); } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .lights .bulb ellipse { animation: none; } * { animation-duration: .01ms !important; } }

/* ── capa ──────────────────────────────────────────────────── */
.cover {
  position: relative; min-height: 100dvh; color: #fff; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 0%, #1F5BA8 0%, var(--blue) 30%, var(--blue-d) 70%, var(--navy) 100%);
}
.cover::after { /* neve */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(2px 2px at 20% 30%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 70% 20%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 40% 70%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 85% 60%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 10% 85%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 60% 90%, #FBD700 50%, transparent 51%);
  background-size: 220px 260px; animation: snow 18s linear infinite;
}
@keyframes snow { to { background-position: 0 520px; } }
.cover-inner { position: relative; z-index: 1; padding: calc(56px + var(--safe-t)) 24px calc(32px + var(--safe-b)); display: flex; flex-direction: column; gap: 22px; }
.lang-switch { position: absolute; top: calc(44px + var(--safe-t)); right: 16px; display: flex; background: rgba(255,255,255,.12); border-radius: 999px; padding: 3px; }
.lang-switch button, .seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.lang-switch button { color: #fff; }
.lang-switch button.on { background: #fff; color: var(--blue); }
.booklet {
  margin: 28px auto 0; width: min(290px, 86%); aspect-ratio: 3 / 4; border-radius: 10px 18px 18px 10px;
  background: linear-gradient(135deg, #00468A, #002A57); position: relative; padding: 22px 20px;
  box-shadow: inset 8px 0 0 rgba(0,0,0,.25), inset 10px 0 0 rgba(255,255,255,.05), 0 30px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(251,215,0,.25);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  transform: rotate(-3deg); animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { transform: rotate(-1.5deg) translateY(-6px); } }
.booklet::before { content: ""; position: absolute; inset: 10px 10px 10px 16px; border: 1.5px solid rgba(251,215,0,.55); border-radius: 6px 12px 12px 6px; pointer-events: none; }
.booklet-logo { background: #fff; border-radius: 999px; padding: 6px 14px; }
.booklet-logo img { height: 20px; width: auto; }
.emblem { margin-top: 10px; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; color: var(--yellow); border: 2px solid rgba(251,215,0,.7); box-shadow: 0 0 0 6px rgba(251,215,0,.12), 0 0 40px rgba(251,215,0,.25); position: relative; }
.emblem .ico { width: 58px; height: 58px; margin-top: -8px; filter: drop-shadow(0 0 10px rgba(251,215,0,.6)); }
.emblem span { position: absolute; bottom: 14px; font-family: var(--font-cond); font-weight: 700; letter-spacing: .2em; font-size: 12px; }
.booklet .kicker { color: rgba(255,255,255,.75); margin: 6px 0 0; }
.booklet h1 { color: var(--yellow); font-weight: 900; font-size: 34px; text-transform: uppercase; letter-spacing: .02em; line-height: .95; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.kicker { font-family: var(--font-cond); font-weight: 700; text-transform: uppercase; letter-spacing: .16em; font-size: 12px; margin: 0; }
.cover .lead { font-size: 19px; text-align: center; margin: 8px 0 0; font-weight: 500; }
.how { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.how li { display: flex; gap: 14px; align-items: center; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 12px 14px; font-size: 15px; line-height: 1.3; }
.how li span { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: var(--navy); }
.how li span .ico { width: 22px; height: 22px; }

/* ── passaporte ────────────────────────────────────────────── */
.hero {
  position: relative; color: #fff; padding: 46px 20px 22px; overflow: hidden;
  background: radial-gradient(120% 120% at 100% 0%, #1F5BA8, var(--blue) 40%, var(--blue-d));
}
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.hero .kicker { color: rgba(255,255,255,.75); }
.hero-title { font-size: 34px; font-weight: 900; margin-top: 6px; }
.hero-seal { flex: none; animation: float 5s ease-in-out infinite; }
.progress { margin-top: 18px; height: 12px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; }
.progress.dark { background: var(--paper-d); }
.progress-bar { height: 100%; width: var(--p); min-width: 12px; border-radius: inherit; background: linear-gradient(90deg, var(--yellow), #FFF08A); box-shadow: 0 0 12px rgba(251,215,0,.6); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.progress-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 15px; }
.progress-row span { color: rgba(255,255,255,.85); }
.hero .btn { margin-top: 16px; width: 100%; }

.page {
  background: var(--paper);
  background-image: repeating-radial-gradient(circle at 50% 120%, transparent 0 14px, rgba(0,63,143,.035) 14px 15px), linear-gradient(var(--paper), var(--paper));
  padding: 20px 14px 26px; border-top: 4px dashed rgba(0,63,143,.12);
}
.stamp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 420px) { .stamp-grid { grid-template-columns: repeat(3, 1fr); } }
.slot-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; padding: 14px 8px 12px;
  border-radius: var(--r); background: rgba(255,255,255,.55); border: 1px solid rgba(11,37,69,.07); text-align: center;
  transition: transform .15s;
}
.slot-card:active { transform: scale(.97); }
.slot-art { width: 100%; max-width: 116px; aspect-ratio: 1; display: grid; place-items: center; transform: rotate(var(--tilt)); }
.slot-art svg { width: 100%; height: 100%; }
.slot { color: rgba(0,63,143,.28); }
.slot-name { font-weight: 700; font-size: 15px; line-height: 1.15; }
.slot-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; min-height: 22px; }
.slot-meta .ui { width: 14px; height: 14px; color: var(--green); }
.slot-card.done { background: rgba(255,255,255,.8); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.mini { gap: 3px; justify-content: center; }
.chip {
  display: inline-flex; flex-direction: column; justify-content: center; min-height: 30px; padding: 4px 10px; border-radius: 8px;
  font-family: var(--font-cond); font-weight: 700; font-size: 15px; background: var(--rc, var(--blue)); color: var(--rt, #fff); line-height: 1.1; text-decoration: none;
}
a.chip { min-width: 52px; min-height: 36px; align-items: center; box-shadow: 0 2px 0 rgba(0,0,0,.15); }
a.chip:active { transform: translateY(1px); box-shadow: none; }
.route-hint { margin: 2px 0 0; }
.chip small { font-family: var(--font); font-weight: 500; font-size: 11px; opacity: .85; display: none; }
.chips.mini .chip { min-height: 0; padding: 2px 5px; font-size: 11px; border-radius: 5px; }
.chip.more { background: var(--paper-d); color: var(--muted); }

.prize-teaser { display: flex; gap: 14px; align-items: center; margin: 16px; padding: 16px; border-radius: var(--r); background: var(--paper); text-decoration: none; border: 1px solid var(--paper-d); }
.prize-teaser .ico.big { color: var(--red); }
.prize-teaser b { display: block; font-size: 17px; }
.prize-teaser span { font-size: 14px; color: var(--muted); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 16px; }
.card h2 { font-size: 17px; margin-bottom: 8px; }
.card p { margin: 6px 0; color: var(--muted); }
.install-card { display: flex; gap: 8px; align-items: flex-start; background: #FFFBE0; border-color: #F2E39A; }
.install-card b { font-size: 16px; }
.small { font-size: 13px; color: var(--muted); }
.ios-share { display: inline-block; width: 14px; height: 16px; vertical-align: -2px; background: currentColor; -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 16"><path d="M7 0l3.5 3.5-1 1L7.7 2.7V10H6.3V2.7L4.5 4.5l-1-1zM1 6h3v1.4H2.4v7.2h9.2V7.4H10V6h3v10H1z"/></svg>') center/contain no-repeat; mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 16"><path d="M7 0l3.5 3.5-1 1L7.7 2.7V10H6.3V2.7L4.5 4.5l-1-1zM1 6h3v1.4H2.4v7.2h9.2V7.4H10V6h3v10H1z"/></svg>') center/contain no-repeat; }

/* ── local ─────────────────────────────────────────────────── */
.place, .settings, .prize { padding: 12px 20px 20px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); text-decoration: none; font-weight: 700; min-height: 44px; margin-left: -6px; }
.back .ui { width: 20px; height: 20px; }
.place-art {
  position: relative; border-radius: 20px; background: var(--paper); aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; margin: 6px 0 18px;
  background-image: repeating-radial-gradient(circle at 50% 120%, transparent 0 14px, rgba(0,63,143,.04) 14px 15px);
}
.place-art .slot { width: 150px; height: 150px; }
.place-stamp { transform: rotate(var(--tilt)); }
.place-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.has-photo .place-stamp { position: absolute; right: 10px; bottom: 6px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.place-title { font-size: 30px; font-weight: 900; }
.badge-verify { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: #FFF1C2; color: #7A5A00; }
.place-desc { font-size: 17px; color: #33445C; margin: 10px 0 20px; }
.hint { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.stamped-on { display: flex; align-items: center; gap: 8px; color: var(--green); font-weight: 700; }
.section-title { font-size: 20px; font-weight: 900; margin: 30px 0 6px; }
.stop { display: flex; gap: 6px; align-items: center; color: var(--muted); margin: 0 0 14px; font-size: 15px; }
.stop .ui { width: 18px; height: 18px; }
.route-group { margin-bottom: 14px; }
.route-kind { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }

/* ── folha modal ───────────────────────────────────────────── */
#sheet { position: fixed; inset: 0; z-index: 100; }
#sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5,20,40,.55); opacity: 0; transition: opacity .25s; }
.sheet-card {
  position: absolute; left: 50%; bottom: 0; width: 100%; max-width: 540px; max-height: 90dvh; overflow: auto;
  background: #fff; border-radius: 24px 24px 0 0; padding: 26px 22px calc(24px + var(--safe-b));
  transform: translate(-50%, 100%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
#sheet.open .sheet-backdrop { opacity: 1; }
#sheet.open .sheet-card { transform: translate(-50%, 0); }
.sheet-x { position: absolute; top: 10px; right: 10px; color: var(--muted); }
.sheet-card h2 { font-size: 24px; font-weight: 900; margin: 6px 40px 10px 0; }
.sheet-card p { font-size: 16px; color: #33445C; }
.sheet-card .kicker { color: var(--blue); }
.locating { text-align: center; padding: 30px 0; }
.radar { width: 80px; height: 80px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; color: var(--blue); background: #E8F1FA; animation: pulse 1.3s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0,63,143,.4); } 100% { box-shadow: 0 0 0 26px rgba(0,63,143,0); } }
.far { text-align: center; }
.far .ico.big { color: var(--blue); margin: 0 auto 8px; }
.far h2 { margin-right: 0; }
.far .btn-row { justify-content: center; }
.celebrate { text-align: center; background: var(--paper); }
.celebrate h2 { margin: 6px 0; font-size: 32px; color: var(--blue); }
.stamp-drop { display: grid; place-items: center; margin: 4px auto 6px; animation: thud .55s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes thud { 0% { transform: scale(2.4) rotate(-20deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(-8deg); } }
.muted { color: var(--muted) !important; }
.sheet-card.wide { padding-top: 20px; }
.postcard-preview { width: 100%; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }

/* ── mapa ──────────────────────────────────────────────────── */
.view-map { padding-bottom: 0; }
.map { height: calc(100dvh - 58px - var(--tab-h) - var(--safe-b) - var(--safe-t)); width: 100%; background: #e9eef3; }
.pin { cursor: pointer; padding: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--blue); border: 3px solid var(--blue); font-weight: 900; font-size: 15px; box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.pin.done { background: var(--ink); border-color: #fff; color: #fff; }
.pin .ui { width: 18px; height: 18px; }
.me { width: 20px; height: 20px; border-radius: 50%; background: #1E88E5; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(30,136,229,.25); }
.pop { display: block; text-decoration: none; font-family: var(--font); min-width: 170px; }
.pop b { display: block; font-size: 15px; margin-bottom: 6px; }
.pop .chips.mini { justify-content: flex-start; }
.pop-go { display: block; margin-top: 8px; color: var(--blue); font-weight: 700; }
.fab { position: fixed; z-index: 40; right: max(16px, calc(50% - 270px + 16px)); bottom: calc(var(--tab-h) + var(--safe-b) + 16px); display: flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; background: #fff; color: var(--blue); padding: 12px 16px; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.maplibregl-popup-content { border-radius: 12px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.maplibregl-map { font-family: var(--font); }

/* ── advento ───────────────────────────────────────────────── */
.advent-head { position: relative; padding: 50px 20px 22px; color: #fff; background: radial-gradient(120% 120% at 0% 0%, #2E8A2A, #1F6B1C 55%, #134912); overflow: hidden; }
.advent-head h1 { font-size: 32px; font-weight: 900; }
.advent-head p { margin: 8px 0 0; color: rgba(255,255,255,.85); }
.advent-status { display: inline-block; margin-top: 14px !important; background: rgba(255,255,255,.14); padding: 6px 12px; border-radius: 999px; font-weight: 700; color: #fff !important; font-size: 14px; }
.gold-row { display: flex; gap: 12px; align-items: center; margin-top: 16px; background: rgba(0,0,0,.18); border-radius: 14px; padding: 10px; }
.gold-row p { margin: 2px 0 0; font-size: 14px; }
.advent-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 16px; background: #0B2545; background-image: radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,.4) 50%, transparent 51%), radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,.3) 50%, transparent 51%); background-size: 120px 140px; }
.door {
  position: relative; aspect-ratio: 1; border: 0; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(160deg, #E30613, #B0040E); color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.15), 0 3px 0 rgba(0,0,0,.3);
  transition: transform .15s;
}
.door:nth-child(3n) { background: linear-gradient(160deg, #2E8A2A, #1F6B1C); }
.door:nth-child(4n+1) { background: linear-gradient(160deg, var(--blue), var(--blue-d)); }
.door.wide { grid-column: span 2; aspect-ratio: auto; }
.door-num { font-family: var(--font); font-weight: 900; font-size: 26px; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.door.ready { box-shadow: inset 0 0 0 2px var(--yellow), 0 0 18px rgba(251,215,0,.55), 0 3px 0 rgba(0,0,0,.3); animation: ready 2s ease-in-out infinite; }
@keyframes ready { 50% { box-shadow: inset 0 0 0 2px var(--yellow), 0 0 4px rgba(251,215,0,.2), 0 3px 0 rgba(0,0,0,.3); } }
.door.locked { filter: saturate(.5) brightness(.75); }
.door-lock { position: absolute; right: 6px; bottom: 6px; width: 14px; height: 14px; opacity: .7; }
.door.opened { background: var(--paper) !important; color: var(--ink); box-shadow: inset 0 0 0 2px rgba(11,37,69,.1); }
.door.opened .door-num { position: absolute; top: 6px; left: 8px; font-size: 14px; text-shadow: none; color: var(--muted); }
.door-ico { width: 30px; height: 30px; color: var(--red); }
.door:active { transform: scale(.95); }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.q { font-weight: 700; font-size: 18px !important; color: var(--ink) !important; }
.quiz { display: grid; gap: 8px; margin: 12px 0; }
.quiz-opt { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 14px; font-weight: 700; text-align: left; font-size: 16px; }
.quiz-opt.right { border-color: var(--green); background: #E6F5EE; color: var(--green); }
.quiz-opt.wrong { border-color: var(--red); background: #FCEBEE; color: var(--red); animation: shake .4s; }
.quiz-opt:disabled { cursor: default; }
.quiz-msg b { color: var(--green); }
.mini-place { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--paper); text-decoration: none; margin: 12px 0 16px; }
.mini-place b { display: block; margin-bottom: 4px; }
.mini-place .chips.mini { justify-content: flex-start; }
.mini-stamp { width: 64px; height: 64px; display: grid; place-items: center; flex: none; }
.mini-stamp > .ico { width: 36px; height: 36px; }
.t-challenge .btn, .finale .btn { width: 100%; }
.finale { position: relative; text-align: center; padding-top: 34px; }

/* ── álbum ─────────────────────────────────────────────────── */
.album-head { padding: 22px 20px 6px; }
.album-head h1 { font-size: 30px; font-weight: 900; }
.album-head p { color: var(--muted); margin: 8px 0 14px; }
.album-head .btn { width: 100%; }
.empty { text-align: center; color: var(--muted); padding: 30px 30px; }
.empty .ico.big { color: var(--paper-d); width: 64px; height: 64px; margin: 0 auto 8px; }
.album-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 16px 18px; }
.polaroid { background: var(--paper); padding: 8px 8px 0; border-radius: 6px; box-shadow: 0 6px 16px rgba(11,37,69,.14); text-decoration: none; transform: rotate(var(--tilt)); }
.polaroid-img { position: relative; aspect-ratio: 1; background: var(--paper-d); border-radius: 3px; overflow: hidden; display: grid; place-items: center; }
.polaroid-img img { width: 100%; height: 100%; object-fit: cover; }
.no-photo { position: absolute; top: 6px; left: 6px; z-index: 1; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 6px; border-radius: 999px; background: #fff; color: var(--blue); font-size: 11px; font-weight: 700; }
.no-photo .ui { width: 14px; height: 14px; }
.empty-img .polaroid-stamp { position: static; transform: rotate(-8deg); opacity: 1; margin-top: 10px; }
.polaroid-stamp { position: absolute; right: 2px; bottom: 2px; transform: rotate(-12deg); opacity: .92; }
.polaroid-cap { font-family: var(--font-cond); font-weight: 700; text-align: center; padding: 8px 0 10px; font-size: 15px; }

/* ── prémio ────────────────────────────────────────────────── */
.prize { position: relative; text-align: center; min-height: calc(100dvh - 58px); }
.prize .back { position: absolute; left: 20px; top: 12px; }
.prize.won { background: radial-gradient(120% 80% at 50% 0%, #1F5BA8, var(--blue-d) 60%, var(--navy)); color: #fff; }
.prize.won .back { color: #fff; }
.prize.won .lights { top: 44px; }
.sock-art { width: 150px; height: 180px; margin: 56px auto 10px; transform: rotate(-10deg); filter: drop-shadow(0 12px 20px rgba(0,0,0,.25)); animation: float 5s ease-in-out infinite; }
.prize h1 { font-size: 30px; font-weight: 900; }
.prize .lead { font-size: 18px; }
.prize.won .small { color: rgba(255,255,255,.8); }
.code-box { margin: 20px auto; max-width: 340px; background: #fff; color: var(--ink); border-radius: 16px; padding: 16px; box-shadow: 0 0 0 4px var(--yellow); }
.code-box span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; }
.code-box b { display: block; font-family: var(--font-cond); font-size: min(30px, calc((100vw - 76px) * .115)); letter-spacing: .06em; margin-top: 4px; white-space: nowrap; }
.prize .progress { max-width: 320px; margin: 18px auto 8px; }
.prize .btn { margin-top: 10px; }

/* ── definições ────────────────────────────────────────────── */
.settings h1 { font-size: 30px; font-weight: 900; margin: 4px 0 6px; }
.settings .card { margin: 14px 0; }
.seg { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 4px; }
.seg button.on { background: var(--blue); color: #fff; }
.credits { text-align: center; color: var(--muted); font-size: 13px; margin-top: 24px; }

/* ── toast ─────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 18px); transform: translate(-50%, 20px); opacity: 0; z-index: 200; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 15px; transition: .3s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── instalar ──────────────────────────────────────────────── */
.install-pill { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--yellow); color: var(--navy); font-weight: 700; font-size: 14px; padding: 8px 14px 8px 10px; border-radius: 999px; box-shadow: 0 2px 0 var(--yellow-d); }
.install-pill .ui { width: 18px; height: 18px; }
.btn-outline-light { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); }
.install-card .btn { margin-top: 8px; }
.install-sheet { text-align: center; }
.install-icon { margin: 4px auto 12px; border-radius: 18px; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.install-sheet h2 { margin-right: 0 !important; }
.steps { text-align: left; counter-reset: s; list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; background: var(--bg); border-radius: 14px; padding: 12px 14px; font-size: 16px; line-height: 1.35; }
.steps li::before { content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 900; }
.steps .ios-share { color: var(--blue); width: 16px; height: 19px; }

/* ── regulamento ───────────────────────────────────────────── */
.rules { padding: 12px 20px 20px; max-width: 680px; }
.rules h1 { font-size: 30px; font-weight: 900; margin: 4px 0 6px; }
.rules-sub { color: var(--muted); margin: 0 0 8px; }
.rules section { border-top: 1px solid var(--line); padding: 14px 0 4px; }
.rules h2 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.rules h2 span { color: var(--blue); }
.rules p { margin: 6px 0; color: #33445C; font-size: 15px; }
.cover-rules { text-align: center; color: rgba(255,255,255,.8); font-size: 14px; }
.rules-link { display: inline-block; margin-top: 14px; font-size: 14px; font-weight: 700; color: inherit; opacity: .85; }
.card-link { display: block; text-decoration: none; }
.card-link h2::after { content: " ›"; color: var(--blue); }

/* Carimbo oficial: tinta da cor do local sobre papel; sobre fotos usa a versão negativa (branco sobre azul-noite) */
.stamp { color: var(--ink); fill: currentColor; overflow: visible; }
.stamp .stamp-bg { fill: none; }
.has-photo .place-stamp .stamp, .polaroid-img img ~ .polaroid-stamp .stamp { color: #fff; }
.has-photo .place-stamp .stamp .stamp-bg, .polaroid-img img ~ .polaroid-stamp .stamp .stamp-bg { fill: #06183A; }
.help-line { margin-top: 10px; }
.help-line a, .rules a[href^="mailto:"] { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.prize.won .help-line a { color: var(--yellow); }
/* aviso da 1.ª utilização */
.save-tip { text-align: center; }
.save-tip h2 { margin-right: 0 !important; }
.save-tip-ico { width: 56px; height: 56px; margin: 4px auto 10px; border-radius: 50%; background: var(--yellow); color: var(--blue); display: grid; place-items: center; }
.save-tip-ico svg { width: 28px; height: 28px; }
.save-tip-list { list-style: none; padding: 0; margin: 16px 0 4px; text-align: left; display: grid; gap: 10px; }
.save-tip-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: #EEF3FA; font-size: 15px; line-height: 1.4; }
.save-tip-list li.dont { background: #FDECEC; }
.save-tip-list i { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 13px; color: #fff; background: #1E8E3E; }
.save-tip-list li.dont i { background: #E30613; }
/* código do prémio a chegar do servidor */
.code-wait p { margin: 8px 0 2px; font-size: 15px; line-height: 1.4; color: var(--ink); }
.spin { display: inline-block; width: 16px; height: 16px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; vertical-align: -3px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.demo-code { display: inline-block; margin: -6px 0 12px; padding: 6px 12px; border-radius: 999px; background: var(--yellow); color: var(--navy); font-size: 14px; font-weight: 700; }

/* Aviso de métricas (analytics.js) */
.consent { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); z-index: 150; max-width: 520px; margin: 0 auto;
  background: var(--navy); color: #fff; border-radius: var(--r); padding: 14px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.consent p { margin: 0 0 10px; font-size: 14px; line-height: 1.4; }
.consent a { color: var(--yellow); }
.consent .btn-row { gap: 8px; justify-content: flex-end; margin: 0; }
.consent .btn-ghost { color: #fff; }
