/* Spritz Counter — grafica cartoon: contorni spessi, ombre piene, colori aperitivo. */

/* Font ospitati qui (niente richieste a Google Fonts: il tuo IP non esce dal sito). */
@font-face { font-family: "Lilita One"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/lilita-one-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Lilita One"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/lilita-one-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url(/fonts/nunito-latin-wght-normal.woff2) format("woff2-variations"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url(/fonts/nunito-latin-ext-wght-normal.woff2) format("woff2-variations"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --ink: #2a1712;
  --cream: #ffe8c7;
  --paper: #fff8ec;
  --orange: #ff6a1f;
  --orange-2: #ff9a3c;
  --lemon: #ffd23f;
  --mint: #33c48d;
  --pink: #ff7aa2;
  --sky: #7ec8f5;
  --grape: #9b7bff;
  --muted: #7a5a4a;
  --line: 3px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --r: 22px;
  --display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

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

html, body { margin: 0; min-height: 100%; }
/* Niente si allarga oltre lo schermo: la pagina resta sempre a misura e non si può "rimpicciolire". */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior-y: none; overflow-x: clip; }
body { overflow-x: clip; }
html.locked, html.locked body { overflow: hidden; }

body {
  font-family: var(--body);
  font-weight: 700;
  color: var(--ink);
  background-color: var(--cream);
  background-image: radial-gradient(rgba(255, 106, 31, 0.16) 2.2px, transparent 2.6px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
/* Niente zoom da doppio tocco, niente menu da pressione lunga, niente selezione accidentale. */
button, a, input, label, .act, .friend, .rank-row, .step-col { touch-action: manipulation; }
button, .btn, .act, .friend, .icon-btn, .chip, .pill, .avatar, .topbar, .summary, .bubble, .stepper,
.teaser, .tabbar, .seg, .podium, .rank-row, .you, .stat, .tab-stats, .install {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.sheet:focus, #app:focus { outline: none; }
img { display: block; }

h1, h2, h3, .display { font-family: var(--display); font-weight: 400; letter-spacing: 0.3px; margin: 0; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 0 max(16px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 120px) max(16px, env(safe-area-inset-left));
  position: relative;
}
#app > :first-child:not(.topbar) { margin-top: calc(env(safe-area-inset-top) + 14px); }

.boot { display: grid; place-items: center; min-height: 70dvh; }
.boot-dot {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--orange); border: var(--line); box-shadow: var(--shadow);
  animation: boing 0.7s ease-in-out infinite alternate;
}
@keyframes boing { to { transform: translateY(-18px) scale(0.92, 1.08); } }

/* ───────── superfici e pulsanti ───────── */

.card {
  background: var(--paper);
  border: var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 22px;
  border: var(--line); border-radius: 999px;
  background: var(--paper); box-shadow: var(--shadow);
  font-family: var(--display); font-size: 20px; letter-spacing: 0.4px;
  text-decoration: none; color: var(--ink);
  transition: transform 0.12s cubic-bezier(.3,.7,.4,1.5), box-shadow 0.12s;
  user-select: none;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.loading { pointer-events: none; opacity: 0.75; }
.btn.loading::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 3px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-orange { background: var(--orange); color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.btn-mint { background: var(--mint); color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.btn-lemon { background: var(--lemon); }
.btn-pink { background: var(--pink); color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.btn-danger { background: #e2453f; color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.btn-block { width: 100%; }

.icon-btn {
  width: 46px; height: 46px; border-radius: 50%;
  border: var(--line); background: var(--paper); box-shadow: 3px 3px 0 var(--ink);
  display: grid; place-items: center; font-size: 20px; padding: 0;
  transition: transform 0.12s;
}
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.icon-btn:disabled { opacity: 0.35; pointer-events: none; }
.icon-spacer { width: 46px; flex: none; }

.field {
  width: 100%; min-height: 54px; padding: 0 18px;
  border: var(--line); border-radius: 16px; background: #fff;
  font-weight: 800; font-size: 18px; outline: none;
  box-shadow: inset 3px 3px 0 rgba(42, 23, 18, 0.08);
}
.field:focus { box-shadow: 0 0 0 4px var(--lemon); }
.field::placeholder { color: #b39a8c; }

.stack { display: grid; gap: 14px; }

/* ───────── barra in alto ───────── */

.topbar {
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 15;
  /* La barra copre anche la zona dell'orologio (se il telefono ce l'ha sopra la pagina): niente spiragli quando scorri. */
  margin: 0 -16px 14px; padding: calc(env(safe-area-inset-top) + 12px) 16px 10px;
  background: rgba(255, 232, 199, 0.88);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
}
.topbar .logo { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.topbar .logo svg { width: 40px; height: 52px; flex: none; }
.topbar .logo span { font-family: var(--display); font-size: 26px; line-height: 1; }
.topbar .logo span b { color: var(--orange); font-weight: 400; -webkit-text-stroke: 1px var(--ink); }
.me-btn { padding: 0; overflow: hidden; }
.me-btn img { width: 100%; height: 100%; object-fit: cover; }

.title-row { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.title-row h1 { font-size: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ───────── login ───────── */

.login { display: grid; justify-items: center; text-align: center; padding-top: 3dvh; gap: 12px; }
.login .hero-glass { width: 210px; margin: 6px 0 -6px; }
.login h1 { font-size: 46px; line-height: 0.95; }
.login h1 b { color: var(--orange); font-weight: 400; display: block; font-size: 58px; -webkit-text-stroke: 1.5px var(--ink); text-shadow: 4px 4px 0 var(--ink); }
.login .tagline { font-size: 18px; max-width: 300px; margin: 6px 0 14px; line-height: 1.35; }
.google-btn { background: #fff; font-family: var(--body); font-weight: 900; font-size: 18px; min-height: 60px; padding: 0 26px; }
.google-btn svg { width: 24px; height: 24px; }
.login .steps { display: grid; gap: 10px; margin-top: 26px; width: 100%; text-align: left; }
.login .step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-size: 15px; line-height: 1.3; }
.login .step .n {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: var(--line);
  display: grid; place-items: center; font-family: var(--display); font-size: 18px;
}
.fineprint { font-size: 12px; color: var(--muted); margin-top: 20px; font-weight: 700; }
.fineprint a { color: inherit; }

/* ───────── riepilogo ───────── */

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.sum {
  padding: 14px 14px 12px; position: relative; overflow: hidden;
  display: grid; gap: 2px;
}
.sum .k { font-size: 13px; text-transform: uppercase; letter-spacing: 0.8px; }
.sum .v { font-family: var(--display); font-size: 44px; line-height: 1; display: flex; align-items: baseline; gap: 6px; }
.sum .v small { font-size: 16px; font-family: var(--body); font-weight: 900; }
.sum.owe { background: var(--orange); color: #fff; }
.sum.owe .v { text-shadow: 3px 3px 0 var(--ink); }
.sum.owed { background: var(--mint); color: #fff; }
.sum.owed .v { text-shadow: 3px 3px 0 var(--ink); }
.sum .deco { position: absolute; right: -8px; top: -6px; font-size: 40px; transform: rotate(14deg); }

.section-h { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 12px; }
.section-h h2 { font-size: 22px; }
.section-h span { font-size: 14px; color: var(--muted); }

/* ───────── lista amici ───────── */

.friends { display: grid; gap: 12px; }
.friend {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  text-align: left; width: 100%; color: inherit; text-decoration: none;
  transition: transform 0.12s cubic-bezier(.3,.7,.4,1.5), box-shadow 0.12s;
}
.friend:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.friend .who { flex: 1; min-width: 0; }
.friend .name { font-family: var(--display); font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.friend .sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.avatar {
  flex: none; width: 54px; height: 54px; border-radius: 18px; border: var(--line);
  display: grid; place-items: center; font-size: 30px; box-shadow: 3px 3px 0 var(--ink);
  position: relative;
}
.avatar.big { width: 76px; height: 76px; font-size: 44px; border-radius: 24px; }
.avatar .pic {
  position: absolute; right: -8px; bottom: -8px; width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--ink); overflow: hidden; background: #fff;
}
.avatar .pic img { width: 100%; height: 100%; object-fit: cover; }

.pill {
  flex: none; display: grid; justify-items: center; min-width: 64px; padding: 6px 10px 5px;
  border: var(--line); border-radius: 16px; box-shadow: 3px 3px 0 var(--ink);
  line-height: 1;
}
.pill b { font-family: var(--display); font-weight: 400; font-size: 26px; }
.pill i { font-style: normal; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.pill.owe { background: var(--orange); color: #fff; }
.pill.owe b { text-shadow: 2px 2px 0 var(--ink); }
.pill.owed { background: var(--mint); color: #fff; }
.pill.owed b { text-shadow: 2px 2px 0 var(--ink); }
.pill.even { background: var(--lemon); }

.linked-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 99px;
  background: var(--sky); border: 2px solid var(--ink); color: var(--ink); font-size: 11px; font-weight: 900;
}

.empty { text-align: center; padding: 26px 18px 22px; display: grid; justify-items: center; gap: 8px; }
.empty svg { width: 120px; }
.empty h3 { font-size: 24px; }
.empty p { margin: 0; color: var(--muted); max-width: 260px; }

/* Pulsanti fissi in basso: fuori da #app, così le animazioni di pagina non li spostano. */
#dock {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; pointer-events: none;
  padding: 0 16px calc(env(safe-area-inset-bottom) + 18px);
}
#dock > * { pointer-events: auto; }
.fab { min-height: 64px; padding: 0 28px; font-size: 22px; box-shadow: var(--shadow-lg); animation: fabIn 0.45s cubic-bezier(.3,.7,.4,1.4) both; }
.fab:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
@keyframes fabIn { from { transform: translateY(120px); } }

/* ───────── dettaglio conto ───────── */

.stage { position: relative; display: grid; justify-items: center; margin: 4px 0 10px; }
.stage .mascot { width: 190px; }
.bubble {
  position: relative; margin: 0 6px 14px; padding: 14px 18px; text-align: center;
  background: #fff; border: var(--line); border-radius: 26px; box-shadow: var(--shadow);
  font-size: 17px; line-height: 1.3; max-width: 340px;
}
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -14px; width: 22px; height: 22px;
  background: #fff; border-right: var(--line); border-bottom: var(--line);
  transform: translateX(-50%) rotate(45deg); border-bottom-right-radius: 4px;
}
.bubble .count { font-family: var(--display); font-size: 64px; line-height: 0.95; display: block; }
.bubble .count.owe { color: var(--orange); text-shadow: 3px 3px 0 var(--ink); -webkit-text-stroke: 1.5px var(--ink); }
.bubble .count.owed { color: var(--mint); text-shadow: 3px 3px 0 var(--ink); -webkit-text-stroke: 1.5px var(--ink); }
.bubble .count.even { color: var(--lemon); text-shadow: 3px 3px 0 var(--ink); -webkit-text-stroke: 1.5px var(--ink); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 18px; }
.act {
  display: grid; justify-items: center; gap: 2px; padding: 12px 8px 10px;
  border: var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  transition: transform 0.12s cubic-bezier(.3,.7,.4,1.5), box-shadow 0.12s;
  text-align: center;
}
.act:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.act:disabled { opacity: 0.45; pointer-events: none; }
.act .e { font-size: 30px; line-height: 1.1; }
.act .t { font-family: var(--display); font-size: 21px; line-height: 1.05; }
.act .s { font-size: 12px; font-weight: 800; opacity: 0.9; }
.act.owe { background: var(--orange); color: #fff; }
.act.owe .t { text-shadow: 2px 2px 0 var(--ink); }
.act.owed { background: var(--mint); color: #fff; }
.act.owed .t { text-shadow: 2px 2px 0 var(--ink); }
.act.drink { grid-column: 1 / -1; background: var(--lemon); grid-template-columns: auto 1fr; justify-items: start; align-items: center; column-gap: 14px; padding: 12px 18px; text-align: left; }
.act.drink .e { font-size: 38px; grid-row: span 2; }

.invite { padding: 14px 16px; display: flex; gap: 12px; align-items: center; margin-bottom: 18px; background: var(--sky); }
.invite p { margin: 0; flex: 1; font-size: 14px; line-height: 1.3; }
.invite p b { font-family: var(--display); font-weight: 400; font-size: 18px; display: block; }
.invite .btn { min-height: 46px; padding: 0 16px; font-size: 17px; flex: none; }

.history { padding: 6px 0; }
.history h2 { font-size: 20px; padding: 10px 16px 4px; }
.entry { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-top: 2px dashed rgba(42, 23, 18, 0.15); }
.entry:first-of-type { border-top: 0; }
.entry .ico {
  flex: none; width: 38px; height: 38px; border-radius: 12px; border: 2.5px solid var(--ink);
  display: grid; place-items: center; font-size: 19px;
}
.entry .txt { flex: 1; min-width: 0; font-size: 15px; line-height: 1.25; }
.entry .txt small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.entry .txt .note { font-weight: 800; color: var(--ink); font-style: italic; }
.entry .undo { width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; font-size: 15px; padding: 0; flex: none; }
.entry .undo:active { background: var(--lemon); }
.entry.pending { opacity: 0.55; }
.entry.fresh { animation: entryIn 0.5s cubic-bezier(.2,.9,.3,1.25); }
@keyframes entryIn { from { opacity: 0; transform: translateY(-10px) scale(0.97); background: var(--lemon); } }
.history .none { padding: 12px 16px 16px; color: var(--muted); }

/* ───────── fogli (bottom sheet) ───────── */

.scrim {
  position: fixed; inset: 0; z-index: 50; background: rgba(42, 23, 18, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade 0.18s ease-out;
}
.scrim.out { animation: fadeOut 0.2s ease-in forwards; pointer-events: none; }
.sheet {
  width: 100%; max-width: 480px; background: var(--paper);
  border: var(--line); border-bottom: 0; border-radius: 30px 30px 0 0;
  padding: 10px 18px calc(env(safe-area-inset-bottom) + 20px);
  box-shadow: 0 -4px 0 var(--ink);
  animation: slideUp 0.34s cubic-bezier(.2,.9,.3,1.12);
  max-height: calc(100% - 28px); overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.scrim.out .sheet { animation: slideDown 0.2s ease-in forwards; }
.sheet .grab { width: 54px; height: 6px; border-radius: 9px; background: var(--ink); opacity: 0.25; margin: 0 auto 4px; position: relative; }
/* Area di presa più grande della lineetta. */
.sheet .grab::before { content: ""; position: absolute; inset: -14px -60px; }
.sheet .grab + * { margin-top: 10px; }
.sheet h2 { font-size: 28px; margin-bottom: 4px; }
.sheet .lead { margin: 0 0 16px; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(100%); } }
@keyframes slideDown { to { transform: translateY(100%); } }

body.plain { display: grid; place-items: center; min-height: 100dvh; padding: 16px; }
body.plain .sheet { border: var(--line); border-radius: 30px; box-shadow: var(--shadow-lg); animation: none; padding: 24px; display: grid; gap: 14px; }
body.plain .sheet p { margin: 0; }

.avatars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.avatars button {
  aspect-ratio: 1; border: var(--line); border-radius: 16px; background: #fff; font-size: 28px; padding: 0;
  transition: transform 0.12s cubic-bezier(.3,.7,.4,1.5);
}
.avatars button:active { transform: scale(0.92); }
.avatars button[aria-pressed="true"] { background: var(--lemon); box-shadow: 3px 3px 0 var(--ink); transform: translate(-2px, -2px) rotate(-4deg); }

.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 4px 0 16px; }
.stepper .icon-btn { width: 58px; height: 58px; font-family: var(--display); font-size: 30px; }
.stepper .num { min-width: 110px; text-align: center; }
.stepper .num b { font-family: var(--display); font-weight: 400; font-size: 72px; line-height: 1; display: block; -webkit-text-stroke: 1.5px var(--ink); text-shadow: 4px 4px 0 var(--ink); }
.stepper .num i { font-style: normal; font-size: 14px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 4px; }
.chip {
  border: 2.5px solid var(--ink); border-radius: 99px; background: #fff; padding: 6px 12px; font-size: 14px; font-weight: 800;
}
.chip:active { background: var(--lemon); }

.menu-list { display: grid; gap: 10px; }
.menu-list .btn { justify-content: flex-start; font-family: var(--body); font-weight: 900; font-size: 17px; }
.menu-list .danger { color: #d1342f; }

.me-card { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.me-card img, .me-card .ph { width: 54px; height: 54px; border-radius: 50%; border: var(--line); object-fit: cover; }
.me-card .ph { display: grid; place-items: center; background: var(--lemon); font-family: var(--display); font-size: 24px; }
.me-card b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; }
.me-card span { font-size: 13px; color: var(--muted); word-break: break-all; }

/* ───────── invito ───────── */

.invite-page { text-align: center; display: grid; justify-items: center; gap: 14px; padding-top: 4dvh; }
.invite-page .from { width: 92px; height: 92px; border-radius: 50%; border: var(--line); box-shadow: var(--shadow); object-fit: cover; background: var(--lemon); display: grid; place-items: center; font-family: var(--display); font-size: 40px; }
.invite-page h1 { font-size: 34px; line-height: 1.05; }
.invite-page .card { padding: 16px; width: 100%; }

/* ───────── toast ed effetti ───────── */

.toast {
  position: fixed; z-index: 80; left: 50%; top: calc(env(safe-area-inset-top) + 12px);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: min(440px, calc(100vw - 28px));
  background: var(--ink); color: #fff; border-radius: 24px; padding: 11px 18px;
  font-weight: 900; font-size: 15.5px; line-height: 1.25; box-shadow: 4px 4px 0 var(--orange);
  animation: toastIn 0.35s cubic-bezier(.2,.9,.3,1.4);
}
.toast.error { box-shadow: 4px 4px 0 #e2453f; }
.toast:has(.toast-btn) { padding-right: 8px; }
.toast-btn {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 99px; border: 2.5px solid #fff;
  background: var(--orange); color: #fff; font-weight: 900; font-size: 14px;
}
.toast-btn:active { transform: scale(0.95); }
.toast.out { animation: toastOut 0.25s ease-in forwards; }
@keyframes toastIn { from { transform: translate(-50%, -140%) rotate(-6deg); } }
@keyframes toastOut { to { transform: translate(-50%, -160%); opacity: 0; } }

#fx { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.particle { position: absolute; left: 0; top: 0; font-size: 26px; will-change: transform, opacity; }
.particle.dot { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--ink); }

.cheers {
  position: fixed; z-index: 85; left: 50%; top: 38%; transform: translate(-50%, -50%);
  font-family: var(--display); font-size: clamp(34px, 11vw, 64px); color: var(--lemon);
  width: max-content; max-width: calc(100vw - 28px); text-align: center; line-height: 1.05; overflow-wrap: anywhere;
  -webkit-text-stroke: 2px var(--ink); text-shadow: 5px 5px 0 var(--ink);
  pointer-events: none;
  animation: cheers 1.3s cubic-bezier(.2,.9,.3,1.3) forwards;
}
@keyframes cheers {
  0% { transform: translate(-50%, -50%) scale(0.2) rotate(-20deg); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.15) rotate(6deg); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(1) rotate(-3deg); }
  80% { opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(0.9) rotate(0); opacity: 0; }
}

/* ───────── mascotte ───────── */

.mascot { overflow: visible; }
.mascot .body { animation: bob 3.2s ease-in-out infinite; transform-origin: 100px 230px; }
.mascot .bub { animation: rise 2.6s ease-in infinite; transform-box: fill-box; transform-origin: center; }
.mascot .bub:nth-of-type(2) { animation-delay: 0.7s; animation-duration: 2.2s; }
.mascot .bub:nth-of-type(3) { animation-delay: 1.4s; animation-duration: 3s; }
.mascot .bub:nth-of-type(4) { animation-delay: 0.3s; animation-duration: 2.8s; }
.mascot .blink { animation: blink 4.5s infinite; transform-box: fill-box; transform-origin: center; }
.mascot .sweat { animation: sweat 1.6s ease-in infinite; }
.mascot.wiggle .body { animation: wiggle 0.6s cubic-bezier(.3,.7,.4,1.5); }
.mascot .liquid { transition: transform 0.7s cubic-bezier(.3,.8,.3,1.25); }

@keyframes bob { 50% { transform: translateY(-6px) rotate(1.5deg); } }
@keyframes rise {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-80px) scale(1.1); opacity: 0; }
}
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes sweat { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(16px); opacity: 0; } }
@keyframes wiggle {
  0% { transform: rotate(0); }
  25% { transform: rotate(-9deg) scale(1.06); }
  50% { transform: rotate(7deg) scale(0.97); }
  75% { transform: rotate(-3deg); }
  100% { transform: rotate(0); }
}

/* Le animazioni di pagina muovono il contenuto, mai la barra in alto. */
.page-in > :not(.topbar) { animation: pageIn 0.28s cubic-bezier(.2,.8,.3,1.1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } }

.pop { animation: pop 0.45s cubic-bezier(.3,.7,.4,1.6); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25) rotate(-4deg); } 100% { transform: scale(1); } }

/* Bordo rosso quando manca un campo obbligatorio. */
.shake { animation: shake 0.4s cubic-bezier(.3,.7,.4,1); box-shadow: 0 0 0 4px var(--pink) !important; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

.dots::after { content: "…"; display: inline-block; animation: dots 1s steps(4) infinite; width: 1.2em; text-align: left; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } to { width: 1.2em; } }

.link-box {
  padding: 14px 16px; margin-bottom: 14px; border: 2.5px dashed var(--ink); border-radius: 16px; background: #fff;
  font-size: 15px; word-break: break-all; -webkit-user-select: all; user-select: all;
}
.google-btn.loading { pointer-events: none; opacity: 0.7; }
.page-msg { margin-top: 12dvh; }

/* Senza rete: avviso discreto in basso. */
body.offline::after {
  content: "📶 Sei offline"; position: fixed; z-index: 70; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 96px);
  background: var(--ink); color: #fff; padding: 7px 16px; border-radius: 99px; font-size: 13px; font-weight: 900;
  box-shadow: 3px 3px 0 #e2453f; pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ───────── amici veri: stati e richieste ───────── */

.tag {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 99px;
  background: var(--sky); border: 2px solid var(--ink); color: var(--ink); font-size: 11px; font-weight: 900; white-space: nowrap;
}
.tag.wait { background: var(--lemon); }
.tag.off { background: #eadfd3; }

.hint { margin: -6px 4px 0; font-size: 13px; color: var(--muted); line-height: 1.3; }
.btn-ghost { background: transparent; box-shadow: none; border-style: dashed; font-family: var(--body); font-weight: 900; font-size: 15px; min-height: 48px; }
.btn-ghost:active { transform: none; background: #fff; }

.invite.wait { background: var(--lemon); }

.requests { margin-bottom: 22px; display: grid; gap: 12px; }
.requests .section-h { margin-bottom: 0; }
.requests .section-h span {
  background: var(--pink); color: #fff; border: 2.5px solid var(--ink); border-radius: 99px; padding: 0 9px;
  font-family: var(--display); font-size: 16px;
}
.req { padding: 14px; display: grid; gap: 12px; background: #fff; animation: pop 0.5s cubic-bezier(.3,.7,.4,1.6); }
.req.in-detail { margin-bottom: 14px; }
.req-top { display: flex; gap: 12px; align-items: center; }
.req-top b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; line-height: 1.1; }
.req-top span { font-size: 14px; line-height: 1.3; }
.req-pic {
  flex: none; width: 52px; height: 52px; border-radius: 50%; border: var(--line); object-fit: cover;
  background: var(--lemon); display: grid; place-items: center; font-family: var(--display); font-size: 24px;
}
.req-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.req-actions .btn { min-height: 48px; font-size: 18px; }

/* ───────── profilo ───────── */

.me-emoji { font-size: 24px; line-height: 1; }
.me-preview { display: flex; align-items: center; gap: 14px; padding: 14px; background: #fff; }
.me-preview b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.1; }
.me-preview span { font-size: 13px; color: var(--muted); }
.lbl { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.8px; margin: 4px 4px -6px; color: var(--muted); }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; padding: 6px 4px; }
.swatches button {
  aspect-ratio: 1; border-radius: 50%; border: var(--line); padding: 0;
  transition: transform 0.12s cubic-bezier(.3,.7,.4,1.5);
}
.swatches button[aria-pressed="true"] { transform: scale(1.15); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink); }

/* ───────── iPhone piccoli (SE, mini) ───────── */
@media (max-width: 380px), (max-height: 700px) {
  .stage .mascot { width: 150px; }
  .bubble .count { font-size: 54px; }
  .sum .v { font-size: 38px; }
  .login .hero-glass { width: 170px; }
  .login h1 b { font-size: 50px; }
  .act .t { font-size: 19px; }
  .avatars { gap: 8px; }
  .avatars button { font-size: 25px; }
}
@media (max-width: 340px) {
  .topbar .logo span { font-size: 22px; }
  .stepper { gap: 12px; }
}

/* ───────── barra di navigazione ───────── */

.tabbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px;
  width: 100%; max-width: 360px; padding: 6px;
  background: var(--paper); border: var(--line); border-radius: 999px; box-shadow: var(--shadow-lg);
  animation: fabIn 0.45s cubic-bezier(.3,.7,.4,1.4) both;
}
.tabbar.still { animation: none; }
.nav-item {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 52px; border: 0; background: transparent; border-radius: 999px;
  font-family: var(--display); font-size: 18px; letter-spacing: 0.3px; color: var(--muted);
  transition: background 0.18s, color 0.18s, transform 0.12s cubic-bezier(.3,.7,.4,1.5);
}
.nav-item:active { transform: scale(0.94); }
.nav-item.on { background: var(--lemon); color: var(--ink); box-shadow: inset 0 0 0 2.5px var(--ink); }
.nav-e { font-size: 22px; line-height: 1; }
.nav-badge {
  position: absolute; top: 4px; right: 10px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 99px; border: 2.5px solid var(--ink); background: var(--pink); color: #fff;
  font-family: var(--display); font-size: 13px; line-height: 17px; text-align: center;
}
.nav-add {
  width: 60px; height: 60px; margin: -14px 0; border-radius: 50%;
  border: var(--line); background: var(--orange); color: #fff; box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--display); font-size: 34px; line-height: 1; padding: 0 0 3px; text-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.12s cubic-bezier(.3,.7,.4,1.5), box-shadow 0.12s;
}
.nav-add:active { transform: translate(2px, 2px) rotate(90deg); box-shadow: 1px 1px 0 var(--ink); }

/* ───────── home: saldo, classifica, filtri ───────── */

.verdict { margin: -10px 4px 16px; font-size: 14px; color: var(--muted); text-align: center; }
.teaser {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 22px;
  text-decoration: none; color: inherit; background: var(--lemon);
  transition: transform 0.12s cubic-bezier(.3,.7,.4,1.5), box-shadow 0.12s;
  animation: fade 0.35s ease-out;
}
.teaser:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.teaser .medal { font-size: 34px; line-height: 1; flex: none; }
.teaser .t { flex: 1; min-width: 0; line-height: 1.2; }
.teaser .t b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; }
.teaser .t span { font-size: 13.5px; }
.teaser .go { font-family: var(--display); font-size: 34px; line-height: 1; flex: none; }

.filters { display: flex; gap: 8px; overflow-x: auto; margin: -2px -16px 14px; padding: 2px 16px 6px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; }
.filters .chip .n { font-size: 12px; opacity: 0.6; }
.filters .chip[aria-selected="true"] { background: var(--ink); color: #fff; }
.filters .chip[aria-selected="true"] .n { opacity: 0.8; }

/* ───────── classifica ───────── */

.logo-t { font-size: 26px; line-height: 1; white-space: nowrap; }
.logo-t b { color: var(--orange); font-weight: 400; -webkit-text-stroke: 1px var(--ink); }

.seg {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 5px; margin-bottom: 10px;
  background: #fff; border: var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.seg button {
  display: grid; justify-items: center; gap: 1px; padding: 6px 2px; min-height: 52px;
  border: 0; border-radius: 15px; background: transparent; font-weight: 900; font-size: 13px; color: var(--muted);
  transition: background 0.18s, color 0.18s;
}
.seg button[aria-selected="true"] { background: var(--orange); color: #fff; box-shadow: inset 0 0 0 2.5px var(--ink); text-shadow: 1px 1px 0 var(--ink); }
.seg-e { font-size: 20px; line-height: 1.1; }

.board-desc { text-align: center; margin: 4px 8px 6px; font-size: 14px; color: var(--muted); min-height: 2.6em; display: grid; place-items: center; }

.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin: 26px 0 18px; }
.step-col {
  display: grid; justify-items: center; text-align: center; gap: 4px; position: relative;
  color: inherit; text-decoration: none; min-width: 0;
  animation: riseIn 0.6s cubic-bezier(.2,.9,.3,1.25) both; animation-delay: var(--d, 0s);
}
.podium.still .step-col, .podium.still .block { animation: none; }
.step-col .avatar { width: 58px; height: 58px; font-size: 32px; }
.step-col .avatar.big { width: 74px; height: 74px; font-size: 42px; }
.step-col.me .avatar { box-shadow: 0 0 0 4px var(--lemon), 3px 3px 0 4px var(--ink); }
.crown {
  position: absolute; top: -30px; font-size: 34px; z-index: 2;
  animation: crown 2.4s ease-in-out infinite; transform-origin: 50% 90%;
}
@keyframes crown { 0%, 100% { transform: rotate(-10deg) translateY(0); } 50% { transform: rotate(8deg) translateY(-4px); } }
.pname { font-family: var(--display); font-size: 18px; line-height: 1.05; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.ptitle { font-size: 11px; font-weight: 900; color: var(--muted); line-height: 1.15; min-height: 2.3em; padding: 0 2px; }
.block {
  width: 100%; display: grid; justify-items: center; align-content: start; gap: 0; padding-top: 10px;
  border: var(--line); border-bottom-width: 3px; border-radius: 16px 16px 6px 6px; box-shadow: var(--shadow);
  transform-origin: bottom; animation: grow 0.7s cubic-bezier(.2,.9,.3,1.15) both; animation-delay: var(--d, 0s);
}
.p1 .block { height: 146px; background: var(--lemon); }
.p2 .block { height: 122px; background: var(--sky); }
.p3 .block { height: 104px; background: var(--orange-2); }
.step-col:not(.p1):not(.p2):not(.p3) .block { height: 104px; background: #eadfd3; }
.pscore { font-family: var(--display); font-size: 40px; line-height: 0.95; -webkit-text-stroke: 1.5px var(--ink); color: #fff; text-shadow: 3px 3px 0 var(--ink); }
.punit { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.4px; }
.pmedal { font-size: 26px; margin-top: 2px; }
.p3 .pmedal, .p2 .pmedal { font-size: 22px; }
.empty-step { visibility: hidden; }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(24px); } }

.you { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 8px; margin-bottom: 16px; background: #fff; }
.you.gold { background: var(--lemon); }
.you-glass { width: 54px; flex: none; margin: -4px 0; }
.you-glass svg { width: 100%; display: block; }
.you-txt { flex: 1; min-width: 0; line-height: 1.2; }
.you-txt .k { display: block; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); }
.you-txt b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; }
.you-txt span:last-child { font-size: 13px; }
.you-score { flex: none; display: grid; justify-items: center; line-height: 1; }
.you-score b { font-family: var(--display); font-weight: 400; font-size: 38px; color: var(--orange); -webkit-text-stroke: 1.5px var(--ink); text-shadow: 3px 3px 0 var(--ink); }
.you-score i { font-style: normal; font-size: 11px; font-weight: 900; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

.ranks { padding: 4px 0; margin-bottom: 14px; overflow: hidden; }
.rank-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: inherit; text-decoration: none;
  border-top: 2px dashed rgba(42, 23, 18, 0.15);
}
.rank-row:first-child { border-top: 0; }
.rank-row.in { animation: riseIn 0.45s cubic-bezier(.2,.9,.3,1.2) both; animation-delay: var(--d, 0s); }
a.rank-row:active { background: var(--cream); }
.rank-row.me { background: var(--lemon); }
.rank-row .rk { width: 26px; flex: none; text-align: center; font-family: var(--display); font-size: 22px; color: var(--muted); }
.avatar.sm { width: 42px; height: 42px; font-size: 23px; border-radius: 14px; box-shadow: 2px 2px 0 var(--ink); }
.rank-row .who { flex: 1; min-width: 0; line-height: 1.2; }
.rank-row .who b { display: block; font-family: var(--display); font-weight: 400; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row .who small { font-size: 12.5px; color: var(--muted); }
.rank-row .rs { font-family: var(--display); font-size: 28px; flex: none; }
.board-note { text-align: center; margin: 8px 8px 14px; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; }
.avatar.initial { font-family: var(--display); }

/* ───────── statistiche ───────── */

.tab-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -6px 0 18px; }
.tab-stats span {
  padding: 4px 11px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper);
  font-size: 12.5px; font-weight: 800; color: var(--muted); white-space: nowrap;
}
.tab-stats b { color: var(--ink); font-family: var(--display); font-weight: 400; font-size: 15px; }

.my-stats .lbl { display: block; margin: 18px 4px 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat {
  display: grid; justify-items: center; gap: 1px; padding: 8px 4px 7px; text-align: center;
  background: var(--bg); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: 2px 2px 0 var(--ink);
}
.stat .se { font-size: 18px; line-height: 1.1; }
.stat b { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1; }
.stat small { font-size: 10.5px; font-weight: 900; line-height: 1.1; }

@media (max-width: 380px), (max-height: 700px) {
  .step-col .avatar { width: 50px; height: 50px; font-size: 27px; }
  .step-col .avatar.big { width: 64px; height: 64px; font-size: 36px; }
  .pscore { font-size: 34px; }
  .p1 .block { height: 134px; } .p2 .block { height: 114px; } .p3 .block { height: 98px; }
  .nav-item { font-size: 16px; }
}
@media (max-width: 340px) {
  .seg button { font-size: 11.5px; }
  .nav-item span:not(.nav-e):not(.nav-badge) { display: none; }
}

/* ───────── installa nella Home ───────── */

.install { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 12px; margin-bottom: 22px; background: var(--sky); animation: fade 0.35s ease-out; }
.install.bye { animation: fadeOut 0.25s ease-in forwards; }
.install-ico { width: 40px; flex: none; }
.install-ico svg { width: 100%; height: auto; display: block; }
.install-t { flex: 1; min-width: 0; line-height: 1.25; font-size: 13.5px; }
.install-t > b { display: block; font-family: var(--display); font-weight: 400; font-size: 19px; }
.install-a { display: flex; align-items: center; gap: 6px; flex: none; }
.install-a .btn { min-height: 44px; padding: 0 14px; font-size: 17px; }
.install-x { width: 36px; height: 36px; border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; padding: 0; font-size: 14px; }

/* App aperta dalla Home: niente rimbalzi, niente evidenziazioni da browser. */
html.standalone, html.standalone body { overscroll-behavior: none; }
html.standalone .fineprint { -webkit-user-select: none; user-select: none; }

/* ───────── Spritzy (motore: public/spritzy.js) ───────── */

.spz { position: relative; width: 100%; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.spz .sp-svg { width: 100%; height: auto; display: block; overflow: visible; cursor: pointer; }
.spz .bub { animation: rise 2.6s ease-in infinite; transform-box: fill-box; transform-origin: center; }
.spz .bub:nth-of-type(2) { animation-delay: 0.7s; animation-duration: 2.2s; }
.spz .bub:nth-of-type(3) { animation-delay: 1.4s; animation-duration: 3s; }
.spz .bub:nth-of-type(4) { animation-delay: 0.3s; animation-duration: 2.8s; }
.spz .acc-bob { animation: accBob 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes accBob { 50% { translate: 0 -3px; } }

.spz-say {
  position: absolute; z-index: 3; left: 50%; bottom: 100%; margin-bottom: 4px;
  width: max-content; max-width: min(240px, 80vw); padding: 8px 13px;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: 3px 3px 0 var(--ink);
  font-size: 14px; font-weight: 900; line-height: 1.25; text-align: center; color: var(--ink);
  pointer-events: none; opacity: 0; transform: translate(-50%, 8px) scale(0.85); transform-origin: 50% 100%;
  transition: opacity 0.18s, transform 0.25s cubic-bezier(.3,.7,.4,1.5);
}
.spz-say::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px; background: #fff;
  translate: var(--tail, 0px) 0; /* se il fumetto è stato spostato per stare nello schermo, la punta resta sul bicchiere */
  border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: translateX(-50%) rotate(45deg);
}
.spz-say.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.spz-say:empty { display: none; }
.spz-fx { position: absolute; z-index: 2; font-size: 22px; pointer-events: none; will-change: transform, opacity; }

/* Nel conto: il fumetto di Spritzy sta di lato, il conteggio resta in alto. */
#mascot { width: 190px; position: relative; }
#mascot .spz-say { left: auto; right: -18px; bottom: 62%; transform-origin: 0 100%; transform: translate(40%, 8px) scale(0.85); }
#mascot .spz-say.on { transform: translate(40%, 0) scale(1); }
#mascot .spz-say::after { left: 22%; }
.login .hero-glass .spz-say { bottom: 92%; }

/* Home: la scheda di Spritzy. */
.hero { display: flex; align-items: center; gap: 10px; padding: 14px 12px 12px 6px; margin-bottom: 16px; background: #fff; overflow: visible; }
.hero-pup { width: 118px; flex: none; margin: -14px -2px -6px 0; }
.hero-pup { position: relative; z-index: 2; }
.hero-pup .spz-say { font-size: 13px; max-width: 190px; left: 84%; bottom: 62%; transform-origin: 0 100%; transform: translate(0, 8px) scale(0.85); }
.hero-pup .spz-say.on { transform: translate(0, 0) scale(1); }
.hero-pup .spz-say::after { left: 16px; }
.hero-info {
  flex: 1; min-width: 0; display: grid; gap: 3px; text-align: left; padding: 0;
  background: none; border: 0; color: inherit;
}
.hero-name { font-family: var(--display); font-size: 24px; line-height: 1; display: flex; align-items: center; gap: 8px; }
.lv {
  display: inline-grid; place-items: center; padding: 2px 8px; border: 2.5px solid var(--ink); border-radius: 99px;
  background: var(--lemon); font-family: var(--display); font-size: 14px; line-height: 1.1;
}
.lv.big { font-size: 20px; padding: 6px 12px; flex: none; }
.hero-title { font-size: 12.5px; font-weight: 900; color: var(--muted); }
.xp { display: block; height: 12px; border: 2.5px solid var(--ink); border-radius: 99px; background: var(--cream); overflow: hidden; margin: 3px 0 4px; }
.xp i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-2)); border-right: 2px solid var(--ink); transition: width 0.8s cubic-bezier(.2,.9,.3,1.1); }
.hero-mood { font-size: 14px; line-height: 1.25; font-weight: 900; }
.hero-mood small { display: block; font-weight: 700; color: var(--muted); font-size: 12.5px; }
.hero-cta { font-size: 12.5px; font-weight: 900; color: var(--orange); margin-top: 2px; }
.hero-info:active .hero-cta { text-decoration: underline; }

/* Foglio di Spritzy. */
.spz-sheet-top { width: 160px; margin: 18px auto 4px 22%; }
.spz-sheet-top .spz-say { left: 86%; bottom: 58%; max-width: 170px; transform-origin: 0 100%; transform: translate(0, 8px) scale(0.85); }
.spz-sheet-top .spz-say.on { transform: translate(0, 0) scale(1); }
.spz-sheet-top .spz-say::after { left: 16px; }
.name-field { text-align: center; font-family: var(--display); font-weight: 400; font-size: 24px; }
.lvl-row { display: flex; align-items: center; gap: 12px; }
.lvl-txt { flex: 1; min-width: 0; }
.lvl-txt b { font-family: var(--display); font-weight: 400; font-size: 19px; }
.lvl-txt small { font-size: 12px; color: var(--muted); }
.mood-line { margin: 0; padding: 10px 14px; background: var(--cream); border-radius: 14px; border: 2px dashed rgba(42, 23, 18, 0.25); font-size: 14px; line-height: 1.3; }
.wardrobe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.acc-item {
  display: grid; justify-items: center; gap: 1px; padding: 10px 4px 8px; text-align: center;
  border: var(--line); border-radius: 18px; background: #fff;
  transition: transform 0.12s cubic-bezier(.3,.7,.4,1.5);
}
.acc-item:active { transform: scale(0.94); }
.acc-item .ae { font-size: 28px; line-height: 1.15; }
.acc-item b { font-family: var(--display); font-weight: 400; font-size: 15px; line-height: 1.1; }
.acc-item small { font-size: 10.5px; font-weight: 800; color: var(--muted); line-height: 1.15; }
.acc-item[aria-pressed="true"] { background: var(--lemon); box-shadow: 3px 3px 0 var(--ink); transform: translate(-2px, -2px); }
.acc-item.locked { background: #f3ebe1; border-style: dashed; }
.acc-item.locked .ae { filter: grayscale(1); opacity: 0.7; }

@media (max-width: 380px), (max-height: 700px) {
  #mascot { width: 150px; }
  .hero-pup { width: 100px; }
  .hero-name { font-size: 21px; }
}

/* ───────── barra a 5 posti ───────── */

.tabbar { grid-template-columns: 1fr 1fr auto 1fr 1fr; max-width: 420px; gap: 2px; }
.nav-item { flex-direction: column; gap: 1px; min-height: 54px; font-size: 13px; padding: 0 2px; }
.nav-item .nav-l { line-height: 1; }
.nav-e { font-size: 21px; }
.nav-badge { top: 1px; right: 4px; min-width: 20px; height: 20px; font-size: 12px; line-height: 15px; padding: 0 5px; }
.nav-add { margin: -14px 4px; }

/* ───────── vetrina (chi non è ancora entrato) ───────── */

.login .trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.login .trust span { padding: 5px 11px; border: 2.5px solid var(--ink); border-radius: 99px; background: #fff; font-size: 13px; font-weight: 900; }
.l-sec { margin-top: 54px; }
.l-kicker { display: inline-block; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 1.2px; color: var(--orange); margin: 0 4px 4px; }
.l-h2 { font-size: 30px; line-height: 1.02; margin: 0 4px 16px; }
.l-lead { margin: -4px 4px 16px; color: var(--muted); line-height: 1.4; }
.l-sec .steps { display: grid; gap: 10px; }
.l-sec .step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-size: 15px; line-height: 1.3; }
.l-sec .step .n { flex: none; width: 34px; height: 34px; border-radius: 50%; border: var(--line); display: grid; place-items: center; font-family: var(--display); font-size: 18px; color: #fff; text-shadow: 1px 1px 0 var(--ink); }
.feat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feat { padding: 14px 13px 15px; display: grid; align-content: start; gap: 4px; background: #fff; position: relative; overflow: hidden; }
.feat::before { content: ""; position: absolute; inset: 0 0 auto; height: 9px; background: var(--bg); border-bottom: 2.5px solid var(--ink); }
.feat-e { font-size: 30px; margin-top: 8px; }
.feat h3 { font-size: 19px; line-height: 1.05; }
.feat p { margin: 0; font-size: 13.5px; line-height: 1.35; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 16px 14px; display: grid; gap: 0; background: #fff; }
.moment { display: grid; grid-template-columns: 46px 38px 1fr; align-items: start; gap: 8px; position: relative; padding-bottom: 16px; }
.moment:last-child { padding-bottom: 0; }
.moment:not(:last-child)::after { content: ""; position: absolute; left: 64px; top: 38px; bottom: 2px; border-left: 3px dashed rgba(42, 23, 18, 0.25); }
.m-time { font-family: var(--display); font-size: 16px; padding-top: 8px; }
.m-dot { width: 38px; height: 38px; border-radius: 50%; border: var(--line); display: grid; place-items: center; font-size: 18px; }
.m-text { font-size: 14.5px; line-height: 1.35; padding-top: 6px; }
.arch { display: grid; gap: 0; }
.arch-node { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: #fff; border-left-width: 9px; border-left-color: var(--ink); box-shadow: var(--shadow); position: relative; }
.arch-node::before { content: ""; position: absolute; left: -9px; top: -3px; bottom: -3px; width: 9px; background: var(--bg); border-radius: 22px 0 0 22px; border: var(--line); border-right: 0; }
.arch-e { font-size: 30px; flex: none; }
.arch-node b, .arch-side b { font-family: var(--display); font-weight: 400; font-size: 19px; display: block; line-height: 1.1; }
.arch-node span, .arch-side span { font-size: 13.5px; line-height: 1.35; color: var(--muted); }
.arch-arrow { display: flex; align-items: center; gap: 10px; padding: 6px 0 6px 30px; font-size: 12px; font-weight: 900; color: var(--muted); }
.arch-arrow i { width: 3px; height: 30px; background: var(--ink); position: relative; border-radius: 2px; }
.arch-arrow i::after { content: ""; position: absolute; left: 50%; bottom: -3px; width: 10px; height: 10px; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
.arch-side { margin-top: 16px; padding: 14px; background: var(--cream); border-style: dashed; box-shadow: none; display: grid; gap: 4px; }
.pillars { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.pillars li { padding: 0 4px 0 30px; position: relative; font-size: 14.5px; line-height: 1.4; }
.pillars li::before { content: "✓"; position: absolute; left: 4px; top: -1px; width: 20px; height: 20px; border-radius: 50%; background: var(--mint); color: #fff; font-size: 12px; font-weight: 900; display: grid; place-items: center; border: 2px solid var(--ink); }
.faqs { display: grid; gap: 10px; }
.faq { padding: 0; background: #fff; }
.faq summary { list-style: none; cursor: pointer; padding: 14px 44px 14px 16px; font-weight: 900; font-size: 15.5px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-family: var(--display); font-size: 24px; color: var(--orange); transition: transform 0.2s; }
.faq[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq p { margin: 0; padding: 0 16px 16px; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.l-final { margin-top: 54px; padding: 26px 18px; text-align: center; display: grid; justify-items: center; gap: 8px; background: var(--lemon); }
.l-final h2 { font-size: 28px; line-height: 1.05; }
.l-final p { margin: 0 0 8px; }
.l-foot { margin: 34px 0 10px; text-align: center; font-size: 12.5px; color: var(--muted); }
.l-foot nav { display: flex; justify-content: center; gap: 18px; margin-bottom: 8px; }
.l-foot a { color: var(--ink); font-weight: 900; }
.l-foot p { margin: 0; }
@media (max-width: 360px) { .feat-grid { grid-template-columns: 1fr; } }

/* ───────── coda d'attesa ───────── */

.waiting h1 b { color: var(--pink); }
.queue { width: 100%; padding: 18px; display: grid; justify-items: center; gap: 4px; background: #fff; margin: 6px 0 4px; }
.q-k { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }
.q-n { font-family: var(--display); font-weight: 400; font-size: 64px; line-height: 1; color: var(--orange); -webkit-text-stroke: 1.5px var(--ink); text-shadow: 3px 3px 0 var(--ink); }
.q-of { font-size: 14px; }
.q-eta { font-size: 14px; font-weight: 900; margin-top: 6px; }
.meter { display: block; width: 100%; height: 14px; border: 2.5px solid var(--ink); border-radius: 99px; background: var(--cream); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), #6fe0b1); border-right: 2px solid var(--ink); transition: width 0.8s cubic-bezier(.2,.9,.3,1.1); }

/* ───────── gruppi ───────── */

.crew-intro { display: flex; gap: 12px; align-items: center; padding: 12px 14px; margin-bottom: 20px; background: var(--sky); }
.crew-intro .ci-e { font-size: 32px; }
.crew-intro b { font-family: var(--display); font-weight: 400; font-size: 18px; display: block; line-height: 1.1; }
.crew-intro span { font-size: 13.5px; line-height: 1.3; }
.crews { display: grid; gap: 12px; }
.crew { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none; transition: transform 0.12s cubic-bezier(.3,.7,.4,1.5), box-shadow 0.12s; }
.crew:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.crew .who { flex: 1; min-width: 0; }
.crew .name { font-family: var(--display); font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.crew .sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.crew-badge { flex: none; width: 54px; height: 54px; border-radius: 50%; border: var(--line); display: grid; place-items: center; font-size: 28px; box-shadow: 3px 3px 0 var(--ink); }
.crew-badge.big { width: 92px; height: 92px; font-size: 48px; box-shadow: var(--shadow); }
.faces { display: flex; flex: none; padding-left: 10px; }
.face { width: 30px; height: 30px; margin-left: -10px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; font-size: 16px; overflow: hidden; background: #fff; }
.face img { width: 100%; height: 100%; object-fit: cover; }
.face.more { background: var(--ink); color: #fff; font-size: 11px; font-weight: 900; }
.invite-page .faces { padding-left: 14px; }
.invite-page .face { width: 40px; height: 40px; font-size: 21px; margin-left: -14px; }
.crew-hero { display: flex; gap: 14px; align-items: center; padding: 14px; margin: 4px 0 14px; background: #fff; position: relative; overflow: hidden; }
.crew-hero::before { content: ""; position: absolute; left: -30px; top: -30px; width: 150px; height: 150px; border-radius: 50%; background: var(--bg); opacity: 0.25; }
.crew-hero .crew-badge { position: relative; }
.ch-txt { flex: 1; min-width: 0; display: grid; gap: 2px; position: relative; }
.ch-txt b { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.05; }
.ch-txt > span:not(.meter) { font-size: 14px; font-weight: 900; }
.ch-txt small { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ch-txt .meter { margin-top: 6px; height: 12px; }
.crew-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.crew-actions .btn { min-height: 50px; font-size: 16px; padding: 0 10px; }
.meet-sec { margin-bottom: 22px; }
.meets { display: grid; gap: 10px; }
.meet { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; }
.meet .who { flex: 1; min-width: 0; display: grid; }
.meet .who b { font-family: var(--display); font-weight: 400; font-size: 18px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meet .who small { font-size: 12.5px; color: var(--muted); line-height: 1.25; }
.btn.mini { min-height: 40px; padding: 0 14px; font-size: 15px; flex: none; }
.btn.mini.danger { color: #d1342f; }
.members { padding: 4px 0; background: #fff; }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: inherit; text-decoration: none; }
.member + .member { border-top: 2px dashed rgba(42, 23, 18, 0.14); }
.member.me { background: rgba(255, 210, 63, 0.25); }
.member .who { flex: 1; min-width: 0; display: grid; }
.member .who b { font-weight: 900; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .who small { font-size: 12.5px; color: var(--muted); }
.m-stat { display: grid; justify-items: center; line-height: 1; flex: none; }
.m-stat b { font-family: var(--display); font-weight: 400; font-size: 22px; }
.m-stat i { font-style: normal; font-size: 10px; font-weight: 900; text-transform: uppercase; color: var(--muted); }

/* ───────── home: gli spritz di stasera ───────── */

.counter { display: flex; align-items: stretch; gap: 12px; padding: 14px; margin-bottom: 14px; background: #fff; }
.c-main { flex: 1.1; display: grid; align-content: center; justify-items: start; padding: 4px 8px 4px 4px; border-right: 2.5px dashed rgba(42, 23, 18, 0.18); }
.c-main .k { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }
.c-today { font-family: var(--display); font-weight: 400; font-size: 64px; line-height: 0.95; color: var(--orange); -webkit-text-stroke: 1.5px var(--ink); text-shadow: 3px 3px 0 var(--ink); }
.c-main small { font-size: 13px; font-weight: 900; }
.c-side { flex: 1; display: grid; gap: 6px; align-content: center; }
.c-mini { display: flex; align-items: baseline; gap: 8px; }
.c-mini b { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1; min-width: 34px; text-align: right; }
.c-mini span { font-size: 13px; color: var(--muted); font-weight: 800; }
.water { margin: -4px 0 16px; padding: 12px 14px; background: var(--sky); font-size: 14px; line-height: 1.35; }
.sec-link { font-size: 14px; font-weight: 900; color: var(--orange); text-decoration: none; }
.drinks { padding: 4px 0; background: #fff; margin-bottom: 8px; }
.drink-row .ico { font-size: 20px; }
.chips.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.pick .chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.periods { display: flex; justify-content: center; gap: 6px; margin: 4px 0 2px; flex-wrap: nowrap; }
.periods .chip { flex: 1 1 0; min-width: 0; max-width: 110px; min-height: 36px; padding: 0 6px; font-size: 14px; white-space: nowrap; justify-content: center; }
.periods .chip[aria-selected="true"] { background: var(--ink); color: #fff; }
.board-body.loading { opacity: 0.55; transition: opacity 0.2s; }
.crew-actions .span2 { grid-column: 1 / -1; min-height: 56px; font-size: 18px; }
.meet-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.pegni-teaser { background: #fff; }

/* ───────── profilo ───────── */

.prof-hero { display: flex; align-items: center; gap: 14px; padding: 16px; background: #fff; margin: 4px 0 12px; }
.ph-txt { display: grid; gap: 3px; min-width: 0; flex: 1; }
.ph-txt b { font-family: var(--display); font-weight: 400; font-size: 27px; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; }
.ph-txt span { font-size: 13.5px; font-weight: 900; }
.ph-txt small { font-size: 12.5px; color: var(--muted); }
.prof-action { margin-bottom: 18px; }
.edit-btn { font-family: var(--body); font-weight: 900; font-size: 16px; min-height: 50px; background: var(--lemon); }
.stat-grid.big { margin-bottom: 14px; }
.stat-grid.big .stat b { font-size: 30px; }
.stat-grid.two { grid-template-columns: 1fr 1fr; }
.card-t { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-t b { font-family: var(--display); font-weight: 400; font-size: 19px; }
.card-t small { font-size: 12.5px; color: var(--muted); font-weight: 900; }
.weeks { padding: 14px; background: #fff; margin-bottom: 14px; }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; height: 110px; align-items: end; }
.bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.bar i { display: block; width: 100%; background: var(--orange-2); border: 2px solid var(--ink); border-radius: 6px 6px 3px 3px; }
.bar.now i { background: var(--orange); }
.bar span { font-size: 10px; font-weight: 900; color: var(--muted); min-height: 12px; line-height: 12px; }
.bars-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 800; margin-top: 4px; }
.facts { padding: 14px; background: #fff; margin-bottom: 14px; }
.fact { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 2px dashed rgba(42, 23, 18, 0.12); font-size: 14.5px; }
.fact:first-of-type { border-top: 0; }
.fact span { color: var(--muted); font-weight: 800; }
.fact b { text-align: right; }
.kinds { padding: 14px; background: #fff; display: grid; gap: 8px; }
.kind-row { display: grid; grid-template-columns: 110px 1fr 30px; align-items: center; gap: 10px; font-size: 14px; font-weight: 800; }
.kind-row .meter { margin: 0; height: 12px; }
.kind-row .meter i { background: linear-gradient(90deg, var(--orange), var(--orange-2)); }
.kind-row b { text-align: right; font-family: var(--display); font-weight: 400; font-size: 18px; }
.chips.shared { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.lbl-in { font-size: 13px; font-weight: 900; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { display: grid; justify-items: center; gap: 1px; padding: 12px 6px 10px; text-align: center; border: var(--line); border-radius: 18px; background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.badge .be { font-size: 30px; line-height: 1.15; }
.badge b { font-family: var(--display); font-weight: 400; font-size: 15px; line-height: 1.1; }
.badge small { font-size: 10.5px; font-weight: 800; color: var(--muted); line-height: 1.15; }
.badge.locked { background: #f3ebe1; border-style: dashed; box-shadow: none; }
.badge.locked .be { filter: grayscale(1); opacity: 0.55; }
@media (max-width: 360px) { .badges { grid-template-columns: 1fr 1fr; } .c-today { font-size: 52px; } }

/* ───────── tieni premuto ───────── */

.lp { position: relative; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.lp.pressing { animation: lpGrow var(--lp, 480ms) linear forwards; }
@keyframes lpGrow { to { box-shadow: 0 0 0 7px var(--lemon), 3px 3px 0 7px var(--ink); transform: scale(1.05); } }
.nav-add.pressing { animation: lpGrowRound var(--lp, 480ms) linear forwards; }
@keyframes lpGrowRound { to { box-shadow: 0 0 0 9px var(--lemon), 0 0 0 12px var(--ink); transform: scale(1.12) rotate(90deg); } }
.drink-row.lp.pressing { animation: lpRow var(--lp, 480ms) linear forwards; }
@keyframes lpRow { to { background: rgba(255, 210, 63, 0.55); } }
.lp-tip {
  position: fixed; z-index: 60; left: 50%; top: 0; transform: translate(-50%, -100%);
  max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 7px 12px; border-radius: 12px; background: var(--ink); color: #fff;
  font: 900 13px/1.2 var(--body); text-shadow: none; letter-spacing: 0; pointer-events: none;
  animation: tipIn 0.16s ease-out;
}
.lp-tip.below { transform: translate(-50%, 0); }
@keyframes tipIn { from { opacity: 0; } }

/* ───────── home ───────── */

.counter { flex-wrap: wrap; cursor: default; }
.c-hint { flex-basis: 100%; margin: 4px 0 0; padding-top: 10px; border-top: 2px dashed rgba(42, 23, 18, 0.14); font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.35; }
.c-hint b { color: var(--ink); }
.tip { display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 14px; margin-bottom: 16px; background: var(--lemon); }
.tip-e { font-size: 28px; }
.tip b { display: block; font-family: var(--display); font-weight: 400; font-size: 18px; }
.tip span { font-size: 13.5px; line-height: 1.35; }
.tip i { font-style: normal; font-weight: 900; }
.tip .install-x { flex: none; }
.btn-sub { display: block; font-family: var(--body); font-size: 11.5px; font-weight: 800; text-shadow: none; opacity: 0.9; margin-left: 8px; }
.crew-actions .span2 { flex-wrap: wrap; }

/* ───────── menu "segna uno spritz" ───────── */

.drink-form { display: grid; gap: 12px; }
.drink-form .lbl { display: block; margin: 4px 4px -4px; }
.redo { display: grid; gap: 8px; }
.redo-list { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 6px; scrollbar-width: none; }
.redo-list::-webkit-scrollbar { display: none; }
.redo-chip { flex: none; min-height: 40px; background: var(--cream); white-space: nowrap; }
.kind-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kind-tile {
  display: grid; justify-items: center; gap: 2px; padding: 10px 4px 9px; border: var(--line); border-radius: 18px;
  background: #fff; box-shadow: 3px 3px 0 var(--ink); transition: transform 0.12s cubic-bezier(.3,.7,.4,1.5), background 0.15s;
}
.kind-tile .kt-e { font-size: 28px; line-height: 1.1; }
.kind-tile b { font-family: var(--display); font-weight: 400; font-size: 16px; }
.kind-tile:active { transform: scale(0.95); }
.kind-tile[aria-pressed="true"] { background: var(--orange); color: #fff; }
.kind-tile[aria-pressed="true"] b { text-shadow: 1px 1px 0 var(--ink); }
.qty-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.stepper.mini { margin: 0; gap: 8px; }
.stepper.mini .icon-btn { width: 46px; height: 46px; font-size: 26px; }
.stepper.mini .num { min-width: 48px; }
.stepper.mini .num b { font-size: 44px; color: var(--orange); text-shadow: 3px 3px 0 var(--ink); }
.size-seg { flex: 1; max-width: 230px; margin: 0; }
.size-seg button { padding: 0 4px; font-size: 14px; min-height: 42px; }
.dchips { display: flex; flex-wrap: wrap; gap: 8px; }
.dchip {
  min-height: 38px; padding: 0 12px; border: 2.5px dashed rgba(42, 23, 18, 0.45); border-radius: 99px;
  background: transparent; font-size: 14px; font-weight: 900; color: var(--muted); max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dchip.set { border-style: solid; border-color: var(--ink); background: var(--lemon); color: var(--ink); }
.dchip[aria-expanded="true"] { border-style: solid; border-color: var(--ink); background: var(--ink); color: #fff; }
.dpanel:empty { display: none; }
.dpanel { padding: 12px; border: 2.5px solid var(--ink); border-radius: 18px; background: var(--cream); animation: tipIn 0.18s ease-out; }
.stack-s { display: grid; gap: 10px; }
.stars { display: flex; justify-content: center; gap: 6px; }
.star { width: 48px; height: 48px; border: 0; background: none; font-size: 38px; line-height: 1; color: #d9c7b4; -webkit-text-stroke: 1.5px var(--ink); transition: transform 0.12s cubic-bezier(.3,.7,.4,1.5); }
.star.on { color: var(--lemon); }
.star:active { transform: scale(1.25); }
.drink-go { min-height: 60px; font-size: 21px; margin-top: 4px; }
.seg.size-seg { grid-template-columns: repeat(3, 1fr); display: grid; padding: 4px; gap: 4px; }
.seg.size-seg button { min-height: 40px; display: grid; place-items: center; font-size: 14px; line-height: 1; padding: 0 2px; }

/* ───────── scorri tra le sezioni ───────── */
#app.swiping > :not(.topbar) { will-change: transform; transform: translateX(var(--sx, 0)); opacity: var(--so, 1); }
#app.swipe-back > :not(.topbar) { transition: transform 0.25s cubic-bezier(.2,.8,.3,1.1), opacity 0.25s; }
#app.page-in[data-from="right"] > :not(.topbar) { animation: fromRight 0.3s cubic-bezier(.2,.8,.3,1.05); }
#app.page-in[data-from="left"] > :not(.topbar) { animation: fromLeft 0.3s cubic-bezier(.2,.8,.3,1.05); }
@keyframes fromRight { from { opacity: 0; transform: translateX(60px); } }
@keyframes fromLeft { from { opacity: 0; transform: translateX(-60px); } }

/* ───────── menu: suggerimento dalla pagina ───────── */
.ctx-banner { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border: 2.5px solid var(--ink); border-radius: 16px; background: var(--sky); }
.ctx-banner .cb-e { font-size: 22px; }
.ctx-banner div { flex: 1; min-width: 0; display: grid; }
.ctx-banner b { font-weight: 900; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-banner small { font-size: 12px; color: var(--ink); opacity: 0.8; }

/* ───────── Spritzy nel profilo ───────── */
.prof-hero { align-items: center; overflow: visible; }
.ph-pup { width: 120px; flex: none; margin: -18px -4px -8px -6px; position: relative; }
.ph-pup .spz-say { display: none; }
.ph-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ph-name .avatar.sm { width: 34px; height: 34px; font-size: 19px; border-radius: 11px; box-shadow: 2px 2px 0 var(--ink); }
.ph-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-title { font-weight: 900; color: var(--orange) !important; }
.ph-wardrobe { justify-self: start; margin-top: 4px; min-height: 34px; font-size: 13px; }

/* ───────── guardaroba a sezioni ───────── */
.wardrobe-tabs { margin-bottom: 12px; }
.wardrobe-tabs button { min-height: 58px; font-size: 12px; }
.seg-n { font-size: 10.5px; font-weight: 900; opacity: 0.75; }

/* ───────── scommesse ───────── */

.bets { margin: 0 0 18px; }
.bet { padding: 14px 14px 10px; margin-bottom: 12px; background: #fff; display: grid; gap: 10px; }
.bet.pending { opacity: 0.6; }
.bet.fresh { animation: pop 0.5s cubic-bezier(.3,.7,.4,1.6); }
.bet-top { display: flex; align-items: flex-start; gap: 10px; }
.bet-title { flex: 1; min-width: 0; font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1.1; overflow-wrap: anywhere; }
.bet .undo { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; font-size: 13px; padding: 0; flex: none; }
.stakes { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.stake { display: grid; justify-items: center; text-align: center; padding: 8px 6px; border: 2.5px solid var(--ink); border-radius: 16px; line-height: 1.1; }
.stake.me { background: #ffe1cf; }
.stake.them { background: #d4f3e5; }
.stake small { font-size: 11.5px; font-weight: 900; color: var(--muted); }
.stake b { font-family: var(--display); font-weight: 400; font-size: 22px; }
.stake.me b { color: var(--orange); -webkit-text-stroke: 1px var(--ink); }
.stake.them b { color: var(--mint); -webkit-text-stroke: 1px var(--ink); }
.stake i { font-style: normal; font-size: 12px; font-weight: 800; }
.vs { font-family: var(--display); font-size: 18px; color: var(--grape); -webkit-text-stroke: 1px var(--ink); }
.bet-actions { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; }
.bet-actions .btn { min-height: 46px; padding: 0 10px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bet-meta { margin: 0; font-size: 12px; color: var(--muted); font-weight: 700; text-align: center; }
.bet-empty {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 12px; text-align: left;
  background: var(--grape); color: #fff; font: inherit; font-size: 14px; line-height: 1.3; cursor: pointer;
}
.bet-empty .e { font-size: 34px; flex: none; }
.bet-empty b { display: block; font-family: var(--display); font-weight: 400; font-size: 19px; text-shadow: 2px 2px 0 var(--ink); }
.bet-empty:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.bets-done { padding: 4px 0; background: #fff; }
.bets-done h3 { font-size: 16px; padding: 10px 16px 2px; margin: 0; color: var(--muted); }
.bets-done .txt b { display: block; }
.bets-done .undo { font-size: 18px; }
.open-bets { margin-bottom: 18px; }
.bet-link { text-decoration: none; color: inherit; }
.bet-link .avatar { width: 40px; height: 40px; font-size: 22px; border-radius: 14px; box-shadow: none; }
.bet-link .go { font-family: var(--display); font-size: 26px; color: var(--muted); }
.tag.dice { background: var(--grape); color: #fff; }

.bet-form .chips { margin: -6px 0 0; }
.stake-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 14px; border: var(--line); border-radius: 18px; background: #fff; }
.stake-pick p { margin: 0; font-size: 14px; line-height: 1.2; }
.stake-pick p b { display: block; font-family: var(--display); font-weight: 400; font-size: 18px; }
.stepper.small { margin: 0; gap: 8px; flex: none; }
.stepper.small .icon-btn { width: 44px; height: 44px; font-size: 24px; }
.stepper.small .num { min-width: 52px; }
.stepper.small .num b { font-size: 40px; text-shadow: 3px 3px 0 var(--ink); }
.stepper.small .num i { font-size: 11px; }
.bet-form .fine { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 700; }
@media (max-width: 360px) {
  .bet-actions { grid-template-columns: 1fr 1fr; }
  .bet-actions .btn:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
}

/* scommesse: chi propone scommette che… */
.bet-claim { flex: 1; min-width: 0; display: grid; gap: 2px; }
.bet-claim small { font-size: 12px; font-weight: 900; color: var(--grape); text-transform: uppercase; letter-spacing: 0.04em; }
.bet.ask { box-shadow: 4px 4px 0 var(--grape); }
.bet-actions.two { grid-template-columns: auto 1fr; }
.bet-claim-field { display: grid; gap: 6px; }
.bet-claim-field span { font-family: var(--display); font-size: 19px; }
.bet-actions .btn { white-space: normal; line-height: 1.1; text-overflow: clip; }

/* "Altro giorno": data e ora sulla stessa riga */
.when-inputs { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.when-inputs .field { min-width: 0; }

/* ───────── un solo Spritzy per schermata ───────── */
/* La copia piccola nella barra in alto: entra quando quello della pagina esce sotto la barra. */
.mini-slot {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 38px; height: 46px; margin: -6px 0; opacity: 0; pointer-events: none;
  transform: translateY(-8px) scale(0.55); transform-origin: 50% 80%;
  transition: opacity 0.2s ease, transform 0.36s cubic-bezier(.3,.7,.4,1.45);
}
.mini-slot.show { opacity: 1; transform: none; }
.mini-spz { width: 38px; }
.mini-spz svg { width: 100%; display: block; }
.mini-spz .spz-say, .mini-spz .spz-fx { display: none; }
@media (prefers-reduced-motion: reduce) { .mini-slot { transition: opacity 0.15s; transform: none; } }

/* Stato vuoto senza un secondo Spritzy */
.empty-e { font-size: 58px; line-height: 1; margin-bottom: 2px; }

/* Nel conto con un amico collegato: il tuo Spritzy e il suo */
#mascot.duo { width: min(340px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: end; }
#mascot.duo .pup { display: grid; justify-items: center; gap: 2px; position: relative; }
#mascot.duo .spz { width: 150px; max-width: 100%; }
#mascot.duo .pup-name { font-family: var(--display); font-size: 15px; color: var(--muted); text-decoration: none; }
#mascot.duo .their-pup .pup-name { color: var(--ink); }
#mascot.duo .their-pup .spz-say { display: none; }
#mascot.duo .me-pup .spz-say { right: auto; left: 40%; }

/* Il nome dell'amico in alto porta al suo profilo */
.title-link { text-decoration: none; color: inherit; }
.title-link .avatar { width: 36px; height: 36px; font-size: 20px; border-radius: 12px; flex: none; box-shadow: none; }
.title-link .go { font-family: var(--display); font-size: 24px; color: var(--muted); margin-left: -4px; }
.me-preview.as-link { width: 100%; text-align: left; border: var(--line); font: inherit; color: inherit; cursor: pointer; }
.ph-hint { margin: 2px 8px 14px; font-size: 13px; color: var(--muted); font-weight: 700; text-align: center; }

/* Rarità: un anello colorato (raro azzurro, epico viola, leggendario oro) */
.avatars button.r-raro, .acc-item.r-raro { box-shadow: inset 0 0 0 3px var(--sky); }
.avatars button.r-epico, .acc-item.r-epico { box-shadow: inset 0 0 0 3px var(--grape); }
.avatars button.r-leggendario, .acc-item.r-leggendario { box-shadow: inset 0 0 0 3px #ffb400, 0 0 12px rgba(255, 180, 0, 0.45); }
.avatars button.locked { position: relative; filter: grayscale(0.85); opacity: 0.5; }
.avatars button.locked::after { content: "🔒"; position: absolute; right: -3px; bottom: -3px; font-size: 13px; filter: none; }
.avatars button[aria-pressed="true"].r-raro, .avatars button[aria-pressed="true"].r-epico, .avatars button[aria-pressed="true"].r-leggendario { box-shadow: 3px 3px 0 var(--ink); }

/* Computer (mouse): un filo di risposta al passaggio. Il telefono non ne risente. */
@media (hover: hover) and (pointer: fine) {
  .btn:hover, .chip:hover, .icon-btn:hover, .nav-item:hover, .friend:hover, .act:hover, .dchip:hover, .kind-tile:hover { filter: brightness(1.05); }
  .nav-item:not(.on):hover { color: var(--ink); }
}

/* Foglio "mettila nella schermata Home" */
.install-sheet { display: grid; gap: 12px; text-align: center; justify-items: center; }
.install-sheet .lead { margin: 0; }
.install-app-ico { width: 72px; height: 72px; border-radius: 18px; border: var(--line); box-shadow: 3px 3px 0 var(--ink); margin-top: 6px; }
.install-steps { list-style: none; margin: 2px 0; padding: 0; display: grid; gap: 8px; width: 100%; text-align: left; }
.install-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; font-size: 15px; line-height: 1.3; }
.install-steps .step-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: #fff; font-family: var(--display); font-size: 17px; border: 2.5px solid var(--ink); }
.install-sheet .btn-block { width: 100%; }

/* Niente che sborda sugli schermi stretti (iPhone SE e simili, 320 px) */
.friends { grid-template-columns: minmax(0, 1fr); }
.friend { min-width: 0; }
.friend .sub { flex-wrap: wrap; row-gap: 2px; min-width: 0; }
.friend .sub > * { white-space: nowrap; }
.friend .pill { flex: none; }
#mascot.duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#mascot.duo .spz { width: min(150px, 100%); }

/* ───────── tour iniziale ───────── */
.tour {
  position: fixed; inset: 0; z-index: 75; overflow: hidden;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto; justify-items: center; gap: 14px;
  padding: calc(env(safe-area-inset-top) + 12px) max(20px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 22px) max(20px, env(safe-area-inset-left));
  background-color: var(--cream);
  background-image: radial-gradient(rgba(255, 106, 31, 0.16) 2.2px, transparent 2.6px);
  background-size: 22px 22px;
  animation: fade 0.3s ease-out;
}
.tour.bye { animation: fadeOut 0.25s ease-in forwards; }
.tour > * { width: 100%; max-width: 440px; }
.tour-top { display: flex; justify-content: flex-end; }
.tour-skip { border: 0; background: transparent; font-weight: 900; font-size: 15px; color: var(--muted); padding: 10px 6px; min-height: 44px; }
.tour-pup { display: grid; place-items: end center; min-height: 0; }
.tour-pup .spz { width: min(190px, 46vw, 28vh); }
.tour-pup .spz-say { font-size: 13.5px; }
.tour-body { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 18px 18px 20px; background: #fff; border: var(--line); border-radius: 26px; box-shadow: var(--shadow-lg, 5px 5px 0 var(--ink)); position: relative; }
.tour-body.in-r { animation: tourInR 0.32s cubic-bezier(.2,.8,.3,1.1); }
.tour-body.in-l { animation: tourInL 0.32s cubic-bezier(.2,.8,.3,1.1); }
@keyframes tourInR { from { opacity: 0; transform: translateX(28px); } }
@keyframes tourInL { from { opacity: 0; transform: translateX(-28px); } }
.tour-e {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--lemon); border: var(--line); box-shadow: 3px 3px 0 var(--ink);
  font-size: 26px; font-family: var(--display); line-height: 1;
}
.tour-t { font-size: clamp(24px, 7vw, 30px); line-height: 1.05; margin-top: 18px; }
.tour-s { margin: 0; font-size: 16px; line-height: 1.4; color: var(--ink); }
.tour-s b { color: var(--orange); }
.tour-dots { display: flex; justify-content: center; gap: 7px; }
.tour-dots i { width: 9px; height: 9px; border-radius: 99px; background: var(--ink); opacity: 0.2; transition: width 0.25s, opacity 0.25s; }
.tour-dots i.on { width: 26px; opacity: 1; background: var(--orange); }
@media (prefers-reduced-motion: reduce) { .tour-body.in-r, .tour-body.in-l { animation: none; } }
