/* Pagina pubblica di una scuola o di una citta' (spot.uniteditalia.com/<scuola>/<citta>).
   Viene dalla bozza drafts/spot-scuola (approvata il 06/10/2026); la pagina e' scritta da
   server/spot-site.ts (spotPageHtml) e animata da /js/school.js. */
/* Bozza della pagina pubblica Spotted di scuola/citta'.
   Stile "grosso" della pagina di oggi (public/spot/css/spot.css): gradiente, logo con il nodo,
   card bianca arrotondata, testo e bottone Invia grandi. Dalla bozza precedente: card fantasma
   delle storie Instagram nello sfondo e pannello dei tag che nasce dal bottone @. */

@font-face { font-family: "Inter"; src: url("/fonts/Inter_400Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter_600SemiBold.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter_700Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter_800ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter_900Black.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "League Spartan"; src: url("/fonts/LeagueSpartan-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Permanent Marker"; src: url("/fonts/PermanentMarker-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --accent: #5565f5;
  --accent-soft: #8b96ff;
  --violet: #8e5cff;
  --pink: #ff5fa8;
  --night: #0a0b1a;
  --ink: #12131c;
  --chip: #ece9fa;
  --white: #ffffff;
  --muted-ink: #6b6f85;
  --font: "Inter", "Helvetica Neue", Arial, sans-serif;

  /* Colori delle card degli spotted (come nell'app). */
  --spot-rose: #F6D6DE;
  --spot-violet: #D7DCFF;
  --spot-peach: #F6D8C2;
  --spot-mint: #CDEFD8;
  --spot-pink: #EFCFE8;
  --spot-lime: #ECEFC0;
  --spot-sky: #CFE6FF;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Niente scorrimento laterale su telefono: "hidden" per i browser che non conoscono "clip". */
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; max-width: 100%; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  background: #0a0b1a;
  color: var(--white);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; border-radius: 12px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------------------------------------
   Sfondo
   --------------------------------------------------------------------------------------------- */
/* Lo sfondo e' grande esattamente quanto lo schermo e ritaglia i livelli animati, che sono
   piu' grandi per non scoprire i bordi quando si muovono: cosi' non allarga la pagina. */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; contain: paint; }
/* Lo sfondo delle storie Instagram (src/workers/instagram-renderer.ts e laboratorio storie):
   blu notte, macchie di colore molto sfocate, card fantasma chiare e sfocate, velo scuro sopra.
   Colori freddi e rilassati: viola, blu e un acqua-marina tenue, niente rosa. */
.bg-gradient {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(60% 45% at 85% 95%, rgba(30, 155, 255, 0.22), transparent 70%),
    #0a0b1a;
}
.bg-layer {
  position: absolute;
  inset: -10%;
  will-change: transform;
}
.bg-glow { position: absolute; border-radius: 50%; filter: blur(60px); }
.bg-glow--1 {
  left: -18%; top: -8%; width: 80vmax; height: 80vmax;
  background: radial-gradient(circle, rgba(83, 97, 255, 0.75), transparent 62%);
  animation: drift-a 19s ease-in-out infinite alternate;
}
.bg-glow--2 {
  right: -26%; top: 42%; width: 70vmax; height: 70vmax;
  background: radial-gradient(circle, rgba(61, 214, 196, 0.42), transparent 62%);
  animation: drift-b 23s ease-in-out infinite alternate;
}
.bg-ghost {
  --r: 0deg;
  position: absolute;
  width: 84vw;
  max-width: 560px;
  aspect-ratio: 760 / 520;
  border-radius: 13%;
  opacity: 0.5;
  filter: blur(30px);
  /* Ferme: si muovono solo con l'inclinazione/mouse (parallasse dei livelli). */
  transform: rotate(var(--r));
}
.bg-ghost--1 { --r: -8deg; left: -22%; top: 8%; background: #e9e6ff; }
.bg-ghost--2 { --r: 7deg; right: -26%; top: 34%; background: #8e5cff; }
.bg-ghost--3 { --r: 5deg; left: -18%; top: 60%; background: #c4f1ea; }
.bg-ghost--4 { --r: -6deg; right: -20%; top: 84%; background: #dcdcff; }
/* Macchia gia' sfocata da app.js (bakeBlobs): niente filtro dal vivo, l'immagine copre anche il
   bordo della sfocatura (--pad) fuori dal riquadro. */
.bg-glow.is-baked,
.bg-ghost.is-baked { filter: none; background: none; border-radius: 0; }
.bg-glow.is-baked::before,
.bg-ghost.is-baked::before {
  content: "";
  position: absolute;
  inset: calc(var(--pad) * -1);
  background: var(--baked) center / 100% 100% no-repeat;
}
.bg-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 50% 45%, transparent 30%, rgba(5, 6, 16, 0.5) 100%),
    rgba(8, 9, 22, 0.58);
}

@keyframes drift-a {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(14vw, 10vh, 0) scale(1.12); }
}
@keyframes drift-b {
  0% { transform: translate3d(0, 0, 0) scale(1.05); }
  100% { transform: translate3d(-16vw, -8vh, 0) scale(0.92); }
}

/* ---------------------------------------------------------------------------------------------
   Pagina e logo
   --------------------------------------------------------------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: max(22px, calc(env(safe-area-inset-top) + 10px)) 16px max(28px, env(safe-area-inset-bottom));
  display: grid;
  gap: 34px;
}
/* "United spot" sopra la card, sullo sfondo; il nodo da solo sta dentro la card, sopra il nome. */
.wordmark { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin: 0; line-height: 1; }
.wordmark-united { font-family: "League Spartan", var(--font); font-weight: 700; font-size: 30px; letter-spacing: -0.01em; color: var(--white); }
.brand-knot { width: 46px; height: auto; color: var(--accent); }
.wordmark-spot {
  font-family: "Permanent Marker", cursive;
  font-size: 30px;
  color: var(--white);
  display: inline-block;
  transform: rotate(-6deg) translateY(-1px);
}

/* Spazio pubblicitario sotto il marchio: piccolo, discreto, con altezza fissa. */
.ad-slot { display: grid; justify-items: center; gap: 4px; margin: -22px 0 -14px; }
.ad-label { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; }
.ad-box {
  width: 320px;
  max-width: 100%;
  height: 50px;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
/* Banner di United nello spazio annuncio (stesse misure, sostituibile dall'annuncio vero). */
.house-ad {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0 12px 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--white);
  text-align: left;
}
.house-ad:active { transform: scale(0.98); }
.house-ad-pill {
  flex: none;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.house-ad-text { flex: 1; min-width: 0; font-size: 12px; line-height: 1.3; font-weight: 700; }
/* "Scarica l'app": bianco, con una passata di evidenziatore blu che si disegna da sola. */
.house-ad-text b {
  color: var(--white);
  font-weight: 900;
  white-space: nowrap;
  padding: 0 3px;
  background-image: linear-gradient(transparent calc(52% - 2px), rgba(85, 101, 245, 0.95) calc(52% - 2px), rgba(85, 101, 245, 0.95) calc(92% - 1px), transparent calc(92% - 1px));
  background-repeat: no-repeat;
  background-size: 100% 100%;
  animation: highlight-in 700ms cubic-bezier(0.3, 0.8, 0.2, 1) 500ms both;
}

/* ---------------------------------------------------------------------------------------------
   Card per scrivere (come .ask-card della pagina di oggi)
   --------------------------------------------------------------------------------------------- */
.ask { display: grid; gap: 14px; }
.ask-card, .ask-done {
  margin: 0;
  border-radius: 36px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 30px 70px rgba(20, 8, 60, 0.35);
}
/* Nome della scuola (o della citta') al centro, sotto il marchio. Entra lettera per lettera:
   ogni lettera sale da sotto, sfocata, e si posa con una piccola molla. */
.ask-top { display: grid; justify-items: center; gap: 8px; padding: 22px 22px 0; text-align: center; }
.ask-school {
  margin: 0;
  color: var(--ink);
  font-size: clamp(23px, 6.2vw, 28px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1;
  overflow-wrap: anywhere;
}
.ask-school .letter {
  display: inline-block;
  white-space: pre;
  animation: letter-in 640ms cubic-bezier(0.18, 1.45, 0.3, 1) both;
  animation-delay: calc(var(--i) * 45ms + 120ms);
}
@keyframes letter-in {
  0% { transform: translateY(0.55em) scale(0.6) rotate(-8deg); opacity: 0; filter: blur(6px); }
  60% { opacity: 1; filter: blur(0); }
  100% { transform: none; opacity: 1; filter: blur(0); }
}

.ask-write { position: relative; }
.ask-write textarea {
  display: block;
  width: 100%;
  min-height: 168px;
  padding: 16px 22px 6px;
  border: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font: 800 22px/1.22 var(--font);
  letter-spacing: -0.025em;
}
.ask-write textarea::placeholder { color: #a2a5b8; }
.ask-write textarea:focus { outline: none; }
.ask-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 6px 22px;
}
.ask-counter { color: #8b8fa3; font-size: 13px; font-weight: 700; }

.ask-comments {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 14px 10px;
  padding: 7px 10px 7px 14px;
  border-radius: 16px;
  background: #f4f4fb;
  color: #4b4f63;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
}
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d5d7e3;
  transition: background-color 180ms ease;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 360ms cubic-bezier(0.2, 1.35, 0.32, 1);
}
.switch input:checked + span { background: #34c85a; }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Bottone Invia grosso, nero, a pillola. */
.send {
  display: block;
  width: calc(100% - 28px);
  margin: 0 14px 14px;
  padding: 13px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font: 900 18px var(--font);
  letter-spacing: -0.03em;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.send:hover { transform: translateY(-2px); }
.send:active { transform: scale(0.97); }
.send:disabled { opacity: 0.6; cursor: progress; transform: none; }
.ask-error { margin: 0; padding: 0 22px 18px; font-weight: 800; color: #c2185b; }
.ask-error:empty { display: none; }
.ask-done { padding: 34px 22px 10px; text-align: center; }
.ask-done[hidden] { display: none; }
.done-emoji { font-size: 64px; line-height: 1; animation: pop-in 600ms cubic-bezier(0.18, 1.5, 0.3, 1); }
.ask-done h2 { margin: 12px 0 6px; font-size: 44px; font-weight: 900; letter-spacing: -0.055em; }
.ask-done p { margin: 0 0 22px; font-size: 17px; font-weight: 600; line-height: 1.45; color: #4b4f63; }
.ask-done .send { width: 100%; margin: 0 0 14px; }
.ask-rules { margin: 0; text-align: center; font-size: 13px; font-weight: 700; opacity: 0.92; line-height: 1.5; }
@keyframes pop-in { from { transform: scale(0.3); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------------------------------------
   Emoji che saltano fuori mentre scrivi: adesivi sui bordi della card + scoppio di mini emoji
   --------------------------------------------------------------------------------------------- */
.ask-card { position: relative; isolation: isolate; }
/* Niente striscia: in alto la card prende colore (blu, viola, un tocco di rosa) e sfuma nel
   bianco verso il testo. La sfumatura respira piano. */
.ask-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 210px;
  z-index: -1;
  border-radius: 36px 36px 0 0;
  background:
    radial-gradient(70% 90% at 12% 0%, rgba(85, 101, 245, 0.38), transparent 70%),
    radial-gradient(60% 80% at 88% 0%, rgba(255, 95, 168, 0.30), transparent 70%),
    radial-gradient(80% 70% at 50% 0%, rgba(142, 92, 255, 0.26), transparent 75%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 35%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 35%, transparent 100%);
  animation: card-glow 9s ease-in-out infinite alternate;
}
/* Bordo sottile che va dal bianco al lilla, come una lastra di vetro. */
.ask-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(160deg, rgba(85, 101, 245, 0.45), rgba(255, 255, 255, 0) 40%, rgba(255, 95, 168, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
/* Solo opacita' (prima anche hue-rotate, che ridisegnava la card a ogni fotogramma). */
@keyframes card-glow {
  0% { opacity: 0.78; }
  100% { opacity: 1; }
}
.emoji-stickers { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.emoji-sticker {
  position: absolute;
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 8px 14px rgba(20, 8, 60, 0.28));
  animation:
    sticker-in 720ms cubic-bezier(0.18, 1.6, 0.3, 1) both,
    sticker-float 3.2s ease-in-out 720ms infinite alternate;
}
/* Quattro posti sul bordo, lontani da testo, contatore e bottone @. */
.emoji-sticker[data-slot="0"] { top: -24px; right: 18px; --rot: 14deg; }
.emoji-sticker[data-slot="1"] { top: -22px; left: 16px; --rot: -12deg; font-size: 38px; }
.emoji-sticker[data-slot="2"] { top: 42%; right: -12px; --rot: 18deg; font-size: 34px; }
.emoji-sticker[data-slot="3"] { top: 46%; left: -10px; --rot: -16deg; font-size: 32px; }
.emoji-sticker.is-leaving { animation: sticker-out 260ms cubic-bezier(0.5, 0, 0.75, 0) forwards; }
@keyframes sticker-in {
  0% { transform: scale(0) rotate(-70deg); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: scale(1) rotate(var(--rot)); opacity: 1; }
}
@keyframes sticker-float {
  from { transform: translateY(0) rotate(var(--rot)); }
  to { transform: translateY(-6px) rotate(calc(var(--rot) * -0.4)); }
}
@keyframes sticker-out {
  from { transform: scale(1) rotate(var(--rot)); opacity: 1; }
  to { transform: scale(0.2) rotate(calc(var(--rot) + 40deg)); opacity: 0; }
}
.emoji-spark {
  position: absolute;
  font-size: 16px;
  line-height: 1;
  animation: spark 760ms cubic-bezier(0.15, 0.8, 0.3, 1) forwards;
}
@keyframes spark {
  0% { transform: translate(0, 0) scale(0.4); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--spin)); opacity: 0; }
}

/* ---------------------------------------------------------------------------------------------
   Tag: bottone @ e pannello che nasce dal bottone
   --------------------------------------------------------------------------------------------- */
.tag-btn {
  position: relative;
  z-index: 7;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--white);
  color: #0b0d17;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16), 0 0 0 1.5px rgba(15, 23, 42, 0.08);
  transition: background-color 220ms ease, color 220ms ease;
}
.tag-btn span {
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  transform: translateY(-2px);
  transition: transform 520ms cubic-bezier(0.18, 1.4, 0.3, 1);
}
.tag-btn[aria-expanded="true"] { background: #0b0d17; color: var(--white); }
.tag-btn[aria-expanded="true"] span { transform: translateY(-2px) rotate(-360deg); }
.tag-btn i {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: #ff4b55;
}
.tag-btn i::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid #ff4b55;
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.tag-btn[aria-expanded="true"] i { display: none; }
@keyframes ping {
  0% { transform: scale(1); opacity: 0.8; }
  80%, 100% { transform: scale(2.4); opacity: 0; }
}

/* Il pannello si apre come un cerchio centrato sul bottone @ e cresce con una molla. */
.tag-pop {
  --origin-x: calc(100% - 23px);
  --origin-y: calc(100% + 30px);
  position: absolute;
  right: 10px;
  bottom: 60px;
  z-index: 6;
  width: min(312px, calc(100% - 20px));
  border-radius: 26px;
  padding: 16px 14px 14px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 30px 70px rgba(20, 8, 60, 0.4), 0 0 0 1px rgba(15, 23, 42, 0.07);
  transform-origin: var(--origin-x) var(--origin-y);
  clip-path: circle(0px at var(--origin-x) var(--origin-y));
  transform: scale(0.72) translateY(8px);
  opacity: 0;
  transition:
    clip-path 560ms cubic-bezier(0.22, 0.9, 0.18, 1),
    transform 620ms cubic-bezier(0.18, 1.3, 0.3, 1),
    opacity 180ms ease;
}
.tag-pop.is-open {
  clip-path: circle(160% at var(--origin-x) var(--origin-y));
  transform: none;
  opacity: 1;
}
.tag-pop.is-closing {
  transition:
    clip-path 320ms cubic-bezier(0.5, 0, 0.75, 0),
    transform 320ms cubic-bezier(0.5, 0, 0.75, 0),
    opacity 220ms ease 100ms;
}
.tag-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 12px; }
.tag-title { margin: 0; font-size: 18px; line-height: 22px; font-weight: 900; letter-spacing: -0.035em; }
.lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  border-radius: 999px;
  padding: 5px 10px 5px 8px;
  background: #0b0d17;
  color: var(--white);
  font-size: 11px;
  line-height: 13px;
  font-weight: 800;
}
.lock-pill svg, .lock svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}
.tag-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tag-row {
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 18px;
  padding: 8px 10px 8px 8px;
  background: #f3f4f9;
  cursor: pointer;
  user-select: none;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition:
    opacity 260ms ease calc(var(--i) * 70ms + 160ms),
    transform 520ms cubic-bezier(0.18, 1.3, 0.3, 1) calc(var(--i) * 70ms + 160ms),
    background-color 160ms ease;
}
.tag-pop.is-open .tag-row { opacity: 1; transform: none; }
.tag-row:hover { background: #eceef6; }
/* Foto e nomi sfocati: si capisce che ci sono persone da spottare, non chi sono. */
.blur-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: #d7dbe5;
}
.blur-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; filter: blur(3.2px) saturate(1.25); transform: scale(1.3); }
.tag-who { flex: 1; min-width: 0; }
.blur-text { display: block; filter: blur(3.7px); white-space: nowrap; overflow: hidden; user-select: none; }
.tag-name { font-size: 14px; line-height: 18px; font-weight: 800; color: var(--ink); }
.tag-handle { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted-ink); }
.lock {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--white);
  color: #9aa0b2;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.lock svg { width: 14px; height: 14px; }
.is-denied { animation: deny 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97); }
.is-denied .lock { color: #0b0d17; }
@keyframes deny {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}
.tag-hint { margin: 12px 4px; color: #5d6578; font-size: 12.5px; line-height: 16px; font-weight: 700; transition: color 200ms ease; }
.tag-hint.is-highlighted { color: #0b0d17; }
.tag-cta {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: var(--white);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

/* ---------------------------------------------------------------------------------------------
   Sezioni sotto: titoli e bottoni larghi
   --------------------------------------------------------------------------------------------- */
.section-title {
  margin: 0 0 16px;
  font-size: clamp(28px, 7.6vw, 36px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.02;
  text-wrap: balance;
}
.kicker {
  display: inline-block;
  margin: 0 0 10px;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(10, 11, 26, 0.32);
  font-size: 13px;
  font-weight: 800;
}
.marker {
  font-family: "Permanent Marker", cursive;
  font-weight: 400;
  letter-spacing: 0;
  display: inline-block;
  transform: rotate(-4deg);
  color: #ffe45c;
}
.wide-btn {
  width: 100%;
  margin-top: 14px;
  min-height: 62px;
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--ink);
  color: var(--white);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.025em;
  text-align: left;
  box-shadow: 0 18px 40px rgba(20, 8, 60, 0.3);
  transition: transform 0.15s ease;
}
.wide-btn span { font-size: 22px; }
.wide-btn:active { transform: scale(0.97); }
.wide-btn--light { background: var(--white); color: var(--ink); }

/* ---------------------------------------------------------------------------------------------
   Spotted e sconti a rotazione: due pagine sovrapposte nello stesso spazio. La nuova entra da
   sinistra, quella vecchia esce a destra e resta sotto. Barrette in alto come nelle storie.
   --------------------------------------------------------------------------------------------- */
.rotator { display: grid; gap: 14px; margin-top: -18px; }
.rotator-bars { display: flex; gap: 6px; padding: 0 6px; }
.rotator-bar {
  flex: 1;
  height: 16px;
  border: 0;
  padding: 6px 0;
  background: transparent;
}
.rotator-bar i {
  position: relative;
  display: block;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.3);
}
.rotator-bar i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #ffffff;
  transform: scaleX(var(--fill, 0));
  transform-origin: left center;
}
.rotator-bar[aria-selected="true"] i::after { transform: scaleX(var(--fill, 1)); }
/* Barretta che si riempie nei 5 secondi (la durata la imposta app.js). */
.rotator-bar.is-running i::after { animation: bar-fill var(--duration, 5s) linear forwards; }
.rotator-bar.is-paused i::after { animation-play-state: paused; }
@keyframes bar-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.rotator-stage {
  position: relative;
  /* Ritaglia solo ai lati (le pagine che escono), lascia libere ombre e card inclinate. */
  clip-path: inset(-60px 0 -60px 0);
  transition: height 520ms cubic-bezier(0.22, 0.9, 0.18, 1);
}
.rotator-panel {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 1;
  transform: translateX(-104%);
  transition: transform 760ms cubic-bezier(0.7, 0, 0.2, 1);
}
.rotator-panel.is-active { z-index: 2; transform: translateX(0); }
.rotator-panel.is-leaving { z-index: 1; transform: translateX(104%); }
/* Senza movimenti: niente scorrimento, solo cambio. */
.rotator-panel.no-motion { transition: none; }

/* Evidenziatore color accento sotto "Sconti per studenti": piu' scuro del rosa, cosi' il testo
   bianco resta leggibile. */
.hl {
  padding: 0 4px;
  background-image: linear-gradient(transparent 50%, rgba(85, 101, 245, 0.95) 50%, rgba(85, 101, 245, 0.95) 87%, transparent 87%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.rotator-panel.is-active .hl { animation: highlight-in 700ms cubic-bezier(0.3, 0.8, 0.2, 1) 380ms both; }
@keyframes highlight-in { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
.deals-title { padding-left: 6px; color: #ffffff; }

/* "Scarica l'app" al centro: quando entra nello schermo fa un saltino, passa un riflesso di
   luce e parte un'onda attorno. Poi resta fermo (app.js lo riaccende a ogni nuova vista). */
.cta-wrap { display: flex; justify-content: center; margin-top: 18px; }
.cta-app {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  padding: 0 30px;
  background: var(--white);
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.025em;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.cta-app span[aria-hidden] { font-size: 21px; transition: transform 0.2s ease; }
.cta-app:active { transform: scale(0.96); }
.cta-app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(85, 101, 245, 0.28) 45%, rgba(61, 214, 196, 0.32) 55%, transparent 70%);
  transform: translateX(-120%);
}
.cta-app::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55);
  pointer-events: none;
}
.cta-app.is-wow { animation: cta-pop 760ms cubic-bezier(0.18, 1.5, 0.3, 1); }
.cta-app.is-wow::before { animation: cta-shine 1100ms cubic-bezier(0.3, 0.6, 0.2, 1) 250ms; }
.cta-app.is-wow::after { animation: cta-ring 1400ms ease-out 300ms; }
.cta-app.is-wow span[aria-hidden] { animation: cta-arrow 900ms ease-in-out 500ms 2; }
@keyframes cta-pop {
  0% { transform: scale(0.82); }
  55% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes cta-shine { to { transform: translateX(120%); } }
@keyframes cta-ring {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
  100% { box-shadow: 0 0 0 22px rgba(255, 255, 255, 0); }
}
@keyframes cta-arrow { 50% { transform: translateX(6px); } }

/* Titolo della sezione spotted: bianco pieno, un filo piu' a destra. */
.tease-title {
  padding-left: 6px;
  color: #ffffff;
}
.nowrap { white-space: nowrap; }
/* Anteprima degli spotted: si legge l'inizio, il resto sfuma e si sfoca. */
.tease-list { display: grid; gap: 12px; }
.tease-card {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  border-radius: 28px;
  padding: 18px 18px 14px;
  background: var(--card, var(--spot-violet));
  color: var(--ink);
  text-align: left;
  box-shadow: 0 16px 36px rgba(20, 8, 60, 0.22);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.2s ease;
}
.tease-card:active { transform: scale(0.98) rotate(var(--tilt, 0deg)); }
.tease-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; font-weight: 800; color: rgba(18, 19, 28, 0.6); }
.tease-top svg { width: 22px; height: auto; color: var(--ink); }
.tease-text { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 800; letter-spacing: -0.025em; }
.tease-text .fade {
  filter: blur(5px);
  opacity: 0.75;
  user-select: none;
}
.tease-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tease-stats { display: flex; align-items: center; gap: 14px; font-size: 14px; font-weight: 800; }
.tease-stats span { display: inline-flex; align-items: center; gap: 5px; }
.tease-stats svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.tease-faces { display: flex; align-items: center; }
.tease-faces .blur-avatar { width: 26px; height: 26px; margin-left: -8px; border: 2px solid var(--card, var(--spot-violet)); }
.tease-faces .blur-avatar:first-child { margin-left: 0; }
.tease-faces b { margin-left: 8px; font-size: 12px; font-weight: 800; color: rgba(18, 19, 28, 0.65); }
/* L'ultima card: tutta sfocata con il lucchetto sopra. */
.tease-card--locked { min-height: 150px; padding: 22px 18px; overflow: hidden; isolation: isolate; }
.tease-card--locked .tease-body { filter: blur(6px); user-select: none; }
.tease-lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  border-radius: inherit;
  text-align: center;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.tease-lock small { font-size: 13px; font-weight: 800; opacity: 0.7; letter-spacing: 0; }
.tease-lock .lock { width: 44px; height: 44px; color: var(--ink); }
.tease-lock .lock svg { width: 20px; height: 20px; }

/* Sconti: stessa card dell'app (UnitedClient/expo/components/convenzioni/TopDealCard.tsx).
   Testo a sinistra (58%), foto a destra che sfuma nel bianco, fascetta diagonale con lo sconto. */
.deal-list { display: grid; gap: 12px; }
.deal-card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 150px;
  border: 0;
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  background: #ffffff;
  color: #1a2742;
  text-align: left;
  box-shadow: 0 16px 36px rgba(20, 8, 60, 0.25), inset 0 0 0 1px rgba(15, 23, 42, 0.06);
  transition: transform 130ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.deal-card:active { transform: scale(0.985); }
.deal-media {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 58%;
  overflow: hidden;
  background: #dde7f7;
}
.deal-media img, .deal-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Foto d'esempio della bozza: gradiente + emoji grande. In produzione c'e' la foto vera. */
.deal-photo { display: grid; place-items: center; font-size: 64px; background: var(--deal-bg); }
.deal-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 54%;
  z-index: 2;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0.92) 18%,
    rgba(255, 255, 255, 0.6) 42%,
    rgba(255, 255, 255, 0.18) 72%,
    rgba(255, 255, 255, 0) 100%);
}
.deal-ribbon {
  position: absolute;
  top: 10px;
  right: -34px;
  z-index: 4;
  width: 120px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #5b52f6;
  color: #ffffff;
  font-size: 20px;
  line-height: 20px;
  font-weight: 900;
  transform: rotate(45deg);
}
.deal-ribbon span { transform: translate(3px, 3px); }
.deal-body {
  position: relative;
  z-index: 3;
  width: 58%;
  padding: 14px;
  display: grid;
  gap: 9px;
}
.deal-head { display: flex; align-items: center; gap: 12px; }
.deal-logo {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #e8eef7;
  font-size: 18px;
}
.deal-logo img { width: 100%; height: 100%; object-fit: cover; }
.deal-title {
  flex: 1;
  margin-right: -10px;
  color: #1a2742;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.deal-place {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #1c2436;
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
}
.deal-place svg { width: 13px; height: 13px; flex: none; color: #111111; }
.deal-place span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-action {
  justify-self: start;
  margin-top: 12px;
  height: 30px;
  border-radius: 16px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #13233a;
  color: #ffffff;
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
}
.deal-action img { width: 12px; height: 12px; filter: brightness(0) invert(1); }

.deals-source { margin: 10px 4px 0; font-size: 12px; font-weight: 700; opacity: 0.75; }

/* Scarica */
.get-app {
  padding: 28px 22px;
  border-radius: 34px;
  background: rgba(10, 11, 26, 0.5);
  text-align: center;
}
.get-app .section-title { font-size: clamp(24px, 6.4vw, 30px); }
.store-row { display: flex; justify-content: center; gap: 14px; }
.store-btn {
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--white);
  color: var(--ink);
  transition: transform 0.15s ease;
}
.store-btn svg { width: 34px; height: 34px; }
.store-btn:active { transform: scale(0.94); }

.foot { display: grid; gap: 10px; text-align: center; font-size: 12.5px; font-weight: 600; line-height: 1.5; opacity: 0.85; }
.foot p { margin: 0; }
.foot a { font-weight: 800; }

/* Testo inviato che vola via (app.js, flySentText). */
.sent-note {
  position: fixed;
  z-index: 30;
  padding: 18px 22px;
  background: #ffffff;
  color: var(--ink);
  font: 800 22px/1.22 var(--font);
  letter-spacing: -0.025em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  pointer-events: none;
  transform-origin: 80% 0%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

/* Passaggio allo store */
.store-toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 14px 16px;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.02em;
  box-shadow: 0 20px 50px rgba(20, 8, 60, 0.4);
  transform: translateX(-50%);
  animation: toast-in 420ms cubic-bezier(0.18, 1.3, 0.3, 1);
}
.store-toast[hidden] { display: none; }
.store-toast svg { width: 34px; height: auto; color: var(--accent); animation: knot-pulse 700ms ease-in-out infinite alternate; }
@keyframes toast-in { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@keyframes knot-pulse { from { opacity: 0.4; transform: scale(0.94); } to { opacity: 1; transform: scale(1.04); } }

/* Chi ha chiesto meno movimento: sfondo fermo, niente molle. */
@media (prefers-reduced-motion: reduce) {
  .bg-glow, .bg-ghost, .tag-btn i::after, .done-emoji, .store-toast, .store-toast svg { animation: none; }
  .emoji-sticker { animation: none; transform: rotate(var(--rot)); }
  .ask-card::before { animation: none; }
  .house-ad-text b, .rotator-panel.is-active .hl { animation: none; background-size: 100% 100%; }
  .rotator-panel, .rotator-stage { transition: none; }
  .cta-app.is-wow, .cta-app.is-wow::before, .cta-app.is-wow::after, .cta-app.is-wow span[aria-hidden] { animation: none; }
  .rotator-bar.is-running i::after { animation: none; }
  .ask-school .letter { animation: none; }
  .emoji-sticker.is-leaving { animation: none; opacity: 0; }
  .bg-layer { transition: none; }
  .tag-pop, .tag-pop.is-closing, .tag-row { transition: opacity 120ms linear; transform: none; }
}


/* --- Produzione ---------------------------------------------------------------------------- */
/* Il marchio in alto e' un link alla home di spot. */
a.wordmark { text-decoration: none; color: inherit; }
/* Campo esca per i bot: fuori dallo schermo, non raggiungibile con il tab, ignorato dai lettori. */
.hp-field { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Al posto del nome, ogni tanto: "Trovi tutti gli spotted sull'app" (js/school.js, askHint).
   Nome e scritta stanno nella stessa cella della griglia, uno sopra l'altro. Le lettere del nome
   si alzano e svaniscono una dopo l'altra; la scritta si svela da sinistra a destra dietro una
   sottile linea luminosa; dopo 3 secondi scorre via verso destra e il nome rientra. */
.ask-top { grid-template-areas: "knot" "title"; }
.ask-top > svg { grid-area: knot; }
.ask-top > .ask-school,
.ask-top > .ask-hint { grid-area: title; align-self: center; }
.ask-hint {
  position: relative;
  justify-self: center;
  max-width: 100%;
  font-size: clamp(15px, 4.6vw, 18px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.ask-hint b { font-weight: 900; color: var(--accent); }
.ask-hint-text { display: block; clip-path: inset(0 100% 0 0); }
.ask-hint-beam {
  position: absolute;
  top: -18%;
  bottom: -18%;
  left: 0;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, transparent, var(--accent) 25%, var(--accent-soft) 75%, transparent);
  box-shadow: 0 0 14px 3px rgba(85, 101, 245, 0.55);
  opacity: 0;
}
.ask-top.show-hint .ask-school .letter {
  animation: letter-out 380ms cubic-bezier(0.5, 0, 0.75, 0) both;
  animation-delay: calc(var(--i) * 18ms);
}
.ask-top.show-hint .ask-hint,
.ask-top.hide-hint .ask-hint { opacity: 1; }
.ask-top.show-hint .ask-hint-text { animation: hint-reveal 820ms cubic-bezier(0.65, 0, 0.35, 1) 300ms both; }
.ask-top.show-hint .ask-hint-beam { animation: hint-beam 820ms cubic-bezier(0.65, 0, 0.35, 1) 300ms both; }
.ask-top.hide-hint .ask-school .letter { opacity: 0; animation: none; }
.ask-top.hide-hint .ask-hint-text { animation: hint-hide 440ms cubic-bezier(0.55, 0, 1, 0.45) both; }
.ask-top.name-back .ask-school .letter {
  animation: letter-back 600ms cubic-bezier(0.18, 1.45, 0.3, 1) both;
  animation-delay: calc(var(--i) * 35ms);
}
@keyframes letter-out {
  to { transform: translateY(-0.45em) scale(0.85); opacity: 0; filter: blur(4px); }
}
@keyframes letter-back {
  0% { transform: translateY(0.55em) scale(0.6) rotate(-8deg); opacity: 0; filter: blur(6px); }
  60% { opacity: 1; filter: blur(0); }
  100% { transform: none; opacity: 1; filter: blur(0); }
}
@keyframes hint-reveal {
  0% { clip-path: inset(0 100% 0 0); filter: blur(3px); }
  70% { filter: blur(0); }
  100% { clip-path: inset(0 0 0 0); filter: blur(0); }
}
@keyframes hint-beam {
  0% { left: 0; opacity: 0; }
  12% { opacity: 1; }
  82% { opacity: 1; }
  100% { left: calc(100% - 3px); opacity: 0; }
}
@keyframes hint-hide {
  0% { clip-path: inset(0 0 0 0); opacity: 1; transform: none; }
  100% { clip-path: inset(0 0 0 100%); opacity: 0.3; transform: translateX(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .ask-top.show-hint .ask-school .letter,
  .ask-top.name-back .ask-school .letter { animation: none; }
  .ask-top.show-hint .ask-school { opacity: 0; }
  .ask-top.show-hint .ask-hint-text,
  .ask-top.hide-hint .ask-hint-text { animation: none; clip-path: none; }
  .ask-hint-beam { display: none; }
  .ask-top.hide-hint .ask-hint { opacity: 0; }
}

/* Finiti i 2 invii dell'ora: il bottone diventa un invito all'app (js/school.js, paintLimit). */
.send.is-limit {
  padding: 12px 22px;
  font: 800 14.5px/1.3 var(--font);
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--ink), #1d2252);
}

/* Il tuo spotted mandato da qui (js/school.js, ricevuta): bottoncino sopra "Invia!" con il
   bollino rosso come la @, e foglio dal basso con l'inizio del testo e delle risposte. */
.receipt-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 auto 12px;
  padding: 8px 14px 8px 12px;
  border: 1px solid rgba(85, 101, 245, 0.25);
  border-radius: 999px;
  background: #f3f4ff;
  color: var(--ink);
  font: 800 13.5px/1.2 var(--font);
  letter-spacing: -0.01em;
  box-shadow: 0 8px 20px rgba(85, 101, 245, 0.18);
  cursor: pointer;
  animation: pop-in 420ms cubic-bezier(0.18, 1.4, 0.3, 1) both;
}
.receipt-pill[hidden] { display: none; }
.receipt-pill:active { transform: scale(0.97); }
.receipt-dot {
  position: relative;
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: #c9cbe0;
}
.receipt-pill.has-news .receipt-dot { background: #ff4b55; }
.receipt-pill.has-news .receipt-dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid #ff4b55;
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.receipt-arrow { font-size: 18px; line-height: 1; color: var(--accent); }

.receipt-sheet { position: fixed; inset: 0; z-index: 60; }
.receipt-sheet[hidden] { display: none; }
.receipt-backdrop { position: absolute; inset: 0; background: rgba(5, 6, 16, 0.6); animation: fade-in 200ms ease both; }
.receipt-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 82vh;
  overflow-y: auto;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--white);
  color: var(--ink);
  outline: none;
  animation: sheet-up 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.receipt-sheet.is-closing .receipt-panel { animation: sheet-down 260ms ease-in both; }
.receipt-sheet.is-closing .receipt-backdrop { animation: fade-out 260ms ease-in both; }
.receipt-handle { display: block; width: 42px; height: 5px; margin: 0 auto 12px; border-radius: 3px; background: #d9dbe8; }
.receipt-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f1f2f8;
  color: var(--ink);
  font: 700 22px/1 var(--font);
}
.receipt-title { margin: 4px 0 2px; font-size: 21px; font-weight: 900; letter-spacing: -0.03em; }
.receipt-meta { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: #6c7086; }
.receipt-own {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--spot-violet, #e6e3ff);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.receipt-stats { display: flex; gap: 14px; margin: 10px 2px 14px; font-size: 14px; font-weight: 800; color: #4a4e66; }
.receipt-subtitle { margin: 6px 0 8px; font-size: 15px; font-weight: 900; }
.receipt-note { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; line-height: 1.4; color: #6c7086; }
.receipt-note:empty { display: none; }
.receipt-replies { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.receipt-reply { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; }
.receipt-reply .blur-avatar { width: 34px; height: 34px; }
.receipt-reply-head { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; font-weight: 800; color: #6c7086; }
.receipt-reply-head b { color: var(--ink); }
.receipt-reply-text { margin: 2px 0 0; font-size: 15px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.receipt-reply-text .fade, .receipt-own .fade { filter: blur(5px); opacity: 0.75; user-select: none; }
.receipt-gif {
  display: inline-grid;
  place-items: center;
  width: 120px;
  height: 72px;
  margin-top: 4px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffb4a2, #8e5cff 55%, #3dd6c4);
  color: var(--white);
  font-weight: 900;
  letter-spacing: 0.08em;
}
.receipt-gif span { filter: blur(1px); }
.receipt-cta { margin: 0 0 8px; width: 100%; }
.receipt-forget {
  display: block;
  margin: 0 auto;
  padding: 8px;
  border: 0;
  background: none;
  color: #8a8ea3;
  font: 700 13px var(--font);
  text-decoration: underline;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { from { transform: none; } to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .receipt-pill, .receipt-panel, .receipt-backdrop, .receipt-sheet.is-closing .receipt-panel,
  .receipt-sheet.is-closing .receipt-backdrop { animation: none; }
  .receipt-pill.has-news .receipt-dot::after { animation: none; }
}

/* Mentre si scrive (body.is-typing, js/school.js) si ferma tutto cio' che si muove: la tastiera
   resta fluida anche su iPhone. */
.is-typing .ask-card::before,
.is-typing .bg-glow,
.is-typing .tag-btn i::after,
.is-typing .receipt-dot::after,
.is-typing .house-ad-text b { animation-play-state: paused; }

/* Il bottoncino dello stato anche nel riquadro "Inviato!". */
.receipt-pill--done { margin: 4px auto 14px; }

/* Scrittura su iPhone: il campo ha un suo livello, cosi' a ogni lettera si ridisegna solo il
   testo e non la card intorno (ombra grande, bagliore con maschera, bordo con maschera, angoli). */
.ask-write { isolation: isolate; contain: layout; }
.ask-write textarea {
  position: relative;
  z-index: 1;
  transform: translateZ(0);
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}

/* Prove per capire cosa rallenta la scrittura su iPhone (?prova=sfondo|card|tutto): spengono
   solo in quella pagina aperta cosi'. Da togliere quando trovato il colpevole. */
.prova-sfondo .bg-layer,
.prova-tutto .bg-layer { display: none; }
.prova-card .ask-card,
.prova-tutto .ask-card { box-shadow: none; }
.prova-card .ask-card::before,
.prova-card .ask-card::after,
.prova-tutto .ask-card::before,
.prova-tutto .ask-card::after { display: none; }
