/* Tema per carburante: benzina verde, gasolio giallo, GPL blu, metano viola */
:root, [data-fuel="1"] {
  --accent: #0e8a55; --deep: #075235; --soft: #dcf4e7; --bg: #f1faf5; --on: #ffffff; --shadow: rgba(14,138,85,.28);
}
[data-fuel="2"] { --accent: #f4b400; --deep: #5a4100; --soft: #fff0bf; --bg: #fffaea; --on: #2b2100; --shadow: rgba(200,140,0,.28); }
[data-fuel="4"] { --accent: #1f62d8; --deep: #0e347a; --soft: #dde8fc; --bg: #f3f7ff; --on: #ffffff; --shadow: rgba(31,98,216,.28); }
[data-fuel="3"] { --accent: #7b3fe4; --deep: #45198f; --soft: #ece3fd; --bg: #f8f4ff; --on: #ffffff; --shadow: rgba(123,63,228,.28); }
:root {
  --ink: #1d1a24;
  --ink-2: #3d3848;
  --muted: #6a6475;
  --line: #ece8f1;
  --chip: #f3f0f6;
  --card: #ffffff;
  --good: #0b6a3a; --good-bg: #dff5e8;
  --bad: #a3261d;  --bad-bg: #fde7e5;
  --radius: 20px;
  --display: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --pump: var(--deep);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: background-color .3s;
  padding-bottom: calc(env(safe-area-inset-bottom) + 78px);
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.mascot, svg.coin-ico { stroke: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  padding: calc(env(safe-area-inset-top) + 14px) 16px 12px;
  transition: background-color .3s;
}
.top-row { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font: 800 24px/1 var(--display); color: var(--deep); }
.logo { width: 40px; height: 40px; border-radius: 14px; background: var(--accent); color: var(--on); display: grid; place-items: center; transition: background-color .3s; }
.logo svg { width: 22px; height: 22px; }
.logo.inv { background: #fff; color: #075235; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; border: 0;
  background: #fff; color: var(--deep); display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(40,20,60,.08);
}
.icon-btn.spin svg { animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

.place {
  margin-top: 10px; max-width: 100%;
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 0; padding: 8px 14px 8px 10px; border-radius: 999px;
  font-size: 14px; font-weight: 700; color: var(--ink-2);
  box-shadow: 0 2px 8px rgba(40,20,60,.06);
}
.place span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place .pin-ico { width: 17px; height: 17px; color: var(--accent); stroke-width: 2.4; }
.place .chev { width: 15px; height: 15px; color: #8a8494; stroke-width: 2.4; }

.fuels { margin-top: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fuels button {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; border-radius: 16px; border: 2px solid var(--line); background: #fff;
  font-size: 14px; font-weight: 800; color: var(--ink-2); transition: all .2s; padding: 0 4px;
}
.fuels i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.fuels button.on { border-color: transparent; background: var(--c); color: var(--c-on); box-shadow: 0 6px 14px var(--c-sh); }
.fuels button.on i { background: var(--c-on); }

/* Main */
main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 16px 16px; }

.hero {
  position: relative; height: 206px; margin-top: 18px;
  border-radius: 26px; color: var(--on);
  background-color: var(--accent);
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255,255,255,.16) 0 9px, transparent 10px),
    radial-gradient(circle at 36% 88%, rgba(255,255,255,.12) 0 6px, transparent 7px),
    radial-gradient(circle at 62% 12%, rgba(255,255,255,.14) 0 5px, transparent 6px),
    radial-gradient(circle at 92% 70%, rgba(255,255,255,.10) 0 12px, transparent 13px);
  box-shadow: 0 10px 24px var(--shadow);
  transition: background-color .3s, box-shadow .3s;
}
.hero-txt { position: absolute; left: 20px; top: 16px; display: flex; flex-direction: column; gap: 2px; max-width: 58%; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .88; }
.hero-price { display: flex; align-items: baseline; gap: 4px; }
.hero-price strong { font: 800 50px/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-price span { font-size: 15px; font-weight: 800; opacity: .9; }
.hero-where { font-size: 14px; font-weight: 700; opacity: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-pig { position: absolute; right: -8px; top: -30px; width: 190px; height: 143px; --pump: var(--deep); }
.hero-stats { position: absolute; left: 14px; right: 14px; bottom: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { border-radius: 16px; padding: 8px 12px; min-width: 0; }
.stat span { display: block; font-size: 12px; font-weight: 700; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b { display: block; font: 700 20px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.stat.glass { background: rgba(255,255,255,.2); }
.stat.white { background: #fff; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.stat.white span { color: #5b5566; opacity: 1; }
.stat.white b { color: var(--deep); font-weight: 800; }
.coin-ico { width: 28px; height: 28px; flex: none; }
.coin-ico.big { width: 40px; height: 40px; }

.filters { margin-top: 16px; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.seg { display: flex; background: #fff; border-radius: 999px; padding: 4px; box-shadow: 0 2px 8px rgba(40,20,60,.06); flex: none; }
.seg button { border: 0; border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 700; background: transparent; color: #5b5566; }
.seg button.on { background: var(--soft); color: var(--deep); font-weight: 800; }
.chips { display: flex; gap: 5px; }
.chips button {
  border: 2px solid transparent; border-radius: 999px; padding: 6px 10px;
  font-size: 14px; font-weight: 700; background: #fff; color: #5b5566; white-space: nowrap;
}
.chips button.on { border-color: var(--accent); color: var(--deep); font-weight: 800; }

.sec-head { margin: 18px 2px 0; display: flex; justify-content: space-between; align-items: center; }
.sec-head h2 { margin: 0; font: 800 20px/1.1 var(--display); }
.sort select {
  border: 0; background: transparent; font-size: 14px; font-weight: 800; color: var(--deep);
  padding: 6px 2px; appearance: none; -webkit-appearance: none; text-align: right;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 0 center, right -5px center; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 14px;
}
.count { margin: 2px 2px 10px; font-size: 13px; font-weight: 700; color: var(--muted); }

/* Lista */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: 0 3px 12px rgba(40,20,60,.06); border: 2.5px solid transparent; width: 100%; text-align: left;
}
.card.best { border-color: var(--accent); }
.medal {
  width: 38px; height: 38px; flex: none; border-radius: 50%; border: 3px solid #d8d3de;
  display: grid; place-items: center; font: 800 17px/1 var(--display); background: var(--chip); color: #5b5566;
}
.medal.m1 { background: #f5c542; border-color: #c98a0c; color: #6b4500; }
.medal.m2 { background: #dfe4e9; border-color: #98a3ad; color: #3d464e; }
.medal.m3 { background: #ebb98f; border-color: #b67742; color: #5a3310; }
.c-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.c-brand { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 5px; }
.c-brand .star { width: 15px; height: 15px; fill: #f5c542; stroke: #c98a0c; stroke-width: 1.5; }
.c-name { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-tags { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 700; background: var(--chip); color: #4d4758; padding: 2px 8px; border-radius: 8px; }
.tag.old { background: #fff1dc; color: #8a4b00; }
.c-price { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.c-price b { font: 800 25px/1 var(--display); font-variant-numeric: tabular-nums; }
.diff { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 8px; white-space: nowrap; background: var(--chip); color: #5b5566; }
.diff.good { background: var(--good-bg); color: var(--good); }
.diff.bad { background: var(--bad-bg); color: var(--bad); }

/* Mappa */
.map { height: calc(100dvh - 380px); min-height: 360px; border-radius: 24px; overflow: hidden; box-shadow: 0 6px 20px rgba(40,20,60,.12); margin-top: 16px; }
.mpin { display: inline-flex; flex-direction: column; align-items: center; transform: translate(-50%, -100%); }
.mpin span {
  background: #fff; color: var(--ink); border: 2.5px solid var(--accent); border-radius: 12px;
  padding: 2px 8px 0; font: 800 14px/1.3 var(--display); white-space: nowrap; box-shadow: 0 4px 10px rgba(40,20,60,.18);
  display: inline-flex; align-items: center; gap: 4px;
}
.mpin::after { content: ""; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 8px solid var(--accent); margin-top: -1px; }
.mpin.best span { background: var(--accent); color: var(--on); border-color: #fff; font-size: 16px; box-shadow: 0 6px 14px var(--shadow); }
.mpin.best::after { border-top-color: #fff; }
.mpin.best svg { width: 16px; height: 16px; stroke: none; }
.dot { display: block; width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.dot.lo { background: #11804a; } .dot.mid { background: #d18a00; } .dot.hi { background: #c0392b; }
.me { display: block; width: 22px; height: 22px; border-radius: 50%; background: #2b7de9; border: 4px solid #fff; transform: translate(-50%, -50%); box-shadow: 0 0 0 10px rgba(43,125,233,.22); }
.leaflet-div-icon { background: none !important; border: 0 !important; }

/* Stati */
.state { text-align: center; color: var(--muted); padding: 28px 16px; }
.state svg.mascot { width: 180px; height: 135px; display: block; margin: 0 auto 8px; }
.state h3 { color: var(--ink); margin: 0 0 6px; font: 800 21px/1.2 var(--display); }
.state p { margin: 0 auto; max-width: 300px; }
.state .btn { margin: 14px 4px 0; }
.skel { height: 78px; border-radius: var(--radius); background: linear-gradient(90deg, #fff 0%, var(--soft) 50%, #fff 100%); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 16px 16px; max-width: 640px; margin: 0 auto; }
.foot a { color: inherit; }

/* Barra in basso */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 10px);
}
.tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--muted); padding: 0; }
.tb-ico { padding: 4px 18px; border-radius: 999px; display: grid; place-items: center; transition: background-color .2s; }
.tb-ico svg { width: 22px; height: 22px; }
.tabbar button.on { color: var(--deep); font-weight: 800; }
.tabbar button.on .tb-ico { background: var(--soft); }

/* Bottoni */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; background: #fff; color: var(--ink);
  min-height: 48px; padding: 0 18px; border-radius: 16px; font-weight: 800; font-size: 15px; text-decoration: none;
}
.btn.primary { background: var(--accent); color: var(--on); box-shadow: 0 8px 18px var(--shadow); }
.btn.soft { background: var(--soft); color: var(--deep); }
.btn.wide { width: 100%; }

/* Bottom sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(20,10,30,.45); z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  max-width: 640px; margin: 0 auto;
  background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 8px 18px calc(env(safe-area-inset-bottom) + 18px);
  max-height: 90dvh; overflow-y: auto;
  animation: up .24s ease-out;
}
@keyframes up { from { transform: translateY(100%); } }
.grab { width: 42px; height: 5px; border-radius: 3px; background: #d8d3de; margin: 4px auto 12px; }
.grab.light { background: rgba(255,255,255,.5); }
#placeSheet h2 { margin: 0 0 14px; font: 800 22px/1.2 var(--display); }

.sheet.station { padding: 0 0 calc(env(safe-area-inset-bottom) + 18px); }
.sh-top {
  position: relative; color: var(--on); padding: 8px 20px 20px; min-height: 250px;
  background-color: var(--accent);
  background-image: radial-gradient(circle at 14% 78%, rgba(255,255,255,.12) 0 12px, transparent 13px), radial-gradient(circle at 70% 18%, rgba(255,255,255,.10) 0 20px, transparent 21px);
  border-radius: 26px 26px 30px 30px;
}
.sh-row { display: flex; justify-content: space-between; align-items: center; }
.sh-brand { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.sh-top h2 { margin: 4px 0 2px; font: 800 28px/1.05 var(--display); max-width: 75%; }
.sh-addr { margin: 0; font-size: 14px; font-weight: 600; opacity: .92; max-width: 70%; }
.sh-fuel { margin: 14px 0 0; font-size: 13px; font-weight: 800; opacity: .85; }
.sh-price { display: flex; align-items: baseline; gap: 6px; }
.sh-price strong { font: 800 56px/.95 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sh-price span { font-size: 16px; font-weight: 800; opacity: .9; }
.sh-pig { position: absolute; right: 4px; bottom: 8px; width: 160px; height: 120px; --pump: var(--deep); }
.fav svg { color: #8a8494; }
.fav.on svg { fill: #f5c542; stroke: #c98a0c; color: #c98a0c; }
.sh-save {
  margin: -22px 16px 0; position: relative; background: #fff; border-radius: 20px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 24px rgba(40,20,60,.12);
}
.sh-save div { flex: 1; min-width: 0; }
.sh-save span:not(.diff) { display: block; font-size: 13px; font-weight: 700; color: #5b5566; }
.sh-save b { display: block; font: 800 20px/1.15 var(--display); color: var(--deep); }
.sh-prices { margin: 14px 16px 0; background: #fff; border-radius: 20px; padding: 4px 14px; box-shadow: 0 3px 12px rgba(40,20,60,.06); }
.pr { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #efecf3; }
.pr:last-child { border-bottom: 0; }
.pr i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #3d3848; }
.pr .n { flex: 1; font-weight: 700; }
.pr .n small { color: var(--muted); font-weight: 600; font-size: 14px; }
.pr b { font: 800 18px/1 var(--display); font-variant-numeric: tabular-nums; }
.pr.sel { background: var(--soft); margin: 0 -10px; padding: 10px; border-radius: 14px; border-bottom-color: transparent; color: var(--deep); }
.sh-meta { color: var(--muted); font-size: 12px; font-weight: 600; margin: 10px 22px 14px; }
.sh-actions { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; margin: 0 16px; }
.sh-actions .btn { min-height: 56px; border-radius: 18px; font-size: 16px; }
.sh-actions:has(#shCall[hidden]) #shNav { grid-column: 1 / -1; }

.search { display: flex; gap: 8px; margin-top: 12px; }
.search input { flex: 1; min-width: 0; border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 11px 14px; }
.search input:focus { outline: none; border-color: var(--accent); }
.results { list-style: none; padding: 0; margin: 10px 0 0; }
.results button { width: 100%; text-align: left; border: 0; background: none; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }

/* Benvenuto */
.welcome {
  position: fixed; inset: 0; z-index: 70; overflow-y: auto;
  color: #fff; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 36px) 28px calc(env(safe-area-inset-bottom) + 28px);
  background-color: #0e8a55;
  background-image:
    radial-gradient(circle at 10% 12%, rgba(255,255,255,.14) 0 14px, transparent 15px),
    radial-gradient(circle at 86% 8%, rgba(255,255,255,.10) 0 22px, transparent 23px),
    radial-gradient(circle at 78% 34%, rgba(255,255,255,.12) 0 8px, transparent 9px),
    radial-gradient(circle at 18% 44%, rgba(255,255,255,.10) 0 10px, transparent 11px),
    radial-gradient(circle at 92% 58%, rgba(255,255,255,.08) 0 16px, transparent 17px);
}
.welcome > * { max-width: 480px; width: 100%; margin-left: auto; margin-right: auto; }
.w-brand { display: flex; align-items: center; gap: 10px; font: 800 24px/1 var(--display); }
.w-art { position: relative; height: 270px; display: grid; place-items: center; margin-top: 16px; flex: none; }
.ring { position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.r1 { width: 280px; height: 280px; } .r2 { width: 200px; height: 200px; }
.w-pig { position: relative; width: 310px; height: 233px; --pump: #075235; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.welcome h1 { margin: 12px auto 8px; font: 800 38px/1.02 var(--display); letter-spacing: -.01em; }
.welcome p { margin: 0 auto; font-size: 16px; line-height: 1.45; color: #e3f7ec; }
.w-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.w-tags span { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.16); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.w-tags i { width: 10px; height: 10px; border-radius: 50%; }
.w-actions { margin-top: auto; padding-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.w-main { min-height: 58px; border-radius: 20px; background: #fff; color: #075235; font-size: 17px; box-shadow: 0 10px 22px rgba(0,40,20,.25); }
.w-main svg { stroke-width: 2.4; }
.w-ghost { min-height: 48px; background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.55); }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 92px); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 700; z-index: 80;
  max-width: calc(100% - 32px);
}

@media (min-width: 640px) {
  .top { padding-left: max(16px, calc(50% - 304px)); padding-right: max(16px, calc(50% - 304px)); }
  .tabbar { padding-left: max(16px, calc(50% - 304px)); padding-right: max(16px, calc(50% - 304px)); }
}
@media (max-width: 360px) {
  .fuels button { font-size: 13px; gap: 4px; }
  .fuels i { display: none; }
  .hero-price strong { font-size: 42px; }
  .chips button { padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
.seg.off { visibility: hidden; }
html, body { overflow-x: clip; }
.filters { min-width: 0; }
.chips { align-items: center; min-width: 0; }
.chips button { min-width: 38px; padding: 6px 8px; }
.chips .km { font-size: 13px; font-weight: 800; color: var(--muted); margin-left: 2px; }

/* --- v3: correzione larghezza (un nome lungo allargava la colonna della lista) --- */
.list { grid-template-columns: minmax(0, 1fr); }
.list > li { min-width: 0; }
.card { min-width: 0; max-width: 100%; }
.c-price { flex: none; }

/* Logo PigFull */
.logo svg.pighead { width: 30px; height: 30px; stroke: none; }
.brand em, .w-brand em { font-style: normal; color: var(--accent); }
.w-brand em { color: #bff3d6; }
[data-fuel="2"] .brand em { color: #c98f00; }

/* Podio: coppa d'oro con stelline, medaglie d'argento e di bronzo */
.rank { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.rank svg { width: 44px; height: 44px; stroke: none; overflow: visible; }
.rank.plain { width: 38px; height: 38px; margin: 0 3px; border-radius: 50%; border: 3px solid #d8d3de; background: var(--chip); color: #5b5566; font: 800 17px/1 var(--display); }
.spark { position: absolute; left: 50%; top: 40%; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: #f5c542;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0; animation: burst 2.4s ease-out infinite; pointer-events: none; }
.spark:nth-child(2) { --dx: -24px; --dy: -20px; animation-delay: .05s; }
.spark:nth-child(3) { --dx: 24px;  --dy: -22px; animation-delay: .12s; background: #ffe58a; }
.spark:nth-child(4) { --dx: -26px; --dy: 10px;  animation-delay: .2s; width: 7px; height: 7px; }
.spark:nth-child(5) { --dx: 26px;  --dy: 12px;  animation-delay: .28s; width: 8px; height: 8px; background: #ffe58a; }
.spark:nth-child(6) { --dx: 0px;   --dy: -30px; animation-delay: .16s; width: 8px; height: 8px; }
@keyframes burst {
  0%   { opacity: 0; transform: translate(0, 0) scale(.2) rotate(0); }
  12%  { opacity: 1; }
  45%  { opacity: 1; transform: translate(var(--dx), var(--dy)) scale(1) rotate(90deg); }
  60%, 100% { opacity: 0; transform: translate(calc(var(--dx) * 1.2), calc(var(--dy) * 1.2)) scale(.4) rotate(140deg); }
}
.rank.gold svg { animation: wiggle 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes wiggle { 0%, 60%, 100% { transform: rotate(0); } 8% { transform: rotate(-8deg) scale(1.08); } 16% { transform: rotate(7deg) scale(1.08); } 24% { transform: rotate(0) scale(1); } }

/* Invito a installare */
.install {
  position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 88px); z-index: 35;
  max-width: 616px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 22px; padding: 12px 10px 12px 12px;
  box-shadow: 0 12px 30px rgba(40,20,60,.2); animation: up .35s ease-out;
}
.install .logo { flex: none; }
.ins-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ins-txt b { font: 800 17px/1.2 var(--display); }
.ins-txt span { font-size: 13px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.install .btn { min-height: 44px; padding: 0 16px; flex: none; }
.ins-x { flex: none; width: 36px; height: 44px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.ios-steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; }
.ios-steps li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.ios-steps .n { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--soft); color: var(--deep); display: grid; place-items: center; font: 800 16px/1 var(--display); }
.ios-ico { width: 18px; height: 18px; vertical-align: -3px; color: #2b7de9; }
#iosSheet h2 { margin: 0 0 16px; font: 800 22px/1.2 var(--display); }

/* --- v4: bottoni sempre visibili (schermi Android bassi, anziani) --- */
.sheet.station { padding-bottom: 0; }
.sh-top { min-height: 0; padding: 6px 18px 30px; }
.sh-top h2 { font-size: 23px; margin-top: 2px; }
.sh-addr { font-size: 13px; }
.sh-fuel { margin-top: 8px; }
.sh-price strong { font-size: 44px; }
.sh-pig { width: 124px; height: 93px; bottom: 26px; right: 2px; }
.sh-save { padding: 10px 12px; }
.sh-save b { font-size: 18px; }
.coin-ico.big { width: 34px; height: 34px; }
.pr { padding: 8px 0; }
.sh-meta { margin-bottom: 8px; }
.sh-actions {
  position: sticky; bottom: 0; z-index: 2;
  margin: 0; padding: 12px 16px calc(env(safe-area-inset-bottom) + 16px);
  background: var(--bg); box-shadow: 0 -8px 18px rgba(40,20,60,.08);
}
.sh-actions .btn { min-height: 60px; font-size: 18px; border-radius: 18px; }
.sh-actions .btn svg { width: 22px; height: 22px; }

.welcome { padding-bottom: 0; }
.w-brand { flex: none; }
.w-art { height: clamp(150px, 31dvh, 270px); margin-top: 8px; }
.r1 { width: clamp(150px, 31dvh, 280px); height: clamp(150px, 31dvh, 280px); }
.r2 { width: clamp(110px, 22dvh, 200px); height: clamp(110px, 22dvh, 200px); }
.w-pig { width: auto; height: clamp(120px, 26dvh, 233px); aspect-ratio: 4 / 3; }
.welcome h1 { font-size: clamp(30px, 5dvh, 38px); margin-top: 6px; }
.welcome p { font-size: 15px; }
.w-tags { margin-top: 12px; }
.w-actions {
  position: sticky; bottom: 0; margin-top: auto; padding: 16px 0 calc(env(safe-area-inset-bottom) + 20px);
  background: linear-gradient(to bottom, rgba(14,138,85,0), #0e8a55 16px);
}
.w-main { min-height: 60px; font-size: 18px; }
.w-ghost { min-height: 52px; font-size: 16px; }

/* --- v5: attività che regala l'app ("offerto da") --- */
.top-row { gap: 10px; }
.brand { flex: none; }
.sponsor {
  flex: 1; min-width: 0; margin-right: 2px;
  display: flex; align-items: center; gap: 8px;
  border: 0; border-left: 2px solid var(--line); background: none; padding: 2px 0 2px 10px; text-align: left;
}
.sp-logo {
  width: 34px; height: 34px; flex: none; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; background: var(--sp, #b4532a); color: #fff;
  font: 800 14px/1 var(--display); box-shadow: 0 2px 6px rgba(40,20,60,.12);
}
.sp-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.sp-logo.big { width: 48px; height: 48px; border-radius: 14px; font-size: 19px; }
.sp-logo.xl { width: 64px; height: 64px; border-radius: 18px; font-size: 24px; }
.sp-txt { min-width: 0; display: flex; flex-direction: column; }
.sp-by { font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1.1; }
.sp-name { font-weight: 800; font-size: 14px; color: var(--ink); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.w-sponsor {
  flex: none; margin-top: 16px; display: flex; align-items: center; gap: 12px;
  background: #fff; color: var(--ink); border-radius: 20px; padding: 12px 14px;
  box-shadow: 0 10px 22px rgba(0,40,20,.2);
}
.w-sponsor div { min-width: 0; display: flex; flex-direction: column; }
.w-sp-by { font-size: 12px; font-weight: 700; color: #0b6a3a; }
.w-sp-by.dark { color: var(--muted); }
.w-sponsor b { font: 800 19px/1.15 var(--display); }
.w-sp-msg { font-size: 13px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.w-sponsor + .w-art { height: clamp(120px, 24dvh, 240px); }
.w-sponsor + .w-art .w-pig { height: clamp(100px, 20dvh, 205px); }
.w-sponsor + .w-art .r1 { width: clamp(120px, 24dvh, 250px); height: clamp(120px, 24dvh, 250px); }
.w-sponsor + .w-art .r2 { width: clamp(90px, 17dvh, 180px); height: clamp(90px, 17dvh, 180px); }

.sps-head { display: flex; align-items: center; gap: 14px; }
.sps-head h2 { margin: 2px 0 0; font: 800 24px/1.1 var(--display); }
.sps-tag { margin: 2px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.sps-msg { margin: 16px 0; font-size: 16px; line-height: 1.45; }
.sps-actions { display: grid; gap: 8px; margin-bottom: 8px; }
.sps-actions .btn { min-height: 54px; font-size: 16px; }
@media (max-width: 389px) {
  .hero-pig { width: 150px; height: 113px; right: -10px; top: -22px; }
  .eyebrow { font-size: 12px; }
}

/* --- v6: fascia logo dell'attività --- */
.sp-logo { color: var(--sp-ink, #fff); }
.w-sponsor { flex-wrap: wrap; }
.sp-banner { display: block; width: 100%; height: auto; border-radius: 12px; }
.w-sponsor .sp-banner { flex: 0 0 100%; margin-bottom: 2px; }
.w-sponsor .sp-banner:not([hidden]) + .sp-logo { display: none; }
.sps-banner { margin-top: 14px; }
/* biglietto da visita compatto */
.w-sponsor.has-banner { padding: 10px 12px 12px; gap: 6px; }
.w-sponsor.has-banner div { order: -1; flex: 0 0 100%; }
.w-sponsor.has-banner #wSpName, .w-sponsor.has-banner #wSpMsg { display: none; }
.w-sponsor.has-banner .w-sp-by { font-size: 12px; }
.w-sp-by { text-transform: none; }
.sheet#sponsorSheet .sps-actions { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); margin-top: 14px; }
.sheet#sponsorSheet .sps-actions .btn { padding: 0 8px; font-size: 15px; }
/* logo dell'attività grande come quello di PigFull */
.sponsor .sp-logo { width: 40px; height: 40px; border-radius: 14px; font-size: 24px; }
.sponsor { gap: 9px; }
.sp-name { font-size: 15px; }
/* aggiornamento accanto alla posizione: il nome dell'attività ha più spazio */
.place-row { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.place-row .place { margin-top: 0; min-width: 0; }
.sponsor { margin-right: 0; }
.sp-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.15; }

/* --- v7: bottone "Guidami" su ogni riga --- */
.card { display: block; padding: 12px 14px 12px; }
.card-open {
  width: 100%; display: flex; align-items: center; gap: 12px;
  border: 0; background: none; padding: 0; text-align: left; color: inherit;
}
.c-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-left: 56px; }
.c-foot .c-tags { margin-top: 0; min-width: 0; }
.guide {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 42px; padding: 0 16px; border-radius: 14px;
  background: var(--accent); color: var(--on); text-decoration: none;
  font: 800 15px/1 Nunito, system-ui, sans-serif; box-shadow: 0 4px 12px var(--shadow); border: 0; cursor: pointer;
}
.guide svg { width: 18px; height: 18px; stroke-width: 2.4; }
.guide:active { transform: scale(.97); }
@media (max-width: 380px) {
  .c-foot { padding-left: 0; }
}
/* --- v8: nella scheda il marchio del distributore è il titolo --- */
.sh-brand { font: 800 30px/1.05 var(--display); letter-spacing: -.01em; text-transform: none; opacity: 1; margin: 0; }
.sh-row { align-items: flex-start; }
.sh-top h2 { font: 700 15px/1.3 Nunito, system-ui, sans-serif; margin: 4px 0 1px; opacity: .95; max-width: 80%; }
.sh-addr { font-size: 13px; opacity: .85; }
.powered { display: block; margin-top: 8px; font-weight: 700; }
.powered a { color: var(--deep); font-weight: 800; }

/* --- v9: benvenuto con i prezzi veri della zona --- */
.w-live { flex: none; margin-top: 12px; background: #fff; color: var(--ink); border-radius: 22px; padding: 12px 14px 10px; box-shadow: 0 10px 24px rgba(0,40,20,.22); }
.w-live-head { display: flex; flex-direction: column; gap: 1px; }
.w-live-kicker { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #0b6a3a; }
.w-live-where { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.w-live-where b { color: var(--ink); }
.w-live-fuels { display: flex; gap: 6px; margin: 8px 0 4px; }
.w-live-fuels button { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.w-live-fuels button.on { background: #0e8a55; border-color: #0e8a55; color: #fff; }
.w-live-fuels button[data-wf="2"].on { background: #f4b400; border-color: #f4b400; color: #2b2100; }
.w-top { list-style: none; margin: 4px 0 0; padding: 0; }
.w-top li { border-bottom: 1px solid #eef0ee; }
.w-top li:last-child { border-bottom: 0; }
.w-top button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 0; border: 0; background: none; text-align: left; color: inherit; }
.w-top .rank, .w-top .rank svg { width: 34px; height: 34px; }
.w-top .rank.plain { width: 30px; height: 30px; font-size: 14px; }
.w-top .spark { display: none; }
.w-top .t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.w-top .t-brand { font-weight: 800; font-size: 15px; }
.w-top .t-name { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-top .t-price { font: 800 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.w-skel { height: 44px; margin: 4px 0; border-radius: 12px; background: linear-gradient(90deg, #f3f0f6 0%, #e9f6ef 50%, #f3f0f6 100%); background-size: 200% 100%; animation: sh 1.2s infinite; border: 0 !important; }
.w-live-foot { margin: 6px 0 0 !important; font-size: 12px !important; line-height: 1.35 !important; color: var(--muted) !important; }
.welcome.has-live .w-intro, .welcome.has-live .w-tags { display: none; }
.welcome.has-live .w-art { height: clamp(96px, 15dvh, 170px); margin-top: 4px; }
.welcome.has-live .w-pig { height: clamp(86px, 13dvh, 150px); }
.welcome.has-live .r1 { width: clamp(100px, 16dvh, 180px); height: clamp(100px, 16dvh, 180px); }
.welcome.has-live .r2 { width: clamp(70px, 11dvh, 130px); height: clamp(70px, 11dvh, 130px); }
.welcome.has-live h1 { font-size: clamp(28px, 4.4dvh, 36px); margin-top: 2px; }
.w-row2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.w-row2:has(#wZona:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.w-row2 .btn { min-height: 50px; font-size: 14px; padding: 0 10px; line-height: 1.2; }
.w-row2 .btn { gap: 0; }
#wZonaCity { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-height: 720px) {
  .welcome.has-live .w-art { display: none; }
  .welcome.has-live h1 { margin-top: 14px; }
}
.state .how { margin-top: 16px; font-size: 13px; line-height: 1.4; color: var(--muted); max-width: 300px; }
.sps-orari { background: #fff; border-radius: 16px; padding: 10px 14px; margin: 14px 0 0; box-shadow: 0 3px 12px rgba(40,20,60,.06); }
.sps-orari b { display: block; font: 800 15px/1.3 var(--display); margin-bottom: 4px; }
.sps-orari div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 15px; border-top: 1px solid #efecf3; }
.sps-orari div span:last-child { font-weight: 800; font-variant-numeric: tabular-nums; }

/* --- v10: tabellone a palette nel benvenuto (link senza attività) --- */
.w-board { flex: none; margin-top: 12px; background: #fff; color: var(--ink); border-radius: 22px; padding: 12px 12px 10px; box-shadow: 0 10px 24px rgba(0,40,20,.22); }
.w-board .w-live-fuels button[data-bf="2"].on { background: #f4b400; border-color: #f4b400; color: #2b2100; }
.w-board .w-live-fuels button[data-bf="1"].on { background: #0e8a55; border-color: #0e8a55; color: #fff; }
.board { margin-top: 6px; background: #17191d; border-radius: 14px; padding: 8px 6px; display: grid; gap: 5px; }
.brow { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 2px; border: 0; background: none; padding: 0; width: 100%; cursor: pointer; }
.brow:focus-visible { outline: 2px solid #f5c542; outline-offset: 2px; border-radius: 6px; }
.flap { position: relative; height: 30px; border-radius: 4px; background: linear-gradient(#2b2e34 0 49%, #202328 51% 100%); color: #f3f1ea;
  display: grid; place-items: center; font: 800 17px/1 'Nunito', system-ui, sans-serif; font-variant-numeric: tabular-nums; overflow: hidden; }
.flap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0,0,0,.55); }
.flap.gap { background: transparent; }
.flap.gap::after { display: none; }
.flap.price { color: #ffd54a; }
.flap.f { animation: flap .09s ease-in; }
@keyframes flap { 0% { transform: scaleY(1); } 50% { transform: scaleY(.15); } 100% { transform: scaleY(1); } }
@media (max-width: 370px) { .flap { height: 26px; font-size: 14px; } }
@media (max-height: 720px) { .welcome.has-live .w-art { display: none; } }
button.brand { border: 0; background: none; padding: 4px 6px 4px 0; margin: -4px 0; border-radius: 16px; cursor: pointer; text-align: left; }
button.brand:active { transform: scale(.97); }
