:root {
  --bg: var(--tg-theme-bg-color, #0f1115);
  --text: var(--tg-theme-text-color, #e7e9ee);
  --sub: var(--tg-theme-hint-color, #8a9099);
  --accent: var(--tg-theme-button-color, #3b82f6);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --card: var(--tg-theme-secondary-bg-color, #181b22);
  --danger: #ef4444;
  --ok: #22c55e;
  /* Accenti di gioco: oro = Potenza/rarità leggendaria, brace = Forgia. */
  --gold: #e3b341;
  --gold-soft: rgba(227, 179, 65, .14);
  --ember: #f97316;
  /* Superfici e bordi: una scala sola per tutto (card, righe, tile). */
  --panel: rgba(255,255,255,.045);
  --panel-strong: rgba(255,255,255,.08);
  --line: rgba(255,255,255,.09);
  /* Rarità equip (allineate a RARITY_COLORS di views/forge.js, scala v202
     a 10 tier). I pezzi pre-v202 slittano: il vecchio leggendario ora è
     epic (viola), l'epic è rare (blu), il rare è uncommon (verde). */
  --rar-common: #9aa0a8;
  --rar-uncommon: #22c55e;
  --rar-rare: #3b82f6;
  --rar-epic: #a855f7;
  --rar-legendary: #ef4444;
  --rar-mythic: #f97316;
  --rar-exotic: #14b8a6;
  --rar-divine: #fbbf24;
  --rar-celestial: #22d3ee;
  --rar-transcendent: #e879f9;
  /* Display: capitali romane per i titoli di vista (non per i nomi player). */
  --font-display: "Cinzel", "Times New Roman", serif;
}

/* Light mode: tenue panna/neutro (non il bianco puro di Telegram e non crema
   spinto). Sovrascrive le 4 variabili che in dark derivano dal tema e ribalta
   gli overlay chiari (panel/line sono alpha BIANCO: su sfondo chiaro
   scompaiono). I residui rgb bianchi scritti a mano (bordi/tile) stanno come
   micro-evidenze. */
html[data-theme="light"] {
  --bg: #ebe8e2;                      /* grigio panna tenue dietro la card */
  --card: #f8f6f1;                    /* superficie quasi neutra */
  --text: #2b2924;
  --sub: #807b6f;
  --accent: #3b82f6;                  /* tg light = azzurro spento, blu pieno tiene meglio */
  --accent-text: #ffffff;
  --panel: rgba(60, 54, 44, .06);
  --panel-strong: rgba(60, 54, 44, .11);
  --line: rgba(60, 54, 44, .16);
}
html[data-theme="light"] body {
  /* alone dietro la card: in light diventa ombra (era glow bianco) */
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(0,0,0,.04), transparent 55%),
    var(--bg);
}
/* v244.38: i contatori della slot (.sm-item) hanno uno sfondo SCURO fisso in
   ogni tema: qui prima il light mode metteva testo scuro (#302d27) su quel
   fondo scuro → cifre illeggibili per chi usa Telegram/tema chiaro (e per il
   tema C). Il testo resta chiaro in ogni tema, vedi .sm-item sotto. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* La pagina non scorre: scorre solo #view dentro la card (la tabbar resta
   sempre visibile in basso e il polling non fa perdere la posizione).
   Dietro la card un alone radiale in alto, quasi impercettibile: profondità. */
body {
  height: 100vh;              /* fallback */
  height: 100dvh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,.05), transparent 55%),
    var(--bg);
}

.card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}

/* Layout a colonna: #view riempie e scorre, tabbar fissata sotto. */
#app.card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px 14px 10px;
}

#view {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.hidden { display: none !important; }

/* Titoli di vista in Cinzel: le capitali romane danno voce all'ambientazione
   (Arena, clan, forgia). Nomi di player e numeri restano nel sans di sistema:
   i nomi si leggono come scritti, i punteggi usano cifre tabulari. */
.bhead-title, .result-title, .tb-head, .ph-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .03em;
}
.rk-val, .bsum-stat b, .hub-stat, .result-highlight, .stat .v, .ac-power, .hub-lvl {
  font-variant-numeric: tabular-nums;
}

.state { text-align: center; padding: 32px 8px; color: var(--sub); }

.spinner {
  width: 28px; height: 28px; margin: 0 auto 12px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Header */
.header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}
.headinfo { line-height: 1.3; }
.display-name { font-size: 18px; font-weight: 700; }
.display-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-power {
  background: linear-gradient(180deg, #f0c96c, #c9972e); color: #241a05;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 800;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.username { font-size: 13px; color: var(--sub); }

/* Badges */
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  background: rgba(239, 68, 68, .15); color: var(--danger);
  border: 1px solid rgba(239, 68, 68, .35);
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
}

/* Bars */
.bar-label {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--sub); margin-bottom: 6px;
}
.bar {
  height: 10px; border-radius: 999px;
  background: rgba(255,255,255,.08); overflow: hidden;
}
.bar-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--accent); transition: width .4s ease;
}

/* Stats grid */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stat {
  background: var(--panel); border-radius: 10px;
  padding: 10px 8px; display: flex; align-items: center; gap: 8px;
}
.stat .ico { font-size: 20px; }
.stat .k { font-size: 11px; color: var(--sub); }
.stat .v { font-size: 15px; font-weight: 700; }

/* Buttons */
.btn {
  width: 100%; padding: 13px; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 8px;
  transition: transform .12s ease, filter .15s ease;
}
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn:disabled { opacity: .6; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.97); filter: brightness(1.1); }

/* Accessibilità: bordo visibile su navigazione da tastiera. */
.btn:focus-visible, .chip:focus-visible, .tab:focus-visible, .subitem:focus-visible,
.hub-card:focus-visible, .fg-chip:focus-visible,
.fg-odds-btn:focus-visible, .sm-close:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Movimento ridotto: spente solo le animazioni decorative in loop
   (glow incudine, martello che oscilla, doom); i momenti guidati
   dall'utente restano. */
@media (prefers-reduced-motion: reduce) {
  .forge-anvil, .forge-hammer, .gift-fig.gift-shake, .fx-doom,
  .slot-reel.spinning { animation: none !important; filter: none !important; }
}

.msg { margin-top: 10px; padding: 10px; border-radius: 10px; font-size: 14px; text-align: center; }
.msg.ok { background: rgba(34, 197, 94, .15); color: var(--ok); }
.msg.err { background: rgba(239, 68, 68, .15); color: var(--danger); }

.err-text { color: var(--danger); margin-bottom: 12px; }

/* Tabbar */
.tabbar {
  display: flex; gap: 8px;
  flex-shrink: 0;
  margin-top: 12px;
  padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08);
}
.tab {
  flex: 1 1 0; min-width: 0; padding: 8px 4px 7px; border: none; border-radius: 10px;
  background: transparent; color: var(--sub);
  font-size: 11px; font-weight: 600; cursor: pointer;
  white-space: nowrap; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-family: inherit;
  transition: background .15s ease, color .15s ease;
}
/* Icone tabbar: sprite SVG inline, pillola oro-soft dietro l'icona attiva. */
.tabicon { font-size: 22px; line-height: 1; height: 24px; display: flex; align-items: center; }
.tabicon svg { width: 22px; height: 22px; display: block; }
.iconpill {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 22px; border-radius: 999px;
}
.tab.active .iconpill { background: rgba(227, 179, 65, .22); }
/* Scheda attiva: tinta dorata + filo in alto, niente blocco pieno. */
.tab.active {
  background: var(--gold-soft); color: var(--text);
  box-shadow: inset 0 2px 0 var(--gold);
}
.tab.active .tabicon { filter: drop-shadow(0 0 6px rgba(227,179,65,.35)); }

/* Edifici */
.bhead { margin-bottom: 12px; }
.bhead-title { font-size: 20px; font-weight: 700; }
.bhead-sub { font-size: 12px; color: var(--sub); margin-top: 2px; }
.bhead-sub .ok { color: var(--ok); }
.bhead-sub .danger { color: var(--danger); }

.bsummary {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px;
}
.bsum-stat {
  background: var(--panel); border-radius: 10px; padding: 8px 10px;
  display: flex; justify-content: space-between; align-items: center; font-size: 13px;
}
.bsum-stat span { color: var(--sub); }
.bsum-stat b { font-size: 15px; }

.bactions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.btn.small { padding: 9px; font-size: 13px; margin-top: 8px; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }

.bgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.bcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.bcard.damaged { border: 1px solid rgba(239,68,68,.4); }
.bcard-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bemoji { font-size: 22px; }
.bname { font-size: 14px; font-weight: 700; flex: 1; }
.blevel { font-size: 12px; color: var(--sub); background: rgba(255,255,255,.06); padding: 2px 7px; border-radius: 999px; }
.binfo { font-size: 12px; color: var(--sub); }
.binfo.locked { color: var(--danger); }
.bdamage { font-size: 11px; color: var(--danger); font-weight: 600; }
.bcountdown { font-size: 12px; color: var(--ok); font-weight: 600; }
.bmax { font-size: 12px; color: var(--sub); text-align: center; padding: 6px 0; }
.bar.small { height: 6px; margin: 2px 0; }
.bar-fill.ok { background: var(--ok); }

/* --- Arena: righe pool avversari -------------------------------------------- */
.ar-resetbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.ar-resetbar > div {
  background: var(--panel); border-radius: 10px; padding: 7px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.ar-resetbar span { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--sub); }
.ar-resetbar b { font-size: 13px; font-variant-numeric: tabular-nums; }
.ar-opp { padding: 9px 0; border-top: 1px solid rgba(255,255,255,.07); }
.ar-opp-top { display: flex; align-items: center; gap: 8px; }
.ar-medal { font-size: 15px; min-width: 26px; text-align: center; }
.ar-opp-name {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ar-opp-lvl { font-weight: 400; font-size: 12px; color: var(--sub); }
.ar-opp-stats { font-size: 12px; color: var(--sub); margin-top: 2px; }
/* Il bottone per riga NON deve ereditare width:100% (.btn): resta compatto
   sulla destra e lascia il nome a tutta larghezza. Rosso = tasto di attacco
   (v187.35): aggressione deliberata, come i bottoni Rapina/Vendetta. */
.ar-atk { width: auto; margin-top: 0; padding: 8px 12px; white-space: nowrap;
  background: var(--danger); color: #fff; }

/* --- Fase 2: hub Home ------------------------------------------------------- */
.hub-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hub-hello { font-size: 18px; font-weight: 700; }
.hub-lvl {
  background: linear-gradient(180deg, #f0c96c, #c9972e); color: #241a05;
  padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.hub-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px;
}
.hub-stat {
  background: var(--panel); border-radius: 10px; padding: 8px 6px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 13px; font-weight: 700;
}
.hub-stat span { font-size: 14px; }

.hub-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
/* Variante a colonna singola (hub Multiplayer: card impilate una sotto l'altra) */
.hub-grid.one { grid-template-columns: 1fr; }
.hub-card {
  position: relative;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 12px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px;
  color: var(--text);
  font-family: inherit;
  transition: background .15s ease;
}
.hub-card:active { background: var(--panel-strong); }
.hc-icon { font-size: 24px; }
.hc-name { font-size: 14px; font-weight: 700; }
.hc-desc { font-size: 11px; color: var(--sub); line-height: 1.35; }
.hc-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--danger); color: #fff;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Pallino badge sulla tabbar */
.tab { position: relative; }
.tabdot {
  position: absolute; top: 2px; right: 6px;
  background: var(--danger); color: #fff;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px; font-size: 9px; font-weight: 700; line-height: 15px;
  text-align: center;
}

/* Subnav secondaria (sopra la tabbar): striscia piu' bassa con icona piccola
   e scritta minuscola, scorrevole in orizzontale se le voci non ci stanno. */
.subnav {
  display: flex; gap: 5px;
  flex-shrink: 0;
  margin-top: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subitem {
  flex: 1 1 auto; min-width: 48px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 8px;
  border: none; border-radius: 8px;
  background: var(--panel); color: var(--sub);
  font-family: inherit; cursor: pointer;
}
.subitem .subicon { font-size: 14px; line-height: 1.25; }
.subitem .subicon svg { width: 15px; height: 15px; display: block; margin: 0 auto; }
.subitem .sublabel { font-size: 9px; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.subitem:active { background: rgba(255,255,255,.1); }
.subitem.active { background: var(--gold-soft); color: var(--text); box-shadow: inset 0 2px 0 var(--gold); }
/* Counter rosso sulla voce della striscia secondaria (come tabdot, ridotto) */
.subitem { position: relative; }
.subdot {
  position: absolute; top: 0; right: 3px;
  background: var(--danger); color: #fff;
  min-width: 13px; height: 13px; padding: 0 3px;
  border-radius: 999px; font-size: 8px; font-weight: 700; line-height: 13px;
  text-align: center;
}
/* v168: punto rosso «premi da riscuotere» sul tasto 🎁 Premi (guerra conclusa)
   v196.21: DENTRO il tasto, non a cavallo del bordo (top:-5/right:-5 uscivano
   dal pannello forgia sui telefoni stretti) — come fa già .subdot. */
.premi-dot {
  position: absolute; top: 2px; right: 3px;
  background: var(--danger); color: #fff;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px; font-size: 9px; font-weight: 700; line-height: 15px;
  text-align: center;
}

/* Placeholder viste non ancora implementate */
.placeholder { text-align: center; padding: 36px 10px; color: var(--sub); }
.ph-icon { font-size: 40px; margin-bottom: 10px; }
.ph-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.ph-text { font-size: 13px; }

/* --- Fase 2: schermata-risultato (overlay) --------------------------------- */
.result-overlay {
  /* v142: 50 -> 65. Con 50 il risultato dello sparring da profilo stava
     DIETRO al popup profilo (z60, .battle-popup) — «saresti in grado di
     batterlo» invisibile a fine battaglia. 65 = sopra i popup di battaglia,
     sotto gli effetti fx (70). */
  position: fixed; inset: 0; z-index: 65;
  background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.result-box {
  width: 100%; max-width: 360px;
  background: var(--card); border-radius: 16px;
  padding: 22px 18px; text-align: center;
  animation: resultIn .18s ease-out;
}
@keyframes resultIn {
  from { transform: scale(.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.result-box.ok { border: 1px solid rgba(34,197,94,.5); }
.result-box.err { border: 1px solid rgba(239,68,68,.5); }
.result-icon { font-size: 42px; margin-bottom: 8px; }
.result-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.result-highlight { font-size: 22px; font-weight: 800; margin: 8px 0; }
.result-box.ok .result-highlight { color: var(--ok); }
.result-box.err .result-highlight { color: var(--danger); }
.result-rows { margin: 10px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.result-row {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--sub);
  background: var(--panel); border-radius: 8px; padding: 7px 10px;
}
.result-row b { color: var(--text); }
.result-box .btn { margin-top: 10px; }

/* --- Sticker Lottie stile Telegram (battaglie) ----------------------------- */
.sticker-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.sticker-box {
  width: min(64vmin, 340px); height: min(64vmin, 340px);
  display: flex; align-items: center; justify-content: center;
}
.sticker-box svg { width: 100%; height: 100%; }
#bt-anim-dice { width: 84px; height: 84px; margin: 0 auto; }
#bt-anim-dice svg { width: 100%; height: 100%; }

/* --- Combattimento come popup (overlay scuro, stile schermata gioco) -------- */
/* v185: NIENTE backdrop-filter/blur qui — su WebKit iOS la combo
   backdrop-filter + contenitori -webkit-overflow-scrolling: touch dietro
   congela il compositing: le battaglie (arena PvP, guerra, scena forgia)
   arrivavano «schiermata ferma senza animazione». Il velo rgba basta. */
.battle-popup {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.78);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.battle-box {
  position: relative;
  width: min(92vw, 360px);
  background: var(--card); border-radius: 16px;
  padding: 16px; text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  animation: resultIn .18s ease-out;
}

/* Profili lunghi: scorrono solo i dati; titolo e chiusura restano visibili. */
.cn-profile-popup, .cn-piece-popup, .cn-clan-popup {
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.cn-profile-popup > .battle-box, .cn-piece-popup > .battle-box, .cn-clan-popup > .battle-box {
  max-height: 100%; min-height: 0; max-width: 100%;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch;
}
.cn-profile-popup > .cn-profile-box {
  display: flex; flex-direction: column; overflow: hidden;
}
.cn-profile-head {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto; text-align: left;
}
.cn-profile-head .fg-swap-title {
  flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cn-profile-dismiss {
  flex: 0 0 44px; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--text); font-size: 20px; cursor: pointer;
}
.cn-profile-dismiss:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cn-profile-body {
  min-height: 0; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch;
}
.cn-profile-actions { flex: 0 0 auto; }

/* --- Scene 2D battaglie (puro DOM/CSS, niente CDN) -------------------------- */
.sc-title { font-weight: 700; font-size: 15px; }
.sc-arena {
  display: flex; align-items: flex-end; gap: 6px;
  margin-top: 12px; padding: 10px 2px 12px;
  min-height: 96px;
}
.fighter { flex: 1 1 0; min-width: 0; position: relative; }
.sc-name {
  font-size: 11px; font-weight: 700; color: var(--sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%; margin-bottom: 2px;
}
.fighter#sc-left .sc-name { text-align: left; }
.fighter#sc-right .sc-name { text-align: right; }
.fighter .sc-fig {
  font-size: 42px; line-height: 1.1; position: relative;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.35));
}
.sc-vs { font-size: 12px; font-weight: 800; color: var(--sub); padding-bottom: 26px; }
.sc-hp {
  height: 9px; border-radius: 999px; background: rgba(255,255,255,.1);
  overflow: hidden; margin: 6px 2px 3px;
}
.sc-hp i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, #22c55e, #84cc16);
  border-radius: 999px; transition: width .45s ease;
}
.sc-hpnum { font-size: 10px; color: var(--sub); font-weight: 600; }
/* v171.1: HP guadagnati da lifesteal, ancorati a fianco dell'etichetta HP
   sotto la barra — in pulsa e svanisce (non vola sulla figura). */
.sc-heal {
  display: inline-block; margin-left: 5px;
  font-size: 12px; font-weight: 800; line-height: 1; color: #22c55e;
  animation: scHealPulse 1.2s ease-out forwards;
  text-shadow: 0 1px 4px rgba(0,0,0,.55); pointer-events: none;
}
@keyframes scHealPulse {
  0% { opacity: 0; transform: scale(.5); }
  15% { opacity: 1; transform: scale(1.25); }
  30% { transform: scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-6px); }
}
.fighter#sc-left .sc-fig { margin-right: auto; text-align: left; }
.fighter#sc-right .sc-fig { margin-left: auto; text-align: right; }

/* Carica avanti/dietro del fighter che colpisce */
.sc-lunge { animation: scLungeR .55s ease-in-out; }
.fighter#sc-left.sc-lunge { animation-name: scLungeR; }
.fighter#sc-right.sc-lunge { animation-name: scLungeL; }
@keyframes scLungeR {
  0% { transform: translateX(0); } 35% { transform: translateX(26px); }
  55% { transform: translateX(18px); } 100% { transform: translateX(0); }
}
@keyframes scLungeL {
  0% { transform: translateX(0); } 35% { transform: translateX(-26px); }
  55% { transform: translateX(-18px); } 100% { transform: translateX(0); }
}

/* Colpo subito: flash rosso + scossa */
.sc-hit .sc-fig { animation: scHitShake .55s ease-in-out; }
@keyframes scHitShake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); filter: brightness(2) saturate(0); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); filter: brightness(1.6) saturate(0); }
  80% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

/* L'arma equipaggiata colpisce: oscilla l'ARMA GIA' IN MANO nell'avatar
   (gruppo .av-weapon). Niente copie in overlay: e' lo stesso pezzo forgia
   portato dal personaggio che ruota e sfonda verso l'avversario. Le
   coordinate sono in unita' del viewBox (transform-box: fill-box, origine
   sul manico). Il fighter di destra e' specchiato dentro l'SVG: la
   rotazione segue da sola la direzione opposta. */
.av-weapon { transform-box: fill-box; transform-origin: 35% 80%; }
.fighter.sc-attacking .av-weapon { animation: scSwing .54s cubic-bezier(.25,.75,.35,1); }
@keyframes scSwing {
  0%   { transform: rotate(0deg); }
  24%  { transform: rotate(-46deg) translate(-2px, 2px); }
  56%  { transform: rotate(34deg) translate(10px, -3px); }
  78%  { transform: rotate(22deg) translate(6px, -2px); }
  100% { transform: rotate(0deg) translate(0, 0); }
}

/* Burst d'impatto: raggi SVG + particelle, ancora sulla figura colpita */
.sc-burst { position: absolute; inset: 0; pointer-events: none; }
.sc-burst svg {
  position: absolute; inset: -30%; width: 160%; height: 160%;
  animation: scBurstPop .6s ease-out forwards;
}
.sc-part {
  position: absolute; left: 50%; top: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sc-burst, #fbbf24);
  animation: scPartFly .6s ease-out forwards;
}
@keyframes scBurstPop {
  0% { transform: scale(.2); opacity: 1; }
  70% { transform: scale(1.1); opacity: .9; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes scPartFly {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; }
}

/* Numero fluttuante di danno/cura sulla figura colpita (duello a turni):
   "-95" rosso, "+23" verde (lifesteal), crit più grande e dorato. */
.sc-float {
  position: absolute; left: 50%; top: 0;
  font-weight: 800; font-size: 22px; line-height: 1;
  pointer-events: none; z-index: 3; white-space: nowrap;
  animation: scFloatUp .95s ease-out forwards;
  text-shadow: 0 2px 6px rgba(0,0,0,.55);
}
.sc-float.dmg { color: #ef4444; }
.sc-float.crit { color: #fbbf24; font-size: 28px; }
.sc-float.heal { color: #22c55e; }
.sc-float.block { color: #60a5fa; } /* 🛡️ Block Chance (v144) */
@keyframes scFloatUp {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(.5); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -48px) scale(1); }
}

/* Dadi: wobble durante il rotolamento */
.sc-dice { min-height: 84px; display: flex; align-items: center; justify-content: center; }
.sc-die {
  line-height: 84px; font-family: "Segoe UI Symbol", sans-serif;
  color: var(--text);
}
.sc-dice.rolling .sc-die { animation: scWobble .11s linear infinite; }
.sc-die.settle { animation: scSettle .5s ease-out; }
@keyframes scSettle {
  0% { transform: scale(1.3) rotate(9deg); }
  55% { transform: scale(.94) rotate(-3deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes scWobble {
  0% { transform: rotate(-9deg) translateY(-2px); }
  50% { transform: rotate(9deg) translateY(2px); }
  100% { transform: rotate(-9deg) translateY(-2px); }
}
.sc-duel { display: flex; align-items: center; justify-content: center; gap: 8px; }
.sc-duel .sc-die { font-size: 42px; line-height: 56px; }
.sc-duel .sc-side { font-size: 20px; }
.sc-duel .sc-dash { color: var(--sub); font-size: 20px; }

/* v180 testa scena duello: dado attaccante a sx, dado difensore a dx, round
   di fianco al titolo (dopo la rimozione «colpi incrociati» delle righe
   dettaglio). Il dado d'angolo eredita .sc-die (face unicode). */
.sc-head { display: flex; align-items: center; gap: 6px; }
.sc-die-corner {
  font-size: 26px; line-height: 1; flex: 0 0 auto;
  color: var(--text); opacity: .9;
  min-width: 1.1em; text-align: center;
}
.sc-die-corner.rolling { animation: scWobble .11s linear infinite; }
.sc-headmid {
  flex: 1 1 auto; min-width: 0;
  /* v187.19: colonna — la barra di progresso sta SOTTO al «72-1» */
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px;
}
.sc-headmid .sc-title {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Monete volanti (rapina/vendetta): volano dalla vittima all'utente */
.sc-coin {
  position: absolute; left: 50%; top: 30%;
  font-size: 18px; pointer-events: none;
  animation: scCoinFly .8s ease-out forwards;
}

/* Bonus giornaliero: scatola regalo che trema e si apre */
.gift-fig { font-size: 96px; line-height: 112px; display: inline-block; }
.gift-fig.gift-shake { animation: giftShake .14s linear infinite; }
@keyframes giftShake {
  0% { transform: rotate(-10deg) scale(.96); }
  25% { transform: rotate(8deg) scale(1.02); }
  50% { transform: rotate(-12deg) scale(.98); }
  75% { transform: rotate(10deg) scale(1.03); }
  100% { transform: rotate(-10deg) scale(.96); }
}
.gift-fig.settle { animation: scSettle .5s ease-out; }
@keyframes scCoinFly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  60% { opacity: 1; }
  100% { transform: translate(var(--fly-dx, -150px), var(--fly-dy, -20px)) scale(.5); opacity: 0; }
}

.sc-round { margin-top: 4px; font-weight: 600; font-size: 14px; }

/* --- Forgia: martello che colpisce l'incudine, tema fuoco ------------------ */
.forge-scene {
  position: relative;
  min-height: 150px; margin-top: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  background:
    radial-gradient(ellipse 70% 45% at 50% 100%, rgba(249, 115, 22, .35), transparent 70%),
    linear-gradient(180deg, #2b2f3a, #1a1d26);
  border: 2px solid rgba(249,115,22,.35); border-radius: 14px;
  padding: 12px 12px 6px;
  overflow: hidden;
}
/* Sfondo fisso scuro: come la slot, leggibile anche col tema chiaro. */
.forge-anvil { font-size: 52px; line-height: 1.2; position: relative;
  animation: forgeGlow 1.6s ease-in-out infinite; }
@keyframes forgeGlow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(249,115,22,.55)); }
  50% { filter: drop-shadow(0 0 16px rgba(251,146,60,.95)); }
}
/* v191.2: martello IN FLUSSO sopra l'incudine e che la colpisce davvero.
   Glifo ic-forge: testa in alto a destra, manico in basso sinistra → ruotato
   ~90° la testa va in basso-destra; la scena sposta il martello 8px a sinistra
   così la testa (ruotata) resta centrata sul piano. Alza (idle) → arco verso
   104° con dip di 4px: la testa si sovrappone all'incudine (margin -14) e
   SEMBRA colpirla, con le scintille (burstAt) calate proprio al colpo. */
.forge-hammer {
  font-size: 40px; line-height: 1;
  position: relative; z-index: 2;
  left: -8px;                          /* testa ruotata centrata sul piano */
  margin-bottom: -14px;                /* testa sul piano dell'incudine */
  transform-origin: 50% 60%;           /* perno: il manico */
  animation: forgeRaise 1.05s ease-in-out infinite;
}
@keyframes forgeRaise {
  0%, 100% { transform: rotate(44deg) translateY(-4px); }
  50%      { transform: rotate(58deg) translateY(-7px); }
}
.forge-hammer.forge-strike { animation: forgeStrike .34s cubic-bezier(.6,.05,.3,1); }
@keyframes forgeStrike {
  0%   { transform: rotate(44deg) translateY(-4px); }
  55%  { transform: rotate(104deg) translateY(4px); }  /* IMPATTO sull'incudine */
  78%  { transform: rotate(104deg) translateY(4px); }
  100% { transform: rotate(44deg) translateY(-4px); }
}
/* Scintille: riusa .sc-part del burst, ma in tinta fuoco */
.forge-scene .sc-part {
  background: linear-gradient(180deg, #fbbf24, #f97316);
  box-shadow: 0 0 8px rgba(249,115,22,.9);
}

/* --- v244.13: scena EVOCAZIONE uova, tema magia (stile scena forgia) ----- */
.egg-scene {
  position: relative;
  min-height: 170px; margin-top: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 70% 45% at 50% 80%, rgba(var(--egg-rgb), .32), transparent 70%),
    linear-gradient(180deg, var(--egg-bg1), var(--egg-bg2));
  border: 2px solid rgba(var(--egg-rgb), .4); border-radius: 14px;
  padding: 16px 12px 14px;
  overflow: hidden;
}
/* Cerchio d'evocazione: anello tratteggiato che ruota + alone interno. */
.egg-circle {
  position: absolute; left: 50%; top: 50%;
  width: 112px; height: 112px; margin: -56px 0 0 -56px;
  border-radius: 50%;
  border: 2px dashed rgba(var(--egg-soft-rgb), .8);
  box-shadow: 0 0 18px rgba(var(--egg-rgb), .35), inset 0 0 18px rgba(var(--egg-rgb), .25);
  opacity: 0; transition: opacity .5s;
}
.egg-circle::before {
  content: ""; position: absolute; inset: 7px; border-radius: 50%;
  border: 1px solid rgba(var(--egg-rgb), .55);
  background: radial-gradient(circle at 50% 62%, rgba(var(--egg-rgb), .38), transparent 65%);
}
.egg-circle.egg-live { opacity: 1; animation: eggSpin 2.4s linear infinite; }
@keyframes eggSpin { to { transform: rotate(360deg); } }
/* L'uovo in scossa: SVG neutro (grigio) che scende e rimbalza nel cerchio. */
.egg-orb {
  position: relative; z-index: 2;
  width: 56px; height: 70px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
}
.egg-orb .egg-art { width: 46px; height: 57px; }
.egg-orb.egg-drop { animation: eggDrop .72s cubic-bezier(.2,.8,.3,1.2) forwards; }
@keyframes eggDrop {
  0%   { transform: translateY(-86px) scale(1.1); opacity: 0; }
  55%  { transform: translateY(0) scale(1.05, .9); opacity: 1; }
  75%  { transform: translateY(-15px) scale(.97, 1.04); opacity: 1; }
  /* opacity esplicito anche al 100%: con forwards, il keyframe 100%
     implicito riprende il base (opacity: 0) rendendo l'uovo invisibile
     per TUTTO il resto della scena (v244.18) */
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.egg-orb.egg-wobble { animation: eggWobble .42s ease-in-out; }
@keyframes eggWobble {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-11deg) scale(1.03); }
  65% { transform: rotate(9deg) scale(1.02); }
}
/* Reveal: il cerchio lampeggia tutto (bagliore del rituale compiuto). */
.egg-circle.egg-flash { animation: eggFlash .85s ease; }
@keyframes eggFlash {
  0%, 100% { box-shadow: 0 0 18px rgba(var(--egg-rgb), .35), inset 0 0 18px rgba(var(--egg-rgb), .25); }
  40% { box-shadow: 0 0 42px 10px rgba(var(--egg-soft-rgb), .85), inset 0 0 34px rgba(var(--egg-soft-rgb), .6); }
}
/* Scintille del rituale in tinta magia */
.egg-scene .sc-part {
  background: linear-gradient(180deg, var(--egg-soft), var(--egg-hex));
  box-shadow: 0 0 8px rgba(var(--egg-rgb), .9);
}
/* xN: le UOVE evocate si vedono TUTTE — griglia in cascata (v244.15);
   solo rarità, niente anteprima pet (v244.16.1) */
.egg-grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 5px; padding: 0 4px;
}
.egg-grid-egg { display: flex; width: 26px; height: 32px; position: relative;
  animation: tileSpawnIn .45s cubic-bezier(.2, .8, .3, 1.25) both; }
.egg-grid-egg .egg-art { width: 26px; height: 32px; }
/* v244.18: il RITUALE del colore — ogni uovo si riempie di BIANCO da sopra
   verso sotto (velo su uno strato), poi quando il bianco è completo la
   rarità sale da sotto verso sopra mentre il velo si ritira al contrario */
.egg-layer { position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; pointer-events: none; }
.egg-fill .egg-l-col { opacity: 0; animation: eggColOn 1.5s linear both; }
.egg-fill .egg-l-white { clip-path: inset(0 0 100% 0);
  animation: eggFillWhite 1.5s cubic-bezier(.4, .2, .3, 1) both; }
.egg-ww { position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  clip-path: inset(0 0 100% 0);
  animation: eggFillWhite 1.5s cubic-bezier(.4, .2, .3, 1) both; }
.egg-ww .egg-art { width: 26px; height: 32px; }
@keyframes eggFillWhite {
  0%   { clip-path: inset(0 0 100% 0); }   /* nessun bianco */
  40%  { clip-path: inset(0 0 0 0); }      /* riempito da sopra verso sotto */
  50%  { clip-path: inset(0 0 0 0); }      /* un respiro: tutto bianco */
  100% { clip-path: inset(0 0 100% 0); }   /* bianco su, colore sù da sotto */
}
@keyframes eggColOn {
  0%, 38% { opacity: 0; }                  /* coperto dal velo bianco */
  41%, 100% { opacity: 1; }                 /* sotto il velo: si rivela poi */
}
/* v244.16.1: chip «facce del pet» della SCHIUSA — sbuca a metà crepe,
   si ritira quando il pet è GRANDE in scena */
.egg-pet {
  position: absolute; left: 50%; bottom: 6px; z-index: 2;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 5px;
  padding: 2px 9px 2px 3px;
  background: var(--egg-chip);
  border: 1px solid rgba(var(--egg-rgb), .65); border-radius: 999px;
  animation: eggPetIn .5s cubic-bezier(.2, .8, .3, 1.3) both;
}
.egg-pet-face { display: flex; align-items: center; justify-content: center;
  width: 21px; height: 21px; border-radius: 50%; font-size: 12px;
  background: rgba(var(--egg-rgb), .18); border: 1px solid; }
.egg-pet-name { font-size: 12px; font-weight: 700; }
@keyframes eggPetIn {
  from { opacity: 0; transform: translateX(-50%) scale(.4); }
}
.egg-bd-sep { color: var(--sub); opacity: .7; }

/* --- v244.14: scena SCHIUSA pet (gemella dell'evocazione) ---------------- */
/* L'uovo colorato (rarità nota) trema e si FENDE: 3 crepe progressive. */
.egg-cracks { position: absolute; left: 50%; top: 50%; z-index: 3;
  width: 56px; height: 66px; margin: -33px 0 0 -28px; pointer-events: none; }
.egg-crack { width: 100%; height: 100%; }
.egg-crack path { fill: none; stroke: rgba(0,0,0,.78); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.5)); }
.egg-cracks { animation: crackIn .3s ease; }
/* v244.17: il pet ESCE dall'uovo — il TOP del guscio si stacca in 2 FRAMMENTI
   (clip-path a polygon, metà superiore) che saltano su e cadono ai piedi,
   il cup (metà inferiore, clip sull'orb) resta aperto sul cerchio. */
.egg-orb.egg-open { animation: none; opacity: 1;
  clip-path: inset(44% 0 0 0); filter: none !important; }
.egg-frag { position: absolute; left: 50%; top: 50%; z-index: 3;
  width: 56px; height: 70px; margin: -35px 0 0 -28px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; }
.egg-frag .egg-art { width: 46px; height: 57px; }
.egg-frag.egg-flyl { clip-path: polygon(0% 0%, 47% 0%, 32% 44%, 0% 44%);
  animation: eggFlyL .95s cubic-bezier(.3,.5,.55,1) forwards; }
@keyframes eggFlyL {
  0%   { transform: translate(0,0) rotate(0); opacity: 1; }
  24%  { transform: translate(-2px,-13px) rotate(-11deg); }
  100% { transform: translate(-27px, 96px) rotate(-78deg); opacity: 0; }
}
.egg-frag.egg-flyr { clip-path: polygon(47% 0%, 100% 0%, 100% 44%, 31% 44%, 42% 25%);
  animation: eggFlyR .95s cubic-bezier(.3,.5,.55,1) forwards; }
@keyframes eggFlyR {
  0%   { transform: translate(0,0) rotate(0); opacity: 1; }
  24%  { transform: translate(3px,-10px) rotate(9deg); }
  100% { transform: translate(31px, 89px) rotate(64deg); opacity: 0; }
}
/* Il pet sale da DENTRO il guscio: è dietro il cup (z 1 < 2) finché non
   supera il bordo del guscio, poi emerge ed è grande in scena. */
.egg-creature { position: absolute; left: 50%; top: 50%; z-index: 1;
  width: 56px; height: 70px; margin: -35px 0 0 -28px; opacity: 0;
  display: flex; align-items: center; justify-content: center; }
.egg-creature.egg-rise {
  opacity: 1; animation: eggRise 1s cubic-bezier(.25,.7,.35,1.12) both;
}
@keyframes eggRise {
  0%   { transform: translateY(14px) scale(.35); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(-38px) scale(1); opacity: 1; }
}
/* Scagline del bordo che cadono insieme ai frammenti (giù). */
.egg-shard {
  position: absolute; left: 50%; top: 46%;
  width: 11px; height: 9px; border-radius: 3px;
  background: linear-gradient(180deg, #d6dade, #8d949f);
  box-shadow: 0 0 4px rgba(0,0,0,.5);
  pointer-events: none;
  animation: shardFly .8s cubic-bezier(.2,.6,.5,1) forwards;
}
@keyframes shardFly {
  0% { transform: translate(0,0) rotate(0) scale(1); opacity: 1; }
  100% { transform: translate(var(--fly-dx,-60px), var(--fly-dy,60px))
      rotate(var(--fly-r,120deg)) scale(.55); opacity: 0; }
}
/* Stat + abilità del neonato, riga di feedback della scena */
.hatch-skills { font-size: 13px; font-weight: 700; }

/* v244.19: schiusa INTERATTIVA a tap — l'uovo RESPIRA mentre aspetta
   il tocco (scale dolce), il tasto scatena la scossa sull'ART interno
   (sull'orb sovrascriverebbe la caduta e l'uovo lampeggia); il curatore
   che non tocca vede le crepe avanzare da sole (fallback a tempo). */
.egg-scene.egg-tappable { cursor: pointer; }
.egg-orb.egg-idle .egg-art {
  animation: eggIdle 3s ease-in-out infinite;
  transform-origin: 50% 90%;
}
@keyframes eggIdle {
  0%, 100% { transform: scale(1) translateY(0); }
  50%      { transform: scale(1.035, .985) translateY(-2px); }
}
.egg-art.egg-wobble { animation: eggWobble .42s ease-in-out; }
/* evocazione: drop + scossa SULL'ORB coesistono — la scossa da sola
   ripartirebbe dal base (opacity:0) e l'uovo sparirebbe a ogni battuta */
.egg-orb.egg-drop.egg-wobble {
  animation: eggDrop .72s cubic-bezier(.2,.8,.3,1.2) forwards,
             eggWobble .42s ease-in-out;
}
/* il pet RESTA VIVO: aleggia (float sull'inner, il rise resta
   sull'outer) e i tap sulla scena mandano su cuori */
.egg-creature.egg-rise > span {
  animation: eggFloat 2.4s ease-in-out infinite;
}
@keyframes eggFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-8px) rotate(3deg); }
}
.egg-heart {
  position: absolute; left: 50%; top: 42%; font-size: 15px;
  pointer-events: none;
  animation: eggHeartUp 1.2s ease-out forwards;
}
@keyframes eggHeartUp {
  0%   { opacity: 0; transform: translate(0, 6px) scale(.5); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--h-dx, 0), -84px) scale(1.25); }
}

/* --- Slot machine: tre rulli ------------------------------------------------ */
.slot-frame {
  display: flex; gap: 8px; justify-content: center;
  margin-top: 14px;
  background: linear-gradient(180deg, #2b2f3a, #1a1d26);
  border: 2px solid rgba(255,255,255,.15); border-radius: 14px;
  padding: 12px;
}
/* Slot "vera": contatori + comandi dentro la scena */
.slot-meter {
  display: flex; gap: 8px; justify-content: center;
  margin-top: 10px;
}
.sm-item {
  flex: 1; text-align: center;
  background: linear-gradient(180deg, #2b2f3a, #1a1d26);
  border: 1px solid rgba(255,255,255,.12); border-radius: 10px;
  padding: 6px 4px;
}
.sm-item span { display: block; font-size: 10px; letter-spacing: .06em; color: rgba(255,255,255,.78); }
.sm-item b { font-size: 16px; color: #f4f5f7; font-variant-numeric: tabular-nums; }
.sm-bets {
  display: flex; gap: 5px; justify-content: center; flex-wrap: wrap;
  margin-top: 10px;
}
/* AUTO: tasto a tutta larghezza, subito sopra lo SPIN */
.sm-auto {
  width: 100%; margin-top: 12px;
  font-weight: 700; letter-spacing: .04em;
  padding: 9px;
}
/* SPIN: il tasto grande della macchina, in fondo a tutti i comandi */
.sm-spin {
  width: 100%; margin-top: 8px;
  font-size: 17px; font-weight: 700; letter-spacing: .04em;
  padding: 12px;
}
.sm-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: var(--sub);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 4px;
}
.slot-reel {
  width: 68px; height: 84px;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; line-height: 1;
  background: linear-gradient(180deg, rgba(255,255,255,.14), #1f232d); /* fisso: --panel è bianco nel tema C */
  border: 1px solid rgba(255,255,255,.2); border-radius: 10px;
  box-shadow: inset 0 8px 14px rgba(0,0,0,.45), inset 0 -8px 14px rgba(0,0,0,.45);
}
.slot-reel.spinning {
  animation: slotBlur .09s linear infinite;
  filter: blur(1px);
}
@keyframes slotBlur {
  0% { transform: translateY(-9px); }
  50% { transform: translateY(9px); }
  100% { transform: translateY(-9px); }
}
.slot-reel.settle { animation: scSettle .45s ease-out; }
.sc-fb { margin-top: 3px; font-size: 12px; color: var(--sub); min-height: 17px; }
.sc-total { margin-top: 7px; font-size: 17px; font-weight: 700; }

/* --- Effetti a schermo pieno (fiamme, schiuma, coriandoli, sconfitta) ------ */
.fx-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(0,0,0,.35); overflow: hidden;
  cursor: pointer;
}
/* v187.6: effetto confinato al riquadro della battaglia (playEffect opts.host
   monta l'overlay DENTRO .battle-box, già position:relative) — clip sul
   bordo del box, niente copertura di tutto lo schermo. */
.fx-overlay.fx-scoped {
  position: absolute; border-radius: inherit;
}
.fx-big {
  position: absolute; left: 50%; top: 50%;
  font-size: 96px; transform: translate(-50%, -50%);
  animation: fxPopIn .3s ease-out;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.5));
}
/* v236: la VITTORIA scoped (campagna) scala col riquadro — 96px nel box
   ridotto si riempiva tutto lo schermo; la sconfitta resta a 96px (era già
   ok per l'owner). Il teschio SVG v236 si allinea a 1em come le icone. */
.fx-overlay.fx-scoped.fx-victory .fx-big { font-size: 64px; }
.fx-skull { width: 1em; height: 1em; display: inline-block; }
@keyframes fxPopIn {
  from { transform: translate(-50%, -50%) scale(.3); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.fx-doom { animation: fxPopIn .3s ease-out, fxDoom .5s .3s ease-in-out infinite; }
@keyframes fxDoom {
  0%, 100% { transform: translate(-50%, -50%) rotate(-4deg) scale(1); }
  50% { transform: translate(-50%, -50%) rotate(5deg) scale(1.08); }
}
/* Impatto: flash bianco a schermo pieno + esplosione */
.fx-impact { animation: fxPopIn .18s ease-out, fxPulse .5s .18s ease-out; }
.fx-overlay.fx-impact { background: rgba(251,191,36,.3); animation: fxFlash .9s ease-out forwards; }
@keyframes fxFlash {
  0% { background: rgba(255,255,255,.8); }
  100% { background: rgba(251,191,36,0); }
}
@keyframes fxPulse {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.35); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
/* Coriandoli vittoria */
.fx-conf {
  position: absolute; top: -16px; font-style: normal;
  width: 8px; height: 13px; border-radius: 2px;
  animation: fxFall 1.6s linear infinite;
}
@keyframes fxFall {
  /* v236: la distanza arriva dalla var --fall (altezza del box + margine)
     con playEffect host-scoped; senza var (schermo pieno) resta 105vh. */
  0% { transform: translateY(-20px) rotate(0); opacity: 1; }
  100% { transform: translateY(var(--fall, 105vh)) rotate(540deg); opacity: .7; }
}

/* --- Fase 2: componenti viste secondarie ----------------------------------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  background: rgba(255,255,255,.06); color: var(--sub);
  border: 1px solid rgba(255,255,255,.1); border-radius: 999px;
  padding: 7px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.chip.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.chip.small { padding: 5px 10px; font-size: 11px; }

.me-card {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.35);
  border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px;
}
.me-card span { color: var(--sub); }
.me-card b { color: var(--text); }

/* v173 — schermata Rapina */
.rb-victim { display: flex; align-items: center; gap: 10px; }
.rb-victim-art { flex: 0 0 auto; width: 48px; height: 58px; display: flex;
  align-items: center; justify-content: center; overflow: hidden; }
.rb-victim-info { flex: 1; min-width: 0; font-size: 13px; }
.rb-victim-info b { color: var(--text); }
.rb-ven-art { flex: 0 0 auto; width: 30px; height: 36px; display: flex;
  align-items: center; justify-content: center; overflow: hidden; }
.rb-vbar { height: 4px; border-radius: 2px; background: rgba(239,68,68,.18);
  overflow: hidden; margin: 6px 0; }
.rb-vbar > i { display: block; height: 100%; border-radius: 2px;
  background: #ef4444; }

.rk-list { display: flex; flex-direction: column; gap: 6px; }
.rk-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
}
.rk-row.me { background: rgba(59,130,246,.15); border: 1px solid rgba(59,130,246,.4); }
.rk-pos { min-width: 30px; font-size: 13px; font-weight: 700; color: var(--sub); text-align: center; }
.rk-name { flex: 1; font-size: 14px; font-weight: 600; display: flex; flex-direction: column; }
.rk-name .rk-sub { font-size: 11px; color: var(--sub); font-weight: 400; }
.rk-you { font-size: 10px; color: var(--accent); font-weight: 600; }
/* v175: tag del clan [TAG] prima del nickname (classifiche e profili). */
.rk-tag { color: var(--gold); font-weight: 600; }
.rk-val { font-size: 14px; font-weight: 700; white-space: nowrap; }

/* Shop (Acquisti) */
.shop-list { display: flex; flex-direction: column; gap: 8px; }
.shop-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border-radius: 12px; padding: 12px;
}
.si-info { flex: 1; }
.si-name { font-size: 14px; font-weight: 700; }
.si-desc { font-size: 11px; color: var(--sub); margin-top: 2px; }
.si-side { display: flex; align-items: center; gap: 8px; }
.si-count { font-size: 13px; font-weight: 700; color: var(--sub); background: rgba(255,255,255,.06); padding: 2px 8px; border-radius: 999px; }
.si-owned.ok { color: var(--ok); font-size: 12px; font-weight: 600; }
.shop-item .btn { width: auto; margin-top: 0; padding: 9px 14px; font-size: 13px; }
.slotline { margin-top: 10px; }

/* Tecnologie */
.tbranch { margin-bottom: 14px; }
.tb-head { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.tb-sub { font-size: 11px; color: var(--sub); font-weight: 400; }
.tnode {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  margin-bottom: 8px;
}
.tnode.owned { border: 1px solid rgba(34,197,94,.35); }
.tn-head { display: flex; align-items: center; gap: 8px; }
.tn-emoji { font-size: 18px; }
.tn-name { flex: 1; font-size: 14px; font-weight: 700; }
.tn-tier { font-size: 11px; font-weight: 700; color: var(--sub); background: rgba(255,255,255,.06); padding: 2px 8px; border-radius: 999px; }
.tn-desc { font-size: 11px; color: var(--sub); margin: 6px 0; }
.tn-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tn-foot .btn { width: auto; margin-top: 0; padding: 8px 12px; font-size: 12px; }
.tn-effect { font-size: 11px; color: var(--sub); text-align: right; }
.tn-max { font-size: 12px; color: var(--ok); font-weight: 600; }

/* Edifici v149: schede generatore (Fabbrica/Tesoreria) — i perk nei rami
   (Casinò/Nascondiglio/Caserma) ri-usano .tnode/.tn-*. */
.bld-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px;
}
.bld-head { display: flex; align-items: center; gap: 8px; }
.bld-head .btn { width: auto; margin-top: 0; padding: 8px 12px; font-size: 12px; }
.bld-rate { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; flex-wrap: wrap; }
.bld-pill {
  font-size: 10px; font-weight: 700; white-space: nowrap;
  color: var(--accent); background: rgba(255,255,255,.06);
  border: 1px solid var(--line); padding: 1px 6px; border-radius: 999px;
}
.bld-sub { font-size: 11px; color: var(--sub); }
.bld-foots { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bld-next { font-size: 11px; color: var(--sub); text-align: right; flex: 1; }

/* v151: griglia 2×2 di tile + scheda dettaglio edificio. */
.bld-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 10px;
}
.bld-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  gap: 3px; min-width: 0; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 10px 10px;
  font: inherit; color: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bld-tile:active { background: rgba(255,255,255,.05); }
.bld-tile.span2 { grid-column: 1 / -1; }
.bld-tile.busy { border-color: rgba(234,179,8,.45); }
.bld-tile-emoji { font-size: 26px; line-height: 1; }
.bld-tile-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.bld-tile-lv {
  position: absolute; top: 8px; right: 8px;
  font-size: 10px; font-weight: 700; color: var(--sub);
  background: rgba(255,255,255,.06); padding: 2px 7px; border-radius: 999px;
}
.bld-tile-info { font-size: 10.5px; color: var(--sub); }
.bld-tile-info.done { color: var(--ok); }
.bld-tile-info.busy { color: var(--gold); }
.bld-tile-info.busy .bld-eta { font-size: 13px; font-weight: 800; }
.bld-tile-info.busy .bld-what { display: block; margin-top: 2px; color: var(--sub); font-size: 10.5px; }
.bld-hint { margin-top: 10px; font-size: 11px; color: var(--sub); text-align: center; }

.bld-back {
  width: auto; margin: 0 0 10px; padding: 6px 12px; font-size: 12px;
  background: transparent; border: 1px solid var(--line); color: var(--sub);
  border-radius: 10px; font-weight: 700; cursor: pointer; font: inherit;
}
.bld-back:active { background: rgba(255,255,255,.05); }
.bld-detail {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px;
}
.bld-d-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bld-d-emoji { font-size: 30px; line-height: 1; }
.bld-d-iddiv { min-width: 0; }
.bld-d-name { font-size: 16px; font-weight: 700; }
.bld-d-iddiv .tn-desc { margin: 2px 0 0; }
.bld-d-sect {
  font-size: 11px; font-weight: 700; color: var(--sub); text-transform: uppercase;
  letter-spacing: .4px; margin: 12px 0 6px;
}
.bld-d-sect.done { color: var(--ok); }
.bld-d-note { font-size: 11px; color: var(--sub); margin-bottom: 8px; }
.bld-detail .btn.primary { width: 100%; margin-top: 2px; padding: 11px 12px; font-size: 13px; }
.bld-progress {
  height: 8px; border-radius: 999px; background: rgba(255,255,255,.08);
  overflow: hidden; margin: 2px 0 6px;
}
.bld-progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  transition: width 1s linear;
}

/* Shop personaggi: griglia verticale 3 per riga, avatar grande in alto. */
.ch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; align-items: stretch; }
.ch-card { margin-bottom: 0; padding: 8px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; height: 100%; }
.ch-av { display: flex; align-items: center; justify-content: center; height: 96px; }
.ch-name { font-size: 12px; font-weight: 700; text-align: center; line-height: 1.2; }
.ch-rar { font-size: 10px; font-weight: 700; text-transform: capitalize; }
.ch-foot { margin-top: auto; padding-top: 5px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ch-btn { width: 100%; margin-top: 0; padding: 7px 4px; font-size: 11px; }

/* Bonus */
.bonus-card { grid-column: span 2; }

/* Admin (Mini App): righe azione con input + bottone */
.ad-input {
  flex: 1; min-width: 0; width: 100%;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; color: var(--text);
  padding: 9px 10px; font-size: 13px; font-family: inherit;
}
.ad-input:focus { outline: none; border-color: var(--accent); }
.ad-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.ad-row .btn { width: auto; margin-top: 0; padding: 9px 12px; font-size: 12px; flex-shrink: 0; }
/* Righe di SOLI bottoni (reset globali, pannello player): le label possono
   essere lunghe — i bottoni si spalmano a colonne invece di sbordare. v196.19 */
.ad-row-btns {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
}
.ad-row-btns .btn { width: 100%; text-align: left; }
.ad-row .btn:disabled { opacity: .6; }
/* --- Forgia v2: panel, attrezzatura, odds ---------------------------------- */
/* Odds: pill con bordo del colore rarità (fisso, leggibile su ogni tema). */
.fg-odds { display: flex; flex-wrap: wrap; gap: 6px; }
.fg-odds-pill {
  font-size: 11px; font-weight: 600; padding: 4px 8px;
  border: 1px solid; border-radius: 999px;
  background: rgba(255,255,255,.05); color: var(--text);
}
/* Pill odds cliccabili: popup col livello di sblocco della rarita'. */
.fg-odds-btn { cursor: pointer; user-select: none; }
.fg-odds-btn:active { transform: scale(.94); }
/* Slot attrezzatura: blocchi compatti dentro la card. */
/* Personaggio (avatar a strati) con 6 hotspot cliccabili sovrapposti alle
   zone anatomiche: elmi ~4-30%, corazze ~30-62%, arma lato destro ~26-68%,
   scudo lato sinistro ~36-64%, amuleto collo ~26-40%, stivali ~74-98%
   dell'altezza del doll (viewBox 0 0 100 120). Ordine DOM in forge.js
   risolve le sovrapposizioni (vince l'ultimo). */
.fg-doll-row { display: flex; gap: 8px; align-items: stretch; margin-top: 8px; }
/* v191.37.5: fondo = pannello del tema (non nero). */
.fg-pw {
  position: absolute; left: 5px; right: 5px; bottom: 5px; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
  padding: 4px 0; border-radius: 9px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.fg-pw .ic { width: 12px; height: 12px; }
/* v191.37.6: testata scheda Equipaggiamenti — omino+testo centrati. */
.fg-card-title {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 6px; font-size: 14px; font-weight: 700;
}
.fg-doll {
  position: relative; width: 96px; flex: 0 0 auto; padding: 8px 4px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.08); border-radius: 12px;
  background: rgba(255,255,255,.03);
}
/* v191.37: i pezzi non sono più cliccabili — hotspot senza feedback/pointer. */
.fg-hot {
  position: absolute; left: 6%; right: 6%; border-radius: 8px;
}
.fg-hot[data-fg-slot="head"]   { top: 6%;  height: 24%; }
.fg-hot[data-fg-slot="body"]   { top: 32%; height: 28%; }
.fg-hot[data-fg-slot="weapon"] { left: 56%; right: -4%; top: 28%; height: 40%; }
.fg-hot[data-fg-slot="shoes"]  { top: 78%; height: 20%; }
/* v120: scudo braccio sinistro (silhouette x21-38 su 100), amuleto collo. */
.fg-hot[data-fg-slot="shield"] { left: 2%;  right: 62%; top: 38%; height: 26%; }
.fg-hot[data-fg-slot="amulet"] { left: 34%; right: 34%; top: 26%; height: 14%; }
/* v240: guanti sulle mani (y47-57 su 120), cintura sui fianchi (y66-71) —
   la cintura scavalca il bordo basso del body-hotspot: ordine DOM decide. */
.fg-hot[data-fg-slot="gloves"] { left: 28%; right: 28%; top: 39%; height: 13%; }
.fg-hot[data-fg-slot="belt"]   { left: 30%; right: 30%; top: 53%; height: 11%; }
/* Dettaglio/riepilogo a destra del personaggio: prende tutto lo spazio libero. */
.fg-eq-detail { flex: 1; min-width: 0; }
.fg-eq-detail .fg-slotbox { margin-top: 0; height: 100%; }
/* v244.8: griglia slot nella Forgia — 8 slot 4 per fila IN ALTO alla
   schermata (il doll anatomico resta nel popup Info della home); il
   dettaglio sta sotto la griglia, a tutta larghezza. */
.fg-eqgrid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px; margin-top: 8px;
}
.fg-tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 0; padding: 8px 4px 6px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); cursor: pointer;
}
.fg-tile:active { transform: scale(.97); }
/* Stelle dell'ascensione della Forgia (1-3) sui pezzi ascesi. */
.fg-tile, .vf-item-art, .vf-item-photo { position: relative; }
.asc-stars { position: absolute; top: 2px; left: 3px; z-index: 2; font-size: 9px; line-height: 1; letter-spacing: -1px; color: #ffd24a; text-shadow: 0 1px 2px #000c, 0 0 4px #ffb30088; pointer-events: none; }
.vf-item-art .asc-stars { font-size: 14px; top: 4px; left: 6px; }
.inv-tile .asc-stars { top: auto; bottom: 2px; left: 3px; }
.au-bar.au-asc { cursor: pointer; }
.asc-stars-inline { color: #ffd24a; letter-spacing: -1px; margin-left: 4px; text-shadow: 0 1px 2px #0008; }
.pr-slot .asc-stars { font-size: 8px; top: 1px; left: 2px; }
.fg-tile.sel { background: var(--gold-soft); }
/* Cornice di rarità più marcata sui pezzi (griglia Forgia, magazzino, schede di scelta): il colore arriva dallo style inline. */
.fg-tile[style*="border-color"] { border-width: 3px; padding: 6px 2px 4px; }
.fg-swap-card[style*="border-color"] { border-width: 3px; padding: 8px; }
.fg-tile.empty { opacity: .55; }
.fg-tile-art { display: flex; align-items: center; justify-content: center; height: 28px; }
.fg-tile-art .ic { width: 22px; height: 22px; }
.fg-tile-name {
  font-size: 10px; font-weight: 600; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fg-eq-full { margin-top: 8px; }
.fg-eq-full .fg-slotbox { margin-top: 0; height: auto; }
.fg-slotbox {
  margin-top: 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px;
  padding: 8px 10px; background: rgba(255,255,255,.03);
}
.fg-slot-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; margin-bottom: 4px;
}
.fg-slot-bonus { font-size: 11px; color: var(--ok); font-weight: 600; }
.fg-piece { font-weight: 700; }
.fg-empty { color: var(--sub); font-size: 11px; }
.fg-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.fg-chips.fg-none { font-size: 10px; color: var(--sub); }
.fg-chip {
  font-size: 11px; padding: 4px 8px; border-radius: 999px;
  border: 1px solid; background: rgba(255,255,255,.05);
  color: var(--text); cursor: pointer; font-family: inherit;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
/* Riquadro personaggio selezionabile (riepilogo attrezzatura). */
.fg-doll.active { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Riepilogo attrezzatura: griglia di tessere compatte, una per statistica
   (ATK e HP affiancati, sotto le abilita' presenti col contributo dei pezzi). */
.fg-tots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.fg-tot {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 10px 7px; display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.fg-tot span { font-size: 11px; color: var(--sub); white-space: nowrap; }
.fg-tot b { font-size: 15px; font-variant-numeric: tabular-nums; }
/* v191.37: abilità del riepilogo = UN quadrante grande, righe impilate. */
.fg-ab-box {
  margin-top: 6px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); padding: 4px 12px;
}
/* Riquadro Progressi: titolo centrato. */
.fg-prog-box .fg-slot-head {
  justify-content: center; gap: 7px; margin-bottom: 2px;
}
.fg-ab-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; font-size: 12px; font-weight: 600;
}
.fg-ab-row + .fg-ab-row { border-top: 1px solid var(--line); }
.fg-ab-row span { display: inline-flex; align-items: center; gap: 7px; color: var(--text); }
.fg-ab-row .ic { width: 14px; height: 14px; }
.fg-ab-row b {
  font-size: 14px; font-variant-numeric: tabular-nums; color: var(--accent);
}
.fg-chip:disabled { opacity: .55; cursor: default; }
/* v126: suffisso livello pezzo nei chip (merge). */
.inv-lvl { font-weight: 700; color: var(--accent); }
/* v128: inventario — filtri tipologia + griglia 3 colonne di tile. */
.inv-filters { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.inv-fchip { padding: 5px 10px; font-size: 11px; }
.inv-fchip.on { background: var(--panel-strong); border-color: var(--accent); color: var(--accent); }
/* v133: 4 colonne — tile piu' compatte. */
/* v178.9: griglia a 5 colonne (richiesta esplicita) — tile piccole, gap da 6. */
.inv-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.inv-tile {
  position: relative; aspect-ratio: 1 / 1; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); font-family: inherit; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.inv-tile:active { transform: scale(.96); }
.inv-tile.eq { background: var(--gold-soft); }
/* v166: tasto lucchetto in alto a destra — pezzo bloccato NON sacrificabile.
   Spento (🔓) quasi invisibile, acceso (🔒) dorato per farsi notare. */
.inv-tile-lock {
  position: absolute; top: 1px; right: 1px; z-index: 1;
  width: 28px; height: 28px; padding: 4px; border: none;
  background: transparent; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  color: var(--sub); opacity: .5;
}
.inv-tile-lock .ic { width: 16px; height: 16px; }
.inv-tile-lock:active { transform: scale(.9); }
.inv-tile-lock.on {
  color: var(--gold); opacity: 1;
  background: rgba(227, 179, 65, .16); border-radius: 8px;
  text-shadow: 0 0 4px rgba(227, 179, 65, .45);
}
.inv-tile-art { display: flex; align-items: center; justify-content: center; }
.inv-tile-sym { position: absolute; top: 4px; left: 5px; font-size: 12px; line-height: 1; }
/* v145: al posto della spunta in alto a destra, banda centrata con «EQUIPAGGIATO». */
.inv-tile-eq {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  text-align: center; font-size: 8px; line-height: 1.4; padding: 2px 0;
  color: var(--ok); font-weight: 700; letter-spacing: .5px;
  background: rgba(255, 255, 255, .07);
}
.inv-tile-lv {
  position: absolute; bottom: 4px; right: 6px; font-size: 10px; line-height: 1;
  color: var(--accent); font-weight: 700;
}
/* v135: simbolo ▲ verde — il pezzo si puo' ancora aumentare di livello. */
.inv-tile-up {
  position: absolute; bottom: 3px; left: 5px; font-size: 12px; line-height: 1;
  color: var(--ok);
  animation: inv-up-pulse 1.6s ease-in-out infinite;
  text-shadow: 0 0 4px rgba(34, 197, 94, .5);
}
/* v178.6: abilita' speciale nella zona bassa della tile — banda scura
   larghissima con scritta in colore rarita'. v178.9: a 5 colonne la tile e'
   piccola → scritta ridotta. v178.10: scritta ANCORA piu' piccola (font 5.5)
   e lucchetto ingrandito (22 -> 28px) che in tile cosi' piccole si perdeva;
   Lv e ▲ salgono sopra la banda. */
.inv-tile-skill {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 5.5px; line-height: 1.25; padding: 1px;
  text-align: center; font-weight: 700; letter-spacing: 0;
  background: rgba(0, 0, 0, .22);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[data-theme="light"] .inv-tile-skill { background: rgba(60, 54, 44, .12); }
.inv-tile.has-skill .inv-tile-lv,
.inv-tile.has-skill .inv-tile-up { bottom: 9px; }
/* v239 «2 abilità» (divine+): i badge vivono dentro .inv-tile-skills
   (wrapper flex a piena larghezza) — metà ciascuno in fila; Lv/▲ salgono
   di più sopra i badge. */
.inv-tile-skills {
  position: absolute; bottom: 1px; left: 2px; right: 2px;
  display: flex; gap: 2px;
}
.inv-tile-skills .inv-tile-skill {
  position: static; flex: 1; min-width: 0;
  font-size: 4.6px; padding: 0 1px;
}
.inv-tile.dual .inv-tile-lv,
.inv-tile.dual .inv-tile-up { bottom: 11px; }
/* v196.27: solo vista PETS — pallino rarità rimosso dalle tile (ridondante:
   bordo della tile e uovo SVG già portano il colore rarità); il badge
   occupa il SUO posto, spigolo alto sinistro (era bottom-right). */
#pets-body .inv-tile .inv-tile-lv {
  top: 4px; left: 5px; bottom: auto; right: auto;
  font-size: 10px; line-height: 1;
}
/* v137: stessa freccia verde sul tasto «Aumenta livello». */
.inv-btn-up { color: var(--ok); margin-right: 3px; }
@keyframes inv-up-pulse {
  0%, 100% { opacity: 1; } 50% { opacity: .55; }
}
/* v126.1: righe candidati merge selezionabili nel popup. */
.merge-cand { cursor: pointer; font-family: inherit; }
.merge-cand:active { transform: scale(.98); }
/* Upgrade in corso: barra + countdown (rosso caldo, come l'incudine). */
.fg-upgrading { font-size: 13px; }
.fg-upgrading b { color: #f97316; }
/* Tag slot nella scena reveal. */
.fg-slot-tag { font-size: 12px; color: var(--sub); }
/* Pezzo rivelato nell'incudine: fermo, glow impostato inline da scene.js. */
.forge-anvil.forge-reveal { animation: none; }
/* --- Popup decisione equip/vendita (slot occupato alla forgiatura) --- */
.fg-swap-box { max-width: 92%; }
.fg-swap-title { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.fg-swap-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.fg-swap-card {
  position: relative;
  border: 1px solid; border-radius: 10px; padding: 10px;
  background: var(--panel); min-width: 0;
  display: flex; gap: 12px; align-items: center;
}
/* v128: la tile equipaggiata della griglia — la card del popup dedicato
   NON è attenuata (unico pezzo mostrato). */
.inv-piece-popup .fg-swap-card.eq { opacity: 1; }
.fg-swap-txt { flex: 1; min-width: 0; }
.fg-swap-card.eq { opacity: .72; }
.fg-swap-card .fg-swap-actions { margin-top: 8px; }
.fg-swap-tag { font-size: 10px; color: var(--sub); text-transform: uppercase; letter-spacing: .4px; }
.fg-swap-name { font-size: 12px; font-weight: 700; margin-top: 3px; }
.fg-swap-bonus { font-size: 10px; color: var(--sub); margin-top: 4px; }
.fg-swap-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.fg-swap-actions .wide { grid-column: 1 / -1; }
/* v109: comparazione nel popup "Nuovo equip" — frecce verdi/rosse accanto
   ai valori di ATK/HP/abilità del pezzo trovato. */
.fg-cmp-lines { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.fg-cmp-line { font-size: 10px; color: var(--sub); }
.fg-cmp-line.fg-swap-skill { color: var(--sub); }
.arr-up { color: #22c55e; font-weight: 700; }
.arr-down { color: #ef4444; font-weight: 700; }
/* --- Icone sprite SVG (sostituiscono le emoji di interfaccia) ------------- */
/* Ogni icona e' un <svg><use href="#ic-*"></svg> che si tinge di
   currentColor: la dimensione la fissa il contesto, come tabbar/subnav. */
.bhead-title svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 5px; color: var(--gold); }
.bemoji svg { width: 20px; height: 20px; display: block; color: var(--gold); }
.hc-icon svg { width: 26px; height: 26px; color: var(--gold); }
.hub-stat svg, .stat .ico svg { width: 15px; height: 15px; color: var(--gold); }
.hub-lvl svg { width: 12px; height: 12px; vertical-align: -1px; }
.btn svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 2px; }
.chip svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.bsum-stat span svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.tb-head svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 3px; color: var(--gold); }
.tn-emoji svg { width: 18px; height: 18px; }
.ph-icon svg { width: 38px; height: 38px; color: var(--gold); }
.sc-title svg { width: 16px; height: 16px; vertical-align: -2px; }
.rk-pos svg, .ar-medal svg { width: 14px; height: 14px; vertical-align: -2px; }
.rk-pos svg.medal-gold, .ar-medal svg.medal-gold { color: var(--gold); }
.rk-pos svg.medal-silver, .ar-medal svg.medal-silver { color: #b9c0cb; }
.rk-pos svg.medal-bronze, .ar-medal svg.medal-bronze { color: #c98b52; }
.ac-power svg { width: 12px; height: 12px; vertical-align: -1px; }
.result-icon svg { width: 44px; height: 44px; color: var(--gold); }

/* Default per le icone sprite (.ic da ui/icons.js): 1em così scalano col
   testo del contesto anche dove manca una regola dedicata (rk-val, rk-sub,
   fg-tot, tn-max, tn-desc, binfo...). Le regole contestuali (.btn svg,
   .bemoji svg, ...) hanno specificità maggiore e continuano a vincere. */
.ic { width: 1em; height: 1em; vertical-align: -0.15em; }
/* v196.40: Pet Ticket SVG (ticketSVG in ui/icons.js) — stesso allineamento
   di .ic (scala col font, si allinea alla base) nelle righe di saldo. */
.pt-ic { width: 1em; height: 1em; vertical-align: -0.15em; }

/* ---- Avatar a strati (ui/avatar.js): mini-avatar in righe e popup ---- */
/* Righe classifica/board/membri: colonna fissa 24px tra posizione e nome. */
.rk-av {
  flex: 0 0 24px; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}
.rk-av svg { width: 22px; height: 26px; }
.rk-av span { font-size: 18px; line-height: 1; }
.rk-av:empty { display: none; }
/* Lista membri clan (tnode): avatar accanto al ruolo. */
.tn-av { display: flex; align-items: center; }
.tn-av svg { width: 20px; height: 24px; }
.tn-av:empty { display: none; }
/* Popup profilo: avatar 40px nel titolo. */
.cn-prof-av { display: flex; align-items: center; margin-right: 6px; }
.cn-prof-av:empty { display: none; }
/* v163: barra di scrittura della chat FISSA in fondo (#view scorre sopra):
   textarea + tasto invio a icona dentro lo stesso pannello opaco, stile
   messaggistica; l'annuncio dell'ufficiale è un'icona della stessa barra. */
/* v164.9: nella chat il box è flex nel wrapper che riempie #view — la barra
   non si comprime mai (flex:0 0 auto); sticky resta di sicurezza per i casi
   di viewport ridotte (min-height del box forza overflow di #view). */
.cn-chat-bar {
  position: sticky; bottom: 8px; z-index: 5;
  flex: 0 0 auto;
  display: flex; align-items: flex-end; gap: 8px;
  margin-top: 10px; padding: 8px;
  background: var(--card);
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.cn-chat-bar textarea {
  flex: 1 1 auto; resize: none; max-height: 96px;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(255,255,255,.05); color: var(--text);
  border: 1px solid rgba(255,255,255,.15);
  font-family: inherit; font-size: 14px;
}
.cn-chat-bar textarea:focus { outline: none; border-color: rgba(227,179,65,.55); }
.cn-chat-go, .cn-chat-ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
}
.cn-chat-go { background: var(--accent); color: var(--accent-text); }
.cn-chat-go:disabled { opacity: .6; }
.cn-chat-go:active:not(:disabled), .cn-chat-ico:active { transform: scale(.94); }
.cn-chat-ico {
  background: transparent; color: var(--sub);
  border: 1px solid rgba(148,163,184,.3);
}
.cn-chat-go .ic, .cn-chat-ico .ic { width: 18px; height: 18px; }
/* v164: tastiera aperta (classe .kb-chat sul view, vedi clan.js viewChat):
   header «Clan», titolo «Chat clan» e banner Annuncio spariscono — i px
   liberati vanno ai messaggi e alla barra di scrittura. */
.kb-chat .bhead,
.kb-chat .tb-head,
.kb-chat #cn-chat-annrow { display: none; }
/* v196.3: a tastiera aperta esce anche la striscia uova (come subnav/tabbar). */
body.kb-open #eggstrip { display: none !important; }
/* v164.3: in scrittura si nasconde anche la navigazione bassa (subnav
   Membri/Chat/Guerre e tabbar) via classe su <body>: display:none
   !important sopravvive ai re-render di renderSubnav (polling). */
body.kb-open #subnav, body.kb-open #tabbar { display: none !important; }
/* v164.4: a tastiera aperta via anche i padding residui (body e card sotto
   #view): niente banda grigia sopra i tasti. (v164.9: il fit non è più JS
   su visualViewport — quando kb-open nasconde subnav/tabbar, #view si
   estende da solo nel contenitore flex di #app e la catena flessibile
   della chat segue.) */
body.kb-open { padding-bottom: 0 !important; }
body.kb-open #app.card { padding-bottom: 0; }
.kb-chat .cn-chat-bar { bottom: 2px; }
/* Header Account: l'SVG dentro il cerchio 48px sta centrato. */
.avatar svg { display: block; }
/* Scene: la figura SVG (72px) al posto dell'emoji 42px. */
.sc-fig svg { display: block; margin: 0 auto; }
/* Personaggi in account: preview nel tnode-head. */

/* Banner "nuova versione" (app.js checkVersion): la WebView tiene la pagina
   vecchia in memoria; se /api/ver differisce dalla versione client, pillola
   fissa sopra la tabbar che ricarica al tocco. */
#ver-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: 60; padding: 10px 16px; border: none; border-radius: 999px;
  background: var(--accent); color: var(--accent-text);
  font-family: inherit; font-size: 13px; font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,0,0,.4); cursor: pointer;
  animation: ver-pop .3s ease-out;
}
@keyframes ver-pop { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }

/* Scena forgia: il personaggio indossa il pezzo appena forgiato. */
.forge-worn { animation: forge-pop .45s ease-out; }
@keyframes forge-pop {
  0% { transform: scale(.9); opacity: .4; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

/* Disegni dei pezzi (ui/avatar.js pieceSVG): ritagli SVG inline. */
.av-piece { vertical-align: -0.2em; }
/* Il disegno di un pezzo è una cella 256x256 di un foglio: la scatola deve restare quadrata, altrimenti le celle vicine spuntano sopra e sotto. */
.equipment-art { aspect-ratio: 1 / 1; height: auto; }
/* Reveal forgia: il pezzo da solo sull'incudine (il glow resta sul wrapper). */
.forge-reveal .av-piece, .forge-reveal svg { display: block; margin: 0 auto; }
/* Swap card: disegno del pezzo a sinistra (colonna fissa), testo a destra. */
.fg-swap-art { flex: 0 0 56px; display: flex; justify-content: center; align-items: center; }
/* v201.20: popup PET — colonna avatar a SINISTRA in alto (avatar + Lv
   sotto), nome e righe a fianco dentro il riquadro. Nuova card non tocca
   gli altri popup .fg-swap-card (align-items è inline lì che serve). */
.fg-swap-col { flex: 0 0 70px; display: flex; flex-direction: column;
  align-items: center; gap: 7px; align-self: flex-start; }
.fg-swap-av { width: 62px; height: 62px; display: flex; align-items: center;
  justify-content: center; font-size: 42px; background: var(--card);
  border-radius: 12px; }
.fg-swap-lvl { font-size: 11px; font-weight: 800; color: var(--gold); }
/* v201.21: riga azioni del popup pet — Upgrade a sinistra, Rimuovi a
   destra, a piena larghezza SOTTO il blocco avatar/livello. */
.fg-swap-foot { display: flex; gap: 8px; flex-basis: 100%; margin-top: 10px; }
.fg-swap-foot .btn { flex: 1; margin-top: 0; }
.fg-swap-foot + .btn { margin-top: 10px; }
/* v201.22: popup pet — FUORI dal riquadro: rarità in alto a sinistra,
   «Equipaggiato» in alto a destra in verde (card pulita: solo avatar/Lv/nome). */
.fg-swap-head { display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 10px; }
.fg-swap-rar { font-size: 15px; font-weight: 800; color: var(--text); }
.fg-swap-eqtag { margin-left: auto; color: var(--ok); font-size: 11px;
  font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
  display: inline-flex; align-items: center; gap: 4px; }
/* v201.25: popup PET — i tasti usano il vocabolario della schermata Pets
   (prima erano blu accent pieno/bordo e stonavano). ORO = azione positiva
   (Upgrade, fonde — stesso gradiente moneta di «Evoca» nel dock); pill
   NEUTRE = secondarie (Rimuovi/Sacrifica/Chiudi/Annulla, come Info/xN);
   il verde resta solo per Equipaggia (= il verde «Equipaggiato»). */
.btn.pp-gold {
  background: linear-gradient(180deg, #eec763 0%, #d9a92f 55%, #c4982a 100%);
  border: 1px solid rgba(0, 0, 0, .35);
  color: #2b2924; font-weight: 700;
}
.btn.pp-gold:disabled { opacity: .45; }
.btn.pp-pill { background: var(--panel); border: 1px solid var(--line);
  color: var(--text); }
/* Popup profilo: riga equip con disegno del pezzo. */
.rk-av .av-piece { vertical-align: 0; }

/* Swap card: l'abilità (affix) su riga separata, in tinta oro. */
.fg-swap-skill { margin-top: 3px; color: var(--gold); }

/* Inventario (v106): riga informativa nel popup del pezzo conservato. */
.inv-note {
  font-size: 11px; color: var(--sub); text-align: center;
  padding: 10px 14px 0;
}

/* Popup profilo player: hero con avatar grande in cornice (stile fg-doll) e
   griglia 2x2 degli slot equip; le statistiche principali impilate sotto. */
.pr-hero { display: flex; gap: 10px; align-items: stretch; margin: 10px 0 2px; }
.pr-hero-av {
  flex: 0 0 auto; width: 150px; padding: 10px 4px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.08); border-radius: 12px;
  background: rgba(255,255,255,.03);
}
.pr-hero-av svg { display: block; }
/* Griglia 2x2 degli slot equip a fianco dell'avatar: solo l'icona del pezzo
   (o un segnaposto attenuato); tap -> dettaglio del pezzo. */
/* v198.7.1: griglia a 3 colonne (piu' strette) — equip + pet di fianco
   all'avatar come richiesto dall'owner. */
.pr-slots { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pr-slot {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.08); border-radius: 12px;
  background: rgba(255,255,255,.03); min-width: 0;
}
.pr-slot svg { display: block; }
.pr-slot-ph { opacity: .3; font-size: 20px; }
.pr-slot[data-piece] { cursor: pointer; }
/* cornice di rarità sulle celle della vetrina (equip, Mount, abilità): più marcata del bordo neutro */
.pr-slot[style*="border-color"] { border-width: 2px; }
.pr-slot[data-piece]:active { background: rgba(255,255,255,.08); }
/* v169.1: livello del pezzo direttamente sulla cella slot (badge angolo). */
.pr-slot { position: relative; }
.pr-slot-lv {
  position: absolute; right: 4px; bottom: 3px;
  font-size: 9px; font-weight: 700; line-height: 1;
  color: var(--accent); background: rgba(0,0,0,.55);
  padding: 2px 3px; border-radius: 6px; pointer-events: none;
}
/* Statistiche sotto l'hero: clan a piena larghezza, poi righe 2x1
   (potenza+forgia, atk+hp) e il riquadro unico delle abilita'. */
.pr-stats { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.pr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.pr-aff {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; margin-top: 8px;
}
.pr-aff-head { font-size: 11px; color: var(--sub); }
.pr-aff-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; min-width: 0;
}
.pr-aff-row b { font-size: 13px; }
.pr-aff-row.dim { color: var(--sub); }
.pr-stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 10px; display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; min-width: 0;
}
.pr-stat span { color: var(--sub); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.pr-stat b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-stat svg { width: 13px; height: 13px; flex: 0 0 auto; }

/* ------------------------------------------------------------------ */
/* Account: hero profilo in un'unica card (avatar + info insieme, niente
   blocchi sconnessi), risorse e menu a righe. */
.ac-hero {
  display: flex; gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; margin: 10px 0 2px;
}
.ac-hero-av {
  flex: 0 0 auto; width: 92px; padding: 8px 2px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.08); border-radius: 12px;
  background: rgba(255,255,255,.03);
}
.ac-hero-av svg { display: block; }
.ac-hero-info {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  justify-content: center; gap: 3px;
}
.ac-hero-name { font-size: 17px; font-weight: 700; line-height: 1.2; }
.ac-hero-name svg { vertical-align: middle; }
.ac-hero-user { font-size: 12px; color: var(--sub); }
.ac-hero-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.stats { margin-bottom: 14px; }

/* Menu account: righe tappabili icona + titolo + chevron. */
.ac-menu { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ac-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; color: var(--text); font-family: inherit; text-align: left;
  cursor: pointer;
}
.ac-row:active { background: rgba(255,255,255,.06); }
.ac-ico {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); color: var(--gold);
}
.ac-ico svg { width: 18px; height: 18px; display: block; }
.ac-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ac-txt b { font-size: 14px; font-weight: 700; }
.ac-txt i {
  font-style: normal; font-size: 11px; color: var(--sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ac-chev { flex: 0 0 auto; color: var(--sub); transform: rotate(180deg); }
.ac-chev svg { width: 15px; height: 15px; display: block; }

/* Shop emoji: griglia verticale 2 per riga, emoji grande in alto. */
.em-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; align-items: stretch; }
.em-card {
  margin-bottom: 0; padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 0; height: 100%;
}
.em-emoji { font-size: 30px; line-height: 1; min-height: 34px; display: flex; align-items: center; }
.em-name { font-size: 12px; font-weight: 700; text-align: center; line-height: 1.2; }
.em-rar {
  font-size: 10px; font-weight: 700; color: var(--sub);
  background: rgba(255,255,255,.06); padding: 1px 8px; border-radius: 999px;
}
.em-foot {
  margin-top: auto; padding-top: 5px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.em-btn { width: 100%; margin-top: 0; padding: 7px 4px; font-size: 11px; }

/* Inviti (popup della home, v244.26): stat tile. v244.30.f: le regole della
   vista Bonus ritirata (bn-grid/card/pay…) tolte. */
.bn-inv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 2px 0 4px; }
.bn-inv-tile {
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 4px; text-align: center; display: flex; flex-direction: column; gap: 1px;
}
.bn-inv-tile b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bn-inv-tile span { font-size: 10px; color: var(--sub); }

/* ------------------------------------------------------------------ */

/* --- Admin: Andamento (grafici risorse, v99) ------------------------------ */
.bar-fill.gold { background: var(--gold); }

/* ------------------------------------------------------------------ */

/* --- Campagna PvE: la Home e' l'arena a loop idle (v103) -------------------- */
/* Riutilizza .battle-box (scena inline) e .hub-stat (striscia contatori). */
/* v187.17: la head «Settore…» della home è eliminata — i cp-tick vivono
   nella scena (sc-sub, compatta e centrata sotto il «72-1 · nome»). */
.sc-sub { margin-top: 2px; }
.cp-ticks {
  display: flex; gap: 5px; margin: 6px 0 4px;
}
.cp-ticks-scene {
  margin: 4px auto 2px; max-width: 150px; justify-content: center;
}
.cp-tick {
  flex: 1 1 0; height: 5px; border-radius: 3px;
  background: var(--panel-strong);
}
.cp-tick.done { background: var(--ok); opacity: .45; }
.cp-tick.cur  { background: var(--gold); }
.cp-reward {
  font-size: 12px; font-weight: 700; color: var(--gold);
  display: flex; align-items: center; gap: 5px;
  font-variant-numeric: tabular-nums;
}
.cp-reward svg { width: 14px; height: 14px; }
/* v181.5: striscia info sopra il settore (potenza, nickname, monete, 💎). */
/* v187.21: la striscia info è una SEZIONE (card): nickname a sinistra,
   le statistiche si spingono a destra. */
.cp-info {
  cursor: pointer;
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  padding: 9px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.cp-info .cp-i {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  flex: none;
}
/* v187.23: gruppo nickname + potenza agganciati a sinistra (la potenza sta
   di fianco al nick); il resto della riga resta spinto a destra. */
.cp-info .cp-nick {
  display: flex; align-items: center; gap: 7px;
  min-width: 0; margin-right: auto;
}
/* v187.39: le icone si centravano sul baseline dello strut → sporgevano sopra
   il numero di ~2px. display:block dentro lo span le riduce al box esatto
   (la flex le centra davvero); nickname: vertical-align middle allinea l'emoji
   del catalogo all'altezza-x del testo. */
.cp-info .cp-i svg { width: 15px; height: 15px; color: var(--gold); display: block; }
.cp-info .cp-name svg { vertical-align: middle; }
/* v187.22: il saldo monete è un tasto (compatto k/m/b ↔ valore esatto) */
.cp-info button.cp-i {
  background: none; border: 0; padding: 0; margin: 0;
  font-family: inherit; color: inherit; cursor: pointer;
}
.cp-info .cp-name {
  flex: 0 1 auto; min-width: 0; text-align: left;
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text); /* v187.24: nick bianco (era --sub) */
}
/* Scena inline: la battle-box esce dal popup e vive dentro la home. */
.cp-arena .battle-box {
  width: 100%;
  box-shadow: none;
  animation: none;
}
.cp-wait {
  padding: 34px 10px; text-align: center;
  color: var(--sub); font-size: 13px;
  background: var(--card); border-radius: 16px;
}
/* v244.22: riquadro «Campagna» — la battaglia non parte più da sola:
   UN tap sul riquadro = UNA battaglia (a scena finita il riquadro torna
   aggiornato). Stesso spazio della scena (#cp-arena). */
.cp-camp {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px 14px 16px; text-align: center; cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
.cp-camp:active { transform: scale(.985); }
.cp-camp-title {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-display); font-weight: 800; font-size: 14px;
  color: var(--gold);
}
.cp-camp-title svg { width: 16px; height: 16px; display: block; }
.cp-camp-stage {
  margin-top: 6px;
  font-family: var(--font-display); font-weight: 800; font-size: 30px;
  font-variant-numeric: tabular-nums; letter-spacing: 1px;
}
.cp-camp-gate {
  margin-top: 8px; font-size: 12px; font-weight: 600;
  color: var(--danger);
}
.cp-camp-cta {
  margin-top: 10px; font-size: 12.5px; font-weight: 700;
  color: var(--sub);
}

/* v244.23: tastino Produzione — piccolo bottone (martello che oscilla +
   monete + «z Z Z» animate) che vive FUORI dalla vista: nav#proddock,
   direttamente sopra la strip chat globale, lato sinistro (visibile solo
   in home, app.js switchView lo nasconde). */
.proddock {
  flex-shrink: 0; display: flex; justify-content: flex-start; gap: 7px;
  align-items: center; padding: 2px 2px 0;
}
.prod-btn {
  position: relative; width: 58px; height: 58px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line); cursor: pointer;
  padding: 7px; overflow: visible; box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.prod-btn:active { transform: scale(.94); }
.prod-svg { width: 100%; height: 100%; display: block; }
.pr-coin { fill: #f5c95e; stroke: #b98a1e; stroke-width: 1.5; }
.pr-coin2 { fill: #d8a939; }
.pr-head { fill: #aab2c0; }
.pr-handle { fill: var(--gold); }
.pr-hammer {
  transform-origin: 34px 16px; transform-box: view-box;
  animation: pr-swing 2.4s ease-in-out infinite;
}
@keyframes pr-swing {
  0%, 100% { transform: rotate(16deg); }
  55% { transform: rotate(-9deg); }
}
.zzz {
  position: absolute; top: 3px; right: 8px; font-size: 10px; font-weight: 800;
  color: var(--sub); line-height: 1; user-select: none; pointer-events: none;
}
.zzz i { position: absolute; right: 0; top: 0; font-style: normal; opacity: 0;
  animation: pr-z 2.4s linear infinite; }
.zzz i:nth-child(2) { animation-delay: .55s; font-size: 11px; top: -3px; }
.zzz i:nth-child(3) { animation-delay: 1.1s; font-size: 12px; top: -6px; }
@keyframes pr-z {
  0% { opacity: 0; transform: translate(-2px, 3px); }
  25% { opacity: .9; }
  60% { opacity: .5; }
  100% { opacity: 0; transform: translate(3px, -7px); }
}
.prod-badge {
  position: absolute; top: -4px; right: -4px; width: 13px; height: 13px;
  border-radius: 50%; background: var(--gold); border: 2px solid var(--card);
  opacity: 0; transition: opacity .3s; box-shadow: 0 0 10px var(--gold);
}
/* v244.25.2: TUTTI i badge in ROSSO (richiesta owner): Produzione, regalo,
   dado — pallino spento (opacity 0) quando non c'è nulla da segnalare,
   rosso a pallino acceso. */
.prod-badge.on {
  opacity: 1; background: var(--danger, #e0554f); box-shadow: 0 0 10px #e0554f;
}
/* pallino con numero (obiettivi e ricompense da ritirare, nel popup Bonus) */
.prod-badge.num { width: auto; min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; line-height: 1; color: #fff; font-style: normal; }
.goals-go-btn { position: relative; }
.goals-go-btn .prod-badge { top: 3px; right: 3px; }

/* v244.24: tasto DADO 3D — cubo isometrico (3 facce in ivory, pips scuri)
   che ogni 3s fa un tuffetto + timbra su se stesso (dice-roll). Accanto al
   tastino Produzione, stesso aspetto di bottone (.prod-btn). */
.dice-svg {
  width: 100%; height: 100%; display: block;
  transform-origin: 28px 28px; transform-box: view-box;
  animation: dice-roll 3s ease-in-out infinite;
}
@keyframes dice-roll {
  0%, 58%, 100% { transform: translateY(0) rotate(0deg); }
  64% { transform: translateY(2px) rotate(-7deg); }
  72% { transform: translateY(-3px) rotate(5deg); }
  80% { transform: translateY(2px) rotate(-3deg); }
  88% { transform: translateY(-1px) rotate(1deg); }
}
/* v244.24.3: cubo centrato a mano (punti già scalati nel markup — una
   transform in matrice veniva ri-originata al centro del viewBox: dado
   spinto a destra e in basso). Nessuna transform sul gruppo. */
/* v244.24.4: il dado NON è più nel dock accanto al tastinoProduzione —
   vive nel contenuto home, SOTTO al riquadro Campagna, allineato a destra. */
.dice-row { display: flex; justify-content: flex-end; margin: 8px 0 2px; }
.dc-top   { fill: #f2ead3; stroke: #9b8650; stroke-width: 1.5; stroke-linejoin: round; }
.dc-left  { fill: #d9cdae; stroke: #9b8650; stroke-width: 1.5; stroke-linejoin: round; }
.dc-right { fill: #bdb087; stroke: #9b8650; stroke-width: 1.5; stroke-linejoin: round; }
.dp-top   { fill: #584323; }
.dp-left  { fill: #4e3c20; }
.dp-right { fill: #453418; }
/* v244.24.5: il badge rosso del dado rientra DENTRO il riquadro del
   pulsante (nel contenuto home un'uscita di -4px veniva TAGLIATA dagli
   scroller che tagliano in orizzontale): resta in alto a destra ma interno. */
.dice-btn .prod-badge { top: 3px; right: 3px; }
/* v244.25.1: badge del regalo (daily-btn) — dentro al riquadro, come il dado */
.daily-btn .prod-badge { top: 3px; right: 3px; }
/* v244.24.2: la scritta dei tentativi sta DENTRO il riquadro del dado
   (in basso — il cubo è alzato col viewBox "0 -11 56 56"); BADGE ROSSO
   con tentativi > 0, spento a 0/3 (paintDiceMini, poll /api/me). */
.dice-count {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; font-weight: 800; color: var(--sub); line-height: 1;
  user-select: none; pointer-events: none; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* (il rosso del pallino acceso è nella regola unica .prod-badge.on) */

/* v244.25: colonna dei tasti-Bonus (regalo — dado — slot; +inviti v244.26)
   nel contenuto home sotto al riquadro Campagna: le .dice-row non portano
   il margine proprio (fa lo scarto della colonna, gap 7px).
   v244.28: la RIGA ospita anche il tasto Classifiche — podio animato
   ancorato a SINISTRA sotto al riquadro Campagna, la colonna resta a destra
   (justify-content: space-between). Tutto il margine lo porta la riga. */
.mini-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin: 8px 0 2px;
}
.mini-row .dice-row { margin: 0; }
.mini-col { display: flex; flex-direction: column; gap: 7px; }

/* scatola regalo (Bonus Giornaliero): tutto il gift trema ruotando sul
   fondo, il coperchio ondeggia un attimo prima di assestarsi — come la
   dice-roll del dado, ogni 3s. */
.gift-svg {
  width: 100%; height: 100%; display: block;
  transform-origin: 28px 44px; transform-box: view-box;
  animation: gift-shake 3s ease-in-out infinite;
}
.gift-lid {
  transform-box: fill-box; transform-origin: 50% 90%;
  animation: lid-bob 3s ease-in-out infinite;
}
.gf-body, .gf-lid {
  fill: var(--danger, #e0554f); stroke: #a23531; stroke-width: 1.2;
}
.gf-banda { fill: var(--gold, #d8b74a); }
.gf-knot { fill: none; stroke: var(--gold, #d8b74a); stroke-width: 2; }
@keyframes gift-shake {
  0%, 60%, 78%, 100% { transform: rotate(0deg); }
  64% { transform: rotate(-7deg) translateY(-.5px); }
  68% { transform: rotate(5deg); }
  72% { transform: rotate(-3.5deg); }
  76% { transform: rotate(1.5deg); }
}
@keyframes lid-bob {
  0%, 58%, 88%, 100% { transform: translateY(0) rotate(0deg); }
  66% { transform: translateY(-1.2px) rotate(-1.4deg); }
  76% { transform: translateY(-.8px) rotate(1deg); }
}

/* slot machine (sotto al dado): rulli che sfarfallano "girando" a steps,
   sfalsati; leva che scatta ogni 4s.
   v244.30: la regola di dimensione era MANCANTE (le quattro sorelle
   dice/gift/iv/rk-svg la hanno) — un svg inline senza size va default
   ~300x150 dentro il bottone e sborda. */
.slot-svg { width: 100%; height: 100%; display: block; }
.sl-base { fill: #7a4a24; stroke: #57331a; stroke-width: 1.2; }
.sl-body { fill: var(--danger, #d64545); stroke: #a23531; stroke-width: 1.5; }
.sl-screen { fill: #2b2340; }
.sl-dial { fill: var(--gold, #e2b53f); stroke: #8f6a1f; stroke-width: 1; }
.sl-rod { fill: #c9a13f; stroke: #8f6a1f; stroke-width: .8; }
.sl-ball { fill: var(--gold, #e2b53f); stroke: #8f6a1f; stroke-width: 1; }
.sl-reel { fill: #f2ead3; transform-box: fill-box; transform-origin: 50% 50%; }
.sl-reel:nth-of-type(1) { animation: reel-roll 2.4s ease-in-out infinite; }
.sl-reel:nth-of-type(2) { animation: reel-roll 2.4s ease-in-out infinite .12s; }
.sl-reel:nth-of-type(3) { animation: reel-roll 2.4s ease-in-out infinite .24s; }
@keyframes reel-roll {
  0%, 70%, 90%, 100% { transform: scaleY(1) translateY(0); }
  73% { transform: scaleY(.45) translateY(4px); }
  76% { transform: scaleY(.45) translateY(-4px); }
  79% { transform: scaleY(.45) translateY(2.5px); }
  82% { transform: scaleY(.45) translateY(-2px); }
  85% { transform: scaleY(.45) translateY(1px); }
}
.sl-lever {
  transform-box: fill-box; transform-origin: 60% 100%;
  animation: lever-pull 4s ease-in-out infinite;
}
@keyframes lever-pull {
  0%, 72%, 88%, 100% { transform: rotate(0deg); }
  78% { transform: rotate(24deg); }
  83% { transform: rotate(-7deg); }
}

/* v244.26: INVITA AMICI — due amici, quello dietro ORO fa un salutino
   (piega a sinistra e torna) ogni 3s come le altre animazioni della colonna. */
.iv-svg {
  width: 100%; height: 100%; display: block;
}
.iv-back {
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: iv-wave 3s ease-in-out infinite;
}
@keyframes iv-wave {
  0%, 62%, 82%, 100% { transform: rotate(0deg); }
  66% { transform: rotate(-10deg) translateY(-1px); }
  70% { transform: rotate(4deg); }
  74% { transform: rotate(-6deg); }
  78% { transform: rotate(2deg); }
}
.iv-front .iv-head, .iv-front .iv-body {
  fill: var(--danger, #d64545); stroke: #a23531; stroke-width: 1.4;
}
.iv-back .iv-head, .iv-back .iv-body {
  fill: var(--gold, #d8b74a); stroke: #8f6a1f; stroke-width: 1.4;
}

/* v244.28: CLASSIFICHE — podio di 3 gradini (oro/argento/bronzo) con la
   stella sopra: ogni 3s i gradini si "abbassano" e si ridisegnano (il
   podio che si ricompone), la stella lampeggia in tempo con loro. */
.rk-svg { width: 100%; height: 100%; display: block; }
.rk-bar {
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: rk-rise 3s ease-in-out infinite;
}
.rk-b1 { fill: var(--gold, #d8b74a); stroke: #8f6a1f; stroke-width: 1.2; }
.rk-b2 { fill: #c7ccd8; stroke: #9aa1b3; stroke-width: 1.2; animation-delay: .15s; }
.rk-b3 { fill: #c98a4b; stroke: #96602c; stroke-width: 1.2; animation-delay: .3s; }
.rk-star {
  fill: var(--gold, #d8b74a);
  transform-box: fill-box; transform-origin: 50% 50%;
  animation: rk-ping 3s ease-in-out infinite;
}
@keyframes rk-rise {
  0%, 50%, 78%, 100% { transform: scaleY(1); }
  55% { transform: scaleY(.28); }
  63% { transform: scaleY(.5) translateY(-2px); }
  70% { transform: scaleY(1.08); }
}
@keyframes rk-ping {
  0%, 48%, 80%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  55% { transform: scale(.35) rotate(-25deg); opacity: .35; }
  68% { transform: scale(1.15) rotate(12deg); opacity: 1; }
}

/* v244.23: popup Produzione (banca, cap, riscossione dei 2 generatori) */
.prod-box { text-align: left; }
.pr-row {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  margin-top: 8px; background: rgba(255,255,255,.03);
}
.pr-hline { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.pr-emo { font-size: 18px; }
.pr-lv {
  margin-left: auto; font-size: 11px; font-weight: 700; color: var(--sub);
  background: rgba(255,255,255,.07); padding: 2px 8px; border-radius: 999px;
}
.pr-rate { margin-top: 3px; font-size: 12.5px; font-weight: 700; color: var(--gold); }
.pr-bank { margin-top: 5px; font-size: 12.5px; color: var(--sub); }
.pr-cap { opacity: .75; }
.pr-bar {
  height: 7px; border-radius: 999px; background: rgba(255,255,255,.08);
  overflow: hidden; margin-top: 6px;
}
.pr-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), #f5e08a);
  transition: width .4s;
}
.pr-state { margin-top: 6px; font-size: 11.5px; color: var(--sub); }
.pr-state.pr-full { color: var(--danger); font-weight: 700; }
.prod-collect {
  margin-top: 12px; width: 100%; padding: 11px; border: none;
  border-radius: 12px; background: var(--gold); color: #1c1408;
  font-weight: 800; font-size: 14.5px; cursor: pointer;
}
.prod-collect:disabled { opacity: .45; cursor: default; }
.prod-msg-accrued { margin-top: 8px; min-height: 18px; text-align: center;
  font-weight: 800; color: var(--gold); font-size: 14px; }
.prod-note {
  margin-top: 8px; font-size: 11px; color: var(--sub); opacity: .85;
  line-height: 1.45; text-align: center;
}

.cp-banner {
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 12px; margin-bottom: 10px; text-align: center;
}
.cp-banner.hidden { display: none; }
.cp-banner-title { font-weight: 800; font-size: 14px; }
.cp-banner-text { font-size: 12px; color: var(--sub); margin: 4px 0 8px; }
.cp-banner-cta {
  background: var(--gold); color: #16130a; border: 0; border-radius: 10px;
  font-weight: 800; font-size: 13px; padding: 8px 14px;
}
/* v181: pannello Forgia compatto in Home (sotto l'arena) — card in stile
   .bcard ma diretta (il markup non è avvolto in .bcard). */
/* v191.5: il pannello forgia perde CARD (contorno e sfondo): la testa
   «Forgia Lv N», l'incudine e i tasti fluttuano diretti sulla home. Il
   padding resta internamente (spacing tra gli elementi). */
.cp-forge {
  margin-top: 10px;
  background: none; border: none; border-radius: 12px;
  padding: 12px 0; display: flex; flex-direction: column; gap: 6px;
}
.cp-forge-head {
  display: flex; align-items: center; gap: 8px;
}
.cp-forge-head .bname { flex: 1 1 auto; text-align: left; }
.cp-forge-odds {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
  justify-content: center;
}
/* v187.15: il riquadro forgia è SEMPRE ancorato sopra il tasto Inventario
   (striscia sopra la tabbar): #home riempie la vista e il pannello è spinto
   in fondo — con lo scroll (contenuto più alto della vista) sticky lo tiene
   attaccato alla striscia. */
#home {
  display: flex; flex-direction: column;
  min-height: 100%;
}
#home #cp-forge {
  margin-top: auto;
  position: sticky; bottom: 0;
  z-index: 5;
}
/* v181.4: griglia 2×2 come le celle unite di un foglio — Forgia in A1+A2
   (colonna larga, span 2 righe), Potenziare in B1, Auto in B2; maxed e
   countdown a riga intera. */
/* v191.4: griglia a 3 colonne flancaTE — Info a sinistra, l'incudine CENTRATA
   al centro, Auto a destra (entrambi centrati verticalmente su 2 righe). */
.cp-forge-actions {
  /* v196.20: minmax(0,1fr) — le colonne laterali POSSONO restringersi sotto
     la dimensione del contenuto (con 1fr puro i bottoni nowrap sbordano sui
     iPhone piccoli); l'incudine resta centrata al centro. */
  display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  grid-template-rows: auto auto;
  gap: 6px; margin-top: 10px;
}
.cp-forge-actions .btn.small { width: auto; margin-top: 0; white-space: nowrap; }
/* v196.20: schermi STRETTI (iPhone SE/mini, ≤390px) — niente più «sborda»:
   incudine più piccola, bottoni laterali compattati e tagliati con ellipsis. */
@media (max-width: 390px) {
  .cp-forge-actions { gap: 4px; margin-top: 8px; }
  .cp-forge-actions .cpf-side { margin-left: 4px; }
  .cp-forge-actions .cpf-side.cp-side-left { margin-right: 4px; }
  .cp-forge-actions .cpf-side .btn.small {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font-size: 11px; padding: 8px 7px;
    justify-content: flex-start;
  }
}
/* v191.3: il tasto forgia è INCUDINE, non più un pulsantino rettangolare:
   silhouette ic-anvil piena (fill currentColor, base in stroke) con il saldo
   martelli timbrato sul corpo (.cpf-ham assoluta sul wrapper dell'svg —
   posizione calibrata su render resvg, massa del glifo ~ (11,7.4)/24).
   Chrome del .btn azzerato: il click resta tutta l'incudine. */
.cp-forge-actions #cpf-roll,
.cp-forge-actions #fg-roll {
  grid-row: 1 / 3; grid-column: 2;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; box-shadow: none;
  padding: 0; gap: 0; line-height: 1;
  color: var(--primary); font-family: inherit; cursor: pointer;
}
/* v191.13: Info/Auto SONO tornati nelle azioni in colonna (v191.12 li aveva
   messi in striscia sotto) — l'incudine resta da sola al centro (le colonne
   1fr ai lati portano Inventario e Info/Auto: la centratura non cambia). */
.cp-forge-actions #cpf-roll:disabled,
.cpf-anvil:disabled { opacity: .45; filter: grayscale(.6); cursor: default; }
.cpf-anvil { background: none; border: none; padding: 0;
  /* v191.30: GRIGIA con bordi neri — niente più tinta dal testo del tema
     (--primary non esiste): grigio acciaio fisso in entrambi i temi. */
  color: #98a0ab;
  font-family: inherit; cursor: pointer; display: inline-flex; }
.cpf-av-w { position: relative; display: block; }
.cp-forge-actions #cpf-roll .cpf-av-w,
.cp-forge-actions #fg-roll .cpf-av-w { width: 106px; height: 112px; } /* viewBox 20:21 (v191.25: leggermente più piccola) */
.cpf-av { display: block; width: 100%; height: 100%;
  background: none;
  filter: drop-shadow(0 3px 0 var(--anv-ext, rgba(0,0,0,.5))) drop-shadow(0 0 8px var(--anv-glow, rgba(249,115,22,.4)));
}
/* v191.22: EFFETTO 3D + BORDATURA — lo stroke scuro disegnato DIETRO il
   fill (paint-order: stroke) diventa un contorno netto della silhouette;
   la drop-shadow dura (0 blur, 3px giù) fa da estrusione sotto la massa.
   Premendo l'incudine si abbassa (pressione sul metallo). */
/* v191.30: bordatura NERA (stroke disegnato dietro al fill con
   paint-order:stroke) — più spessa della v191.22, stessa nei due temi;
   la drop-shadow dura (0 blur, 3px giù) resta l'estrusione. */
.cpf-anvil .cpf-av path, .cpf-anvil .cpf-av rect {
  paint-order: stroke; stroke: var(--anv-stroke, #000); stroke-width: var(--anv-sw, .9);
}
.cpf-anvil:active .cpf-av {
  filter: drop-shadow(0 1px 0 var(--anv-ext, rgba(0,0,0,.5))) drop-shadow(0 0 8px var(--anv-glow, rgba(249,115,22,.4)));
}
.cpf-anvil:active .cpf-av-w { transform: translateY(1px); }
/* v191.4/6: numero SULLA BASE allargata dell'incudine — bianco 22px con
   doppia ombra scura, centrato a 50%/83% del crop (base = bar (11.5,20.5)). */
.cp-forge-actions #cpf-roll .cpf-ham,
.cpf-anvil .cpf-ham {
  position: absolute; left: 50%; top: 83%;
  transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 23px; font-weight: 800; color: #fff;
  letter-spacing: .5px;
  text-shadow: 0 0 4px rgba(0,0,0,.55), 0 2px 3px rgba(0,0,0,.5);
  white-space: nowrap;
}
.cp-forge-actions #cpf-roll .cpf-ham .ic,
.cp-forge-actions #fg-roll .cpf-ham .ic,
.cpf-anvil .cpf-ham .ic { width: 17px; height: 17px; color: #fff; }
/* v191.13: HOME — numero martelli PICCOLO e NERO sulla base, allineato a
   SINISTRA (l'incudine eredita il testo chiaro del tema → il bianco c'entrava
   poco) e perde l'ombra scura (a v191.24 il «Lv N» è fuoriuscito dal tasto:
   vive su «Forgia Lv N»). Nel tema light il testo gira #fff (anvil scura). */
/* v191.31: con l'incudine grigia/scura (gradiente + riflessi) il numero
   martelli torna CHIARO (#fff) in entrambi i temi — il nero su base
   scura non si leggeva più. */
.cp-forge-actions #cpf-roll .cpf-ham,
.cp-forge-actions #fg-roll .cpf-ham {
  left: 50%; transform: translate(-50%, -50%); /* v191.25: centro base */
  font-size: 14px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.cp-forge-actions #cpf-roll .cpf-ham .ic,
.cp-forge-actions #fg-roll .cpf-ham .ic {
  width: 12px; height: 12px; color: #fff;
}
/* variante sezione forgia (riga .bactions): incudine media */
.cpf-anvil.av-sm .cpf-av-w { width: 60px; height: 63px; }
.cpf-anvil.av-sm .cpf-ham { font-size: 13px; }
.cpf-anvil.av-sm .cpf-ham .ic { width: 12px; height: 12px; }
/* v196.20: schermi stretti — incudine home più piccola (DEVE venire dopo
   le regole base di .cpf-av-w/.cpf-ham per la specificità) */
@media (max-width: 390px) {
  .cp-forge-actions #cpf-roll .cpf-av-w,
  .cp-forge-actions #fg-roll .cpf-av-w { width: 84px; height: 89px; }
  .cp-forge-actions #cpf-roll .cpf-ham,
  .cp-forge-actions #fg-roll .cpf-ham { font-size: 12px; }
  .cp-forge-actions #cpf-roll .cpf-ham .ic,
  .cp-forge-actions #fg-roll .cpf-ham .ic { width: 12px; height: 12px; }
}

/* v191.9.2: animazione forgia IN HOME — l'INVOLUCRO .cpf-hammerbox monta
   il martello della SCENA (classi .forge-hammer identiche, 40px) sopra
   l'incudine del tasto; sta in .cp-forge (NIENTE absolute dentro <button>:
   i WebView li tagliano) e il posizionamento lo fa il JS sugli offset
   reali del tasto. .cpf-forge-anchor = solo l'ancora di posizionamento. */
.cpf-forge-anchor { position: relative; }
.cpf-hammerbox { position: absolute; z-index: 2; width: 40px; height: 40px;
  pointer-events: none; }
.cpf-spark { position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: linear-gradient(180deg, #fbbf24, #f97316);
  box-shadow: 0 0 8px rgba(249,115,22,.9); pointer-events: none;
  animation: cpfSpark .5s ease-out forwards; }
@keyframes cpfSpark {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; }
}
/* v191.17: REVEAL del pezzo auto-venduto — copre l'incudine per ~1s al
   posto dei colpi di martello: anello del colore della rarità (glow inline
   con hex8, niente color-mix nel WebView), emoji del pezzo + «+N monete»,
   fondo opaco var(--bg) per NASCONDERE la forgia mentre è visibile. */
.cpf-revealbox { position: absolute; z-index: 3; display: flex;
  align-items: center; justify-content: center; pointer-events: none; }
/* v191.26: NON più pallino — la piastrella PEZZO riempie e sostituisce
   l'area dell'incudine (background opaco, bordo rarità). */
.cpf-reveal { width: 100%; height: 100%; border-radius: 14px; border: 2px solid;
  background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; animation: cpfReveal 1s ease-in-out forwards; box-sizing: border-box; }
.cpf-reveal-art { display: flex; align-items: center; justify-content: center; }
.cpf-reveal-art .av-piece { width: auto; height: 58px; }
.cpf-reveal-emoji { font-size: 34px; line-height: 1; }
/* v191.35: popup INFO catalogo — righe rarità (bordo del colore) e nel
   dettaglio: pezzi (art + nome + slot) e abilità (% uscita + range). */
.fg-cat-list { display: flex; flex-direction: column; gap: 6px;
  margin: 10px 14px 0; }
.fg-cat-row {
  display: flex; align-items: center; gap: 8px; font-family: inherit;
  font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
  background: var(--panel); border: 1px solid var(--line);
  border-left-width: 3px; border-radius: 10px; padding: 9px 12px;
}
.fg-cat-pct { margin-left: auto; color: var(--sub); font-size: 12px; }
.fg-cat-pieces .fg-cat-piece {
  display: flex; align-items: center; gap: 8px; padding: 5px 2px;
  border-bottom: 1px dashed var(--line); }
.fg-cat-piece:last-child { border-bottom: none; }
.fg-cat-art { width: 30px; display: flex; justify-content: center; flex: none; }
.fg-cat-name { font-size: 12px; font-weight: 600; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-cat-slot { font-size: 10px; color: var(--sub); flex: none; }
.fg-cat-skill { display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 4px 6px; padding: 5px 2px; font-size: 12px;
  border-bottom: 1px dashed var(--line); }
.fg-cat-skill:last-child { border-bottom: none; }
.fg-cat-meta { font-size: 11px; color: var(--sub); }
.cpf-reveal-val { font-size: 11px; font-weight: 700; color: var(--gold);
  display: inline-flex; align-items: center; gap: 3px; }
@keyframes cpfReveal {
  0% { opacity: 0; transform: scale(.5); }
  18% { opacity: 1; transform: scale(1); }
  78% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.9); }
}
/* v201.13: forgie 2ª/3ª del giro Auto — le piastrelle si SOVRAPPONGONO a
   quella già in scena (l'offset sta sul .cpf-revealbox esterno, l'anim
   controlla il transform dell'INTERNO). `.keep` = entra e RESTA (niente
   fade-out chiave 100%): il caller le rimuove a fine giro del loop. */
.cpf-reveal.keep { animation: cpfRevealKeep 1s ease-out forwards; }
@keyframes cpfRevealKeep {
  0% { opacity: 0; transform: scale(.5); }
  100% { opacity: 1; transform: scale(1); }
}

/* v201.13: selettore «forgie per giro» x1/x2/x3 nel popup Auto (chips
   custom: la classe .btn sarebbe width:100% e le impila — lezione v201.8). */
.fg-xm { width: 52px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--sub); font-weight: 700; font-size: 13px;
  font-family: inherit; cursor: pointer; }
.fg-xm.sel { border-color: var(--accent); color: var(--accent);
  background: var(--card); }

/* v187.18: il tasto forgia mostra SOLO l'icona del martello + il numero
   di martelli (rimane `.cpf-ham`; con v191.3 il numero è timbrato
   sull'incudine). */
.cp-forge-actions #cpf-up, .cp-forge-actions #cpf-auto {
  font-size: 12px; padding: 8px 6px; white-space: nowrap;
}
/* v191.13: nel potenziamento INCUDINE e countdown si scambiano — il
   countdown sta al CENTRO (colonna 2, dove sta l'incudine), con Inventario
   a sinistra e la colonna Info/Auto a destra invariati. */
/* v191.27: l'incudine resta SEMPRE al centro (col 2 row 1/3) — durante il
   potenziamento il countdown va nella riga 3 (intera, come tn-max). */
.cp-forge-actions .fg-upgrading {
  grid-column: 1 / 4; grid-row: 3; align-self: stretch;
  font-size: 11px; padding: 2px 2px 0;
}
.cp-forge-actions .fg-upgrading .bar { height: 4px; border-radius: 3px; }
.cp-forge-actions .tn-max { grid-column: 1 / 4; grid-row: 3; }
.bactions .cpf-anvil { align-self: center; } /* sezione: incudine centrata */
.cp-forge-logline { border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 3px; }
.cp-forge-pending {
  width: 100%; box-sizing: border-box; margin-top: 8px;
  background: var(--gold-soft); border: 1px solid var(--gold);
  color: var(--text); font-size: 12px; font-weight: 700;
  font-family: inherit;
  border-radius: 10px; padding: 9px 10px; cursor: pointer;
}
/* v191.13: la striscia v191.12 è sostituita dal layout ATTORNO
   all'incudine — Inventario a sinistra allineato ALLA BASE, colonna
   Info (sopra) / Auto (sotto) a destra, stessa allineatura alla base. */
/* v191.21: colme come prima (stretch) ma con un piccolo margine sul lato
   incudine — «leggermente» distanti, non rimpicciolite. */
/* v191.35: colonna SINISTRA simmetrica alla destra — Info (sopra) /
   Inventario (sotto); #cpf-inv non ha più la sua griglia. Il margine verso
   l'incudine qui è a DESTRA (l'incudine sta a destra della colonna). */
.cp-forge-actions .cpf-side {
  grid-column: 3; grid-row: 1 / 3; align-self: end;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  margin-left: 10px;
}
/* .cpf-side.cp-side-left: specificità (0,3,0) — DEVE vincere su .cpf-side
   (0,2,0) che mette la colonna a destra (v191.35: le regole invertite di
   ordine si sovrapponevano tutte in colonna 3). */
.cp-forge-actions .cpf-side.cp-side-left {
  grid-column: 1; grid-row: 1 / 3; align-self: end;
  margin-left: 0; margin-right: 10px;
}
.cp-forge-actions .cpf-side .btn.small {
  width: auto; margin-top: 0; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  font-size: 12px; padding: 9px 11px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--text);
}

/* --- v111: Forgia Auto — pannello config, log vendite, stato bottone --- */
.fg-auto-wrap { margin-top: 8px; }
.fg-auto-cfg { cursor: pointer; }
.fg-auto-log {
  margin-top: 6px; padding: 4px 6px; border: 1px dashed var(--border);
  border-radius: 8px; min-height: 20px;
}
.fg-auto-line { font-size: 11px; color: var(--sub); padding: 1px 0; }
.fg-auto-line b { color: var(--text); }
.fg-auto-line.fg-auto-idle { opacity: .55; }
.fg-auto-row {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid; border-radius: 8px; padding: 8px 10px;
  background: var(--panel); margin-top: 6px; cursor: pointer;
}
.fg-auto-row.dim { opacity: .55; }
.fg-auto-row span:first-of-type { font-weight: 700; font-size: 13px; }
.fg-auto-row input[type="checkbox"] { margin: 0; }
.fg-auto-note { margin-left: auto; font-size: 10px; color: var(--sub); text-align: right; }
/* v191.37: Progressi/Potenziamento nel popup Info forgia = riquadri
   fg-slotbox (fg-prog-box / fg-up-box), nessun CSS extra necessario.
   (fg-info-sec rimossa con il markup a flusso.) */
/* Bottone Auto: verde quando gira, ambra quando in pausa (home+sezione). */
.auto-on { background: var(--ok, #16a34a) !important; color: #fff !important; }
.auto-paused { background: var(--gold, #f59e0b) !important; color: #16130a !important; }

/* --- v191.36: RECORDS clan — tasto icona nella testata + popup battaglie --- */
/* v191.36.2: PICCOLO NELL'ANGOLO in alto a destra della testata (absolute:
   il bhead è flex-wrap e il tasto grande finiva SOTTO il sottotitolo).
   Icona LIBRO (ic-book, log di battaglie) + counter attacchi ricevuti.
   v191.36.3: TUTTO dentro la testata — la bhead è il primo elemento del
   contenitore scrollabile (#view) e con offset negativi (top:-4/-6) il
   bordo superiore finiva FUORI pagina (clippato dallo scroll container). */
.bhead .cn-records-btn, .tb-head .cn-records-btn {
  position: absolute; top: 0; right: 0;
  width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--text); cursor: pointer; font-family: inherit;
}
.bhead .cn-records-btn:active, .tb-head .cn-records-btn:active {
  transform: translateY(1px); }
.bhead .cn-records-btn .ic, .tb-head .cn-records-btn .ic
  { width: 15px; height: 15px; }
.rec-count {
  position: absolute; top: 0; right: 0;
  min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 8px; background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 800; line-height: 14px;
  text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.rec-list { display: flex; flex-direction: column; gap: 4px; max-height: 52vh; overflow-y: auto; padding: 2px; }
.rec-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); border-left-width: 3px;
}
.rec-row[data-profile] { cursor: pointer; }
.rec-win { border-left-color: var(--ok, #16a34a); }
.rec-loss { border-left-color: var(--danger, #dc2626); }
.rec-role { display: inline-flex; width: 18px; }
.rec-role .ic { width: 16px; height: 16px; color: var(--sub); }
.rec-body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.rec-opp { font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-sub { font-size: 10px; color: var(--sub); }
.rec-res { font-size: 11px; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.rec-win .rec-res { color: var(--ok, #16a34a); }
.rec-loss .rec-res { color: var(--danger, #dc2626); }
.rec-res .ic { width: 11px; height: 11px; }
.rec-when { font-size: 10px; color: var(--sub); white-space: nowrap; }

/* ------------------------------------------------------------------ */
/* v191.38: striscia CHAT GLOBALE in home (nav#chatstrip, tra #view e  */
/* #subnav) — ultime 3 battute della chat globale; tap = chat globale. */
.chatstrip {
  flex-shrink: 0;
  margin-top: 8px;
  padding: 6px 10px 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  display: flex; flex-direction: column; gap: 2px;
  cursor: pointer; text-align: left; font-family: inherit; width: 100%;
  max-width: 100%; overflow: hidden;
}
.chatstrip:active { transform: translateY(1px); }
.cs-head {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; color: var(--sub);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 2px;
}
.cs-head .ic { width: 12px; height: 12px; color: var(--gold); }
.cs-row {
  display: flex; gap: 6px; align-items: baseline;
  font-size: 11px; line-height: 1.45; min-width: 0;
}
.cs-row .cs-name {
  flex: 0 0 auto; font-weight: 700; max-width: 38%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cs-row .cs-text {
  flex: 1 1 auto; min-width: 0; color: var(--sub);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chatstrip .cs-row:only-child, .chatstrip .cs-row:last-child { color: inherit; }

/* ------------------------------------------------------------------ */
/* v244.10: striscia FORGIA (nav#forgestrip, tra #eggstrip e #subnav) — */
/* i 5 tasti della toolbar (Info, Inventario, incudine, «Forgia Lv N», */
/* Auto) ancorati sopra la barra Potenzia COME la striscia uova sta    */
/* sopra il tasto Pet: fuori dallo scroll, sempre a portata di pollice. */
.forgestrip {
  flex-shrink: 0;
  margin-top: 8px;
  padding: 4px 2px 2px;
  width: 100%; max-width: 100%;
}
.forgestrip:empty { display: none; }
.forgestrip .cp-forge { margin-top: 0; padding: 0; }
.forgestrip .cp-forge-pending { margin-top: 6px; }
.forgestrip .msg { margin: 0 0 4px; padding: 6px 8px; font-size: 12px; }

/* ------------------------------------------------------------------ */
/* v196.3: striscia UOVA (nav#eggstrip, tra #view e #subnav) — i 3 slot */
/* d'incubazione SEMPRE ancorati alla base della bottombar (solo admin; */
/* il terzo slot è bloccato in fase 1). */
.eggstrip {
  flex-shrink: 0;
  margin-top: 8px;
  padding: 6px 8px 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  width: 100%; max-width: 100%;
}
.eggstrip .msg { margin: 0 0 4px; padding: 6px 8px; font-size: 12px; }
.eggstrip-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.eggslot {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; min-height: 46px;
  padding: 5px 3px; border: 1px solid var(--line); border-radius: 8px;
  text-align: center; cursor: pointer;
}
.eggslot.empty { opacity: .7; border-style: dashed; }
.eggslot.locked { opacity: .5; border-style: dashed; cursor: default; }
.eggslot.ready { box-shadow: 0 0 0 1px var(--gold, #fbbf24) inset; }
.eggslot:active { transform: translateY(1px); }
.eggslot.locked:active { transform: none; }
.es-emoji { font-size: 20px; line-height: 1.1; }
.es-emoji svg { width: 16px; height: 16px; }
/* v196.26: uova in SVG — dimensione per contesto (la .es-emoji svg 16px si
   applica solo alle icone, la .egg-art ha le sue misure) */
.es-emoji .egg-art { width: 22px; height: 27px; display: block; margin: 0 auto; }
.eggslot.empty .es-emoji .egg-art { opacity: .55; }
.inv-tile-art .egg-art { width: 30px; height: 38px; display: block; }
.fg-swap-art .egg-art { width: 60px; height: 74px; display: block; margin: 0 auto; }
.fg-auto-row .egg-art { width: 15px; height: 19px; display: inline-block;
  vertical-align: -5px; }
.es-timer { font-size: 10px; color: var(--sub); line-height: 1.2; }

/* v196.16: countdown LIVE (ticker per-segondo in pets.js) + ANIMAZIONI di
   spawn — uova evocate, pet schiuso, slot che passa a PRONTO. Le classi
   .tile-spawn/.tile-hatch/.es-pop sono volatili: aggiunte SOLO all'azione. */
@keyframes tileSpawnIn {
  0% { transform: scale(.2) translateY(10px); opacity: 0; }
  60% { transform: scale(1.12) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes tileHatchIn {
  0% { transform: scale(.3) rotate(-8deg); opacity: 0; box-shadow: 0 0 0 0 rgba(251,191,36,.8); }
  45% { transform: scale(1.18) rotate(4deg); }
  70% { transform: scale(.94) rotate(-2deg); box-shadow: 0 0 14px 4px rgba(251,191,36,.55); }
  100% { transform: scale(1) rotate(0); opacity: 1; box-shadow: 0 0 0 0 rgba(251,191,36,0); }
}
@keyframes esReadyPop {
  0% { transform: scale(.75); }
  55% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes esReadyGlow {
  0%, 100% { box-shadow: 0 0 0 1px var(--gold, #fbbf24) inset; }
  50% { box-shadow: 0 0 12px 3px rgba(251,191,36,.6), 0 0 0 1px var(--gold, #fbbf24) inset; }
}
.inv-grid .inv-tile.tile-spawn {
  animation: tileSpawnIn .5s cubic-bezier(.2, .8, .3, 1.25) both;
}
.inv-grid .inv-tile.tile-hatch {
  animation: tileHatchIn .8s cubic-bezier(.2, .8, .3, 1.1) both;
  z-index: 2;
}
.eggslot.es-pop .es-emoji { animation: esReadyPop .55s cubic-bezier(.2, .8, .3, 1.3); }
/* 0.9s < 1s (il rebuild per-segondo ricrea lo slot): il bagliore finisce. */
.eggslot.es-pop { animation: esReadyGlow .9s ease; }

/* ------------------------------------------------------------------ */
/* v196.8: DOCK della vista pets (come la barra di scrittura chat) —   */
/* slot pet + azioni Info | Evoca | xN FISSI sopra lo slot uova:       */
/* #pets-scroll è lo SCROLLER interno, il dock resta fuori dallo scroll*/
/* (sticky non basta già: a fine pagina si stacca).                    */
body.view-pets #view { overflow: hidden; }
#pets {
  height: 100%; display: flex; flex-direction: column;
}
#pets .bhead, #pets #pets-msg { flex: 0 0 auto; }
#pets #pets-body, #pets #pets-frame {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
#pets #pets-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#pets #pets-dock {
  flex: 0 0 auto;
  background: var(--card);
  padding-top: 8px;
  z-index: 5;
}
/* v196.31: striscia saldi ANCORATA in cima a #pets-frame, fuori dallo
   scroller — non scorre via col contenuto (come il dock in basso). */
#pets .pets-saldi {
  flex: 0 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px 4px; font-size: 14px;
}
.pets-actions {
  display: flex; gap: 8px; align-items: stretch;
  margin-top: 10px; padding-bottom: 2px;
}
/* v196.35: Evoca allineato ai due pill — .btn.small portava margin-top:8px
   che lo faceva stare più in basso di Info/xN (margin-top:0). */
.pets-actions #pets-egg { flex: 1 1 auto; white-space: nowrap; margin-top: 0; }
/* v196.38: Evoca in ORO — il blu primario stonava nella schermata Pets
   (tema tutta oro: Incubatrice Lv, Consigliato, saldi 🎟/💎); gradiente
   moneta con testo scuro, leggibile su tema chiaro e scuro (id > .btn.primary). */
.pets-actions #pets-egg {
  background: linear-gradient(180deg, #eec763 0%, #d9a92f 55%, #c4982a 100%);
  border: 1px solid rgba(0, 0, 0, .35);
  color: #2b2924;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 10px;
}
.pets-actions .btn { font-family: inherit; }
/* v196.22: Info e xN nel dock pet = stessa grafica del tasto Info in home
   forgia (#cpf-catalog): pill con pannello, bordo neutro e testo normale
   (il ghost trasparente accent-era diverso).
   v196.23: larghezza FISSA identica (68px, contenuti centrati). */
.pets-actions #pets-info,
.pets-actions #pets-mult {
  flex: 0 0 68px; width: 68px; text-align: center;
  margin-top: 0; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--text); border-radius: 12px; font-size: 12px; padding: 9px 0;
}

/* v198.5: moneta volante delle vendite (ui/coinfly.js) — parte dal bottone
   Vendi e vola verso il contatore monete della strip (#cpi-coins). */
.cf-coin {
  position: fixed;
  z-index: 5000;
  width: 26px;
  height: 26px;
  pointer-events: none;
  color: var(--gold);
  will-change: transform, opacity;
}
.cf-coin .ic { width: 26px; height: 26px; }

/* --- v198.6: Impostazioni (Account) — righe toggle vibrazione/audio ------ */
.ac-sett-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 0; color: var(--text); cursor: pointer;
}
.ac-sett-row + .ac-sett-row { border-top: 1px solid var(--line); }
.ac-sett-ico {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); color: var(--gold);
}
.ac-sett-ico svg { width: 18px; height: 18px; display: block; }
.ac-sett-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ac-sett-txt b { font-size: 14px; }
.ac-sett-txt i { font-style: normal; font-size: 12px; color: var(--sub); }
.ac-sw { margin-left: auto; flex: 0 0 auto; position: relative; width: 46px; height: 26px; }
.ac-sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ac-sw i {
  display: block; width: 46px; height: 26px; border-radius: 13px;
  background: rgba(255,255,255,.12); border: 1px solid var(--line);
  transition: background .18s ease;
  pointer-events: none;
}
.ac-sw i::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform .18s ease;
}
.ac-sw input:checked + i { background: var(--ok, #16a34a); border-color: transparent; }
.ac-sw input:checked + i::after { transform: translateX(20px); }

/* v198.7: celle PET nella griglia profilo (dopo le 6 equip, stesso stile).
   Emoji della specie al centro, badge Lv come i pezzi; bordo in tinta
   rarità (inline dal client). */
.pr-pet .pr-pet-em { font-size: 22px; line-height: 1; }
.pr-pet { min-height: 38px; } /* come le celle equip (svg 36px) */

/* v198.8: pet equipaggiati in scena di battaglia — emoji fluttuanti accanto
   alla figura (sinistra per il fighter sx, destra specchiata per quello dx),
   posizione random data inline da petRow() in scene.js. */
.sc-pets { position: absolute; inset: 0; pointer-events: none; }
.sc-pet {
  position: absolute; font-size: 16px; line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.45));
}
/* scattano con il padrone: quando il fighter lunga, i pet saltano. */
.fighter.sc-lunge .sc-pets { animation: sc-pet-hop .65s ease; }
@keyframes sc-pet-hop {
  0% { transform: translateY(0); }
  25% { transform: translateY(-5px); }
  50% { transform: translateY(0); }
  68% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

/* --- Leghe Arena v241 -------------------------------------------------- */
/* Chip lega in Arena + Classifiche: bordo colorato per lega (il server
   manda label/emoji/color; qui solo contenitore neutro). */
.league-chip {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 11px; margin: 8px 0;
  font-size: 13px; color: var(--text-dim);
}
.league-chip b { font-size: 14px; }
/* Avversario del pool proveniente da un'altra lega (fallback cross-lega). */
.league-cross { color: var(--text-dim); font-size: 11px; margin-left: 2px; }

/* --- Schermata Arena v243 ---------------------------------------------- */
/* Vista flessibile con scroller interno (pattern #pets): #view non scorre  */
/* piu', scroller classifiche + dock ancorato alla bottombar FUORI scroll.  */
body.view-arena #view { overflow: hidden; }
#arena { height: 100%; display: flex; flex-direction: column; }
#arena .bhead { flex: 0 0 auto; }
#arena #ar-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ar-crest-head { flex: 0 0 auto; text-align: center; padding: 6px 12px 4px; }
.ar-crest {
  background: none; border: none; padding: 0; cursor: pointer; margin: 0;
}
.ar-crest svg { width: 86px; height: 97px; display: block; margin: 0 auto; }
.ar-crest:active { transform: scale(.96); }
.ar-league-name {
  font-size: 16px; font-weight: 700; margin-top: 2px; color: var(--text-dim);
}
.ar-league-name b { font-size: 18px; }
.ar-season {
  margin-top: 3px; font-size: 12px; color: var(--text-dim);
}
.ar-season b { color: var(--text); }
.ar-mystats {
  display: flex; justify-content: center; gap: 14px;
  margin-top: 5px; font-size: 12px; color: var(--text-dim);
}
.ar-mystats b { color: var(--text); }
/* Scroller della classifica (FUORI dal dock, dentro la vista). */
.ar-scroll {
  flex: 1 1 auto; min-height: 0; margin-top: 6px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* Righe di classifica: pos · nome · potenza · punti (senza avatar: la    */
/* lista può avere centinaia di righe, resta leggerissima).               */
.ar-row {
  display: grid; grid-template-columns: 38px minmax(0,1fr) auto auto;
  gap: 6px; align-items: center; padding: 7px 12px;
  border-top: 1px solid rgba(255,255,255,.06); font-size: 13px;
}
.ar-row.dim { opacity: .55; }
.ar-row.me, .ar-me-row .ar-row.me {
  border-left: 3px solid var(--lgc, var(--gold));
  background: rgba(255,255,255,.05);
}
.ar-row .ar-pos { text-align: center; font-weight: 700; color: var(--text-dim); }
.ar-row .ar-pos .ic { width: 15px; height: 15px; }
.ar-row .ar-nm {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ar-row .ar-pw, .ar-row .ar-pts {
  color: var(--text-dim); font-size: 12px; display: flex; gap: 3px;
  align-items: center;
}
.ar-row .ar-pw .ic, .ar-row .ar-pts .ic { width: 12px; height: 12px; }
/* Separator di zona: verde sopra (sale), rosso sotto (scende).            */
.ar-zone {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 4px 12px; text-transform: uppercase;
}
.ar-zone .ic { width: 13px; height: 13px; }
.ar-zone.zone-promo { color: #7ed957; }
.ar-zone.zone-releg { color: #ff5c5c; }
.ar-zone.ar-elision {
  color: var(--text-dim); font-weight: 600; text-transform: none;
  letter-spacing: 0; justify-content: center;
}
/* Dock ancorato alla bottombar: la MIA riga + Combatti.                   */
/* v243.2: il dock respirava sopra la tabbar (solo il margin-top della
   tabbar, 12px): sotto Arena il margine azzera e il dock tocca la tabbar.
   ATTENZIONE: #app padding-bottom NON si tocca — la tabbar e' l'ultimo
   elemento della card, togliendo quel padding SCENDE di 10px in Arena
   rispetto alle altre viste (v243.1, rollback).
   v243.3: ANCHE #tabbar margin-top:0 si toglie — la subnav (ancorata
   dopo #view, piu' alto di 12px con lo scroller interno piu' largo)
   SCENDEVA di 12px toccando la tabbar. Ora Arena e' identica a Guerre
   (copia prod @03:50, misure Playwright guerra/arena): barra attacco
   -12px sopra la subnav subnav mt 8 / tabbar mt 12 - dock mb 12px. */
.ar-dock {
  flex: 0 0 auto; display: flex; gap: 8px; align-items: stretch;
  background: none; border-top: none;
  margin: 10px 0 12px;
  padding: 0 12px;
  z-index: 5;
}
.ar-dock #ar-me { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#ar-me .ar-row { border-top: none; padding: 4px 6px; }
.ar-me-info {
  font-size: 12px; color: var(--text-dim);
  display: flex; align-items: center; gap: 5px; padding: 8px 6px;
}
.ar-fight { white-space: nowrap; margin-top: 0; }
/* v243.1: Combatti in ROSSO (richiesta owner) — override del blu primario,
   pieno --danger su entrambi i temi. v244.6.1: da selettore id a classe
   scoppata su .ar-dock-row (entrambi i tasti, Arena e Guerre, stanno lì):
   .ar-fight SECCA perderebbe il tie-break vs .btn.danger (0,2,0 a riga
   270) — qui (0,2,0) in fondo al file vince. */
.ar-dock-row .ar-fight {
  background: linear-gradient(180deg, #f26a6a 0%, #ef4444 55%, #dc2626 100%);
  border: 1px solid rgba(0, 0, 0, .35);
  color: #fff; font-weight: 700;
}
/* v244.3: riga a 3 tasti (Info · Combatti · Riscuoti) SOTTO la riga ME —
   l'aumento d'altezza comprime lo scroller (#view resta flex:1, subnav e
   tabbar NON si muovono: lezioni v243.x intatte). */
.ar-dock { flex-wrap: wrap; }
.ar-dock #ar-me { flex: 1 1 100%; }
.ar-dock-row { flex: 1 0 100%; display: flex; gap: 8px; align-items: stretch;
  margin-top: 4px; }
.ar-dock-row .ar-fight, .ar-dock-row #ar-fight { flex: 1; }
/* v244.3.2: Info e Premi — STESSA grafica del tasto Info in home forgia
   (pill pannello, bordo neutro, testo normale): prima restavano ghost
   trasparenti. */
.ar-dock-row .ar-fbtn {
  white-space: nowrap; margin-top: 0; width: auto;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--text); border-radius: 12px; font-size: 12px;
  padding: 9px 14px; flex: 0 0 auto;
}
.ar-dock-row .ar-fbtn svg { vertical-align: middle; }

/* v244.7: popup premi war — striscia VS (clan vs clan) e pacchetti come
   card-righe invece dei paragrafoni .binfo (feedback owner «grafica
   terribile, favella incasinata»). */
.wp-vs { display: flex; align-items: stretch; gap: 8px; margin: 2px 0 10px; }
.wp-vs .wp-side {
  flex: 1; min-width: 0; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 6px; text-align: center;
  font-size: 12px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wp-vs .wp-side b { display: block; font-size: 18px; color: var(--text);
  margin-top: 2px; }
.wp-sep { align-self: center; font-weight: 700; color: var(--sub);
  font-size: 11px; flex: 0 0 auto; }
.wp-pkg {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; margin-top: 8px; text-align: left;
}
.wp-pkg .wp-ico { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.wp-pkg .wp-ico svg { display: block; }
.wp-pkg .wp-pkg-body { flex: 1; min-width: 0; }
.wp-pkg .wp-head { font-size: 12px; color: var(--text-dim); }
.wp-pkg .wp-val { margin-top: 2px; font-weight: 700; font-size: 13px; }
.wp-pkg .wp-sub { margin-top: 1px; font-size: 11px; color: var(--text-dim); }
/* Badge «premio pronto»: tasto Riscuoti in verde (positivo, convenzione
   tastiera) con puntino pulsatore. */
#ar-claim.ar-claim-ready {
  background: linear-gradient(180deg, #34d399 0%, #22c55e 60%, #16a34a 100%);
  border: 1px solid rgba(0, 0, 0, .35);
  color: #fff; font-weight: 700; position: relative;
}
#ar-claim.ar-claim-ready::after {
  content: ""; position: absolute; top: -3px; right: -3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #fde047; border: 1px solid rgba(0, 0, 0, .4);
  animation: ar-claim-pulse 1.2s ease-in-out infinite;
}
@keyframes ar-claim-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.35); }
}
/* Nel popup Riscuoti: la fascia corrente (posizionamento live) s'illumina */
.lp-row.ar-now { background: var(--gold-soft, rgba(251, 191, 36, .12));
  border-radius: 8px; }
.lp-row.ar-now span, .lp-row.ar-now b { color: var(--gold, #fbbf24); }
/* Popup premi di lega (dallo stemma): blocchi per lega + fasce.           */
.lp-block { border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; margin-bottom: 8px; }
.lp-block.mine { border-color: var(--gold); }
.lp-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; margin-bottom: 5px;
}
.lp-head svg { width: 22px; height: 25px; flex: 0 0 auto; }
.lp-row {
  /* v244.3.2: la colonna ETICHETTA è a LARGHEZZA FISSA — con «auto» ogni
     .lp-row misura la propria etichetta (grid separati per riga) e le
     colonne premi non partivano tutte allo stesso x tra le righe.
     I premi restano allineati a destra, il wrap avviene dentro la cella. */
  display: grid; grid-template-columns: 84px minmax(0, 1fr);
  gap: 3px 10px; align-items: baseline;
  font-size: 12px; color: var(--text-dim); padding: 3px 0;
}
.lp-row b { color: var(--text); text-align: right; line-height: 1.35; }
/* Popup Combatti: stats in capo + lista avversari (riusa .ar-opp).        */
.fp-stats {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12px; color: var(--text-dim); margin-bottom: 8px;
}
.fp-stats b { color: var(--text); }
.fp-list { max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* v244.31: Account → Tema — scelta del tema grafico (Attuale / A / B). */
.ac-theme-list { display: grid; gap: 8px; padding: 10px; }
.ac-theme-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 14px; cursor: pointer; font-family: inherit;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
}
.ac-theme-card.on { border-color: var(--gold); background: var(--gold-soft); }
.ac-theme-sw { display: flex; flex: 0 0 auto; }
.ac-theme-sw i {
  width: 22px; height: 38px; border: 1px solid rgba(255,255,255,.18);
}
.ac-theme-sw i:first-child { border-radius: 8px 0 0 8px; }
.ac-theme-sw i:last-child { border-radius: 0 8px 8px 0; }
.ac-theme-sw i + i { margin-left: -1px; }
.ac-theme-txt { display: grid; gap: 1px; min-width: 0; flex: 1; }
.ac-theme-txt b { font-size: 15px; }
.ac-theme-txt i { font-style: normal; font-size: 12px; color: var(--sub); }
.ac-theme-ck { width: 22px; height: 22px; color: var(--gold); opacity: 0; flex: 0 0 auto; }
.ac-theme-ck svg { width: 22px; height: 22px; }
.ac-theme-card.on .ac-theme-ck { opacity: 1; }
.ac-theme-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* v244.33: tema Attuale PULITO — una sola scala di raggi (16 pannelli /
   12 elementi interni), niente doppio bordo (tessere dentro un pannello
   senza contorno proprio), un solo accento (oro: i bottoni primari non
   sono più blu mentre le schede attive sono oro), testo piccolo ≥ 11px,
   meno ombre e glow. Selettori semplici: i temi A/B/C (html[data-skin]) li
   scavalcano per specificità. */
.cp-info, .cp-camp, .bcard, .ac-hero, .ac-row, .chatstrip { border-radius: 16px; }
.stat, .fg-tile, .fg-tot, .fg-slotbox, .ac-hero-av, .subitem { border-radius: 12px; }
.fg-tile, .fg-tot, .fg-slotbox, .ac-hero-av, .stat {
  border-color: transparent; background: var(--panel-strong);
}
.fg-tile.empty { opacity: .7; }
.ac-ico { background: none; width: 30px; }
.prod-btn { box-shadow: none; border-radius: 16px; }
.tab.active .tabicon { filter: none; }
.btn.primary { background: var(--gold); color: #1a1405; }
.btn.ghost { color: var(--text); border-color: var(--line); }
.subitem .sublabel { font-size: 11px; }
.fg-tile-name { font-size: 11px; }
.ac-txt i, .stat .k, .fg-tot span, .cs-head { font-size: 12px; }
.fg-slotbox .fg-tot { background: var(--card); }

/* v244.34: incudine della Forgia nella palette del tema (Attuale = bronzo
   oro, stesso oro dell'accento; prima grigio/crema con glow arancio che
   stonava con tutto). I temi A/B/C ridefiniscono le stesse variabili. */
:root {
  --anv-0: #f6e3a1; --anv-1: #ecc75a; --anv-2: #c99a2c; --anv-3: #6e4f14; --anv-4: #2a1d07;
  --anv-stroke: #140e03; --anv-sw: 1; --anv-ext: rgba(0,0,0,.45); --anv-glow: rgba(227,179,65,.28);
}

/* v244.34: scena SCHIUSA/EVOCAZIONE uova nella palette del tema (prima viola
   fisso con fondo grigio-viola su tutti i temi). Attuale = oro; i temi A/B/C
   ridefiniscono le stesse variabili. Il colore dell'uovo e delle crepe
   resta quello della rarità (è contenuto, non tema). */
:root {
  --egg-rgb: 227, 179, 65; --egg-soft-rgb: 250, 226, 150;
  --egg-hex: #e3b341; --egg-soft: #fbe9a8;
  --egg-bg1: #2a2416; --egg-bg2: #15120a; --egg-chip: rgba(22, 18, 8, .85);
  --egg-burst: rgba(255, 236, 170, .95);
}

/* --- v244.35: SCHIUSA cinematografica -------------------------------------
   --hc/--hc-rgb = colore della rarità (impostati dalla scena); --charge 0→1
   = energia accumulata a ogni crepa. Tutto dentro .egg-scene (overflow:hidden). */
.hx-rays, .hx-orbit, .hx-flash { position: absolute; pointer-events: none; }
.hx-rays {
  left: 50%; top: 50%; width: 340px; height: 340px; margin: -170px 0 0 -170px;
  background: repeating-conic-gradient(from 0deg,
    rgba(var(--hc-rgb, 255,255,255), .42) 0 6deg, transparent 6deg 24deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 68%);
          mask-image: radial-gradient(circle, #000 0, transparent 68%);
  opacity: calc(var(--charge, 0) * .34);
  animation: hxSpin 14s linear infinite;
  transition: opacity .5s;
}
.egg-scene.hx-revealed .hx-rays { opacity: .5; animation-duration: 9s; }
@keyframes hxSpin { to { transform: rotate(360deg); } }
.hx-orbit { left: 50%; top: 50%; width: 0; height: 0; }
.hx-orb-p {
  position: absolute; left: -2px; top: -2px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--egg-soft); box-shadow: 0 0 7px 2px rgba(var(--hc-rgb, 255,255,255), .9);
  animation: hxOrbit 2s linear infinite;
}
@keyframes hxOrbit {
  from { transform: rotate(var(--a, 0deg)) translateX(var(--r, 56px)) scale(.8); }
  to   { transform: rotate(calc(var(--a, 0deg) + 360deg)) translateX(var(--r, 56px)) scale(1.2); }
}
/* la luce filtra dalle crepe */
.egg-crack-glow path {
  stroke: var(--hc, #fff); stroke-width: 5.5; opacity: .9;
  filter: blur(1.6px) drop-shadow(0 0 4px var(--hc, #fff));
}
.egg-crack-line path { stroke-width: 1.7; }
/* lampo bianco-rarità all'esplosione */
.hx-flash {
  inset: 0; z-index: 6; opacity: 0;
  background: radial-gradient(circle at 50% 50%, #fff 0, rgba(var(--hc-rgb, 255,255,255), .75) 38%, transparent 75%);
}
.hx-flash.hx-go { animation: hxFlash .65s ease-out; }
@keyframes hxFlash { 0% { opacity: 0; } 14% { opacity: 1; } 100% { opacity: 0; } }
/* onde d'urto */
.hx-ring {
  position: absolute; left: 50%; top: 50%; z-index: 4; width: 60px; height: 60px;
  margin: -30px 0 0 -30px; border-radius: 50%;
  border: 3px solid var(--hc, #fff);
  box-shadow: 0 0 14px rgba(var(--hc-rgb, 255,255,255), .8), inset 0 0 12px rgba(var(--hc-rgb, 255,255,255), .5);
  opacity: 0; animation: hxRing 1s cubic-bezier(.15,.7,.3,1) forwards;
}
@keyframes hxRing {
  0% { transform: scale(.3); opacity: .95; }
  100% { transform: scale(4.2); opacity: 0; }
}
/* scintille dell'esplosione */
.hx-spark {
  position: absolute; left: 50%; top: 50%; z-index: 5;
  width: var(--sz, 5px); height: var(--sz, 5px); margin: -3px 0 0 -3px; border-radius: 50%;
  background: var(--hc, #fff); box-shadow: 0 0 8px 1px rgba(var(--hc-rgb, 255,255,255), .9);
  opacity: 0; animation: hxSpark 1.1s cubic-bezier(.1,.7,.3,1) forwards;
}
.hx-spark-w { background: #fff; }
@keyframes hxSpark {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, 0)) scale(.2); opacity: 0; }
}
/* riflettore sotto il pet */
.hx-spot {
  position: absolute; left: 50%; bottom: 8px; width: 170px; height: 34px; margin-left: -85px; z-index: 0;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse, rgba(var(--hc-rgb, 255,255,255), .75), transparent 70%);
  animation: hxSpot .8s ease-out both;
}
@keyframes hxSpot { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
/* scossa del popup: ampiezza --shk */
.battle-box.hx-shake { animation: hxShake .38s linear; }
@keyframes hxShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(calc(var(--shk, 2px) * -1), calc(var(--shk, 2px) * .5)); }
  40% { transform: translate(var(--shk, 2px), calc(var(--shk, 2px) * -.5)); }
  60% { transform: translate(calc(var(--shk, 2px) * -.7), 0); }
  80% { transform: translate(calc(var(--shk, 2px) * .7), calc(var(--shk, 2px) * .3)); }
}
/* titolo e statistiche entrano dopo l'esplosione */
.sc-total.hx-title-in { animation: hxTitle .6s cubic-bezier(.2,.8,.3,1.25) .35s both; }
.sc-fb.hx-fb-in { animation: hxFade .5s ease .7s both; }
@keyframes hxTitle { from { opacity: 0; transform: translateY(14px) scale(.8); } }
@keyframes hxFade { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  .hx-rays, .hx-orb-p { animation: none; }
  .battle-box.hx-shake { animation: none; }
}

/* v244.37: tasto Evoca + gettone Pet Ticket nei colori del tema. Variabili
   --evo-* (sfondo, testo, bordo) e --tk-* (gettone): Attuale = oro storico. */
:root {
  --evo-bg: linear-gradient(180deg, #eec763 0%, #d9a92f 55%, #c4982a 100%);
  --evo-fg: #2b2924; --evo-bd: rgba(0, 0, 0, .35);
  --tk-0: #eec763; --tk-1: #c4982a; --tk-ink: rgba(43, 41, 36, .82);
}
.pets-actions #pets-egg { background: var(--evo-bg); color: var(--evo-fg); border-color: var(--evo-bd); }

/* v244.39: titoletto della sezione temi stagionali (solo anteprima). */
.ac-theme-sub {
  display: flex; align-items: center; gap: 6px; margin: 14px 2px 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--sub);
}
.ac-theme-sub svg { width: 14px; height: 14px; color: var(--gold); }

/* v244.41: cella GADGET (vuota e bloccata) dopo gli 8 slot equip del profilo. */
.pr-gadget { min-height: 38px; border-style: dashed; opacity: .55; color: var(--sub); }
.pr-gadget svg { width: 18px; height: 18px; }

/* v244.42: card OBIETTIVI DEL GIORNO in home (3 righe: testo+premio, barra,
   stato). Usa i token del tema (--k-* quando il tema li definisce). */
.goals-card {
  padding: 10px 12px 8px; display: grid; gap: 8px; min-width: 0;
  background: var(--panel); border: var(--k-bw, 1px) solid var(--line);
  border-radius: var(--k-r, 16px); box-shadow: var(--k-sh, none);
}
.gl-head { display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--sub); }
.gl-head span { display: inline-flex; align-items: center; gap: 6px; }
.gl-head svg { width: 15px; height: 15px; color: var(--gold); }
.gl-head b { color: var(--text); font-size: 13px; }
.gl-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "txt right" "bar bar";
  align-items: center; gap: 4px 8px; }
.gl-txt { grid-area: txt; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.gl-label { font-size: 13px; font-weight: 700; }
.gl-rew { font-size: 11px; color: var(--sub); display: inline-flex; align-items: center; gap: 3px; }
.gl-rew svg { width: 12px; height: 12px; color: var(--gold); }
.gl-bar { grid-area: bar; height: 7px; border-radius: 99px; background: rgba(128,128,128,.22); overflow: hidden; }
.gl-bar i { display: block; height: 100%; border-radius: 99px; background: var(--gold); transition: width .4s; }
.gl-row.is-done .gl-bar i, .gl-row.is-claimed .gl-bar i { background: var(--ok); }
.gl-row.is-claimed { opacity: .6; }
.gl-num { grid-area: right; font-size: 12px; font-weight: 700; color: var(--sub); font-variant-numeric: tabular-nums; }
.gl-ok { grid-area: right; color: var(--ok); display: inline-flex; }
.gl-ok svg { width: 18px; height: 18px; }
.gl-claim, .gl-all {
  grid-area: right; font-family: inherit; font-weight: 800; font-size: 12px; cursor: pointer;
  padding: 5px 12px; border-radius: var(--k-ri, 10px); border: 1px solid transparent;
  background: var(--gold); color: #1a1405;
}
.gl-all { grid-area: auto; width: 100%; padding: 8px; font-size: 13px; display: inline-flex; gap: 6px; justify-content: center; align-items: center; }
.gl-all svg { width: 15px; height: 15px; }
.gl-claim:disabled { opacity: .6; }
.gl-claim:focus-visible, .gl-all:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.gl-msg { text-align: center; font-size: 13px; font-weight: 800; color: var(--ok); display: flex; gap: 4px; justify-content: center; align-items: center; }
.gl-msg svg { width: 14px; height: 14px; }
.mini-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; margin-right: 10px; }
.mini-left .dice-row { justify-content: flex-start; }

/* v244.44: ACCOUNT riorganizzato — scheda profilo con chip e 4 fatti, riga
   unica di 4 risorse, menu a gruppi con righe compatte a 2 colonne. */
.ac-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--panel-strong); border: 1px solid var(--line); color: var(--text);
}
.ac-chip svg { width: 12px; height: 12px; color: var(--gold); }
.ac-facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0 0;
}
.ac-fact {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  padding: 7px 10px; border-radius: 12px; background: var(--panel);
  border: 1px solid var(--line); font-size: 13px; min-width: 0;
}
.ac-fact-k { display: inline-flex; align-items: center; gap: 5px; color: var(--sub); font-size: 11px; white-space: nowrap; }
.ac-fact-k svg { width: 13px; height: 13px; color: var(--gold); }
.ac-fact b { font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-res { grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 4px; }
.ac-res .stat {
  flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 8px 7px; min-width: 0;
}
.ac-res .stat .ico { font-size: 16px; line-height: 1; display: flex; }
.ac-res .stat .ico svg { width: 17px; height: 17px; color: var(--gold); }
.ac-res .stat .k { font-size: 10px; }
.ac-res .stat .v { font-size: 13px; font-variant-numeric: tabular-nums; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ac-sec {
  margin: 12px 2px 5px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--sub);
}
.ac-group { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ac-group .ac-row { padding: 8px 10px; gap: 8px; min-width: 0; }
.ac-group .ac-row:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ac-group .ac-ico { width: 28px; height: 28px; }
.ac-group .ac-ico svg { width: 17px; height: 17px; }
.ac-group .ac-txt b { font-size: 13px; }
.ac-group .ac-txt i { font-size: 11px; }

/* v244.45: scheda profilo di Account = intestazione (nome, @utente, chip) +
   avatar e celle equip/gadget/pet come nel profilo pubblico; sotto 6 fatti. */
.ac-hero2 { flex-direction: column; align-items: stretch; gap: 10px; }
.ac-hero-head { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ac-hero2 .pr-hero { margin: 0; }
.ac-hero2 .pr-slot { min-height: 38px; }
#ac-aff { margin-top: 6px; }
#ac-aff .pr-aff { margin: 0; }

/* v244.49: barra FORGIA con tasto normale (come Evoca dei Pet) — sostituisce
   l'incudine grande. Colori da --evo-* (si adattano ai temi). */
.fgbar { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.fgbar #fg-roll {
  width: 100%; margin-top: 0; padding: 11px 10px; font-size: 15px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
  background: var(--evo-bg); color: var(--evo-fg); border: 1px solid var(--evo-bd);
}
.fgbar #fg-roll svg { width: 18px; height: 18px; }
.fgbar #fg-roll:disabled { opacity: .55; }
.fgbar-sub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fgbar-sub .btn.small { width: 100%; margin-top: 0; padding: 9px 4px; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; }

/* v244.51: popup PROMOSSO / RETROCESSO di lega Arena. */
.lg-pop { text-align: center; display: grid; gap: 8px; padding: 22px 18px 16px; position: relative; overflow: hidden; }
.lg-emoji { font-size: 64px; line-height: 1; animation: lgPop .7s cubic-bezier(.2,.9,.3,1.4) both; }
.lg-pop.up .lg-emoji { filter: drop-shadow(0 0 16px var(--gold)); }
.lg-pop.down .lg-emoji { filter: grayscale(.35); }
.lg-title { font-size: 22px; font-weight: 800; font-family: var(--font-display); }
.lg-pop.up .lg-title { color: var(--gold); }
.lg-sub { color: var(--sub); font-size: 14px; }
.lg-pos { font-weight: 700; display: inline-flex; gap: 6px; justify-content: center; align-items: center; }
.lg-pos svg, .lg-note svg { width: 15px; height: 15px; color: var(--gold); }
.lg-note { font-size: 13px; color: var(--ok); display: inline-flex; gap: 6px; justify-content: center; align-items: center; }
.lg-actions { display: grid; gap: 6px; margin-top: 6px; }
.lg-actions .btn { margin-top: 0; }
.lg-x { position: absolute; top: 8px; right: 10px; }
.lg-stars { position: absolute; inset: 0; pointer-events: none; }
.lg-stars i { position: absolute; top: 46%; left: 50%; font-style: normal; color: var(--gold); font-size: 18px;
  opacity: 0; animation: lgStar 1.4s ease-out .2s both; }
.lg-stars i:nth-child(1) { --dx: -120px; --dy: -90px; }
.lg-stars i:nth-child(2) { --dx: 120px; --dy: -80px; animation-delay: .3s; }
.lg-stars i:nth-child(3) { --dx: -80px; --dy: -140px; animation-delay: .4s; }
.lg-stars i:nth-child(4) { --dx: 90px; --dy: -140px; animation-delay: .5s; }
.lg-stars i:nth-child(5) { --dx: 0; --dy: -160px; animation-delay: .35s; }
@keyframes lgPop { from { transform: scale(.3); opacity: 0; } }
@keyframes lgStar { 0% { transform: translate(0,0) scale(.4); opacity: 0; }
  30% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lg-emoji, .lg-stars i { animation: none; } .lg-stars { display: none; } }

/* v244.58: riga Info | Forgia | Auto + barra di progresso che diventa Upgrade. */
.fgbar-sub { grid-template-columns: 1fr 1.7fr 1fr; align-items: stretch; }
.fgbar-sub #fg-roll { padding: 10px 6px; font-size: 14px; gap: 5px; }
.fgbar-sub #fg-roll svg { width: 16px; height: 16px; }
.fgprog {
  position: relative; overflow: hidden; height: 40px; border-radius: var(--k-ri, 12px);
  background: var(--panel); border: 1px solid var(--line); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.fgprog i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--gold-soft, rgba(227,179,65,.25));
  border-right: 2px solid var(--gold); transition: width .4s; }
.fgprog.is-up i { background: rgba(128,128,128,.25); border-right-color: var(--sub); }
.fgprog.is-max i { border-right: 0; }
.fgprog span { position: relative; font-size: 13px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.fgprog span svg { width: 15px; height: 15px; color: var(--gold); }
.fgprog:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.fgbar .fgprog-up { width: 100%; margin-top: 0; height: 40px; padding: 0 10px; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 6px; }
.fgbar .fgprog-up svg { width: 16px; height: 16px; }

/* v244.59: popup differenze di livello Forgia (attuale → successivo). */
.fg-diff-box { display: grid; gap: 5px; margin-top: 8px; }
.fg-diff-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.fg-diff-r { flex: 1; display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.fg-diff-r svg { width: 14px; height: 14px; color: var(--gold); }
.fg-diff-v { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--sub); }
.fg-diff-v b { color: var(--text); }
.fg-diff-v i, .fg-diff-arrow { font-style: normal; color: var(--sub); }
.fg-diff-d { min-width: 54px; text-align: right; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fg-diff-d.up { color: var(--ok); } .fg-diff-d.down { color: var(--danger); } .fg-diff-d.same { color: var(--sub); }

/* v244.61: scena Forgia Auto xN — i pezzi venduti si trasformano in monete. */
.fb-batch { display: grid; gap: 10px; padding-top: 14px; }
.fb-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fb-coins { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--panel-strong); border: 1px solid var(--line); font-weight: 800; font-variant-numeric: tabular-nums; }
.fb-coins svg { width: 16px; height: 16px; color: var(--gold); }
.fb-coins.fb-bump { animation: fbBump .35s ease; }
@keyframes fbBump { 40% { transform: scale(1.18); box-shadow: 0 0 14px var(--gold); } }
.fb-row { display: flex; gap: 8px; justify-content: center; }
.fb-tile { flex: 1 1 0; max-width: 104px; min-width: 0; text-align: center; padding: 8px 4px; border-radius: 14px;
  background: var(--panel); border: 2px solid var(--fb-col, var(--line)); box-shadow: 0 0 12px color-mix(in srgb, var(--fb-col, #888) 40%, transparent);
  animation: fbIn .45s cubic-bezier(.2,.9,.3,1.3) var(--fb-d, 0s) both; position: relative; }
.fb-art { display: grid; place-items: center; min-height: 58px; font-size: 40px; }
.fb-name { font-size: 11px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-val { font-size: 13px; font-weight: 800; color: var(--gold); opacity: 0; }
.fb-tile.fb-melt { animation: fbMelt .65s ease-in forwards; }
.fb-tile.fb-melt .fb-val { opacity: 1; }
@keyframes fbIn { from { transform: translateY(-20px) scale(.5); opacity: 0; } }
@keyframes fbMelt {
  0% { filter: none; transform: scale(1); }
  35% { filter: brightness(1.8) saturate(1.5); transform: scale(1.08); }
  100% { filter: brightness(1.4); transform: scale(.55); opacity: .15; }
}
.fb-coin { position: fixed; z-index: 90; pointer-events: none; opacity: 0; }
.fb-coin svg { width: 22px; height: 22px; color: var(--gold); filter: drop-shadow(0 0 6px var(--gold)); }
@media (prefers-reduced-motion: reduce) { .fb-tile, .fb-tile.fb-melt, .fb-coins.fb-bump { animation: none; } .fb-tile.fb-melt { opacity: .2; } }
.fb-art svg, .fb-art img { max-width: 100%; height: auto; max-height: 58px; }

/* v244.63: RICOMPENSE OFFLINE — due anelli di progresso (monete / martelli). */
.ro-sub { text-align: center; color: var(--sub); font-size: 13px; margin: 2px 0 10px; }
.ro-gauges { display: flex; gap: 12px; justify-content: center; }
.ro-g { flex: 1 1 0; min-width: 0; display: grid; justify-items: center; gap: 4px; text-align: center; --ro-col: var(--gold); }
.ro-h { --ro-col: var(--ember, #f97316); }
.ro-ring { position: relative; width: 128px; height: 128px; }
.ro-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; overflow: visible; }
.ro-track { fill: none; stroke: var(--line); stroke-width: 8; opacity: .9; }
.ro-prog { fill: none; stroke: var(--ro-col); stroke-width: 8; stroke-linecap: round;
  transition: stroke-dashoffset .9s linear; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--ro-col) 55%, transparent)); }
.ro-mid { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 2px; }
.ro-mid svg { width: 34px; height: 34px; color: var(--ro-col); transform: none; }
.ro-mid b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ro-name { font-weight: 800; font-size: 14px; }
.ro-name span { color: var(--sub); font-weight: 600; font-size: 12px; margin-left: 4px; }
.ro-rate { font-size: 12px; color: var(--sub); }
.ro-state { font-size: 11px; color: var(--sub); display: inline-flex; gap: 4px; align-items: center; justify-content: center; min-height: 15px; }
.ro-state svg { width: 12px; height: 12px; }
.ro-g.is-full .ro-prog { stroke: var(--danger); filter: drop-shadow(0 0 6px var(--danger)); animation: roPulse 1.6s ease-in-out infinite; }
.ro-g.is-full .ro-state { color: var(--danger); font-weight: 700; }
@keyframes roPulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .ro-prog { transition: none; } .ro-g.is-full .ro-prog { animation: none; } }

/* v244.68: badge Edifici — pallino rosso standard solo a costruzione finita (serve «Completa») */
.bld-tile { position: relative; }
.bld-badge { position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; border-radius: 50%;
  background: var(--danger); }

/* v244.72: Classifiche + Ricompense Offline a sinistra del riquadro Campagna (stretto) */
.mini-left { flex-direction: row; align-items: flex-start; gap: 8px; }
.mini-lcol { display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; }
.mini-left .cp-arena { flex: 1 1 0; min-width: 0; }
.mini-left .cp-camp { padding: 14px 8px 12px; }
.mini-left .cp-camp-stage { font-size: 26px; }
.mini-left .cp-camp-cta { font-size: 11.5px; }

/* v244.73: Campagna più bassa + 2 tasti-modalità bloccati sotto, fine allineata
   alla base del tasto Invita Amici (la colonna centrale riempie l'altezza della riga). */
.mini-row { align-items: stretch; }
.mini-left { align-self: stretch; align-items: stretch; }
.mini-lcol { align-self: flex-start; }
.mini-mid { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.mini-mid .cp-arena { flex: 0 0 auto; }
.mini-left .cp-camp { padding: 8px 6px 8px; }
.mini-left .cp-camp-stage { font-size: 24px; margin-top: 2px; }
.mini-left .cp-camp-cta { margin-top: 4px; font-size: 11px; }
.mini-locks { flex: 1 1 0; min-height: 0; display: flex; gap: 8px; }
.mode-lock {
  flex: 1 1 0; min-width: 0; border-radius: 18px; background: var(--card);
  border: 1px solid var(--line); color: var(--sub); opacity: .8;
  display: flex; align-items: center; justify-content: center; cursor: default;
}
.mode-lock svg { width: 26px; height: 26px; }

/* v244.73: schermi BASSI (telefoni piccoli): la home deve starci senza scroll —
   tasti più piccoli, scheda obiettivi e striscia chat più compatte. */
@media (max-height: 760px) {
  .prod-btn { width: 48px; height: 48px; border-radius: 14px; padding: 5px; }
  .mini-col, .mini-lcol { gap: 5px; }
  .mini-left { gap: 6px; margin-right: 6px; }
  .mini-locks { gap: 6px; }
  .mini-mid { gap: 6px; }
  .mode-lock { border-radius: 14px; }
  .goals-card { padding: 7px 10px 6px; gap: 5px; }
  .gl-label { font-size: 12.5px; }
}
@media (max-height: 640px) {
  .prod-btn { width: 42px; height: 42px; padding: 4px; }
  .goals-card { gap: 3px; }
  .gl-row { gap: 2px 8px; }
  .gl-rew { display: none; }
  .mini-row { margin-top: 5px; }
}

/* v244.74: schermi STRETTI — niente testo tagliato in Account / griglia slot. */
@media (max-width: 380px) {
  .ac-fact { flex-wrap: wrap; row-gap: 0; }
  .ac-fact b { white-space: normal; overflow: visible; text-overflow: clip; text-align: right; margin-left: auto; }
  .ac-txt b { overflow-wrap: anywhere; }
}
@media (max-width: 350px) {
  .ac-group { grid-template-columns: 1fr; }
  .ac-res { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 300px) {
  .fg-tile-name { font-size: 9px; letter-spacing: -.2px; }
  .fg-tile { padding-left: 2px; padding-right: 2px; }
}

/* v244.74: righe di tasti che sbordavano a 280-320px (Arena: Info/Combatti/
   Premi; Pet: Info/Evoca/xN) — i tasti si restringono invece di uscire. */
@media (max-width: 380px) {
  .ar-dock-row { min-width: 0; gap: 6px; }
  .ar-dock-row .ar-fbtn { flex: 0 1 auto; min-width: 0; padding: 9px 8px; }
  .ar-dock-row .ar-fight, .ar-dock-row #ar-fight { min-width: 0; padding-left: 6px; padding-right: 6px; }
  .pets-actions { gap: 6px; }
  .pets-actions #pets-info, .pets-actions #pets-mult { flex: 0 0 52px; width: 52px; }
  .pets-actions #pets-egg { min-width: 0; font-size: 12px; padding: 9px 6px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 300px) {
  .ar-dock-row .ar-fbtn svg { display: none; }
}

/* v244.74: classifica e tabbar a 280px — il nome cede spazio al valore; etichette tab ridotte. */
.rk-name { min-width: 0; overflow-wrap: anywhere; }
.rk-val { flex: 0 0 auto; }
@media (max-width: 300px) {
  .tablabel { font-size: 9.5px; letter-spacing: -.2px; }
}

/* v244.75: chip pezzo in attesa sopra la riga Info/Forgia/Auto */
.fgbar .cp-forge-pending { margin-top: 0; }

/* v244.75: sottotitoli del menu Account e fatti del profilo vanno a capo invece di tagliarsi
   (temi con font/padding più larghi: b, d, i). */
.ac-group .ac-txt i { white-space: normal; line-height: 1.25; }
@media (max-width: 420px) {
  .ac-fact { flex-wrap: wrap; row-gap: 0; }
  .ac-fact b { white-space: normal; overflow: visible; text-overflow: clip; text-align: right; margin-left: auto; }
}

/* v244.77: chat clan — righe di sistema e annunci */
.cn-sys { display: flex; flex-direction: column; align-items: center; gap: 1px; margin: 6px 8px; text-align: center; }
.cn-sys span { font-size: 12px; color: var(--sub); background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; max-width: 100%; overflow-wrap: anywhere; }
.cn-sys i, .cn-ann i { font-style: normal; font-size: 10px; color: var(--sub); opacity: .8; }
.cn-ann { margin: 6px 0; padding: 8px 10px; border-radius: 12px; background: var(--gold-soft);
  border: 1px solid var(--gold); font-size: 13px; }
.cn-ann b { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--gold); margin-bottom: 2px; }
.cn-ann b svg { width: 13px; height: 13px; }
.cn-ann div { overflow-wrap: anywhere; }

/* v244.79: schermata Clan rinnovata */
.cn-hero { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 8px; }
.cn-hero-top { display: flex; align-items: center; gap: 10px; }
.cn-crest { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft); border: 1px solid var(--gold); color: var(--gold); }
.cn-crest svg { width: 26px; height: 26px; }
.cn-hero-id { flex: 1; min-width: 0; }
.cn-hero-name { font-family: var(--font-display); font-weight: 800; font-size: 17px; overflow-wrap: anywhere; line-height: 1.15; }
.cn-tag { color: var(--gold); font-size: 13px; }
.cn-hero-sub { font-size: 12px; color: var(--sub); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.cn-hero-sub svg, .cn-role svg { width: 13px; height: 13px; }
.cn-role { flex: 0 0 auto; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--sub);
  display: inline-flex; align-items: center; gap: 4px; }
.cn-role.leader, .cn-role.officer { color: var(--gold); border-color: var(--gold); }
.cn-lv { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; color: var(--sub); font-weight: 700; }
.cn-lv .bar { flex: 1; margin: 0; }
.cn-unread { margin-top: 8px; width: 100%; font-family: inherit; font-size: 12px; font-weight: 700; padding: 7px; border-radius: 10px; cursor: pointer;
  background: color-mix(in srgb, var(--danger) 14%, transparent); border: 1px solid var(--danger); color: var(--text); display: flex; gap: 6px; justify-content: center; align-items: center; }
.cn-unread svg { width: 14px; height: 14px; }
.cn-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.cn-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px 7px; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; text-align: center; }
.cn-tile-ic svg { width: 17px; height: 17px; color: var(--gold); display: block; }
.cn-tile b { font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cn-tile i { font-style: normal; font-size: 10px; color: var(--sub); }
.cn-war { display: block; width: 100%; text-align: left; font-family: inherit; color: var(--text); cursor: pointer; margin-bottom: 8px;
  background: var(--card); border: 1px solid var(--danger); border-radius: 14px; padding: 10px 12px; }
.cn-war.done { border-color: var(--gold); }
.cn-war.idle { cursor: default; border-color: var(--line); }
.cn-war-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.cn-war-h svg { width: 15px; height: 15px; color: var(--danger); }
.cn-war.done .cn-war-h svg { color: var(--gold); }
.cn-war.idle .cn-war-h svg { color: var(--sub); }
.cn-war-h span { margin-left: auto; font-size: 11px; color: var(--sub); }
.cn-war-s { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cn-war-s span { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.cn-war-s span.en { text-align: right; align-items: flex-end; }
.cn-war-s span b { font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cn-war-s em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--sub); }
.cn-war-n { margin-top: 6px; font-size: 11px; color: var(--sub); display: flex; align-items: center; gap: 4px; }
.cn-war-n svg { width: 12px; height: 12px; }
.cn-ann-card { display: block; width: 100%; text-align: left; font-family: inherit; color: var(--text); cursor: pointer; margin-bottom: 8px;
  background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 12px; padding: 8px 10px; font-size: 13px; }
.cn-ann-card b { display: flex; align-items: center; gap: 5px; color: var(--gold); font-size: 12px; margin-bottom: 2px; }
.cn-ann-card b svg { width: 13px; height: 13px; }
.cn-ann-card div { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cn-mine { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.cn-mine > div:not(.cn-sec) { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 2px 0; }
.cn-mine span { color: var(--sub); display: inline-flex; align-items: center; gap: 5px; }
.cn-mine svg { width: 13px; height: 13px; color: var(--gold); }
.cn-mine b { font-variant-numeric: tabular-nums; }
.cn-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.cn-acts .btn { margin: 0; width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; }
.cn-acts .cn-act-main { grid-column: 1 / -1; }
.cn-acts .btn:last-child:nth-child(even) { grid-column: 1 / -1; }
.cn-cnt { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; }
.cn-sec { margin: 10px 2px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sub); }
.cn-act { display: grid; gap: 4px; }
.cn-act > div { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.cn-act span { overflow-wrap: anywhere; }
.cn-act i { font-style: normal; color: var(--sub); font-size: 10px; flex: 0 0 auto; }
@media (max-width: 350px) { .cn-tiles { grid-template-columns: 1fr 1fr; } }

/* v244.80: hub PvP — carte-modalità con stato e tasto d'azione */
.hub-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pv-pow { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 14px; padding: 4px 10px; border-radius: 999px;
  background: var(--gold-soft); border: 1px solid var(--gold); }
.pv-pow svg { width: 14px; height: 14px; color: var(--gold); }
.pv-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 10px; cursor: pointer; }
.pv-card.alert { border-color: var(--danger); }
.pv-card:active { transform: scale(.99); }
.pv-card-h { display: flex; align-items: center; gap: 10px; }
.pv-ic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft); border: 1px solid var(--gold); color: var(--gold); }
.pv-ic svg { width: 22px; height: 22px; }
.pv-ti { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pv-ti b { font-family: var(--font-display); font-size: 16px; }
.pv-ti i { font-style: normal; font-size: 12px; color: var(--sub); overflow-wrap: anywhere; }
.pv-dot { flex: 0 0 auto; min-width: 20px; height: 20px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.pv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.pv-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.pv-chip svg { width: 13px; height: 13px; color: var(--gold); }
.pv-chip.lg { border-color: var(--gold); }
.pv-cta { width: 100%; margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
@media (max-height: 760px) {
  .pv-card { padding: 9px 10px; margin-bottom: 7px; }
  .pv-ti i { display: none; }
  .pv-ic { width: 34px; height: 34px; }
  .pv-chips { margin: 7px 0; gap: 5px; }
  .pv-cta { padding-top: 8px; padding-bottom: 8px; }
}
@media (max-height: 700px) {
  .pv-chips .pv-chip:nth-child(n+3) { display: none; }
}

/* v244.82: Membri/Chat/Guerre dentro la schermata Clan (via striscia) + chip «‹ Clan» nelle sotto-viste */
.cn-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.cn-navb { position: relative; font-family: inherit; color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 4px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.cn-navb svg { width: 24px; height: 24px; color: var(--gold); }
.cn-navb b { font-size: 13px; }
.cn-navb:active { transform: scale(.97); }
.cn-navb .cn-cnt { position: absolute; top: 5px; right: 8px; }
.cn-subhead { display: flex; align-items: center; gap: 6px; }
.cn-topback { font-family: inherit; font-size: 12px; font-weight: 700; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px 4px 7px; margin-right: 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.cn-topback svg { width: 13px; height: 13px; margin: 0; color: var(--gold); }

/* v244.83: Rapina rinnovata */
.rb-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.rb-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px 7px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; text-align: center; }
.rb-tile svg { width: 17px; height: 17px; color: var(--gold); }
.rb-tile b { font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-height: 18px; display: flex; align-items: center; }
.rb-tile i { font-style: normal; font-size: 10px; color: var(--sub); }
.rb-tile.out { border-color: var(--danger); }
.rb-pips { gap: 4px; }
.rb-pip { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: inline-block; }
.rb-pip.on { background: var(--gold); box-shadow: 0 0 5px color-mix(in srgb, var(--gold) 60%, transparent); }
.rb-hunt { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px 12px; margin-bottom: 10px; text-align: center; }
.rb-hunt-ic { width: 54px; height: 54px; margin: 0 auto 6px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--gold-soft); border: 1px solid var(--gold); color: var(--gold); }
.rb-hunt-ic svg { width: 30px; height: 30px; }
.rb-hunt-t { font-family: var(--font-display); font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.rb-rules { display: grid; gap: 5px; text-align: left; margin-bottom: 12px; }
.rb-rules > div { display: flex; align-items: center; gap: 8px; font-size: 12.5px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; }
.rb-rules svg { width: 15px; height: 15px; color: var(--gold); flex: 0 0 auto; }
.rb-hunt-go { width: 100%; margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.rb-empty { display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; font-size: 12px; color: var(--sub); padding: 8px; }
.rb-empty svg { width: 14px; height: 14px; }
.rb-rev .tnode { border-color: var(--danger); }
.rb-vname { font-size: 16px; display: block; margin-bottom: 4px; overflow-wrap: anywhere; }
.rb-loot { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rb-loot > div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; }
.rb-loot > div.ko { border-color: var(--danger); }
.rb-loot i { display: block; font-style: normal; font-size: 10px; color: var(--sub); }
.rb-loot b { font-size: 14px; display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.rb-loot svg { width: 13px; height: 13px; color: var(--gold); }
@media (max-width: 350px) { .rb-tiles { grid-template-columns: 1fr 1fr; } }

/* v244.84: striscia chat della home a due pagine (globale / clan) con swipe */
.cs-head { position: relative; }
.cs-dots { margin-left: auto; display: inline-flex; gap: 4px; }
.cs-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.cs-dots i.on { background: var(--gold); }
.cs-new { color: var(--danger); }
.chatstrip { touch-action: pan-y; }
.chatstrip.slide-r { animation: csR .22s ease-out; }
.chatstrip.slide-l { animation: csL .22s ease-out; }
@keyframes csR { from { transform: translateX(-28px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes csL { from { transform: translateX(28px); opacity: .3; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chatstrip.slide-r, .chatstrip.slide-l { animation: none; } }

/* v244.85: intestazione a due metà Globale | Clan nelle due chat */
.chat-sw { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 3px; min-width: 0; }
.csw-head { padding: 0; margin-bottom: 8px; }
.csw-head .chat-sw { width: 100%; }
.csw-b { position: relative; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--sub); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 6px; border: 0; border-radius: 9px; background: transparent; min-width: 0; }
.csw-b svg { width: 15px; height: 15px; margin: 0; }
/* identica ovunque (anche dentro .tb-head della chat clan, che userebbe il carattere dei titoli) */
.chat-sw .csw-b { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; text-transform: none; letter-spacing: normal; font-size: 13px; font-weight: 700; }
.csw-b.on { background: var(--gold-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--gold); }
.csw-b.on svg { color: var(--gold); }
.csw-b.lock { opacity: .45; cursor: not-allowed; }
.csw-n { font-style: normal; background: var(--danger); color: #fff; border-radius: 999px; font-size: 10px; padding: 0 5px; min-width: 15px; line-height: 15px; text-align: center; }
.cn-subhead .chat-sw { flex: 1; }

/* v244.86: tasto Messaggi (busta) + popup */
.inbox-btn .prod-badge { top: 3px; right: 3px; }
.ib-body { fill: var(--card); stroke: var(--gold); stroke-width: 2.5; }
.ib-flap { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; transform-origin: 28px 19px; }
.inbox-btn.has-new .ib-env { animation: ibWiggle 3s ease-in-out infinite; transform-origin: 28px 30px; }
@keyframes ibWiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-8deg); } 90% { transform: rotate(7deg); } 95% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .inbox-btn.has-new .ib-env { animation: none; } }
.ib-box { max-height: 80vh; display: flex; flex-direction: column; text-align: left; }
.ib-box .fg-swap-title { text-align: left; padding-right: 36px; }
.ib-list { overflow-y: auto; display: grid; gap: 8px; margin-top: 8px; padding-right: 2px; }
.ib-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; }
.ib-card.new { border-color: var(--gold); }
.ib-card.open { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, var(--panel)); }
.ib-card.done { opacity: .6; }
.ib-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ib-h b { font-size: 14px; overflow-wrap: anywhere; }
.ib-h i { font-style: normal; font-size: 10px; color: var(--sub); flex: 0 0 auto; }
.ib-b { font-size: 12.5px; color: var(--sub); margin-top: 3px; overflow-wrap: anywhere; white-space: pre-wrap; }
.ib-rew { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.ib-rew span { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 13px; padding: 3px 9px; border-radius: 999px; background: var(--gold-soft); border: 1px solid var(--gold); }
.ib-rew svg { width: 14px; height: 14px; color: var(--gold); }
.ib-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.ib-exp { font-size: 11px; color: var(--sub); display: inline-flex; align-items: center; gap: 4px; }
.ib-exp svg { width: 12px; height: 12px; }
.ib-foot .btn { margin: 0; }
.ib-all { width: 100%; margin: 8px 0 0; display: flex; justify-content: center; align-items: center; gap: 6px; }
.ib-flash { margin-top: 8px; text-align: center; font-weight: 700; font-size: 13px; color: var(--ok); }
.ib-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--sub); font-size: 13px; padding: 24px 10px; }
.ib-empty svg { width: 34px; height: 34px; color: var(--gold); }

/* v244.87: Clan — niente tasto Guerre; Membri = tessera cliccabile, Chat = tasto largo */
.cn-tile.go { font-family: inherit; color: var(--text); cursor: pointer; }
.cn-tile.go i svg { width: 9px; height: 9px; }
.cn-tile.go:active { transform: scale(.97); }
.cn-chatb { position: relative; width: 100%; margin-bottom: 8px; font-family: inherit; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; font-size: 14px; }
.cn-chatb svg { width: 22px; height: 22px; color: var(--gold); }
.cn-chatb .cn-cnt { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); }
.cn-tile.go i svg { transform: rotate(180deg); }

/* v244.90: azioni Clan senza «Dona» — l'ultimo bottone dispari occupa tutta la riga */
.cn-acts .btn:last-child:nth-child(even) { grid-column: auto; }
.cn-acts .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* v244.94: le crepe stanno nella casella dell'uovo (46×57, viewBox 44×54) e sono sottili */
.egg-cracks { width: 46px; height: 57px; margin: -28.5px 0 0 -23px; }
.egg-crack path { stroke-width: 1.1; }
.egg-crack-glow path { stroke-width: 2.6; filter: blur(.7px) drop-shadow(0 0 2px var(--hc, #fff)); }
.egg-crack-line path { stroke-width: 1; }

/* v244.95: LANCIAFIAMME (anteprima) */
.mode-fire { flex-direction: column; gap: 4px; cursor: pointer; opacity: 1; color: var(--text); border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--card)); font-family: inherit; font-size: 11px; font-weight: 800; }
.mode-fire:active { transform: scale(.97); }
.fr-flame { width: 20px; height: 20px; fill: #f97316; stroke: #fde68a; stroke-width: 1; vertical-align: -3px; }
.mode-fire .fr-flame { width: 30px; height: 30px; animation: frFlick 1.1s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes frFlick { 50% { transform: scale(1.1, 1.18) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .mode-fire .fr-flame { animation: none; } }
.fr-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.fr-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.fr-tile svg { width: 17px; height: 17px; color: var(--gold); }
.fr-tile b { font-size: 15px; font-variant-numeric: tabular-nums; }
.fr-tile i { font-style: normal; font-size: 10px; color: var(--sub); }
.fr-how { font-size: 12.5px; color: var(--sub); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.fr-target { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; margin-bottom: 6px; }
.fr-av { flex: 0 0 auto; width: 46px; height: 56px; display: flex; align-items: center; justify-content: center; }
.fr-ti { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fr-ti b { overflow-wrap: anywhere; }
.fr-ti i { font-style: normal; font-size: 11px; color: var(--sub); }
.fr-ti i svg { width: 11px; height: 11px; color: var(--gold); }
.fr-target .btn { margin: 0; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.fr-game { position: relative; touch-action: none; user-select: none; -webkit-user-select: none; }
.fr-game canvas { display: block; width: 100%; border-radius: 14px; border: 1px solid var(--line); touch-action: none; }
.fr-hud { position: absolute; left: 8px; right: 8px; top: 8px; display: grid; gap: 5px; pointer-events: none; }
.fr-row { display: flex; align-items: center; gap: 6px; }
.fr-bar { position: relative; height: 10px; border-radius: 999px; background: rgba(0,0,0,.55); overflow: hidden; flex: 1; }
.fr-bar i { display: block; height: 100%; width: 100%; border-radius: 999px; }
.fr-bar.b { height: 16px; } .fr-bar.b i { background: linear-gradient(90deg, #f97316, #ef4444); }
.fr-bar.b span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; }
.fr-bar.f i { background: #facc15; } .fr-bar.p i { background: #22c55e; }
.fr-time { font-weight: 800; font-size: 13px; color: #fff; text-shadow: 0 1px 2px #000; min-width: 32px; text-align: right; }
.fr-fire { position: absolute; right: 12px; bottom: 14px; width: 84px; height: 84px; border-radius: 50%; border: 2px solid #fde68a; background: radial-gradient(circle at 40% 35%, #fb923c, #dc2626); color: #fff; font-family: inherit; font-weight: 900; font-size: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; box-shadow: 0 4px 16px rgba(220,38,38,.55); touch-action: none; }
.fr-fire:active { transform: scale(.94); }
.fr-fire .fr-flame { width: 28px; height: 28px; }
.fr-end { position: absolute; inset: 0; background: rgba(0,0,0,.72); border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.fr-end.hidden { display: none; }
.fr-end-b { text-align: center; padding: 16px; display: grid; gap: 10px; justify-items: center; }
.fr-end-t { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: #fff; }
.fr-pct { font-size: 22px; font-weight: 900; color: #fb923c; }
.fr-rw { display: flex; gap: 8px; } .fr-rw span { display: inline-flex; gap: 5px; align-items: center; font-weight: 800; padding: 4px 12px; border-radius: 999px; background: var(--gold-soft); border: 1px solid var(--gold); color: #fff; }
.fr-rw svg { width: 15px; height: 15px; color: var(--gold); }
.fr-end-a { display: flex; gap: 8px; } .fr-end-a .btn { margin: 0; }

/* v244.97: comandi FUORI dalla mappa — joystick a sinistra, FUOCO a destra, sotto lo schermo di gioco */
.fr-pad { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 6px 4px; }
.fr-stick { position: relative; width: 120px; height: 120px; border-radius: 50%; background: var(--panel); border: 2px solid var(--line); touch-action: none; flex: 0 0 auto; }
.fr-stick::after { content: ""; position: absolute; inset: 30px; border-radius: 50%; border: 1px dashed var(--line); }
.fr-stick i { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: var(--gold-soft); border: 2px solid var(--gold); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.fr-pad .fr-fire { position: static; width: 112px; height: 112px; flex: 0 0 auto; }

/* v244.98: scelta della base — la colonna del nome non si schiaccia più (il .btn prendeva tutta la riga) */
.fr-target { flex-wrap: nowrap; }
.fr-target .fr-ti { flex: 1 1 0; min-width: 0; }
.fr-target .btn { width: auto; flex: 0 0 auto; margin: 0; padding: 8px 12px; }
@media (max-width: 350px) { .fr-target { flex-wrap: wrap; } .fr-target .btn { width: 100%; justify-content: center; } }

/* v244.99: LANCIAFIAMME a SCHERMO INTERO (overlay sopra tabbar e navigazione) */
.fr-full { position: fixed; inset: 0; z-index: 5000; display: flex; flex-direction: column; background: #0b0f0a;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0); touch-action: none; user-select: none; -webkit-user-select: none; }
.fr-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.fr-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; display: block; }
.fr-full .fr-hud { left: 10px; right: 10px; top: 10px; }
.fr-top { display: flex; align-items: center; gap: 8px; }
.fr-quit { pointer-events: auto; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.55); color: #fff; font-size: 15px; font-family: inherit; cursor: pointer; }
.fr-ic { font-size: 12px; text-shadow: 0 1px 2px #000; }
.fr-time.low { color: #f87171; animation: frPulse .6s ease-in-out infinite; }
@keyframes frPulse { 50% { transform: scale(1.25); } }
.fr-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); opacity: 0; transition: opacity .3s; pointer-events: none;
  background: rgba(0,0,0,.65); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; max-width: 92%; text-align: center; }
.fr-hint.on { opacity: 1; }
.fr-full .fr-pad { margin: 0; padding: 12px 24px 16px; background: linear-gradient(180deg, #101610, #0b0f0a); border-top: 1px solid rgba(255,255,255,.08); flex: 0 0 auto; }
.fr-stars { display: flex; gap: 6px; } .fr-stars b { font-size: 36px; line-height: 1; color: #475569; }
.fr-stars b.on { color: #facc15; text-shadow: 0 0 12px rgba(250,204,21,.7); }
body.fr-playing { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .fr-time.low { animation: none; } }

/* v244.100: SCATTO + joystick mobile sullo schermo di gioco */
.fr-dash { position: relative; width: 70px; height: 70px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); color: #fff; font-family: inherit; cursor: pointer; flex: 0 0 auto;
  background: conic-gradient(rgba(14,165,233,.15) calc(var(--cd, 0) * 360deg), #0ea5e9 0); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; touch-action: none; }
.fr-dash b { font-size: 20px; line-height: 1; } .fr-dash span { font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.fr-dash.ready { box-shadow: 0 0 14px rgba(14,165,233,.7); border-color: #7dd3fc; }
.fr-dash:active { transform: scale(.94); }
.fr-fj { position: absolute; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); background: rgba(255,255,255,.06); pointer-events: none; opacity: 0; transition: opacity .12s; }
.fr-fj.on { opacity: 1; }
.fr-fj i { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: rgba(255,255,255,.35); }
.fr-full .fr-pad { gap: 8px; padding-left: 16px; padding-right: 16px; }
.fr-full .fr-stick { width: 112px; height: 112px; } .fr-full .fr-pad .fr-fire { width: 104px; height: 104px; }

.fr-beta { font-style: normal; font-size: 9px; font-weight: 800; background: var(--gold); color: #1a1405; border-radius: 6px; padding: 1px 5px; margin-left: 4px; }

/* v244.109: Lanciafiamme — comandi twin-stick */
.fr-full .fr-pad { display: flex; align-items: stretch; gap: 10px; padding: 10px 14px 14px; height: 156px; box-sizing: border-box; }
.fr-mzone { position: relative; flex: 1 1 auto; min-width: 0; border-radius: 18px; touch-action: none;
  background: radial-gradient(circle at 50% 55%, rgba(255,255,255,.05), rgba(255,255,255,.015)); border: 1px dashed rgba(255,255,255,.12); }
.fr-zlabel { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 9.5px; font-weight: 800; letter-spacing: .05em;
  color: rgba(255,255,255,.35); pointer-events: none; }
.fr-full .fr-mzone .fr-stick { position: absolute; left: 50%; top: 46%; width: 104px; height: 104px; margin: -52px 0 0 -52px;
  pointer-events: none; opacity: .55; transition: opacity .12s; }
.fr-full .fr-mzone .fr-stick.on { opacity: 1; transition: none; }
.fr-rzone { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.fr-full .fr-rzone .fr-dash { width: 60px; height: 60px; align-self: flex-start; margin-top: 4px; }
.fr-aim { position: relative; width: 122px; height: 122px; border-radius: 50%; touch-action: none; cursor: pointer;
  background: radial-gradient(circle at 40% 35%, rgba(251,146,60,.35), rgba(220,38,38,.25)); border: 2px solid rgba(253,230,138,.7);
  box-shadow: 0 0 18px rgba(220,38,38,.35); display: flex; align-items: center; justify-content: center; }
.fr-aim.on { box-shadow: 0 0 26px rgba(249,115,22,.85); border-color: #fde68a; }
.fr-aim i { width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 40% 35%, #fb923c, #dc2626); box-shadow: 0 3px 10px rgba(0,0,0,.45); pointer-events: none; }
.fr-aim i .fr-flame { width: 28px; height: 28px; }
.fr-aim span { position: absolute; bottom: -15px; left: -12px; right: -12px; text-align: center; font-size: 8.5px; font-weight: 800; color: rgba(255,255,255,.55); pointer-events: none; }
.fr-autob { pointer-events: auto; flex: 0 0 auto; font-family: inherit; font-size: 10px; font-weight: 900; letter-spacing: .04em; color: #fff;
  padding: 4px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.5); cursor: pointer; }
.fr-autob.on { background: linear-gradient(180deg, #f97316, #dc2626); border-color: #fde68a; box-shadow: 0 0 8px rgba(249,115,22,.6); }
@media (max-height: 640px) { .fr-full .fr-pad { height: 132px; } .fr-aim { width: 104px; height: 104px; } .fr-full .fr-mzone .fr-stick { width: 90px; height: 90px; margin: -45px 0 0 -45px; } }


/* Torre (v244.119) */
.mode-tower { flex-direction: column; gap: 4px; cursor: pointer; opacity: 1; color: var(--text); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 9%, var(--card)); font-family: inherit; font-size: 11px; font-weight: 800; }
.mode-tower:active { transform: scale(.97); }
.tw-ico { width: 20px; height: 20px; color: var(--gold); vertical-align: -3px; }
.mode-tower .tw-ico { width: 30px; height: 30px; }
.tw-hero { display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.tw-lv { font-family: var(--font-display, inherit); font-size: 46px; font-weight: 800; line-height: 1; color: var(--gold); min-width: 92px; text-align: center; }
.tw-lv small { opacity: .5; font-size: 30px; }
.tw-foe { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tw-foe span { font-size: 30px; line-height: 1.1; }
.tw-foe i { font-style: normal; font-size: 12px; color: var(--sub); }
.tw-floor { margin-bottom: 8px; }
.tw-floor-t { font-size: 12px; font-weight: 700; color: var(--sub); margin-bottom: 4px; }
.tw-cells { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.tw-cell { text-align: center; font-size: 11px; font-weight: 700; padding: 6px 0; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); color: var(--sub); }
.tw-cell.done { background: color-mix(in srgb, var(--ok) 22%, var(--panel)); color: var(--text); }
.tw-cell.cur { background: var(--gold); color: #1a1405; border-color: var(--gold); }
.tw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.tw-att { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; font-size: 12px; }
.tw-att i { font-style: normal; color: var(--sub); }
.tw-pip { display: inline-block; width: 14px; height: 14px; margin: 0 3px; border-radius: 50%; border: 2px solid var(--line); }
.tw-pip.on { background: var(--gold); border-color: var(--gold); }
.tw-tk { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 15px; }
.tw-tkico { width: 16px; height: 16px; vertical-align: -3px; }
.tw-go { width: 100%; margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tw-rw { margin-left: 4px; font-weight: 800; }
.tw-hint { font-size: 11px; color: var(--sub); text-align: center; margin: 4px 0 2px; }
.tw-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 8px; }
.tw-tab { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: inherit; color: var(--text); cursor: pointer; min-width: 0; }
.tw-tab b { font-size: 11px; } .tw-tab span { font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; } .tw-tab i { font-style: normal; font-size: 10px; color: var(--sub); }
.tw-tab.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--panel)); }
.tw-tab:active { transform: scale(.97); }
.tw-foe em { font-style: normal; font-size: 15px; font-weight: 800; color: var(--gold); margin-left: 4px; }
.tw-tab.lock { opacity: .55; cursor: default; } .tw-tab.lock:active { transform: none; } .tw-tab.lock .ic { width: 16px; height: 16px; }
.ib-b { white-space: pre-line; }
.mode-tower, .tw-tab { position: relative; }
.mode-tower .prod-badge, .tw-tab .prod-badge { top: 4px; right: 4px; }
.ac-theme-card.locked { opacity: .85; } .ac-theme-price { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--gold); white-space: nowrap; } .ac-theme-price .ic { width: 16px; height: 16px; }
/* v244.144: tessere equipaggiamento = quadratini dei pet (inv-tile): quadrate, Lv in alto a sx, abilità sulla banda in basso */
.fg-eqgrid .fg-tile { position: relative; aspect-ratio: 1 / 1; justify-content: center; }
.fg-eqgrid .inv-tile.fg-tile { padding: 0; border-radius: 12px; }
.fg-eqgrid .inv-tile .inv-tile-lv { top: 4px; left: 5px; bottom: auto; right: auto; }
.tp-box { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.tp-sub { font-size: 12px; color: var(--sub); margin-bottom: 4px; }
.tp-bar { position: fixed; left: 8px; right: 8px; bottom: 74px; z-index: 9999; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: rgba(10, 12, 20, .94); color: #fff; font-size: 12px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15), 0 10px 30px rgba(0, 0, 0, .5); }
.tp-bar span { flex: 1; min-width: 0; } .tp-bar i { font-style: normal; font-weight: 800; color: #fde047; }
.tp-bar .btn { width: auto; flex: 0 0 auto; margin: 0; } .tp-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Chat privata (v244.148) */
.dm-btn .dm-bub { fill: var(--panel-strong, #232a38); stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; }
.dm-btn .dm-dot { fill: var(--gold); }
.dm-btn .prod-badge { top: 3px; right: 3px; }
/* v387: chat privata — intestazione, elenco, fumetti raggruppati, composer */
.dm-box { display: flex; flex-direction: column; max-height: 86vh; height: 86vh; text-align: left; padding: 0; overflow: hidden; }
.dm-head { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 10px 46px 10px 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
.dm-sw { flex: 1; min-width: 0; margin: 0; }
.dm-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.dm-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft, rgba(234,179,8,.15)); color: var(--gold); flex: 0 0 auto; }
.dm-ico .ic { width: 20px; height: 20px; }
.dm-who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.dm-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.dm-name b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-name small { font-size: 11px; color: var(--sub); }
.dm-back, .dm-blk { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.dm-back .ic, .dm-blk .ic { width: 18px; height: 18px; }
.dm-blk.on { color: var(--danger, #e0554f); border-color: var(--danger, #e0554f); }
.dm-back:active, .dm-blk:active { transform: scale(.94); }
.dm-box .dm-x { top: 10px; right: 10px; }
.dm-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.dm-av { flex: 0 0 44px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.dm-av-head { flex-basis: 40px; width: 40px; height: 40px; }
/* elenco */
.dm-convs { display: flex; flex-direction: column; padding: 6px; }
.dm-conv { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font-family: inherit; text-align: left; cursor: pointer; }
.dm-conv + .dm-conv { border-top: 1px solid var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
.dm-conv:active { background: var(--panel); }
.dm-ct { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dm-ct-top, .dm-ct-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.dm-ct-top b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-ct-top time { font-size: 11px; color: var(--sub); flex: 0 0 auto; }
.dm-ct-bot i { font-style: normal; font-size: 13px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dm-you { color: var(--text); opacity: .7; }
.dm-conv.unread .dm-ct-top b, .dm-conv.unread .dm-ct-bot i { color: var(--text); font-weight: 800; }
.dm-conv.unread .dm-ct-top time { color: var(--gold); font-weight: 700; }
.dm-ct-bot em { flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; background: var(--gold); color: #1a1405; }
/* ---- parti COMUNI alle tre chat (globale, clan, privata) — ui/chat_ui.js ---- */
.chat-scroll { flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding: 6px 10px; }
#gc-scroll, #cn-chat-scroll { background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); border-radius: 16px; }
.dm-body > .chat-scroll { padding: 4px 10px; }
.chat-rows { display: flex; flex-direction: column; }
.chat-day { align-self: center; margin: 12px 0 8px; text-align: center; }
.chat-day span { font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--sub); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; }
.chat-day:first-child { margin-top: 2px; }
.chat-row { display: flex; align-items: flex-end; gap: 6px; margin-top: 8px; }
.chat-row.grouped { margin-top: 2px; }
.chat-row.me { justify-content: flex-end; }
.chat-av { flex: 0 0 28px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.chat-av[data-profile] { cursor: pointer; }
.chat-ini { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: hsl(var(--h, 210) 38% 38%); border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); }
.chat-m { max-width: 78%; padding: 7px 11px 5px; border-radius: 16px; font-size: 15px; line-height: 1.35; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-m time { align-self: flex-end; font-size: 10px; opacity: .6; line-height: 1; }
.chat-author { align-self: flex-start; font-size: 12px; font-weight: 800; color: var(--gold); cursor: pointer; margin-bottom: 1px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.me .chat-m { background: linear-gradient(180deg, var(--gold), color-mix(in srgb, var(--gold) 82%, #000)); color: #1a1405; }
.chat-row.them .chat-m { background: var(--panel-strong, var(--panel)); border: 1px solid var(--line); }
.chat-row.me.last .chat-m { border-bottom-right-radius: 4px; }
.chat-row.them.last .chat-m { border-bottom-left-radius: 4px; }
.chat-sys { display: flex; flex-direction: column; align-items: center; gap: 1px; margin: 8px 8px 2px; text-align: center; }
.chat-sys span { font-size: 12px; color: var(--sub); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; max-width: 92%; overflow-wrap: anywhere; }
.chat-sys time, .chat-ann time { font-size: 10px; color: var(--sub); opacity: .8; }
.chat-ann { margin: 10px 0 4px; padding: 9px 12px; border-radius: 14px; background: var(--gold-soft); border: 1px solid var(--gold); font-size: 14px; }
.chat-ann b { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--gold); margin-bottom: 3px; }
.chat-ann b svg { width: 13px; height: 13px; }
.chat-ann div { overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-ann time { display: block; text-align: right; margin-top: 2px; }
.chat-empty { margin: auto; padding: 30px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--sub); }
.chat-empty b { color: var(--text); font-size: 15px; }
.chat-empty small { font-size: 12px; max-width: 240px; }
.chat-empty-ico { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--gold); margin-bottom: 4px; }
.chat-empty-ico .ic { width: 26px; height: 26px; }
/* barra di scrittura: la stessa nelle tre chat */
.cn-chat-bar { position: sticky; bottom: 8px; z-index: 5; flex: 0 0 auto; display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; padding: 8px; background: var(--card, var(--panel)); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 6px 18px rgba(0,0,0,.28); }
.dm-box .cn-chat-bar { position: relative; bottom: 0; margin: 0 8px 8px; box-shadow: none; }
.cn-chat-bar textarea { flex: 1 1 auto; resize: none; max-height: 112px; min-height: 44px; box-sizing: border-box; padding: 11px 14px; border-radius: 22px; background: var(--bg, #0f1722); color: var(--text); border: 1px solid var(--line); font-family: inherit; font-size: 16px; line-height: 1.3; }
.cn-chat-bar textarea:focus, .cn-chat-bar textarea:focus-visible { outline: none !important; border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 35%, transparent); }
.cn-chat-bar textarea:disabled { opacity: .5; }
.cn-chat-go, .cn-chat-ico { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 0; cursor: pointer; padding: 0; }
.cn-chat-go { background: var(--gold); color: #1a1405; transition: transform .1s, opacity .15s; }
.cn-chat-go.is-empty { opacity: .45; }
.cn-chat-go:disabled { opacity: .35; }
.cn-chat-ico { background: transparent; color: var(--sub); border: 1px solid var(--line); }
.cn-chat-go .ic, .cn-chat-ico .ic { width: 19px; height: 19px; }
.chat-count { position: absolute; right: 64px; top: -15px; font-size: 10px; color: var(--sub); background: var(--panel); border-radius: 8px; padding: 0 6px; }
.chat-count.hidden { display: none; }
.dm-blocked { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 10px 0; padding: 8px 12px; border-radius: 12px; font-size: 12px; color: var(--text); background: rgba(224,85,79,.14); border: 1px solid rgba(224,85,79,.45); }
.dm-blocked .btn { width: auto; margin: 0; flex: 0 0 auto; }
.dm-box > .dm-body > .msg { flex: 0 0 auto; margin: 4px 10px 0; }


/* Missioni giornaliere (v244.156) */
.goals-card.ms-bar { padding: 6px 8px; gap: 6px; }
.ms-open { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 10px; background: transparent; border: 0; color: var(--text); font-family: inherit; cursor: pointer; }
.ms-open-t { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; } .ms-open-t .ic { width: 16px; height: 16px; color: var(--gold); }
.ms-open-s { font-size: 12px; color: var(--sub); margin-left: auto; margin-right: 12px; }
.ms-open .prod-badge { top: 4px; right: 4px; }
.ms-pips { display: inline-flex; gap: 3px; }
.ms-pip { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); } .ms-pip.on { background: var(--gold); border-color: var(--gold); }
.ms-clanstrip { width: 100%; text-align: left; font-family: inherit; font-size: 12px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--panel)); color: var(--text); cursor: pointer; }
.ms-box { display: flex; flex-direction: column; height: min(88vh, 720px); text-align: left; padding: 10px; }
.ms-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 34px 6px 2px; font-size: 16px; }
.ms-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.ms-tab { position: relative; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--sub); font-family: inherit; font-weight: 700; cursor: pointer; }
.ms-tab.on { color: var(--text); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--panel)); }
.ms-tdot { position: absolute; top: 4px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger, #e0554f); opacity: 0; } .ms-tdot.on { opacity: 1; }
.ms-viewport { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.ms-track { display: flex; height: 100%; width: 100%; transition: transform .28s cubic-bezier(.23, 1, .32, 1); }
.ms-pane { flex: 0 0 100%; min-width: 0; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 2px; display: flex; flex-direction: column; gap: 6px; }
.ms-att { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; } .ms-att small { color: var(--sub); width: 100%; }
.ms-sec { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--sub); margin-top: 6px; } .ms-sec small { text-transform: none; letter-spacing: 0; font-weight: 600; margin-left: 6px; }
.ms-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--sub); } .ms-legend span { display: inline-flex; align-items: center; gap: 4px; }
.ms-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.ms-row.done { opacity: .55; } .ms-row.new { border-color: var(--gold); } .ms-row.res.lost { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
.ms-lv { flex: 0 0 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; background: var(--panel-strong, var(--card)); border: 1px solid var(--line); }
.ms-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .ms-rw { font-size: 14px; display: inline-flex; align-items: center; gap: 4px; } .ms-rw small { color: var(--sub); font-weight: 600; }
.ms-rec { font-size: 11px; color: var(--sub); display: inline-flex; align-items: center; gap: 5px; }
.ms-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; } .ms-dot.green { background: #22c55e; } .ms-dot.orange { background: #f59e0b; } .ms-dot.red { background: #ef4444; }
.ms-rec.green { color: #4ade80; } .ms-rec.orange { color: #fbbf24; } .ms-rec.red { color: #f87171; }
.ms-ok { color: var(--ok, #5fd39a); font-weight: 800; font-size: 12px; }
.ms-live { padding: 10px; border-radius: 14px; border: 2px solid var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--panel)); display: flex; flex-direction: column; gap: 6px; }
.ms-live.green { border-color: #22c55e; } .ms-live.orange { border-color: #f59e0b; } .ms-live.red { border-color: #ef4444; }
.ms-live-t { display: flex; justify-content: space-between; align-items: center; } .ms-count { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--gold); }
.ms-live-r { font-size: 13px; } .ms-team { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; flex-wrap: wrap; } .ms-team b.green { color: #4ade80; } .ms-team b.orange { color: #fbbf24; } .ms-team b.red { color: #f87171; }
.ms-claim { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 8px; text-align: center; } .ms-claim-n { font-size: 44px; } .ms-claim-n b { font-size: 52px; color: var(--gold); }
.ms-claim p, .ms-claim small { color: var(--sub); font-size: 12px; margin: 0; }
.ms-toast { position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 8px 12px; border-radius: 12px; background: rgba(8, 10, 18, .92); color: #fff; font-size: 13px; text-align: center; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; } .ms-toast.on { opacity: 1; transform: none; }
.ms-row .btn, .ms-live .btn { width: auto; flex: 0 0 auto; margin: 0; }
.ms-live .btn { align-self: flex-start; }
.ms-info { overflow: hidden; } .ms-rec { white-space: normal; line-height: 1.25; }
.ms-open .ms-pips { margin-left: 4px; }
.ms-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 2px 0; }
.ms-slot { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); min-width: 0; text-align: center; }
.ms-slot.lead { border-color: var(--gold); }
.ms-slot.empty { border-style: dashed; opacity: .75; }
.ms-slot b { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-slot i { font-style: normal; font-size: 10px; color: var(--sub); }
.ms-slot-av { height: 42px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--sub); }
.ms-row.clan .ms-slots { gap: 4px; } .ms-row.clan .ms-slot { padding: 3px 2px; } .ms-row.clan .ms-slot-av { height: 30px; font-size: 16px; }
.ms-slot.fill { animation: msFill .35s cubic-bezier(.23, 1, .32, 1); } @keyframes msFill { from { transform: scale(.85); opacity: .4; } to { transform: none; opacity: 1; } }
.ms-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; background: var(--panel-strong, var(--card)); border: 1px solid var(--line); font-size: 12px; font-weight: 700; white-space: nowrap; }
.ms-rw { display: flex; flex-wrap: wrap; gap: 4px; } .ms-live-r { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ms-chip .ic { width: 13px; height: 13px; }

/* Aure (v244.159) */
.au-art { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--s); height: var(--s); }
.au-art b { font-size: calc(var(--s) * .52); line-height: 1; filter: drop-shadow(0 0 6px var(--c)); position: relative; z-index: 1; }
.au-art::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 55%, transparent), transparent 68%); animation: auPulse 2.4s ease-in-out infinite; }
.au-ring { position: absolute; inset: 8%; border-radius: 50%; border: 1.5px solid var(--c); opacity: .6; animation: auSpin 6s linear infinite; }
.au-ring.r2 { inset: -2%; animation-duration: 9s; animation-direction: reverse; border-style: dashed; } .au-ring.r3 { inset: -10%; animation-duration: 4s; opacity: .35; }
@keyframes auPulse { 0%, 100% { transform: scale(.92); opacity: .75; } 50% { transform: scale(1.08); opacity: 1; } } @keyframes auSpin { to { transform: rotate(360deg); } }
.au-top { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 6px; } .au-top .btn { width: auto; }
.au-tk { font-size: 15px; } .au-tk b { color: var(--gold); }
.au-bar { position: relative; height: 22px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; margin-bottom: 8px; }
.au-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 55%, transparent), var(--gold)); }
.au-bar span { position: relative; z-index: 1; display: block; text-align: center; font-size: 11px; line-height: 22px; font-weight: 700; }
.au-eq { display: flex; align-items: center; gap: 12px; padding: 10px; margin-bottom: 8px; border-radius: 16px; border: 1px solid var(--c, var(--line)); background: color-mix(in srgb, var(--c, #666) 10%, var(--panel)); }
.au-eq.empty { justify-content: center; text-align: center; color: var(--sub); font-size: 13px; border-style: dashed; padding: 16px; }
.au-eq-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 12px; } .au-eq-t b { font-size: 15px; } .au-ab { color: var(--gold); }
.au-evoke { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 6px; } .au-evoke .btn { width: auto; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; } .au-evoke small { font-size: 10px; opacity: .8; }
.au-hint { font-size: 12px; color: var(--sub); text-align: center; margin-bottom: 4px; }
.au-tile .inv-tile-art { transform: translateY(-4px); } .au-lock { position: absolute; top: 3px; right: 4px; width: 14px; height: 14px; color: var(--gold); } .au-lock .ic { width: 14px; height: 14px; }
.au-pop { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.au-reveal { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; } .au-sum, .au-sub { font-size: 12px; color: var(--sub); }
.au-stats { display: flex; gap: 16px; font-weight: 700; } .au-ab.c { font-size: 13px; } .au-prog { font-size: 12px; color: var(--sub); }
.au-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: 100%; } .au-acts .btn { width: auto; flex: 1 1 30%; }
.au-odds { display: grid; gap: 4px; width: 100%; } .au-odd { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; font-size: 12px; text-align: left; } .au-odd i { color: var(--sub); font-style: normal; min-width: 52px; text-align: right; }
.au-mgrid { max-height: 38vh; overflow-y: auto; width: 100%; } .au-mat.sel { outline: 2px solid var(--gold); background: var(--gold-soft); }
.pr-aura { display: flex; align-items: center; justify-content: center; } .pr-aura.empty { border-style: dashed; opacity: .65; }

/* Popup «Nuovo equip» / scelta Vendi-Equipaggia (v244.159.7/8): scritte e tasti più leggibili ma contenuti. */
.fg-find { max-width: 94%; }
.fg-find .fg-swap-title { font-size: 17px; margin-bottom: 12px; text-align: center; }
.fg-find .fg-swap-grid { gap: 10px; }
.fg-find .fg-swap-card { padding: 11px; gap: 12px; border-width: 1.5px; border-radius: 12px; }
.fg-find .fg-swap-card.eq { opacity: .85; }
.fg-find .fg-swap-art { flex: 0 0 60px; }
.fg-find .fg-swap-art svg, .fg-find .fg-swap-art .av-piece { width: 56px; height: 56px; }
.fg-find .fg-swap-txt { text-align: left; }
.fg-find .fg-swap-tag { font-size: 11px; letter-spacing: .4px; font-weight: 700; }
.fg-find .fg-swap-name { font-size: 15px; line-height: 1.2; margin-top: 3px; }
.fg-find .fg-swap-bonus { font-size: 13px; margin-top: 5px; }
.fg-find .fg-cmp-lines { gap: 3px; margin-top: 6px; }
.fg-find .fg-cmp-line { font-size: 14px; font-weight: 700; color: var(--text); }
.fg-find .fg-cmp-line.fg-swap-skill, .fg-find .fg-swap-skill { color: var(--gold); }
.fg-find .fg-cmp-line svg, .fg-find .fg-swap-bonus svg { width: 14px; height: 14px; vertical-align: -2px; }
.fg-find .fg-swap-card:not(.eq) { background: color-mix(in srgb, var(--gold) 6%, var(--panel)); flex-wrap: wrap; }
.fg-find .fg-swap-card:not(.eq) .fg-swap-actions { flex: 1 0 100%; margin-top: 2px; gap: 8px; }
.fg-find .fg-swap-actions .btn { min-height: 42px; font-size: 15px; font-weight: 800; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.fg-find .fg-swap-actions .btn svg { width: 17px; height: 17px; }
.fg-find #fg-sw-stopauto { min-height: 40px; font-size: 14px; }
.fg-find .fg-find-hint { opacity: .6; font-size: 12px; text-align: center; margin-top: 10px; }
.ms-acts { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }

/* Aura: stessa struttura dei Pet (v244.159.11) — saldi in alto, griglia che scorre, riga tasti fissa sotto. */
body.view-auras #view { overflow: hidden; }
#auras { height: 100%; display: flex; flex-direction: column; }
#auras #au-frame { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#auras #au-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#auras #au-dock { flex: 0 0 auto; background: var(--card); padding-top: 8px; z-index: 5; }
#auras .au-saldi { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 6px 12px 4px; font-size: 14px; }
.au-actions { display: flex; gap: 8px; align-items: stretch; margin-top: 10px; padding-bottom: 2px; }
.au-actions .btn { font-family: inherit; margin-top: 0; }
.au-actions #au-evoke { flex: 1 1 auto; white-space: nowrap; background: linear-gradient(180deg, #eec763 0%, #d9a92f 55%, #c4982a 100%); border: 1px solid rgba(0, 0, 0, .35); color: #2b2924; font-weight: 700; font-size: 13px; padding: 9px 10px; }
.au-actions #au-evoke:disabled { opacity: .5; }
.au-actions #au-info, .au-actions #au-mult { flex: 0 0 68px; width: 68px; text-align: center; white-space: nowrap; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 12px; font-size: 12px; padding: 9px 0; }
@media (max-width: 380px) { .au-actions { gap: 6px; } .au-actions #au-info, .au-actions #au-mult { flex: 0 0 52px; width: 52px; } .au-actions #au-evoke { min-width: 0; font-size: 12px; padding: 9px 6px; overflow: hidden; text-overflow: ellipsis; } }
.au-qsel { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; width: 100%; }
.au-qsel .au-q { width: auto; flex: 0 0 auto; padding: 6px 10px; font-size: 12px; border-width: 1.5px; } .au-qsel .au-q.sel { background: var(--gold-soft); outline: 2px solid var(--gold); }

/* v244.159.31: titolo della missione a tema nella riga */
.ms-tt { display: block; font-size: 13px; margin-bottom: 2px; }
.ms-tt small { font-weight: 400; opacity: .75; }

/* v244.163: albero degli edifici — nodi circolari con icona per funzione,
   linee tra i prerequisiti (SVG, viewBox in % per la x), livello sotto ogni nodo. */
.tt-head { display: flex; align-items: baseline; justify-content: space-between; margin: 10px 0 6px; }
.tt-title { font-family: var(--font-display); font-size: 18px; }
.tt-pct { font-size: 13px; font-weight: 800; color: var(--gold); }
.tt-tree { position: relative; width: 100%; max-width: 420px; margin: 0 auto; }
.tt-links { position: absolute; left: 0; top: 0; width: 100%; overflow: visible; pointer-events: none; }
.tt-link { fill: none; stroke: var(--line); stroke-width: 2; vector-effect: non-scaling-stroke; }
.tt-link.on { stroke: var(--gold); }
.tt-node {
  position: absolute; transform: translate(-50%, 0); width: 72px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tt-disc {
  position: relative; width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--panel-strong, var(--panel)); border: 2px solid var(--line);
  color: var(--text);
}
.tt-disc .ic { width: 28px; height: 28px; }
.tt-node.owned .tt-disc { border-color: var(--gold); }
.tt-node.max .tt-disc { border-color: var(--ok); }
.tt-node.locked { opacity: .4; filter: grayscale(1); }
.tt-lv { font-size: 11px; font-weight: 800; color: var(--sub); background: rgba(255,255,255,.06); padding: 1px 7px; border-radius: 999px; }
.tt-ico { position: relative; display: inline-grid; place-items: center; }
.tt-badge {
  position: absolute; right: -10px; bottom: -8px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); color: var(--gold);
}
.tt-badge .ic { width: 12px; height: 12px; }
/* titolo del popup di un nodo: l'icona con il suo badge sta a sinistra del testo, senza coprirlo */
.node-box .fg-swap-title, .clan-popup .fg-swap-title:has(.tt-ico) { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 0 30px; }
.node-box .fg-swap-title .tt-ico .ic, .clan-popup .fg-swap-title .tt-ico .ic { width: 24px; height: 24px; }
.node-box .fg-swap-title .tt-badge, .clan-popup .fg-swap-title .tt-badge { right: -9px; bottom: -7px; }
.tt-node.busy .tt-disc, .tt-tree.busy .tt-node.owned .tt-disc { animation: tt-pulse 1.6s ease-in-out infinite; }
@keyframes tt-pulse { 50% { box-shadow: 0 0 0 4px rgba(234,179,8,.35); } }
/* v244.165: stato dell'effetto nel popup del nodo */
.tt-live { color: var(--ok); font-weight: 700; }
.tt-soon { color: var(--sub); }
/* nodo non ancora collegato al gioco: disco tratteggiato e attenuato, con l'etichetta «presto» */
.tt-node.soon .tt-disc { border-style: dashed; opacity: .6; }
.tt-soon-tag { font-style: normal; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--gold); margin-left: 3px; }

/* v244.166: albero di gilda con la grafica degli edifici (dischi per funzione) */
.gt-sec { font-size: 12px; font-weight: 800; color: var(--sub); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.gt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 4px; justify-items: center; }
.gt-node {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 72px;
  background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.gt-node.owned .tt-disc { border-color: var(--gold); }
.gt-node.max .tt-disc { border-color: var(--ok); }
.gt-node.soon .tt-disc { border-style: dashed; }
.gt-box { max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* v244.170: nodo in ricerca — anello dorato che pulsa e tempo residuo sotto il livello */
.tt-node.researching .tt-disc { border-color: var(--gold); animation: tt-pulse 1.6s ease-in-out infinite; }
.tt-node.researching .tt-lv { color: var(--gold); background: rgba(234,179,8,.14); }
.tt-node.researching .tt-lv .ic { width: 11px; height: 11px; vertical-align: -1px; }

/* v244.178: nemici dell'ondata come figure separate, tutti insieme sul lato destro */
.fighter.multi > .sc-fig, .fighter.multi > .sc-hp, .fighter.multi > .sc-hpnum { display: none; }
.sc-egroup { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 6px; margin-top: 4px; }
.sc-ecard { width: 58px; text-align: center; border-radius: 8px; padding: 2px; transition: opacity .25s, filter .25s; }
.sc-ecard .sc-fig { margin: 0 auto; }
.sc-ecard .sc-hp { height: 5px; margin-top: 2px; }
.sc-ecard .sc-hpnum { font-size: 9px; }
.sc-ecard.dead { opacity: .2; filter: grayscale(1); }
.sc-ecard.tgt { outline: 2px solid #ef4444; }


/* v244.182–184 — replay a tempo della campagna (ui/timeline.js): figure SVG disegnate nel
   codice (nessun asset del gioco), regia e movimenti del visualizzatore di riferimento */
.tl-box { width: min(94vw, 460px); }
.tl-lane { position: relative; height: 190px; margin: 8px 0; overflow: hidden; border-radius: 12px;
  --ppu: 24px;
  background-color: #0f172a;
  background-image:
    linear-gradient(180deg, transparent 0 62%, rgba(51, 65, 85, .55) 62% 100%),
    repeating-linear-gradient(90deg, transparent 0, transparent calc(var(--ppu) - 1px),
      rgba(255, 255, 255, .07) calc(var(--ppu) - 1px), rgba(255, 255, 255, .07) var(--ppu));
}
.tl-ground { position: absolute; left: 0; right: 0; bottom: 26px; height: 2px; background: rgba(255, 255, 255, .22); }
.tl-u { position: absolute; left: 0; bottom: 26px; width: 0; height: 0; will-change: transform; }
.tl-fig { position: absolute; left: calc(var(--ppu) * -0.5); bottom: 0; width: calc(var(--ppu) * 1);
  height: calc(var(--ppu) * 2.3); transform-origin: 50% 100%; will-change: transform; }
.tl-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tl-hp { position: absolute; left: calc(var(--ppu) * -0.6); bottom: calc(var(--ppu) * 2.6); width: calc(var(--ppu) * 1.2);
  height: 6px; border-radius: 3px; background: #1e293b; border: 1px solid rgba(255, 255, 255, .7);
  box-sizing: content-box; overflow: hidden; z-index: 2; }
.tl-hp > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }
.tl-pre { background: #e5e7eb; }
.tl-cur { background: #4ade80; }
.tl-foe .tl-cur { background: #f87171; }
.tl-dmgs { position: absolute; left: 0; bottom: calc(var(--ppu) * 3); width: 0; height: 0; z-index: 3; }
.tl-float { position: absolute; left: calc(var(--ppu) * -1); bottom: 0; width: calc(var(--ppu) * 2); text-align: center;
  white-space: nowrap; font-size: 12px; font-weight: 800; color: #fde047; text-shadow: 0 1px 2px #000;
  transform-origin: 50% 50%; }
.tl-float.tl-crit { color: #fb923c; font-size: 15px; }
.tl-poof { position: absolute; left: 50%; top: 50%; font-size: calc(var(--ppu) * 1.2); line-height: 1;
  transform: translate(-50%, -50%); pointer-events: none; }
.tl-shot { position: absolute; left: 0; bottom: calc(var(--ppu) * 1.6); width: calc(var(--ppu) * 0.9); height: 6px;
  transform-origin: 0 50%; }
.tl-shot svg { display: block; width: 100%; height: 100%; }
.tl-win { color: #4ade80; font-weight: 800; }
.tl-lose { color: #f87171; font-weight: 800; }

/* v244.192 — Obiettivi (views/achievements.js) */
.ach-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; margin: 4px 0 10px; }
.ach-count { margin-left: auto; font-size: 12px; font-weight: 700; color: #facc15; }
.ach-list { display: flex; flex-direction: column; gap: 8px; }
.ach-row { padding: 10px 12px; border-radius: 12px; background: rgba(148, 163, 184, .10); }
.ach-row.ach-inactive { opacity: .55; }
.ach-title { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.ach-bar { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .3); overflow: hidden; }
.ach-bar i { display: block; height: 100%; background: #4ade80; border-radius: 3px; }
.ach-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12px; }
.ach-done { color: #94a3b8; font-weight: 700; }
.ach-off { color: #94a3b8; }
.ach-gem { color: #facc15; font-weight: 700; }
.ach-note { font-size: 12px; color: #94a3b8; margin: 10px 0 0; }

/* v244.232 — abilità (views/skills.js) e lampi di abilità nel replay (ui/timeline.js) */
.tl-fx { position: absolute; left: 0; bottom: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px dashed rgba(253, 224, 71, .9); background: rgba(253, 224, 71, .12); font-size: 14px; pointer-events: none;
  transform-origin: 50% 50%; }
.sk-saldi { display: flex; justify-content: space-between; gap: 8px; padding: 4px 12px 8px; font-size: 14px; }
.sk-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 12px; }
.sk-slot-tile { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 6px; min-height: 64px; background: transparent;
  color: inherit; font-size: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.sk-slot-tile.pick { border-style: solid; border-color: #fde047; }
.sk-slot-tile b { font-size: 13px; }
.sk-hint { padding: 6px 12px; font-size: 12px; opacity: .8; }
.sk-bar { position: relative; margin: 0 12px 8px; height: 18px; border-radius: 9px; background: rgba(148, 163, 184, .25); overflow: hidden; }
.sk-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #22c55e; }
.sk-bar span { position: relative; font-size: 11px; line-height: 18px; display: block; text-align: center; }
.sk-counts { display: flex; gap: 6px; padding: 0 12px 6px; }
.sk-list { display: grid; gap: 8px; padding: 0 12px 12px; }
.sk-card { border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px; padding: 10px; }
.sk-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sk-meta { font-size: 12px; opacity: .85; margin: 4px 0 8px; }
.sk-slot { font-weight: 700; color: #fde047; }
.sk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
body.view-skills #view { overflow: hidden; }
#skills { height: 100%; display: flex; flex-direction: column; }
#skills #sk-frame { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#skills #sk-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#skills #sk-dock { flex: 0 0 auto; background: var(--card); padding-top: 8px; z-index: 5; }

.sk-name { display: inline-flex; align-items: center; gap: 6px; }
.sk-ic { width: 24px; height: 24px; flex: 0 0 auto; display: inline-block; object-fit: contain; vertical-align: middle; }
.sk-slot-ic { display: block; }
.sk-slot-ic .sk-ic { width: 22px; height: 22px; }
.tl-fx .sk-ic { width: 60%; height: 60%; }
/* v244.237 — abilità: griglia come i Pet, popup con descrizione */
.sk-tile-art { width: 100%; }
.sk-tile-art .sk-ic { width: min(72px, 76%); height: auto; aspect-ratio: 1; }
.sk-pop-art { flex-shrink: 0; }
.sk-pop-art .sk-ic { width: 80px; height: 80px; display: block; }
.sk-desc { font-size: 13px; line-height: 1.4; margin: 10px 0 6px; color: var(--text); }
.sk-empty { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; opacity: .7; }
/* v244.239 — abilità: marcatore verde ▲ sulle tile potenziabili */
.sk-up-mark { position: absolute; right: 4px; top: 4px; color: #22c55e; font-weight: 800; font-size: 14px; line-height: 1; }

/* v244.241 — evocazione abilità: animazione e riepilogo per tipologia */
.sk-sum-box { text-align: center; overflow: hidden; position: relative; }
.sk-sum-glow { position: absolute; left: 50%; top: 40px; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(253, 224, 71, .55), rgba(253, 224, 71, 0) 70%); animation: skGlow 1.1s ease-out both; pointer-events: none; }
@keyframes skGlow { from { transform: scale(.2); opacity: 0; } 40% { opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.sk-sum-title { position: relative; font-weight: 800; font-size: 18px; padding-top: 8px; }
.sk-sum-sub { position: relative; font-size: 12px; opacity: .8; margin-bottom: 8px; }
.sk-sum-grid { position: relative; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 52vh; overflow: auto; padding: 4px; }
.sk-sum-card { position: relative; border: 2px solid; border-radius: 12px; padding: 10px 6px 8px; background: rgba(15, 23, 42, .6);
  display: flex; flex-direction: column; align-items: center; gap: 2px; animation: skIn .5s cubic-bezier(.2, .9, .3, 1.25) both; animation-delay: var(--d, 0ms); }
.sk-sum-art .sk-ic { width: 64px; height: 64px; display: block; }
.sk-sum-name { font-size: 13px; color: var(--text); }
.sk-sum-rar { font-size: 11px; opacity: .85; }
.sk-sum-n { font-weight: 800; font-size: 16px; color: var(--text); }
.sk-sum-new { position: absolute; top: -6px; right: -4px; background: #22c55e; color: #052e16; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 8px; }
@keyframes skIn { from { opacity: 0; transform: translateY(18px) scale(.6) rotate(-6deg); } to { opacity: 1; transform: none; } }

/* v244.251 — abilità equipaggiate nel replay: cerchio con anello di carica e timer centrale */
.tl-skills { display: flex; justify-content: center; gap: 16px; margin: 8px 0 2px; }
.tl-sk { --rc: #94a3b8; --c: var(--rc); --p: 0; position: relative; width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(148, 163, 184, .22) 0); }
.tl-sk::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #0f172a; }
.tl-sk .sk-ic { position: relative; width: 32px; height: 32px; color: var(--rc); transition: opacity .15s; }
.tl-sk.charging .sk-ic, .tl-sk.cooldown .sk-ic { opacity: .35; }
.tl-sk-t { position: absolute; font-size: 13px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.tl-sk.active { --c: #fde047; box-shadow: 0 0 10px rgba(253, 224, 71, .6); }
.tl-sk.ready { --c: var(--rc); box-shadow: 0 0 10px var(--rc); }
.tl-sk.cast { animation: tlSkPop .45s ease-out; }
.tl-sk.empty { border: 2px dashed rgba(148, 163, 184, .35); background: none; }
.tl-sk.empty::before { display: none; }
@keyframes tlSkPop { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }

/* v244.254 — stemma del clan */
.cn-crest.cn-emblem { background: none; border: 0; padding: 0; }
.cn-crest.cn-emblem svg { width: 46px; height: 46px; }
.emb-prev { display: flex; justify-content: center; margin: 6px 0 10px; }
.emb-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 8px; }
.emb-ic, .emb-sw { border: 2px solid transparent; border-radius: 10px; padding: 2px; background: transparent; }
.emb-sw { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.emb-ic.on, .emb-sw.on { border-color: #fde047; }
.tn-head .emblem { flex: 0 0 auto; margin-right: 6px; }
.me-card .emblem { vertical-align: middle; margin-right: 4px; }

/* v244.261 — popup donazione albero di gilda: parte bassa [xN] [Pozioni] [Diamanti] */
.gn-dock { display: flex; gap: 8px; align-items: stretch; margin-top: 12px; }
.gn-dock .btn { margin-top: 0; font-size: 13px; line-height: 1.2; padding: 8px 6px; }
.gn-dock .gn-mult { flex: 0 0 62px; font-size: 16px; font-weight: 800; }
.gn-dock #gn-pot, .gn-dock #gn-gem { flex: 1 1 0; }
.gn-dock .btn span { font-size: 12px; opacity: .9; }
.gn-dock.gn-confirm { flex-wrap: wrap; }

/* v244.264 — barra di progresso del nodo di gilda (sopra i tasti di donazione) */
.gn-bar { position: relative; height: 22px; border-radius: 11px; margin-top: 12px; background: rgba(148, 163, 184, .25); overflow: hidden; }
.gn-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #22c55e, #84cc16); transition: width .3s; }
.gn-bar span { position: relative; display: block; text-align: center; font-size: 12px; font-weight: 700; line-height: 22px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.gn-bar + .gn-dock { margin-top: 8px; }

/* v244.271 — Forgia Auto: popup scorrevole con tasti sempre visibili, riga «martelli» compatta su una linea */
.fg-auto-box { max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.fg-auto-box .fg-auto-actions { position: sticky; bottom: 0; z-index: 2; display: flex; gap: 8px; margin-top: 10px;
  padding: 8px 0 2px; background: var(--card); }
.fg-auto-box .fg-auto-actions .btn { flex: 1 1 0; width: auto; margin-top: 0; }
.fg-xrow { margin-top: 12px; text-align: center; }
.fg-xlab { font-size: 12px; margin-bottom: 6px; }
.fg-xchips { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: nowrap; }
.fg-xchips .fg-xm { width: 46px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.fg-xchips b.fg-xm { width: 64px; }
/* v244.271 — scena di vendita con molti pezzi: griglia a capo (non più una riga che sborda a destra) */
.fb-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 104px)); justify-content: center; gap: 8px;
  max-height: 54vh; overflow-y: auto; padding: 2px; }
.fb-tile { max-width: none; }
.fb-row.many { grid-template-columns: repeat(auto-fit, minmax(58px, 78px)); gap: 6px; }
.fb-row.many .fb-tile { padding: 5px 2px; }
.fb-row.many .fb-art { min-height: 40px; }
.fb-row.many .fb-name { display: none; }
.fb-row.many .fb-val { font-size: 11px; }
.fg-auto-intro { margin: 4px 0 6px; font-size: 11px; line-height: 1.35; }
.fg-auto-box .fg-xrow { margin: 4px 0 10px; }
.fb-row.many { grid-template-columns: repeat(auto-fit, minmax(54px, 66px)); gap: 5px; }

/* v244.272 — popup Forgia Auto: ✕ in alto a destra (niente «Annulla»), martelli in contemporanea + Avvia in basso */
.fg-auto-top { position: sticky; top: 0; z-index: 3; background: var(--card); padding: 2px 28px 4px; }
.fg-auto-x { top: 2px; right: 0; }
.fg-auto-foot { position: sticky; bottom: 0; z-index: 2; margin-top: 8px; padding: 8px 0 2px; background: var(--card); }
.fg-auto-foot .fg-xrow { margin: 0 0 8px; }
.fg-auto-foot .btn { width: 100%; margin-top: 0; }

/* v244.273 — scheletri: la barra Missioni e la chat hanno SEMPRE la loro altezza, niente salti all'apertura */
.goals-card.ms-bar { min-height: 46px; }
.ms-skel .ms-pips .ms-pip { opacity: .35; }
.ms-sk-line { display: inline-block; width: 74px; height: 10px; border-radius: 5px; vertical-align: middle;
  background: linear-gradient(90deg, rgba(148,163,184,.18), rgba(148,163,184,.34), rgba(148,163,184,.18));
  background-size: 200% 100%; animation: msShimmer 1.2s linear infinite; }
.cs-row.cs-sk .ms-sk-line { width: 70%; height: 9px; margin: 3px 0; }
@keyframes msShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ms-sk-line { animation: none; } }
.cs-row.cs-sk { min-height: 16px; align-items: center; }

/* v244.275: icone profilo */
.pf-icon { display: block; border-radius: 22%; }
.pf-grid { display: grid; gap: 6px; padding: 8px 0; }
.pf-pick { background: none; border: 2px solid transparent; border-radius: 12px; padding: 2px; cursor: pointer; line-height: 0; }
.pf-pick.on { border-color: var(--accent, #f59e0b); }

/* v244.276: tasto Bonus (forziere) + popup coi 4 bonus */
.bn-svg { width: 100%; height: 100%; display: block; }
.bn-base { fill: #b45309; } .bn-lid { fill: #d97706; } .bn-band { fill: #fcd34d; }
.bn-lock { fill: #fef3c7; stroke: #92400e; stroke-width: 1.5; } .bn-star { fill: #fde047; transform-origin: 44px 10px; animation: bnTw 3s ease-in-out infinite; }
.bn-lid { transform-origin: 10px 27px; animation: bnLid 3s ease-in-out infinite; }
@keyframes bnTw { 0%,70%,100% { transform: scale(.7); opacity: .6; } 85% { transform: scale(1.25); opacity: 1; } }
@keyframes bnLid { 0%,80%,100% { transform: rotate(0); } 88% { transform: rotate(-7deg); } }
.bonus-box { max-width: 320px; }
.bonus-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 4px 6px; }
.bonus-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 124px; padding: 10px 6px; text-align: center; }
.bonus-cell .dice-row { margin: 0; justify-content: center; }
.bonus-cell .prod-btn { width: 64px; height: 64px; }
.bonus-lbl { font-size: 12px; font-weight: 600; }
.bonus-cell .goals-go-btn .ic { width: 34px; height: 34px; color: var(--gold); }
.bonus-cell:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 5px); }
.bonus-sub { font-size: 10px; line-height: 1.3; color: var(--sub); }
.bonus-sub.on { color: var(--gold); font-weight: 600; }

/* v244.277: abilità 3 per riga; dock Info | Evoca | xN come Pet/Aure */
.inv-grid.sk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.au-actions #sk-summon { flex: 1 1 auto; white-space: nowrap; background: linear-gradient(180deg, #eec763 0%, #d9a92f 55%, #c4982a 100%); border: 1px solid rgba(0, 0, 0, .35); color: #2b2924; font-weight: 700; font-size: 13px; padding: 9px 10px; }
.au-actions #sk-summon:disabled { opacity: .5; }
.au-actions #sk-info, .au-actions #sk-mult { flex: 0 0 68px; width: 68px; text-align: center; white-space: nowrap; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 12px; font-size: 12px; padding: 9px 0; }
@media (max-width: 380px) { .au-actions #sk-info, .au-actions #sk-mult { flex: 0 0 52px; width: 52px; } .au-actions #sk-summon { min-width: 0; font-size: 12px; padding: 9px 6px; overflow: hidden; text-overflow: ellipsis; } }

/* v244.281: Abilità, Pet e Forgia con la stessa disposizione dell'Aura (saldi in alto, barra + Info | Evoca | xN in basso) */
#skills .au-saldi { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 6px 12px 4px; font-size: 14px; }
.fgbar .fgprog, .fgbar .fgprog-up { width: 100%; box-sizing: border-box; height: 22px; border-radius: 11px; margin-bottom: 0; }
.fgbar .fgprog span { font-size: 11px; line-height: 22px; }
.fgbar .fgprog-up { font-size: 12px; padding: 0 10px; }
.fgbar-sub.au-actions { display: flex; margin-top: 2px; }
.fgbar-sub.au-actions .btn { font-family: inherit; }
.fgbar-sub.au-actions #fg-roll { flex: 1 1 auto; width: auto; white-space: nowrap; background: linear-gradient(180deg, #eec763 0%, #d9a92f 55%, #c4982a 100%); border: 1px solid rgba(0, 0, 0, .35); color: #2b2924; font-weight: 700; font-size: 13px; padding: 9px 10px; }
.fgbar-sub.au-actions #fg-roll:disabled { opacity: .5; }
.fgbar-sub.au-actions #cpf-catalog, .fgbar-sub.au-actions #fg-auto { flex: 0 0 68px; width: 68px; text-align: center; white-space: nowrap; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 12px; font-size: 12px; padding: 9px 0; }
@media (max-width: 380px) { .fgbar-sub.au-actions #cpf-catalog, .fgbar-sub.au-actions #fg-auto { flex: 0 0 52px; width: 52px; } .fgbar-sub.au-actions #fg-roll { min-width: 0; font-size: 12px; padding: 9px 6px; overflow: hidden; text-overflow: ellipsis; } }

/* v244.282: slot uova nel dock Pet, 4 in riga, sopra la barra di progresso */
#pets #pets-eggs { margin: 0 0 6px; padding: 4px; }
#pets #pets-eggs .eggstrip-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; }
#pets #pets-eggs .eggslot { min-height: 42px; padding: 3px 1px; }
#pets #pets-eggs .es-timer { font-size: 9px; }
#pets .au-bar[data-es-info] { cursor: pointer; }

/* v244.284: Account — icona a sinistra del nome, griglia gear a 4 colonne con le abilità */
.ac-head-row { flex-direction: row !important; align-items: center; gap: 12px !important; }
.ac-ico { flex: 0 0 auto; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; }
.ac-head-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ac-gear .pr-slots { grid-template-columns: repeat(4, 1fr); }
.ac-gear .pr-slot { aspect-ratio: 1; }
.pr-skill .pr-sk-ic { width: 76%; height: 76%; max-width: 64px; max-height: 64px; }
.pr-skill.empty { opacity: .6; border-style: dashed; }

/* v244.285: potenza nell'angolo in alto a destra della scheda profilo */
.ac-hero2 { position: relative; }
.ac-hero2 #ac-power-chip { position: absolute; top: 10px; right: 10px; }
.ac-hero2 .ac-hero-name { padding-right: 84px; }

/* v244.286: gear in Account — 5 per riga, un riquadro per tipologia */
.ac-gear .pr-slots { display: flex; flex-direction: column; gap: 8px; }
.ac-grp { border: 1px solid var(--gc, var(--line)); border-radius: 12px; padding: 6px 8px 8px; background: color-mix(in srgb, var(--gc, #888) 7%, transparent); }
.ac-grp-t { font-size: 11px; font-weight: 700; color: var(--gc, var(--sub)); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.ac-grp-g { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ac-grp-eq { --gc: #60a5fa; } .ac-grp-au { --gc: #fbbf24; } .ac-grp-pt { --gc: #34d399; } .ac-grp-sk { --gc: #f472b6; }
.ac-gear .ac-grp-g .pr-slot { aspect-ratio: 1; min-height: 0; }
.ac-gear .pr-slots { width: 100%; }
.ac-gear .ac-grp { width: 100%; box-sizing: border-box; }

/* v244.287: un solo riquadro, 5 per riga; il contorno di ogni cella indica la tipologia */
.ac-gear .pr-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); box-sizing: border-box; }
.ac-gear .ac-grp { display: contents; }
.ac-gear .ac-grp-t { display: none; }
.ac-gear .ac-grp-g { display: contents; }
.ac-gear .pr-slot { aspect-ratio: 1; min-height: 0; box-shadow: 0 0 0 2px color-mix(in srgb, var(--gc) 70%, transparent) inset; }

/* v244.287.1: 6 per riga; l'aura occupa 3 spazi */
.ac-gear .pr-slots { grid-template-columns: repeat(6, 1fr); }
.ac-gear .pr-slot.pr-aura, .ac-gear .ac-grp-au .pr-slot { grid-column: span 3; aspect-ratio: auto; }

/* v244.287.2: E E E E A A / E E E E A A / P P P S S S */
.ac-gear .pr-slot.pr-aura, .ac-gear .ac-grp-au .pr-slot { grid-column: 5 / span 2; grid-row: 1 / span 2; aspect-ratio: auto; }

/* v244.290: intestazione Account allineata — icona | nickname [TAG] | potenza, tutto centrato in verticale */
.ac-hero2 #ac-power-chip { position: static; flex: 0 0 auto; margin-left: auto; }
.ac-hero2 .ac-hero-name { padding-right: 0; overflow: hidden; text-overflow: ellipsis; }
.ac-head-row .ac-head-txt { flex: 1 1 auto; }

/* v244.291: Account — meno spazio sopra e sotto */
.ac-hero.ac-hero2 { padding: 6px 8px; margin: 2px 0 0; gap: 4px; }
.ac-hero2 .ac-ico { width: 52px; height: 52px; }
.ac-hero2 .ac-hero-head { margin: 0; gap: 8px !important; }
.ac-gear .pr-slots { padding: 5px; gap: 4px; }
.ac-hero2 .pr-hero { margin: 0; }
.ac-facts { margin-top: 4px; }
.ac-hero2 .ac-ico svg { width: 100%; height: 100%; }

/* v244.295: emblema SVG dell'aura */
.au-emb { position: relative; z-index: 1; width: 58%; height: 58%; filter: drop-shadow(0 0 5px var(--c)); }

/* v244.297: icona profilo proporzionata al nickname */
.ac-hero2 .ac-ico { width: 42px; height: 42px; }
.ac-hero2 .ac-hero-name { font-size: 20px; }

/* v244.298: intestazione Account = UNA casella compatta come la riga di classifica (icona | nickname [TAG] | potenza) */
.ac-hero2 .ac-head-row { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; gap: 8px !important; }
.ac-hero2 .ac-ico { width: 28px; height: 28px; }
.ac-hero2 .ac-hero-name { font-size: 15px; font-weight: 600; }

/* v244.302: Missioni = tasto sotto al Bonus; la chat della home si estende in altezza sotto i tasti Chat / Rapina / Torre */
.ms-svg { width: 100%; height: 100%; display: block; }
.ms-board { fill: #f3e9d2; stroke: #1b1b22; stroke-width: 2.4; stroke-linejoin: round; }
.ms-clip { fill: #94a3b8; stroke: #1b1b22; stroke-width: 2.2; }
.ms-chk { fill: none; stroke: #16a34a; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.ms-ln { fill: none; stroke: #8b6f47; stroke-width: 2.4; stroke-linecap: round; }
.ms-skel .ms-chk, .ms-skel .ms-ln { opacity: .4; }
.ms-btn { position: relative; }
/* Home: il pannello superiore scorre solo verticalmente; la chat è un contenitore separato. */
body.view-home #view {
  flex: 0 1 auto;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}
/* I badge restano dentro i pulsanti e non allargano lo scroller della Home. */
#home .mini-col .prod-badge { top: 3px; right: 3px; }
body.view-home #chatstrip:not(.hidden) { flex: 1 1 0; min-height: 96px; margin-top: 8px; }
.chatstrip .cs-rows { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; gap: 2px; }

/* v244.303: intestazione della chat con 3 pulsanti Globale · Clan · Privata */
.cs-head { gap: 6px; padding-bottom: 2px; }
.cs-tab { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 6px; border-radius: 9px;
  border: 1px solid var(--line); color: var(--sub); font-size: 10.5px; cursor: pointer; white-space: nowrap; background: transparent; }
.cs-tab.on { color: var(--text); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.cs-tab.off { opacity: .4; }
.cs-tab .ic { width: 12px; height: 12px; }
.cs-row.unread .cs-name, .cs-row.unread .cs-text { color: var(--text); font-weight: 800; }
.cs-empty { color: var(--sub); font-size: 11px; text-align: center; padding: 8px 0; }
.cs-head { padding-bottom: 4px; }
.cs-tab { padding: 9px 6px; font-size: 11px; border-radius: 11px; }
.cs-tab .ic { width: 14px; height: 14px; }

/* v244.305: punti della guerra giorno per giorno */
.wd-tot { display: flex; align-items: center; justify-content: space-around; gap: 8px; margin: 8px 0; text-align: center; }
.wd-tot div { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .wd-tot i { font-style: normal; font-size: 12px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.wd-tot b { font-size: 26px; font-weight: 800; } .wd-tot span { color: var(--sub); font-size: 12px; }
.wd-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-height: 50vh; overflow-y: auto; }
.wd-day { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: var(--panel); cursor: pointer; }
.wd-day.win { border-color: var(--ok, #22c55e); } .wd-day.lose { border-color: var(--danger, #ef4444); }
.wd-row { display: flex; align-items: center; gap: 8px; } .wd-row b { font-size: 13px; }
.wd-pts { margin-left: auto; font-size: 15px; } .wd-pts b { font-size: 15px; }
.wd-row em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--sub); min-width: 58px; text-align: right; }
.wd-row em.wd-w { color: var(--ok, #22c55e); } .wd-row em.wd-l { color: var(--danger, #ef4444); } .wd-row em.wd-live { color: var(--gold); }
.wd-row em .ic { width: 12px; height: 12px; }
.wd-det { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--sub); }
.wd-det div { display: flex; gap: 8px; flex-wrap: wrap; } .wd-det i { font-style: normal; font-weight: 700; color: var(--text); flex: 1 0 100%; }
.wd-val { color: var(--sub); font-size: 10px; margin-left: 6px; }
.wd-cap { text-align: center; font-size: 11px; color: var(--sub); margin-top: 4px; }

/* v244.310: i 5 attacchi — rivali per potenza */
.wt-list { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.wt-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.wt-row.down { opacity: .55; }
.wt-rk { width: 18px; text-align: center; font-size: 11px; color: var(--sub); font-weight: 700; }
.wt-av { flex: 0 0 auto; display: inline-flex; }
.wt-nm { flex: 1; min-width: 0; display: flex; flex-direction: column; } .wt-nm b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-nm i { font-style: normal; font-size: 11px; color: var(--sub); display: inline-flex; align-items: center; gap: 3px; } .wt-nm i .ic { width: 11px; height: 11px; }
.wt-pt { font-weight: 800; color: var(--gold); font-size: 13px; }
.wt-atk { width: 34px; margin: 0; padding: 6px 0; } .wt-atk .ic { width: 14px; height: 14px; }
.wt-st .ic { width: 16px; height: 16px; color: var(--danger, #ef4444); }

/* Original expansion views. */
.expansion { padding: 12px 12px 110px; max-width: 760px; margin: auto; }
.ex-tabs, .ex-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ex-tabs { position: sticky; top: 0; padding: 8px 0; background: var(--tg-theme-bg-color, #17202e); z-index: 2; }
.ex-tab, .ex-button { font: inherit; border-radius: 12px; padding: 10px 14px; border: 1px solid #64748b66; color: inherit; background: #64748b22; cursor: pointer; }
.ex-tab.selected, .ex-button { background: var(--tg-theme-button-color, #3b82f6); color: var(--tg-theme-button-text-color, #fff); }
.ex-button:disabled { opacity: .45; cursor: default; }
.ex-card { margin: 12px 0; border: 1px solid #64748b55; border-radius: 18px; padding: 14px; }
.ex-card h3 { margin: 0 0 8px; } .ex-card p { line-height: 1.6; } .ex-message { padding: 10px; border-left: 3px solid #60a5fa; }

.ex-tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
.ex-tab { flex: 0 0 auto; white-space: nowrap; }

/* Quantità di evocazione Pet disponibili nel selettore. */
#pets .pets-mult-help { margin:6px 0 0;font-size:10px;line-height:1.5;color:var(--sub);text-align:center;overflow-wrap:anywhere; }

/* Fusione Aura: anche le selezioni grandi restano scorrevoli su schermi piccoli. */
.aura-popup > .battle-box {max-height:100%;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;}

/* v363: keep the equipped-slot tag clear of the skill illustration. */
.sk-tile .inv-tile-eq { top: 4px; bottom: auto; left: 4px; right: auto; transform: none; padding: 1px 5px; border-radius: 3px; }

/* v364: transparent full-body companion art; scale only inside the pet inventory. */
.pet-art { display: inline-block; object-fit: contain; vertical-align: middle; flex-shrink: 0; }
#pets .inv-tile[data-kind="pet"] .inv-tile-art { width: 100%; }
#pets .inv-tile[data-kind="pet"] .inv-tile-art > span { width: 100%; }
#pets .inv-tile[data-kind="pet"] .pet-art { width: min(64px, 82%); height: auto; aspect-ratio: 1; }
#pets .inv-tile[data-kind="pet"] .inv-tile-eq { left: 3px; right: auto; top: auto; bottom: 16px; transform: none; display: grid; place-items: center; width: 16px; height: 16px; padding: 0; border-radius: 50%; border: 1px solid #c7b47188; }
#pets .inv-tile[data-kind="pet"] .inv-tile-eq .ic { width: 11px; height: 11px; }
#pets .inv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pet-detail-col { flex-basis: 88px; }
.pet-detail-art { width: 84px; height: 84px; }
/* A very short Mini App must still leave the collection reachable. */
@media (max-height: 360px) {
  #pets #pets-frame { display: block; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
  #pets #pets-scroll { overflow: visible; }
}

/* Mount collection: compact rows keep abilities readable on small screens. */
#auras .au-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:6px 0 5px}
#auras .au-filters label{display:flex;flex-direction:column;gap:3px;color:var(--sub);font-size:10px;font-weight:700}
#auras .au-filters select{width:100%;min-width:0;min-height:38px;padding:5px 3px;border:1px solid var(--line);border-radius:7px;background:var(--panel);color:var(--text);font:inherit;font-size:11px}
#auras .au-list-count{color:var(--sub);font-size:11px;text-align:right;margin:4px 2px}
#auras .au-list{display:flex;flex-direction:column;gap:7px;padding-bottom:8px}
#auras .au-row{display:flex;align-items:center;text-align:left;gap:8px;width:100%;min-height:80px;padding:7px;border:1px solid var(--mount-rarity);border-radius:9px;background:linear-gradient(120deg,#355266e8,#142e3ef2);color:#fff0d3;cursor:pointer}
#auras .au-row.eq{box-shadow:inset 0 0 0 2px #ebd58b70;background:linear-gradient(120deg,#586c48ef,#293e31f2)}
#auras .au-row:focus-visible{outline:3px solid #ffe18a;outline-offset:2px}
#auras .au-row-art{display:flex;align-items:center;justify-content:center;flex:0 0 58px;width:58px;height:58px}
#auras .au-row-content{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
#auras .au-row-head{display:flex;justify-content:space-between;align-items:baseline;gap:6px;font-size:12px}
#auras .au-row-head strong{font-size:13px;overflow-wrap:anywhere}
#auras .au-row-head>span{white-space:nowrap}
#auras .au-row-meta,#auras .au-row-stats{font-size:11px;color:#d0d9ca}
#auras .au-row-abilities{font-size:12px;font-weight:700;line-height:1.35;color:#ffdc83;overflow-wrap:anywhere}
@media(max-width:350px){#auras .au-row-art{flex-basis:49px;width:49px}#auras .au-row-art .mount-art{transform:scale(.86)}#auras .au-filters{gap:4px}#auras .au-filters select{font-size:10px}}

/* Skills inventory controls use the same compact layout as Mount filters. */
#skills .sk-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:6px 0 5px}
#skills .sk-filters label{display:flex;flex-direction:column;gap:3px;color:var(--sub);font-size:10px;font-weight:700}
#skills .sk-filters select{width:100%;min-width:0;min-height:38px;padding:5px 3px;border:1px solid var(--line);border-radius:7px;background:var(--panel);color:var(--text);font:inherit;font-size:11px}
#skills .sk-list-count{color:var(--sub);font-size:11px;text-align:right;margin:4px 2px}
@media(max-width:350px){#skills .sk-filters{gap:4px}#skills .sk-filters select{font-size:10px}}
