/* ==========================================================================
   MINIGAME — cielo arcade, strada nel cielo, angelo dorato (segnaposto)
   Il mondo è un canvas a bassa risoluzione scalato a pixel interi;
   HUD, schede e classifica sono HTML (Helvetica Bold, identità del sito).
   Niente scarabocchi in questa pagina (brief: cielo + nuvole).
   ========================================================================== */

:root {
  --gold: #f0b429;
  --gold-hi: #ffe58a;
  --gold-deep: #a86a08;
  --hud-ink: #131313;
}

/* ---------- STAGE ---------- */
.game {
  position: relative;
  margin-top: var(--header-h);
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  min-height: 300px;
  overflow: hidden;
  overflow: clip; /* niente contenitore di scorrimento: il fuoco non può spostare il palco */
  background: var(--sky);
  isolation: isolate;
  color: var(--hud-ink);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  /* fuori dal volo si può scorrere la pagina col dito anche sopra il cielo */
  touch-action: pan-y;
}
.game[data-state="playing"],
.game[data-state="waking"],
.game[data-state="dying"] {
  touch-action: none;
  cursor: grab;
}
.game[data-state="playing"]:active { cursor: grabbing; }

.game__canvas {
  position: absolute;
  left: 0; top: 0;
  max-width: none;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  touch-action: inherit;
}

.game__noscript {
  position: absolute; inset: auto 16px 24px;
  text-align: center; font-weight: var(--w-bold); font-size: 14px;
}

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 14px var(--gutter) 0;
  pointer-events: none;
}
.hud button, .hud input, .hud form { pointer-events: auto; }

.hud__side {
  display: grid;
  justify-items: start;
  align-content: start;
  min-width: 0;
  transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease-out), visibility 0s;
}
.hud__side--right { justify-items: end; text-align: right; }
.hud__label { font-size: 10.5px; line-height: 1.25; opacity: 0.72; }
.hud__best {
  font-weight: var(--w-bold);
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-top: 3px;
}

.hud__icon {
  position: relative;
  width: 44px; height: 44px;
  margin-top: 10px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 10px 24px -12px rgba(22, 86, 128, 0.55), 0 0 0 1px rgba(19, 19, 19, 0.05);
  transition: transform 0.4s var(--ease-spring), background 0.2s, color 0.2s;
}
.hud__icon svg { width: 20px; height: 20px; fill: currentColor; }
.hud__icon:hover { transform: translateY(-2px); }
.hud__icon:active { transform: scale(0.92); }
.hud__icon[data-open-lb] svg rect { transform-box: fill-box; transform-origin: 50% 100%; transition: transform 0.45s var(--ease-spring); }
.hud__icon[data-open-lb]:hover svg rect:nth-child(1) { transform: scaleY(1.08); }
.hud__icon[data-open-lb]:hover svg rect:nth-child(2) { transform: scaleY(0.82); transition-delay: 0.04s; }
.hud__icon[data-open-lb]:hover svg rect:nth-child(3) { transform: scaleY(1.3); transition-delay: 0.08s; }

/* suono: icona altoparlante, onde solo quando attivo */
.hud__icon--sound .snd-on { display: none; }
.hud__icon--sound[aria-pressed="true"] .snd-on { display: inline; }
.hud__icon--sound[aria-pressed="true"] .snd-off { display: none; }
.hud__icon--sound[aria-pressed="false"] { color: rgba(19, 19, 19, 0.62); }

/* punteggio grande al centro */
.hud__center {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-top: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.4s var(--ease-out), transform 0.6s var(--ease-out), visibility 0s 0.4s;
}
.hud__score {
  font-weight: var(--w-bold);
  font-size: clamp(46px, 9vw, 78px);
  line-height: 0.88;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.55);
  transform-origin: 50% 70%;
}
.hud__score.is-tick { animation: g-tick 0.5s var(--ease-spring); }
@keyframes g-tick { 30% { transform: scale(1.12); } }

/* vite: tre aureole */
.hud__lives { display: flex; gap: 7px; }
.halo {
  width: 20px; height: 8px;
  border-radius: 50%;
  border: 2.5px solid var(--gold);
  box-shadow: inset 0 1px 0 var(--gold-hi), 0 1px 0 rgba(168, 106, 8, 0.35);
  transition: border-color 0.3s, opacity 0.3s, transform 0.3s;
}
.halo.is-lost {
  border-color: rgba(19, 19, 19, 0.22);
  box-shadow: none;
  animation: g-halo-out 0.55s var(--ease-out);
}
@keyframes g-halo-out {
  0% { transform: scale(1.6) translateY(-3px); border-color: var(--gold); }
  40% { transform: scale(0.8); }
}

/* nuovo record in volo */
.hud__flag {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-weight: var(--w-bold);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-6px) scale(0.9);
  transition: opacity 0.3s, transform 0.5s var(--ease-spring);
}
.hud__flag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.hud__flag.is-on { opacity: 1; transform: none; }

/* "Ostacoli!" a 300 punti: al posto del pallino, una barra in miniatura
   con le stesse strisce d'avvertimento delle barriere sulla strada */
.hud__flag--warn::before {
  width: 16px; height: 6px;
  border-radius: 1px;
  background: repeating-linear-gradient(-45deg, var(--sky-line, #4ea3cf) 0 3px, #2e5468 3px 5px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.hud__flag--warn.is-on { animation: g-warn 0.9s steps(2, end) 2; }
@keyframes g-warn { 50% { background: #2e5468; } }

/* nickname modificabile */
.nick { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: end; margin-top: 3px; width: 100%; min-width: 0; }
.nick__btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  max-width: min(100%, 240px);
  min-width: 0;
  min-height: 44px;
  font-weight: var(--w-bold);
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  border-radius: 6px;
}
.nick__btn::after { content: ""; position: absolute; inset: -10px -10px -10px -12px; } /* bersaglio ≥ 44px */
.nick__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nick__pen { width: 13px; height: 13px; flex: none; opacity: 0.5; transition: opacity 0.2s, transform 0.4s var(--ease-spring); }
.nick__btn:hover .nick__pen { opacity: 1; transform: rotate(-12deg) translateY(-1px); }
.nick__form { display: grid; justify-items: end; gap: 5px; width: 100%; }
.nick__form[hidden] { display: none; }
.nick__input {
  width: 100%;
  max-width: 210px;
  height: 36px;
  padding: 4px 10px;
  border: 0;
  border-radius: 10px;
  background: var(--white);
  box-shadow: inset 0 0 0 1.5px var(--ink);
  font-weight: var(--w-bold);
  font-size: 16px; /* ≥16 px: niente zoom su iOS */
  text-align: right;
  -webkit-user-select: text;
  user-select: text;
}
.nick__input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.nick__hint { font-size: 9.5px; line-height: 1.3; font-weight: var(--w-bold); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.66; text-align: right; }
.nick__err {
  font-size: 12px; line-height: 1.35; color: var(--danger);
  max-width: 230px; margin-top: 5px;
  background: rgba(255, 255, 255, 0.86); padding: 5px 8px; border-radius: 8px;
}
.nick__err:empty { display: none; }
.nick.is-busy .nick__input { opacity: 0.5; }

/* ---------- AVVIO ---------- */
.game__prompt {
  position: absolute;
  left: 0; right: 0;
  top: var(--prompt-top, calc(68% + 64px));
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 4px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0s 0.35s;
}
.game__start {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 46px;
  padding: 0 22px 0 18px;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-weight: var(--w-bold);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 14px 30px -16px rgba(22, 86, 128, 0.6), 0 0 0 1px rgba(19, 19, 19, 0.05);
  transition: transform 0.4s var(--ease-spring);
}
.game__start::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue);
  animation: g-blink 1.2s steps(1, end) infinite;
}
.game__start:hover { transform: translateY(-2px); }
.game__start:active { transform: scale(0.96); }
@keyframes g-blink { 0%, 62% { opacity: 1; } 63%, 100% { opacity: 0.15; } }
.game__hint {
  font-size: 11px;
  font-weight: var(--w-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(19, 19, 19, 0.7);
  text-align: center;
  padding: 6px 16px 0;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.95), 0 0 2px rgba(255, 255, 255, 0.9);
}
.game__hint-keys::before { content: " · "; }
@media (hover: none) and (pointer: coarse) {
  .game__hint-keys { display: none; }
}

/* ---------- PAUSA ---------- */
.game__pause {
  position: absolute; inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  background: rgba(205, 238, 255, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: g-fade 0.3s var(--ease-out);
}
.game__pause[hidden] { display: none; }
.game__pause-cta {
  font-weight: var(--w-bold);
  font-size: clamp(30px, 6vw, 52px);
  line-height: 1;
  letter-spacing: -0.035em;
}
.game__pause-keys { font-size: 11px; font-weight: var(--w-bold); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; margin-top: 4px; }
@media (hover: none) and (pointer: coarse) { .game__pause-keys { display: none; } }
.game[data-state="paused"] .hud { z-index: 5; }
.game__pause:focus-visible { outline-offset: -8px; border-radius: 18px; }
@keyframes g-fade { from { opacity: 0; } }

/* ---------- LIVELLO SCHEDE ---------- */
.game__layer {
  position: absolute; inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 20px 16px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-user-select: text;
  user-select: text;
  pointer-events: none; /* il cielo intorno alla scheda lascia passare i tocchi verso HUD e classifica */
}
.game__layer > .card { pointer-events: auto; }
.game__layer[hidden] { display: none; }
.card {
  position: relative;
  margin: auto;
  width: min(400px, 100%);
  flex: none;
  background: var(--white);
  border-radius: 26px;
  padding: 30px 24px 22px;
  /* ombra corta: una sfocatura ampia sopra il canvas pixelato ne ammorbidisce la retinatura */
  box-shadow: 0 22px 44px -26px rgba(22, 86, 128, 0.5), 0 0 0 1px rgba(19, 19, 19, 0.04);
  animation: g-card-in 0.6s var(--ease-out) both;
}
.card[hidden] { display: none; }
@keyframes g-card-in { from { opacity: 0; transform: translateY(26px) scale(0.97); } }
.card__title {
  text-align: center;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}
.card__lead {
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin: 10px auto 20px;
  max-width: 300px;
  text-wrap: balance;
}

/* ---------- ACCOUNT ---------- */
.auth__form { display: grid; gap: 10px; }
.auth__form[hidden] { display: none; }
.gf { display: grid; gap: 4px; }
.gf__box {
  position: relative;
  background: var(--paper);
  border-radius: 14px;
  transition: background 0.2s, box-shadow 0.2s;
}
.gf__box:focus-within { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--ink); }
.gf.is-invalid .gf__box { box-shadow: inset 0 0 0 1.5px var(--danger); background: #fff6f5; }
.gf__input {
  display: block;
  width: 100%;
  height: 56px;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 23px 16px 7px;
  font-size: 16px;
  font-weight: var(--w-medium);
  border-radius: 14px;
}
.gf__input:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.gf--pw .gf__input { padding-right: 52px; }
.gf__label {
  position: absolute;
  left: 16px; top: 18px;
  font-size: 15px;
  line-height: 20px;
  color: rgba(19, 19, 19, 0.6);
  pointer-events: none;
  transform-origin: 0 0;
  transition: transform 0.3s var(--ease-out), color 0.2s, letter-spacing 0.3s;
}
.gf__input:focus + .gf__label,
.gf__input:not(:placeholder-shown) + .gf__label {
  transform: translateY(-10px) scale(0.74);
  color: var(--ink);
  font-weight: var(--w-bold);
  letter-spacing: 0.02em;
}
.gf__eye {
  position: absolute; right: 6px; top: 6px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: rgba(19, 19, 19, 0.7);
}
.gf__eye svg { width: 20px; height: 20px; }
.gf__eye[aria-pressed="false"] .eye-slash { display: none; }
.gf__hint { font-size: 12px; color: var(--muted); padding: 0 4px; }
.gf__error { font-size: 12.5px; line-height: 1.4; color: var(--danger); padding: 0 4px; }
.gf__error:empty { display: none; }

.gc {
  display: grid;
  grid-template-columns: 22px 1fr;
  column-gap: 12px;
  align-items: start;
}
.gc:first-of-type { margin-top: 4px; }
.gc__box {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  margin: 11px 0 0;
  border-radius: 7px;
  background: var(--white) no-repeat center / 14px 14px;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  cursor: pointer;
  transition: background-color 0.2s, transform 0.35s var(--ease-spring);
}
.gc__box:checked {
  background-color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.4 5.6 10.3 11.5 3.8' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transform: scale(1.06);
}
.gc.is-invalid .gc__box { box-shadow: inset 0 0 0 1.5px var(--danger); }
.gc__label {
  padding: 11px 0 9px;
  min-height: 44px;
  font-size: 13.5px;
  line-height: 1.45;
  cursor: pointer;
}
.gc__label a { font-weight: var(--w-bold); }
.gc__req { color: var(--muted); }
.gc .gf__error { grid-column: 2; margin-top: -6px; padding: 0; }

.auth__status { font-size: 13.5px; line-height: 1.45; color: var(--danger); text-align: center; }
.auth__status:empty { display: none; }
.auth__submit { margin-top: 8px; position: relative; }
.auth__submit.is-busy, .result .btn.is-busy { pointer-events: none; }
.auth__submit.is-busy span { opacity: 0.35; }
.auth__submit.is-busy::after {
  content: ""; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: g-spin 0.8s linear infinite;
}
@keyframes g-spin { to { transform: rotate(360deg); } }
.auth__switch {
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 2px;
}
.auth__switch button {
  color: var(--ink);
  font-weight: var(--w-bold);
  min-height: 44px;
  padding: 0 4px;
}
.auth__done { display: grid; justify-items: center; gap: 4px; text-align: center; padding-top: 6px; }
.auth__done[hidden] { display: none; }
.auth__done .btn { margin-top: 8px; }
.auth__done-mark {
  display: grid; place-items: center;
  width: 56px; height: 56px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--sky);
  animation: g-pop 0.7s var(--ease-spring) both;
}
.auth__done-mark .dot { width: 14px; height: 14px; }
@keyframes g-pop { from { transform: scale(0.4); opacity: 0; } }

/* ---------- RISULTATO ---------- */
.result { text-align: center; padding-top: 26px; }
.result__eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.result__eyebrow .dot { width: 8px; height: 8px; min-width: 8px; min-height: 8px; }
.result__score {
  font-weight: var(--w-bold);
  font-size: clamp(76px, 20vw, 124px);
  line-height: 0.86;
  letter-spacing: -0.06em;
  margin: 18px 0 6px;
  font-variant-numeric: tabular-nums;
}
.result__unit { font-size: 10.5px; }
.result__badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px;
  padding: 7px 13px 7px 11px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-weight: var(--w-bold);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: g-pop 0.7s 0.5s var(--ease-spring) both;
}
.result__badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.result__badge[hidden] { display: none; }
.result__stats {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 7vw, 36px);
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.result__stats > div[hidden] { display: none; }
.result__stats dt { font-size: 10px; }
.result__stats dd { margin: 4px 0 0; font-weight: var(--w-bold); font-size: 20px; letter-spacing: -0.02em; }
.result__status { margin-top: 14px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.result__status.is-error { color: var(--danger); }
.result__status:empty { display: none; }
.result__actions { display: grid; gap: 10px; margin-top: 20px; }

/* ---------- STATI ---------- */
.game[data-state="boot"] .hud__side,
.game[data-state="auth"] .hud__side {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0s 0.3s;
}
.game[data-state="ready"] .game__prompt {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s 0.15s, visibility 0s;
}
/* in volo l'interfaccia si riduce all'essenziale: punteggio + aureole */
.game[data-state="waking"] .hud__side,
.game[data-state="playing"] .hud__side,
.game[data-state="paused"] .hud__side,
.game[data-state="dying"] .hud__side {
  opacity: 0.26;
  transform: translateY(-4px);
}
.game[data-state="waking"] .hud__side *,
.game[data-state="playing"] .hud__side *,
.game[data-state="dying"] .hud__side * { pointer-events: none; }
.game[data-state="waking"] .hud__center,
.game[data-state="playing"] .hud__center,
.game[data-state="paused"] .hud__center,
.game[data-state="dying"] .hud__center {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.4s var(--ease-out), transform 0.6s var(--ease-out), visibility 0s;
}
.game[data-state="over"] .game__layer { padding-top: 24px; }
@media (max-width: 620px) {
  .game[data-state="over"] .game__layer { padding-top: 132px; }
}

/* flash di colpo (riduzione movimento: niente scossa, solo un lampo) */
.game.is-hit .hud__center { animation: g-shudder 0.3s steps(3, end); }
@keyframes g-shudder { 33% { transform: translateX(-3px); } 66% { transform: translateX(3px); } }

/* ---------- CLASSIFICA (EG.sheet) ---------- */
.sheet-backdrop.lb-sheet .sheet {
  padding: 0;
  background-color: var(--sky);
  background-repeat: repeat-x;
  background-position: 50% 0;
  image-rendering: pixelated;
  width: min(480px, 100%);
}
.lb { padding: 22px 16px 18px; display: grid; gap: 14px; }
.lb__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
.lb__top .label { opacity: 0.75; }
.lb__close {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 10px 24px -14px rgba(22, 86, 128, 0.6);
  transition: transform 0.4s var(--ease-spring);
}
.lb__close:hover { transform: rotate(90deg); }
.lb__close svg { width: 14px; height: 14px; }
.lb__box {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  padding: 22px 20px 16px;
  box-shadow: 0 24px 50px -30px rgba(22, 86, 128, 0.6), 0 0 0 1px rgba(19, 19, 19, 0.04);
}
.lb__title {
  font-size: clamp(18px, 4.6vw, 22px);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1.1;
}
.lb__sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.lb__group { position: relative; }
.lb__group--top { margin-top: 18px; }
.lb__tag {
  display: flex; justify-content: space-between;
  font-size: 10px; font-weight: var(--w-bold); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--ink);
}
.lb__row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  padding: 10px 8px;
  margin: 0 -8px;
  box-shadow: inset 0 -1px 0 var(--line);
  font-weight: var(--w-bold);
  font-size: 13px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  animation: g-row 0.5s var(--ease-out) both;
}
.lb__row:last-child { box-shadow: none; }
@keyframes g-row { from { opacity: 0; transform: translateY(6px); } }
.lb__rank { font-variant-numeric: tabular-nums; }
.lb__nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; font-size: 14px; letter-spacing: 0; }
.lb__score { font-variant-numeric: tabular-nums; }
.lb__row.is-empty { color: rgba(19, 19, 19, 0.36); }
.lb__row.is-empty .lb__nick { text-transform: uppercase; font-size: 13px; letter-spacing: 0.035em; }
.lb__row.is-first .lb__score::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--gold); vertical-align: 1px; }
.lb__group--rest .lb__row { font-weight: var(--w-medium); color: rgba(19, 19, 19, 0.62); }
.lb__group--rest { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line-strong); }
.lb__row.is-me { background: var(--sky); box-shadow: none; border-radius: 10px; color: var(--ink); }
.lb__row.is-me .lb__nick::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--blue); vertical-align: 1px; }
.lb__note { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.lb__state { padding: 26px 0 18px; text-align: center; font-size: 14px; color: var(--muted); }
.lb__state .btn { margin-top: 14px; min-height: 44px; padding: 0 22px; }
.lb__state.is-error { color: var(--danger); }

/* ---------- COME SI GIOCA ---------- */
.game-info {
  padding: clamp(80px, 11vw, 160px) var(--gutter) 0;
}
/* brief: il Minigame vive nel cielo — anche sotto il palco di gioco */
body[data-page="minigame"] { background: linear-gradient(var(--sky) 0%, var(--sky) 40%, #e6f6ff 100%); }
body[data-page="minigame"] .site-footer__row { border-top-color: rgba(19, 19, 19, 0.16); }
.game-info__head, .game-info__rules, .game-info__foot { max-width: 1240px; margin-left: auto; margin-right: auto; }
.game-info__eyebrow { display: flex; align-items: center; gap: 10px; }
.game-info__eyebrow .dot { width: 8px; height: 8px; min-width: 8px; min-height: 8px; }
.game-info__title {
  margin-top: clamp(18px, 2.4vw, 30px);
  font-size: clamp(44px, 8.4vw, 132px);
  line-height: 0.9;
  letter-spacing: -0.055em;
  max-width: 11ch;
  text-wrap: balance;
}
.game-info__rules {
  margin-top: clamp(56px, 8vw, 110px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px clamp(20px, 3vw, 48px);
}
.game-info__rules li {
  display: grid;
  align-content: start;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
}
.game-info__n { font-size: 11px; font-weight: var(--w-bold); letter-spacing: 0.08em; color: var(--muted); }
.game-info__rules h3 { font-size: clamp(22px, 2vw, 28px); letter-spacing: -0.025em; line-height: 1.05; }
.game-info__rules p { font-size: 16px; line-height: 1.55; max-width: 34ch; text-wrap: pretty; }
.game-info__foot {
  margin-top: clamp(48px, 6vw, 80px);
  display: grid;
  gap: 14px;
  justify-items: start;
}
.game-info__note { font-size: 14px; line-height: 1.55; color: var(--muted); max-width: 62ch; }
.game-info__account { font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.game-info__account[hidden], .preview-flag[hidden] { display: none; }
.game-info__account button { font-weight: var(--w-bold); min-height: 44px; }

@media (max-width: 860px) {
  .game-info__rules { grid-template-columns: 1fr; gap: 30px; }
}

/* ---------- SCHERMI PICCOLI ---------- */
@media (max-width: 420px) {
  .hud { padding-top: 12px; gap: 4px; }
  .hud__best { font-size: 19px; }
  .nick__btn { font-size: 16px; }
  .card { padding: 26px 18px 18px; border-radius: 22px; }
  .lb__box { padding: 20px 16px 14px; }
}
@media (max-width: 350px) {
  .hud__label { font-size: 9.5px; letter-spacing: 0.08em; }
  .hud__score { font-size: 42px; }
  .halo { width: 16px; height: 7px; border-width: 2px; }
}
@media (max-height: 680px) {
  .card { padding-top: 22px; }
  .result__score { font-size: 64px; margin: 12px 0 4px; }
  .result__badge { margin-top: 10px; }
  .result__stats { margin-top: 14px; padding-top: 12px; }
  .result__status { margin-top: 10px; }
  .result__actions { margin-top: 14px; }
  .game[data-state="over"] .game__layer { padding-top: 24px; }
}
@media (max-height: 680px) and (max-width: 620px) {
  .game[data-state="over"] .game__layer { padding-top: 118px; }
}
@media (max-height: 520px) {
  .game__prompt { top: auto; bottom: 8px; }
  .game__hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .game__start::before { animation: none; }
  .hud__flag, .hud__flag.is-on { transform: none; }
  .hud__flag--warn.is-on { animation: none; }
}
