/* Beeppy - interfaccia. Mobile-first: tutto pensato per il pollice.
   Le misure usano px perché il gioco vive dentro un canvas a scala fissa. */

:root {
  --honey: #ffc542;
  --honey-dark: #e8a01a;
  --ink: #2b2118;
  --ink-soft: rgba(43, 33, 24, 0.66);
  --panel: rgba(255, 253, 246, 0.985);
  --panel-line: rgba(43, 33, 24, 0.1);
  --shadow: 0 12px 34px rgba(23, 16, 8, 0.28);
  --radius: 22px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: 'Baloo 2', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

/* Su iOS un tocco tenuto premuto seleziona la pagina e apre il menu
   "Copia / Cerca info / Traduci" sopra il gioco: durante una partita è
   esattamente il gesto sbagliato nel momento sbagliato. Queste due proprietà lo
   impediscono; i campi di testo si riattivano più sotto, altrimenti diventerebbe
   impossibile correggere il nickname. */
html, body, #app, #game, #tap-layer, .screen, .install-hint {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* niente trascinamento delle immagini con il dito o col mouse */
img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #14212b;
  color: var(--ink);
  font-family: 'Baloo 2', system-ui, -apple-system, sans-serif;
  overscroll-behavior: none;
  touch-action: manipulation;
}

#app {
  position: fixed;
  inset: 0;
  margin: 0 auto;
  max-width: 560px;
  overflow: hidden;
  isolation: isolate;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* strato che raccoglie i tap di gioco: sta sopra al canvas ma sotto ai pannelli */
#tap-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  touch-action: none;
}

/* --------------------------------------------------------------- barra alta */
#hud {
  position: absolute;
  top: calc(10px + var(--safe-t));
  left: 12px;
  right: 12px;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.chip {
  pointer-events: auto;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.82);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 14px rgba(23, 16, 8, 0.2);
  cursor: pointer;
}
.chip:active { transform: scale(0.95); }
body.is-flying #hud { opacity: 0.32; pointer-events: none; }
#hud { transition: opacity 0.25s ease; }
.chip-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; padding: 0; }
.chip-account { max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------- schermate */
.screen {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: calc(66px + var(--safe-t)) 22px calc(26px + var(--safe-b));
  text-align: center;
}
.screen.is-on { display: flex; }
.screen-ready { pointer-events: none; background: rgba(20, 33, 43, 0.18); }

.logo h1 {
  margin: 6px 0 2px;
  font-size: 62px;
  font-weight: 800;
  line-height: 1;
  color: #fffdf6;
  letter-spacing: -1px;
  text-shadow: 0 3px 0 var(--honey-dark), 0 10px 26px rgba(0, 0, 0, 0.35);
}
.tagline {
  margin: 0;
  color: #fffdf6;
  font-size: 16px;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.logo-bee {
  display: block;
  width: 122px;
  height: 122px;
  margin: 0 auto;
  /* solo l'ape, senza il quadro dell'icona app: qui il fondo è già il cielo */
  background: url('assets/bee.svg') center/contain no-repeat;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
  animation: hover 2.4s ease-in-out infinite;
}
@keyframes hover {
  0%, 100% { transform: translateY(-5px) rotate(-4deg); }
  50%      { transform: translateY(6px) rotate(4deg); }
}

.stats-row { display: flex; gap: 10px; }
.stat {
  min-width: 132px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 253, 246, 0.86);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.stat-k { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.5px; }
.stat b { font-size: 30px; font-weight: 800; line-height: 1.1; }

.menu-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 300px; }

.btn {
  min-height: 54px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 253, 246, 0.92);
  color: var(--ink);
  font: inherit;
  font-size: 19px;
  font-weight: 700;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s ease;
}
.btn:active { transform: translateY(2px) scale(0.99); }
.btn-primary {
  background: linear-gradient(180deg, #ffd569, var(--honey));
  box-shadow: 0 5px 0 var(--honey-dark), var(--shadow);
  font-size: 22px;
  min-height: 60px;
}
.btn-ghost {
  background: transparent;
  box-shadow: none;
  color: var(--ink-soft);   /* dentro un pannello chiaro: mai bianco su bianco */
  font-size: 16px;
  min-height: 44px;
  text-decoration: underline;
}

/* ------------------------------------------------------------ pronti, via */
.ready-box {
  padding: 20px 26px;
  border-radius: var(--radius);
  background: rgba(20, 33, 43, 0.5);
  backdrop-filter: blur(4px);
  color: #fffdf6;
}
.ready-box p { margin: 4px 0; font-size: 20px; font-weight: 600; }
.ready-box .small { font-size: 15px; opacity: 0.85; }
.tap-icon { font-size: 44px; animation: tap 1.1s ease-in-out infinite; }
@keyframes tap {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* --------------------------------------------------------- fine partita */
#screen-over.is-on { background: rgba(20, 33, 43, 0.32); }

.panel {
  width: 100%;
  max-width: 340px;
  padding: 24px 22px 18px;
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
  position: relative;
}
.badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  padding: 6px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd569, var(--honey));
  box-shadow: 0 4px 0 var(--honey-dark);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}
.panel-k { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 1px; }
.big-score { font-size: 76px; font-weight: 800; line-height: 1; margin: 2px 0 12px; }
.over-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.over-rows > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(43, 33, 24, 0.05);
  font-size: 15px;
  font-weight: 600;
}
.over-rows b { font-size: 20px; font-weight: 800; }

/* La riga dell'inseguimento: sta appena sotto i numeri e li commenta, quindi ha
   il fondo di miele invece del grigio delle note, altrimenti si legge come un
   messaggio di servizio e non come il motivo per rigiocare. */
.inseguimento {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 197, 66, 0.22);
  border: 1px solid rgba(232, 160, 26, 0.35);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
}
.inseguimento b { font-weight: 800; }

code {
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(43, 33, 24, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  white-space: nowrap;   /* "?prova" non deve spezzarsi a metà */
}

.note { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--ink-soft); line-height: 1.35; }
.screen > .note { color: #fffdf6; text-shadow: 0 1px 6px rgba(0,0,0,0.5); }
.error { margin: 4px 0 0; padding: 9px 12px; border-radius: 12px; background: #ffe3e0; color: #a3231b; font-size: 14px; font-weight: 700; }
.note-big { font-size: 15px; }
.note a { color: inherit; font-weight: 800; }
.screen > .note a { color: #fffdf6; }
.hidden { display: none !important; }

/* ------------------------------------------------------------- modali */
.modal {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: calc(12px + var(--safe-t)) 12px calc(12px + var(--safe-b));
  background: rgba(14, 22, 30, 0.55);
  backdrop-filter: blur(3px);
}
.modal.is-on { display: flex; animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: 100%;
  max-width: 420px;
  max-height: 88%;
  display: flex;
  flex-direction: column;
  padding: 16px 18px calc(18px + var(--safe-b));
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: rise 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes rise { from { transform: translateY(26px); } to { transform: translateY(0); } }

/* I pannelli dentro una modale devono scorrere, non sbordare.
   La scheda ha max-height: 88% ed è un contenitore flex: senza min-height: 0
   i figli si rifiutano di rimpicciolirsi sotto la propria altezza naturale — è
   il classico inciampo dei layout flex — e il contenuto finisce fuori dallo
   schermo senza modo di raggiungerlo. Il profilo è arrivato a 991 px di
   altezza su schermi da 812: il pulsante per cancellare l'account era
   inaccessibile. */
#auth-forms, #auth-logged, #auth-recupero, #auth-codice, #auth-nobackend {
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;   /* lo scorrimento non si propaga alla pagina */
}
.modal-card header { flex: 0 0 auto; }

.modal-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-card h2 { margin: 0; font-size: 22px; font-weight: 800; }
.x {
  width: 38px; height: 38px;
  border: 0; border-radius: 999px;
  background: rgba(43, 33, 24, 0.07);
  font-size: 16px; color: var(--ink);
  cursor: pointer;
}

.lb { list-style: none; margin: 12px 0 0; padding: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.lb li {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
}
.lb li:nth-child(odd) { background: rgba(43, 33, 24, 0.045); }
.lb li.me { background: linear-gradient(90deg, rgba(255,197,66,0.4), rgba(255,197,66,0.12)); box-shadow: inset 0 0 0 2px var(--honey); }
.lb .pos { font-weight: 800; color: var(--ink-soft); text-align: center; }
.lb li:nth-child(1) .pos, .lb li:nth-child(2) .pos, .lb li:nth-child(3) .pos { font-size: 20px; color: var(--ink); }
.lb .nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.lb .pts { font-weight: 800; font-size: 18px; }
/* il messaggio di lista vuota non deve ereditare la griglia delle righe */
.lb li.lb-empty { display: block; padding: 26px 8px; text-align: center; color: var(--ink-soft); font-weight: 600; line-height: 1.5; background: none; }

.tabs { display: flex; gap: 6px; margin: 14px 0 4px; padding: 4px; border-radius: 14px; background: rgba(43,33,24,0.07); }
.tab {
  flex: 1; min-height: 40px;
  border: 0; border-radius: 10px; background: transparent;
  font: inherit; font-weight: 700; font-size: 16px; color: var(--ink-soft);
  cursor: pointer;
}
.tab.is-on { background: #fffdf6; color: var(--ink); box-shadow: 0 2px 8px rgba(23,16,8,0.14); }

.btn-bio {
  width: 100%;
  margin-top: 14px;
  background: linear-gradient(180deg, #4a4f57, #33373d);
  color: #fffdf6;
  box-shadow: 0 4px 0 #24272b, var(--shadow);
}

#auth-logged .btn { width: 100%; margin-top: 10px; }

#auth-form { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
/* `display: block` non è pignoleria: le etichette dentro #campi-registrazione
   non sono figlie del flex, quindi restavano in linea e "Telefono" finiva
   accanto al suo campo invece che sopra. */
#auth-form label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
#campi-registrazione input { width: 100%; }
#auth-form input {
  min-height: 50px;
  margin-bottom: 6px;
  padding: 0 14px;
  border: 2px solid var(--panel-line);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
}
#auth-form input {
  /* qui la selezione serve: senza, non si può correggere ciò che si è scritto */
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
#auth-form input:focus { outline: none; border-color: var(--honey); }
#f-pass { letter-spacing: 6px; font-size: 20px; }
#f-pass::placeholder { letter-spacing: 0; font-size: 17px; }
#auth-form .btn { margin-top: 8px; }
/* il campo trappola deve essere invisibile ma raggiungibile dai bot:
   display:none lo farebbe ignorare anche a loro. */
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.logged-as { font-size: 19px; font-weight: 600; margin: 16px 0 12px; }

@media (max-height: 620px) {
  .logo h1 { font-size: 46px; }
  .logo-bee { width: 84px; height: 84px; }
  .big-score { font-size: 58px; }
  .screen { gap: 14px; }
}

/* ------------------------------------------- invito a installare l'app */
.install-hint {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(10px + var(--safe-b));
  z-index: 7;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  animation: rise 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.install-body { display: flex; align-items: flex-start; gap: 12px; }
.install-body img { flex: 0 0 auto; border-radius: 10px; }
.install-body b { font-size: 17px; }
.install-body p { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--ink-soft); line-height: 1.35; }
.install-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.install-actions .btn { flex: 1; min-height: 46px; font-size: 17px; }
.install-actions .btn-ghost { flex: 0 0 auto; margin-left: auto; } /* da solo va a destra */

/* ------------------------------------------------------ scheda profilo */
.profilo-testa {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 0 14px;
}
#profilo-avatar {
  width: 75px;
  height: 75px;
  flex: 0 0 auto;
  border-radius: 20px;
  background: linear-gradient(160deg, #9adcef, #3fb0dd);
  box-shadow: 0 4px 12px rgba(23, 16, 8, 0.2);
}
.profilo-nome { min-width: 0; }
.profilo-nome b {
  display: block;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profilo-dal { font-size: 13px; font-weight: 600; color: var(--ink-soft); }

.profilo-record {
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,197,66,0.32), rgba(255,197,66,0.14));
  box-shadow: inset 0 0 0 2px rgba(255, 197, 66, 0.55);
  text-align: center;
}
.profilo-record b { display: block; font-size: 44px; font-weight: 800; line-height: 1.05; }
.profilo-posizione { font-size: 14px; font-weight: 700; color: var(--ink-soft); }

.profilo-griglia {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.profilo-griglia > div {
  padding: 10px 6px;
  border-radius: 14px;
  background: rgba(43, 33, 24, 0.05);
  text-align: center;
}
.profilo-griglia b { display: block; font-size: 20px; font-weight: 800; line-height: 1.2; }
.profilo-griglia span { font-size: 11px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.4px; }

.traguardi { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.traguardo {
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(43, 33, 24, 0.06);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}
.traguardo.preso {
  background: linear-gradient(180deg, #ffd569, var(--honey));
  color: var(--ink);
  box-shadow: 0 2px 0 var(--honey-dark);
}

.btn-danger {
  background: transparent;
  box-shadow: none;
  color: #a3231b;
  font-size: 15px;
  min-height: 42px;
  text-decoration: underline;
}
.btn-danger.conferma {
  background: #a3231b;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 0 #7d1a14;
}

/* ------------------------------------------ codice di recupero e storico */
.codice {
  margin: 14px 0;
  padding: 16px 12px;
  border-radius: 16px;
  background: rgba(43, 33, 24, 0.06);
  box-shadow: inset 0 0 0 2px rgba(255, 197, 66, 0.6);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  word-break: break-all;
  /* qui la selezione serve: il codice va copiato */
  -webkit-user-select: all;
  user-select: all;
}
#auth-codice .btn, #auth-recupero .btn { width: 100%; margin-top: 8px; }
#recupero-form { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
#recupero-form label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
#recupero-form input {
  min-height: 50px; margin-bottom: 6px; padding: 0 14px;
  border: 2px solid var(--panel-line); border-radius: 14px;
  background: #fff; font: inherit; font-size: 17px; color: var(--ink);
  -webkit-user-select: text; user-select: text;
}
#recupero-form input:focus { outline: none; border-color: var(--honey); }
#r-codice { font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px; text-transform: uppercase; }

.storico { margin-top: 16px; }
.storico-grafico {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 56px;
  margin: 8px 0 10px;
  padding: 6px 8px;
  border-radius: 14px;
  background: rgba(43, 33, 24, 0.05);
}
.storico-barra {
  flex: 1;
  min-height: 3px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #ffd569, var(--honey-dark));
}
.storico-barra.record { background: linear-gradient(180deg, #8ccf63, #4e9440); }
.storico-lista { list-style: none; margin: 0; padding: 0; }
.storico-lista li {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 10px; border-radius: 10px; font-size: 14px; font-weight: 600;
}
.storico-lista li:nth-child(odd) { background: rgba(43, 33, 24, 0.04); }
.storico-lista b { font-size: 16px; font-weight: 800; }
.storico-quando { color: var(--ink-soft); font-size: 13px; }

/* ------------------------------------------------ area amministratore */
.admin-sezione { margin-top: 18px; }
.admin-sezione .btn { width: 100%; margin-top: 8px; }
#admin-annuncio {
  width: 100%; min-height: 46px; margin-top: 6px; padding: 0 12px;
  border: 2px solid var(--panel-line); border-radius: 12px;
  background: #fff; font: inherit; font-size: 15px; color: var(--ink);
  -webkit-user-select: text; user-select: text;
}
#admin-annuncio:focus { outline: none; border-color: var(--honey); }
.admin-riga { display: flex; align-items: center; gap: 9px; margin-top: 10px; font-weight: 700; font-size: 15px; }
.admin-riga input { width: 20px; height: 20px; accent-color: var(--honey-dark); }

.admin-lista { list-style: none; margin: 8px 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.admin-lista li {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 12px; font-size: 14px;
}
.admin-lista li:nth-child(odd) { background: rgba(43, 33, 24, 0.045); }
.admin-nome { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-punti { font-weight: 800; }
.admin-azione {
  border: 0; border-radius: 9px; padding: 5px 9px; cursor: pointer;
  background: rgba(43, 33, 24, 0.1); color: var(--ink);
  font: inherit; font-size: 12px; font-weight: 700;
}
.admin-azione.rossa { background: #ffe3e0; color: #a3231b; }
.admin-badge { font-size: 11px; font-weight: 800; color: var(--honey-dark); }

/* annuncio mostrato nel menu */
.annuncio {
  margin: 0 0 4px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 253, 246, 0.9);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

/* --------------------------------------- schermata di installazione obbligata */
#screen-install, #screen-email, #screen-notifiche { background: rgba(20, 33, 43, 0.35); gap: 14px; }
#screen-notifiche .install-passi .btn { width: 100%; }
#screen-notifiche .btn-ghost { margin-top: 6px; }
#screen-email .install-passi { text-align: left; }
#email-form { display: flex; flex-direction: column; gap: 3px; }
#email-form label { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-top: 6px; }
#email-form input {
  min-height: 48px; padding: 0 13px;
  border: 2px solid var(--panel-line); border-radius: 13px;
  background: #fff; font: inherit; font-size: 16px; color: var(--ink);
  -webkit-user-select: text; user-select: text;
}
#email-form input:focus { outline: none; border-color: var(--honey); }
#email-form .btn { margin-top: 12px; }
.install-titolo {
  margin: 0; font-size: 26px; font-weight: 800; color: #fffdf6; line-height: 1.15;
  text-shadow: 0 3px 0 var(--honey-dark), 0 8px 20px rgba(0, 0, 0, 0.35);
}
.install-perche {
  margin: 0; max-width: 320px; font-size: 15px; font-weight: 600; color: #fffdf6;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.install-passi {
  width: 100%; max-width: 340px; padding: 18px 20px;
  border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow);
}
.install-passi ol { margin: 0; padding-left: 20px; text-align: left; }
.install-passi li { margin-bottom: 9px; font-size: 15px; font-weight: 600; line-height: 1.4; }
.install-passi li:last-child { margin-bottom: 0; }
.install-passi .btn { width: 100%; margin-top: 12px; }
.install-passi svg { vertical-align: -3px; }

/* Istruzioni passo-passo, usate sia nella schermata delle notifiche sia dentro
   il messaggio d'errore della registrazione. */
.istruzioni { margin: 6px 0 0; padding-left: 20px; text-align: left; }
.istruzioni li { margin-bottom: 6px; font-size: 14px; font-weight: 600; line-height: 1.4; }
.istruzioni li:last-child { margin-bottom: 0; }

/* ------------------------------------------------ dati personali */
.due-campi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.due-campi input { width: 100%; }
.obbligatorio {
  font-size: 11px; font-weight: 800; color: var(--honey-dark);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.profilo-dati { margin-top: 18px; }
.profilo-dati > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  padding: 8px 0;
  list-style: none;          /* via il triangolino di serie... */
}
.profilo-dati > summary::-webkit-details-marker { display: none; }   /* ...anche su Safari */
/* La freccia la disegniamo noi, così ruota e si vede che la sezione si apre. */
.profilo-dati > summary::after {
  content: '›';
  margin-left: auto;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-soft);
  transition: transform 0.15s ease;
}
.profilo-dati[open] > summary::after { transform: rotate(90deg); }
/* L'etichetta non si stringe: a stringersi dev'essere l'email, che ha i puntini
   di sospensione. Senza questa riga "I TUOI DATI" veniva tagliato a metà. */
.profilo-dati > summary .stat-k { flex: 0 0 auto; }
.dati-riassunto {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  font-size: 13px;
  color: var(--ink-soft);
}
.dati-riassunto.manca { color: #b4451c; font-weight: 700; }
#dati-form { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
#dati-form label { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-top: 6px; }
#dati-form input {
  min-height: 46px; padding: 0 12px;
  border: 2px solid var(--panel-line); border-radius: 12px;
  background: #fff; font: inherit; font-size: 16px; color: var(--ink);
  -webkit-user-select: text; user-select: text;
}
#dati-form input:focus { outline: none; border-color: var(--honey); }
#dati-form .btn { margin-top: 10px; }

/* ------------------------------------------------------- foto profilo */
.avatar-scatola { position: relative; flex: 0 0 auto; width: 75px; height: 75px; }
.avatar-scatola #profilo-avatar,
.avatar-scatola #profilo-foto {
  width: 75px; height: 75px; border-radius: 20px;
  box-shadow: 0 4px 12px rgba(23, 16, 8, 0.2);
  object-fit: cover;
}
.avatar-modifica {
  position: absolute; right: -5px; bottom: -5px;
  width: 30px; height: 30px; padding: 0;
  border: 2px solid var(--panel); border-radius: 999px;
  background: linear-gradient(180deg, #ffd569, var(--honey));
  color: var(--ink); font-size: 14px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 6px rgba(23, 16, 8, 0.25);
}
.avatar-modifica:active { transform: scale(0.92); }
.avatar-rimuovi {
  display: block; margin-top: 3px; padding: 0;
  border: 0; background: none; color: var(--ink-soft);
  font: inherit; font-size: 12px; font-weight: 700;
  text-decoration: underline; cursor: pointer;
}
/* la foto compare anche accanto al nome in classifica */
.lb-foto {
  width: 28px; height: 28px; border-radius: 9px; object-fit: cover;
  margin-right: -2px; vertical-align: -8px;
}

/* --------------------------------------------------- invito alle notifiche */
.invito {
  margin: 4px 0 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 197, 66, 0.2);
  box-shadow: inset 0 0 0 2px rgba(255, 197, 66, 0.5);
}
.invito p { margin: 0 0 10px; font-size: 15px; font-weight: 700; line-height: 1.35; }
.invito-azioni { display: flex; flex-direction: column; gap: 6px; }
.invito-azioni .btn { width: 100%; min-height: 46px; font-size: 17px; }
.invito-azioni .btn-ghost { min-height: 36px; font-size: 14px; }
