/* ==========================================================================
   Componenti condivisi: icone, bottoni, header, dialog, toast, lobby, profilo.
   Tutti i colori arrivano dai token di base.css → funzionano in entrambi i temi.
   ========================================================================== */

.icon { width: 20px; height: 20px; flex: none; }
.icon--xs { width: 14px; height: 14px; }

/* --- Bottoni ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background-color .2s;
}
.btn:hover { background: var(--surface-2); box-shadow: var(--glow-sm); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }

.btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  box-shadow: var(--glow-sm);
}
.btn--primary:hover { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: var(--glow); }

.btn--danger { border-color: rgba(255, 92, 122, .6); color: var(--danger); }
.btn--danger:hover { background: rgba(255, 92, 122, .1); box-shadow: 0 0 12px rgba(255, 92, 122, .35); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: color .2s, border-color .2s, box-shadow .2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--border-strong); box-shadow: var(--glow-sm); }
.icon-btn[aria-pressed="true"] { color: var(--accent); }

/* --- Header -------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-total);
  padding-top: var(--safe-top);
  border-bottom: 1px solid var(--border);
  background: rgba(4, 6, 10, .72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
/* Linea luminosa sotto l'header */
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  opacity: .7;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.brand__mark {
  width: 28px;
  height: 28px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  transform: rotate(45deg);
  box-shadow: var(--glow-sm), inset 0 0 8px rgba(var(--accent-rgb), .5);
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(var(--accent-rgb), .6);
}

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  font-weight: 500;
  text-decoration: none;
  transition: color .2s, background-color .2s;
}
.main-nav a:hover { color: var(--text); background: var(--surface); }
.main-nav a[aria-current="page"] { color: var(--accent); background: rgba(var(--accent-rgb), .08); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Bottoni bonus / codice */
.hbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s, border-color .2s, box-shadow .2s;
}
.hbtn:hover { border-color: var(--border-strong); color: var(--text); }
.hbtn__timer:empty { display: none; }
.hbtn.is-ready {
  border-color: rgba(var(--gold-rgb), .7);
  color: var(--gold);
  box-shadow: 0 0 12px rgba(var(--gold-rgb), .3);
  animation: pulse-gold 2.2s ease-in-out infinite;
}

@keyframes pulse-gold {
  50% { box-shadow: 0 0 20px rgba(var(--gold-rgb), .55); }
}

/* Saldo */
.balance {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(var(--accent-rgb), .06);
  box-shadow: inset 0 0 12px rgba(var(--accent-rgb), .12);
}
.balance__icon { color: var(--gold); }
.balance__value {
  min-width: 5ch;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: right;
}
.balance.is-up .balance__value { animation: flash-up .9s var(--ease); }
.balance.is-down .balance__value { animation: flash-down .6s var(--ease); }
@keyframes flash-up { 0%, 40% { color: var(--win); text-shadow: 0 0 10px rgba(var(--win-rgb), .8); } }
@keyframes flash-down { 0%, 30% { color: var(--danger); } }

/* --- Dialog -------------------------------------------------------------- */
.dialog {
  width: min(440px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  color: var(--text);
  box-shadow: var(--glow), 0 30px 80px rgba(0, 0, 0, .6);
}
.dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(4px); }
.dialog[open] { animation: pop-in .25s var(--ease); }
.fx-canvas { position: fixed; inset: 0; z-index: 150; width: 100%; height: 100%; pointer-events: none; }
.dialog__body { padding: 20px 22px 24px; }
.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.dialog__head h2 { margin: 0; font-size: 1.1rem; }

@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }

.field {
  margin: 0;
  padding: 16px 0 0;
  border: 0;
}
.field + .field { margin-top: 12px; border-top: 1px solid var(--border); }
.field legend {
  float: left;
  width: 100%;
  margin-bottom: 10px;
  color: var(--text-dim);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.field legend + * { clear: both; }
.field__hint { margin: 0 0 12px; color: var(--text-dim); font-size: .875rem; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
}
.segmented input:checked + span { border-color: var(--accent); box-shadow: var(--glow-sm); color: var(--accent); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

.swatch { width: 14px; height: 14px; border-radius: 50%; }
.swatch--cyan { background: #00e5ff; box-shadow: 0 0 8px #00e5ff; }
.swatch--purple { background: #c07bff; box-shadow: 0 0 8px #c07bff; }

.switch, .range {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
}
.range span { min-width: 64px; }
.range input { flex: 1; }
.switch input, .range input { accent-color: var(--accent); }
.switch input { width: 20px; height: 20px; }

/* Campo testo (riscatto codici) */
.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(0, 0, 0, .35);
  color: var(--text);
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
  font-size: .85rem;
  resize: vertical;
  word-break: break-all;
}
.input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: var(--glow-sm); }
.form-msg { min-height: 1.5em; margin: 10px 0 0; font-size: .9rem; }
.form-msg.is-error { color: var(--danger); }
.form-msg.is-ok { color: var(--win); }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* --- Toast --------------------------------------------------------------- */
.toasts {
  position: fixed;
  top: calc(var(--header-total) + 12px);
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(340px, calc(100% - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: rgba(8, 14, 22, .92);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  font-size: .9rem;
  pointer-events: auto;
  cursor: pointer;
  animation: toast-in .3s var(--ease);
}
.toast.is-leaving { animation: toast-out .25s var(--ease) forwards; }
.toast__title { font-weight: 700; }
.toast--win { border-color: rgba(var(--win-rgb), .6); }
.toast--win .toast__title { color: var(--win); }
.toast--jackpot, .toast--achievement { border-color: rgba(var(--gold-rgb), .7); box-shadow: 0 0 20px rgba(var(--gold-rgb), .25); }
.toast--jackpot .toast__title, .toast--achievement .toast__title { color: var(--gold); }
.toast--error { border-color: rgba(255, 92, 122, .7); }
.toast--error .toast__title { color: var(--danger); }

@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* --- Titoli e badge ------------------------------------------------------ */
.page-title { font-size: clamp(1.5rem, 4vw, 2rem); }
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 40px 0 16px;
  font-size: .85rem;
  color: var(--text-dim);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.glow-text { color: var(--accent); text-shadow: 0 0 18px rgba(var(--accent-rgb), .7); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge--soon { border-color: var(--border); color: var(--text-dim); }
.badge--original { border-color: rgba(var(--accent-2-rgb), .7); color: var(--accent-2); }

/* --- Lobby --------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 24px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 240px at 0% 0%, rgba(var(--accent-rgb), .12), transparent 70%),
    var(--surface);
}
.hero__title { font-size: clamp(1.6rem, 4.5vw, 2.6rem); margin-bottom: 12px; }
.hero__lead { margin: 0; max-width: 46ch; color: var(--text-dim); }

.jackpot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 24px 16px;
  border: 1px solid rgba(var(--gold-rgb), .5);
  border-radius: var(--radius);
  background: radial-gradient(circle at 50% 0%, rgba(var(--gold-rgb), .16), transparent 70%), rgba(0, 0, 0, .3);
  box-shadow: 0 0 24px rgba(var(--gold-rgb), .15), inset 0 0 24px rgba(var(--gold-rgb), .08);
  text-align: center;
}
.jackpot__label { color: var(--gold); font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.jackpot__value {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(var(--gold-rgb), .6);
}
.jackpot__hint { color: var(--text-dim); font-size: .8rem; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  height: 100%;
  min-height: 190px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--surface-2), var(--surface) 60%);
  color: var(--text);
  text-decoration: none;
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
/* Riflesso che attraversa la card all'hover */
.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(var(--accent-rgb), .12) 50%, transparent 65%);
  transform: translateX(-100%);
  transition: transform .7s var(--ease);
  pointer-events: none;
}
a.game-card:hover, a.game-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--glow);
}
a.game-card:hover::before, a.game-card:focus-visible::before { transform: translateX(100%); }

.game-card__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(var(--accent-rgb), .08);
  color: var(--accent);
  box-shadow: inset 0 0 14px rgba(var(--accent-rgb), .15);
}
.game-card__icon .icon { width: 28px; height: 28px; }
.game-card__text { display: flex; flex-direction: column; gap: 2px; }
.game-card__name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; letter-spacing: .04em; }
.game-card__tag { color: var(--text-dim); font-size: .875rem; }
.game-card__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.game-card__limits { color: var(--text-dim); font-size: .8rem; white-space: nowrap; }
.game-card__limits::before { content: "Puntata "; }

.game-card.is-locked { cursor: not-allowed; }
.game-card.is-locked .game-card__icon { filter: grayscale(.6); opacity: .6; }
.game-card.is-locked .game-card__name { color: var(--text-dim); }

/* --- Profilo ------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.stat-tile__label { color: var(--text-dim); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.stat-tile__value { font-size: 1.4rem; font-weight: 700; }
.stat-tile--accent { border-color: var(--border-strong); box-shadow: inset 0 0 18px rgba(var(--accent-rgb), .1); }
.stat-tile--accent .stat-tile__value { color: var(--accent); }
.pos .stat-tile__value, td.pos { color: var(--win); }
.neg .stat-tile__value, td.neg { color: var(--danger); }

.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.stats-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.stats-table th, .stats-table td { padding: 12px 14px; text-align: right; white-space: nowrap; }
.stats-table th:first-child { text-align: left; }
.stats-table thead th { color: var(--text-dim); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.stats-table tbody tr + tr { border-top: 1px solid rgba(255, 255, 255, .05); }
.empty { color: var(--text-dim); }

/* --- Classifica settimanale ------------------------------------------------ */
.lb__reset { margin-top: -8px; }
.lb { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lb__board { padding: 16px 18px 18px; }
.lb__title { margin: 0 0 12px; font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.lb__list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.lb__row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; min-height: 38px; padding: 4px 10px; border-radius: 10px; }
.lb__row:nth-child(odd) { background: rgba(255, 255, 255, .03); }
.lb__row.is-me { background: rgba(var(--accent-rgb), .14); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .55); }
.lb__row.is-me .lb__name { color: var(--accent); }
.lb__rank { color: var(--text-dim); text-align: center; font-size: .85rem; }
.lb__medal { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: .75rem; font-weight: 800; color: #1a1200; }
.lb__medal--1 { background: var(--gold); box-shadow: 0 0 10px rgba(var(--gold-rgb), .7); }
.lb__medal--2 { background: #c9d3de; }
.lb__medal--3 { background: #d08b4f; }
.lb__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb__name small { color: var(--text-dim); font-weight: 400; }
.lb__value { font-weight: 700; }
.lb__mine { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: .85rem; }
.lb__mine b { color: var(--accent); }
@media (max-width: 900px) { .lb { grid-template-columns: 1fr; } }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .main-nav span, .hbtn__label { display: none; }
  .hero { grid-template-columns: 1fr; padding: 24px; }
}

@media (max-width: 560px) {
  /* Telefono: header su una riga (logo, bonus, ruota, saldo); menu, audio e
     impostazioni stanno nella barra in basso (.tabbar). */
  :root { --header-h: 58px; --tabbar-h: 62px; }
  .header-inner { gap: 8px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .brand__name { display: none; }
  .main-nav, .header-actions > .icon-btn { display: none; }
  .header-actions { margin-left: auto; min-width: 0; }
  main { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 32px); }
  .hero { padding: 20px; }
  .game-grid { grid-template-columns: 1fr; }
  .game-card { min-height: 0; grid-template-columns: auto 1fr; grid-template-rows: auto auto; }
  .game-card__meta { grid-column: 1 / -1; }
}

/* ==========================================================================
   Condivisi dai giochi: barra superiore, carte, fiches, tavolo, pulsanti azione
   ========================================================================== */
.game-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 16px; }
.game-bar h1 { margin: 0; font-size: clamp(1.3rem, 4vw, 1.8rem); text-shadow: 0 0 14px rgba(var(--accent-rgb), .45); }
.game-bar__right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.back-link { color: var(--text-dim); font-weight: 600; text-decoration: none; }
.back-link:hover { color: var(--accent); }

/* Puntata con +/− e riquadri numerici (slot, video poker, originali) */
.ht-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; }
.slot-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 24px;
}
.bet-box { display: flex; align-items: center; gap: 10px; }
.bet-box .icon-btn { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.bet-box .icon-btn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.stat { display: flex; flex-direction: column; align-items: center; min-width: 88px; }
.stat small { color: var(--text-dim); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.stat output { font-size: 1.3rem; font-weight: 700; }
.stat--win output { color: var(--win); }


/* Etichette, regole e pannello comandi dei tavoli */
.bj-rules { color: var(--text-dim); font-size: .85rem; margin: 0; }
.bj-label { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.bj-label b { color: var(--text); font-size: 1rem; letter-spacing: 0; }
.pcard.is-old { animation: none; }
.bj-controls { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 18px; }
.bj-total { margin: 0; color: var(--text-dim); }
.bj-total b { color: var(--text); }
.bj-question { margin: 0; text-align: center; }
@media (max-width: 700px) { .bj-rules { display: none; } }

/* Pannello laterale dei giochi originali (Neon Heist, Towers) */
.nh-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.nh-panel { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.nh-next { margin: 0; color: var(--text-dim); text-align: center; }
.nh-next b { color: var(--text); }
.nh-start { width: 100%; max-width: 320px; }
.nh-panel .actions { margin-top: 0; }
@media (max-width: 760px) { .nh-layout { grid-template-columns: 1fr; } }

/* Carte da gioco */
.pcard {
  --w: var(--card-w, 74px);
  position: relative;
  flex: none;
  width: var(--w);
  aspect-ratio: 5 / 7;
  border-radius: calc(var(--w) * .1);
  background: linear-gradient(160deg, #ffffff, #e9eef5);
  color: #111827;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .15);
  font-family: var(--font-ui);
  font-weight: 800;
  user-select: none;
  animation: card-in .3s var(--ease) both;
}
.pcard--red { color: #d4213d; }
.pcard__corner {
  position: absolute;
  top: 6%;
  left: 8%;
  font-size: calc(var(--w) * .2);
  line-height: 1;
  text-align: center;
}
.pcard__corner--br { top: auto; left: auto; bottom: 6%; right: 8%; transform: rotate(180deg); }
.pcard__pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--w) * .46); }
.pcard--back {
  background:
    repeating-linear-gradient(45deg, rgba(var(--accent-rgb), .35) 0 4px, transparent 4px 9px),
    linear-gradient(160deg, var(--bg-2), #020409);
  border: 2px solid var(--border-strong);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45), inset 0 0 12px rgba(var(--accent-rgb), .35);
}
@keyframes card-in { from { opacity: 0; transform: translateY(-18px) rotate(-4deg) scale(.95); } }

.hand { display: flex; min-height: calc(var(--card-w, 74px) * 1.4); }
.hand .pcard + .pcard { margin-left: calc(var(--card-w, 74px) * -.45); }

/* Fiches */
.chip-rack { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.chip, .chip-stack {
  --c: #9db2c7;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--bg-0) 0 52%, transparent 53%),
    repeating-conic-gradient(var(--c) 0 20deg, #fff 20deg 30deg);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .5), 0 0 0 2px var(--c) inset;
}
.chip { cursor: pointer; transition: transform .15s var(--ease), box-shadow .2s; }
.chip:hover { transform: translateY(-3px); }
.chip.is-selected { transform: translateY(-5px); box-shadow: 0 0 0 3px var(--bg-0), 0 0 0 5px var(--accent), 0 0 18px rgba(var(--accent-rgb), .7); }
.chip span, .chip-stack span { position: relative; }
.chip--0_1 { --c: #8fa3b8; }
.chip--0_5 { --c: #ff5c7a; }
.chip--1 { --c: #00b8d4; }
.chip--2 { --c: #3dd68c; }
.chip--5 { --c: #c07bff; }
.chip-stack { width: 44px; height: 44px; font-size: .7rem; animation: pop-in .2s var(--ease); }

/* Tavolo */
.felt {
  position: relative;
  padding: 24px;
  border: 1px solid var(--border-strong);
  border-radius: 28px;
  background:
    radial-gradient(900px 400px at 50% 0%, rgba(var(--accent-rgb), .12), transparent 70%),
    radial-gradient(circle at 50% 120%, rgba(var(--accent-2-rgb), .12), transparent 60%),
    #050b12;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .8), var(--glow-sm);
}
.table-msg { min-height: 1.5em; margin: 12px 0 0; text-align: center; color: var(--text-dim); }
.table-msg.is-win { color: var(--win); font-weight: 600; }
.table-msg.is-lose { color: var(--danger); }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.actions .btn { min-width: 110px; }
.kbd { display: inline-block; margin-left: 6px; padding: 0 5px; border: 1px solid currentColor; border-radius: 4px; font-size: .7em; opacity: .6; }
@media (hover: none) { .kbd { display: none; } }

.bet-spot {
  display: grid;
  place-items: center;
  min-width: 64px;
  min-height: 64px;
  border: 2px dashed var(--border-strong);
  border-radius: 50%;
  background: rgba(var(--accent-rgb), .04);
  color: var(--text-dim);
  font-size: .75rem;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.bet-spot:hover:not(:disabled) { border-color: var(--accent); box-shadow: var(--glow-sm); background: rgba(var(--accent-rgb), .08); }
.bet-spot:disabled { cursor: default; }

.result-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  animation: pop-in .25s var(--ease);
}
.result-badge--win { background: rgba(var(--win-rgb), .15); color: var(--win); box-shadow: 0 0 10px rgba(var(--win-rgb), .35); }
.result-badge--lose { background: rgba(255, 92, 122, .15); color: var(--danger); }
.result-badge--push { background: var(--surface-2); color: var(--text-dim); }
.result-badge--bj { background: rgba(var(--gold-rgb), .18); color: var(--gold); box-shadow: 0 0 10px rgba(var(--gold-rgb), .4); }

@media (max-width: 560px) {
  .felt { padding: 14px 10px; border-radius: 20px; }
  .chip { width: 46px; height: 46px; }
  .actions .btn { min-width: 0; flex: 1 1 40%; }
}

/* --- Achievement (profilo) ------------------------------------------------ */
.ach-progress { height: 8px; margin: -4px 0 16px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ach-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--gold)); box-shadow: var(--glow-sm); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.ach {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-dim);
}
.ach__icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); }
.ach__text { display: flex; flex-direction: column; gap: 2px; font-size: .875rem; }
.ach__text b { color: var(--text); font-size: .95rem; }
.ach__text small { color: var(--gold); font-size: .75rem; }
.ach.is-unlocked { border-color: rgba(var(--gold-rgb), .55); box-shadow: 0 0 16px rgba(var(--gold-rgb), .12); color: var(--text); }
.ach.is-unlocked .ach__icon { background: rgba(var(--gold-rgb), .15); color: var(--gold); font-size: 1.2rem; text-shadow: 0 0 10px rgba(var(--gold-rgb), .8); }

/* --- Account: header, pagine di accesso, profilo, ruota -------------------- */
.btn--sm { min-height: 40px; padding: 0 16px; font-size: .9rem; text-decoration: none; }
.btn--sm .icon { width: 18px; height: 18px; }
a.btn, a.hbtn { text-decoration: none; }
.header-account { display: flex; align-items: center; gap: 8px; }
a.balance { color: inherit; text-decoration: none; }
a.balance:hover { box-shadow: var(--glow-sm), inset 0 0 12px rgba(var(--accent-rgb), .12); }
.hbtn--wheel.is-ready { border-color: rgba(var(--accent-rgb), .8); color: var(--accent); box-shadow: var(--glow-sm); animation: pulse-accent 1.8s ease-in-out infinite; }
@keyframes pulse-accent { 50% { box-shadow: 0 0 18px rgba(var(--accent-rgb), .6); } }

.auth { display: grid; place-items: center; padding: 16px 0 32px; }
.auth__card { width: min(440px, 100%); padding: 28px; }
.auth__lead { margin: 0 0 16px; color: var(--text-dim); }
.auth__demo { margin: 0 0 16px; padding: 10px 12px; border: 1px dashed rgba(var(--gold-rgb), .6); border-radius: 12px; color: var(--gold); font-size: .85rem; }
.auth__form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.auth-field .input { font-family: var(--font-ui); font-size: 1rem; }
.auth-field small { color: var(--text-dim); font-weight: 400; font-size: .78rem; }
.auth-check { align-items: flex-start; font-size: .85rem; color: var(--text-dim); }
.auth-check input { flex: none; margin-top: 2px; }
.auth__submit { width: 100%; }
.auth__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 18px 0 0; font-size: .9rem; }

.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.hero__cta .auth__demo { flex-basis: 100%; margin: 4px 0 0; }
.hero__hello { margin: 0; color: var(--text-dim); }
.hero__hello b { color: var(--accent); }

.profile-user { color: var(--accent); font-size: .7em; letter-spacing: .02em; }
.bonus-card { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px 28px; align-items: center; margin-bottom: 8px; }
.bonus-card__tier { margin: 0 0 6px; font-size: 1.6rem; color: var(--gold); text-shadow: 0 0 14px rgba(var(--gold-rgb), .5); }
.bonus-card__hint { margin: 0; color: var(--text-dim); }
.bonus-card__label { display: block; margin-bottom: 10px; font-size: .9rem; color: var(--text-dim); }
.bonus-card__label b { color: var(--text); }
.bonus-card .ach-progress { margin: 0 0 12px; }
.tier-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: .85rem; color: var(--text-dim); }
.tier-list li { padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; }
.tier-list li.is-on { border-color: rgba(var(--gold-rgb), .7); color: var(--text); box-shadow: 0 0 12px rgba(var(--gold-rgb), .15); }
.tier-list b { color: var(--text); }

.settings-row { display: flex; flex-wrap: wrap; gap: 10px; }

.bw-dialog { width: min(420px, calc(100% - 32px)); }
.bw-box { display: grid; place-items: center; padding: 8px 0; }
.bw-wheel { width: min(300px, 100%); filter: drop-shadow(0 0 18px rgba(var(--accent-rgb), .4)); }
.bw-spin { transform-box: fill-box; transform-origin: center; }

@media (max-width: 900px) {
  .bonus-card { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .header-account { gap: 6px; }
  .hbtn[data-action="redeem"] { display: none; }   /* il saldo apre già il portafoglio */
  .btn--sm span { display: none; }
  .auth__card { padding: 20px 16px; }
}

/* --- Barra di navigazione in basso (solo telefono) ------------------------- */
.tabbar { display: none; }
@media (max-width: 560px) {
  .tabbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 50;
    display: flex;
    padding: 0 env(safe-area-inset-right) var(--safe-bottom) env(safe-area-inset-left);
    border-top: 1px solid var(--border);
    background: rgba(4, 6, 10, .88);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
  }
  .tabbar__item {
    flex: 1 1 0;
    min-width: 0;
    height: var(--tabbar-h);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0 1px;
    border: 0;
    background: none;
    color: var(--text-dim);
    font: inherit;
    font-size: .66rem;
    font-weight: 500;
    letter-spacing: -.01em;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar__item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar__item .icon { width: 22px; height: 22px; }
  .tabbar:has(> :nth-child(6)) .tabbar__item { font-size: .6rem; letter-spacing: -.02em; }   /* 6 voci (gestore) */
  .tabbar__item[aria-current="page"] { color: var(--accent); }
  .tabbar__item[aria-current="page"] .icon { filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), .7)); }
  .toasts { top: auto; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 10px); right: 12px; width: calc(100% - 24px); }
}

/* --- Portafoglio (saldo cliccabile, riscatta / preleva) --------------------- */
button.balance { font: inherit; color: inherit; cursor: pointer; }
button.balance:hover { box-shadow: var(--glow-sm), inset 0 0 12px rgba(var(--accent-rgb), .12); }
.wallet { width: min(520px, calc(100% - 32px)); }
.wallet__balance { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 4px 0 16px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(var(--accent-rgb), .05); }
.wallet__balance span { color: var(--text-dim); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.wallet__balance strong { font-size: 2rem; color: var(--gold); text-shadow: 0 0 14px rgba(var(--gold-rgb), .45); }
.wallet__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; }
.wallet__tabs button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border: 0; border-radius: 9px; background: none; color: var(--text-dim); font-weight: 600; cursor: pointer; }
.wallet__tabs button .icon { width: 18px; height: 18px; }
.wallet__tabs button[aria-selected="true"] { background: rgba(var(--accent-rgb), .14); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .5); }
.wallet__code-input { width: 100%; font-size: 1.1rem; letter-spacing: .08em; text-transform: uppercase; }
.wallet__amount { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wallet__amount .input { flex: 1 1 120px; min-width: 0; font-size: 1.1rem; }
.wallet__quick { display: flex; flex-wrap: wrap; gap: 6px; }
.wallet__quick .btn { padding: 0 12px; }
.wallet__result { margin-top: 14px; padding: 14px; border: 1px dashed rgba(var(--gold-rgb), .7); border-radius: var(--radius); background: rgba(var(--gold-rgb), .05); text-align: center; }
.wallet__result .settings-row { justify-content: center; margin: 8px 0; }
.wallet__result-title { margin: 0; color: var(--text-dim); }
.wallet__big-code { margin: 6px 0; font-size: clamp(1.2rem, 5.5vw, 1.6rem); font-weight: 800; letter-spacing: .08em; color: var(--gold); word-break: break-all; user-select: all; }
.wallet__subtitle { margin: 18px 0 8px; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.wallet__list { display: grid; gap: 6px; max-height: 240px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.wallet__item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: .88rem; }
.wallet__item-code { font-weight: 700; letter-spacing: .04em; }
.wallet__item-amt { text-align: right; font-weight: 700; }
.wallet__item-status { color: var(--text-dim); font-size: .8rem; }
.wallet__item-actions { display: flex; gap: 6px; justify-content: flex-end; }
.wallet__item.is-open { border-color: rgba(var(--gold-rgb), .55); }
.wallet__item.is-open .wallet__item-amt { color: var(--gold); }
.wallet__item.is-off { opacity: .65; }
.wallet__bonus { margin-top: 2px; color: var(--text-dim); font-size: .78rem; text-align: center; }
.wallet__support { display: flex; width: fit-content; margin: 16px auto 0; }
.wallet__note { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: .78rem; text-align: center; }

/* --- Footer ---------------------------------------------------------------- */
.site-footer { max-width: 1200px; margin: 0 auto; padding: 0 16px 32px; color: var(--text-dim); font-size: .8rem; text-align: center; }
.site-footer p { margin: 0; padding-top: 16px; border-top: 1px solid var(--border); }
.site-footer strong { color: var(--text); font-weight: 600; }
@media (max-width: 560px) { .site-footer { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px); } }   /* sopra la .tabbar */

/* --- Pagina gestore ---------------------------------------------------------- */
.admin__totals .stat-tile__value { font-size: 1.3rem; }
.admin__sub { color: var(--text-dim); font-size: .75rem; }
.admin__create { margin: 20px 0; padding: 4px 20px 20px; }
.admin__form, .admin__filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.admin__form .auth-field, .admin__filters .auth-field { flex: 1 1 120px; min-width: 0; }
.admin__form .admin__note, .admin__filters .admin__search { flex: 3 1 200px; }
.admin__filters { margin-bottom: 4px; }
.admin__tools { flex: 0 0 auto; }
.danger-zone { margin: 32px 0 8px; padding: 16px 20px 18px; border: 1px solid rgba(255, 92, 122, .55); border-radius: var(--radius); background: rgba(255, 92, 122, .05); }
.danger-zone .section-title { margin-top: 0; color: var(--danger); }
.danger-zone p { margin: 0 0 8px; }
.danger-zone__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 12px; }
.danger-zone__form .auth-field { flex: 1 1 220px; }
.admin__created { margin-top: 14px; padding: 12px 14px; border: 1px dashed rgba(var(--gold-rgb), .7); border-radius: var(--radius); }
.admin__created p { margin: 0 0 8px; }
.admin__codes { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; padding: 0; list-style: none; }
.admin__codes li { display: flex; align-items: center; gap: 4px; font-weight: 700; color: var(--gold); }
.admin__table th, .admin__table td { padding: 8px 10px; text-align: left; font-size: .85rem; }
.admin__table td.num { text-align: right; }
.admin__code { font-weight: 700; letter-spacing: .03em; }
.admin__status { display: inline-block; padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: .75rem; }
.admin__table tr.is-open .admin__status { border-color: rgba(var(--gold-rgb), .7); color: var(--gold); }
.admin__table tr.is-done .admin__status { border-color: rgba(var(--win-rgb), .6); color: var(--win); }
.admin__table tr.is-off { color: var(--text-dim); }
.admin__note-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.admin__actions { display: flex; gap: 6px; justify-content: flex-end; }
.admin__actions .btn { min-height: 34px; padding: 0 10px; }
.admin__choice { display: grid; gap: 8px; margin-bottom: 12px; padding-top: 4px; }
.admin__choice .auth-check { display: flex; gap: 8px; }
@media (max-width: 560px) {
  .wallet__tabs button { font-size: .85rem; }
  .admin__create { padding: 4px 14px 14px; }
}

/* --- Missioni di oggi ---------------------------------------------------------- */
.missions { margin: 0 0 24px; padding: 16px 20px 18px; }
.missions__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.missions__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1rem; letter-spacing: .08em; }
.missions__title .icon { color: var(--gold); }
.missions__count { padding: 2px 10px; border: 1px solid var(--border-strong); border-radius: 999px; font-weight: 700; font-size: .85rem; }
.missions__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.mission { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; font-size: .88rem; }
.mission .ach-progress { grid-column: 1 / -1; margin: 0; }
.mission__num { color: var(--text-dim); font-size: .8rem; }
.mission.is-done { border-color: rgba(var(--win-rgb), .6); }
.mission.is-done .mission__label { color: var(--win); }
.missions__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.missions__hint { margin: 0; color: var(--text-dim); font-size: .85rem; }
.missions__hint b { color: var(--gold); font-weight: 600; }
@media (max-width: 760px) {
  .missions__list { grid-template-columns: 1fr; }
  .missions { padding: 14px; }
}

/* --- Invita un amico ------------------------------------------------------------ */
.invite { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px 24px; margin: 0 0 24px; padding: 16px 20px 18px; }
.invite__main .missions__hint { margin: 8px 0 12px; }
.invite__code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.invite__label { width: 100%; color: var(--text-dim); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.invite__code strong { margin-right: 6px; font-size: 1.5rem; letter-spacing: .08em; color: var(--gold); text-shadow: 0 0 12px rgba(var(--gold-rgb), .45); user-select: all; }
.invite__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-self: center; }
.invite__stats div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border: 1px solid var(--border); border-radius: 12px; text-align: center; }
.invite__stats span { font-size: 1.3rem; font-weight: 700; }
.invite__stats small { color: var(--text-dim); font-size: .72rem; }
.invite__list { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 0; padding: 0; list-style: none; }
.invite__list li { display: flex; gap: 10px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: .82rem; }
.invite__list .pos { color: var(--win); }
@media (max-width: 760px) { .invite { grid-template-columns: 1fr; padding: 14px; } }

/* --- Account sospeso ------------------------------------------------------------- */
.blocked-banner { position: fixed; top: var(--header-total); left: 0; right: 0; z-index: 40; padding: 10px 16px; background: rgba(255, 92, 122, .95); color: #1a0008; font-weight: 700; font-size: .9rem; text-align: center; }

/* --- Gestore: schede, grafici, utenti ------------------------------------------- */
.admin-tabs { display: flex; gap: 6px; margin: -6px 0 18px; padding: 4px; width: fit-content; max-width: 100%; border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
.admin-tabs a { padding: 8px 16px; border-radius: 9px; color: var(--text-dim); font-weight: 600; text-decoration: none; white-space: nowrap; }
.admin-tabs a:hover { color: var(--text); }
.admin-tabs a[aria-current="page"] { background: rgba(var(--accent-rgb), .14); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .5); }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card { margin: 0; padding: 14px 16px 10px; }
.chart-card figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-bottom: 6px; }
.chart-card__title { font-weight: 600; }
.chart-legend { display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: .8rem; }
.chart-key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; vertical-align: middle; }
.chart-key--line1 { background: var(--chart-1); }
.chart-key--line2 { background: var(--chart-2); margin-left: 8px; }
.chart-key--bar { height: 8px; width: 8px; border-radius: 2px; background: var(--chart-1); }
.chart-wrap { position: relative; }
.chart { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart__grid { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.chart__tick { fill: var(--text-dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart__label { fill: var(--text-dim); font-size: 11px; font-weight: 600; }
.chart__line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__line--1 { stroke: var(--chart-1); }
.chart__line--2 { stroke: var(--chart-2); }
.chart__cross { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 2 3; }
.chart__dot { stroke: var(--bg-1); stroke-width: 2; }
.chart__dot--1 { fill: var(--chart-1); }
.chart__dot--2 { fill: var(--chart-2); }
.chart__bar { fill: var(--chart-1); }
.chart__bar-hit.is-hover .chart__bar { fill: var(--accent); }
.chart-tip { position: absolute; z-index: 2; min-width: 120px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-2); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); pointer-events: none; font-size: .8rem; }
.chart-tip__title { margin-bottom: 4px; color: var(--text-dim); }
.chart-tip__row { display: flex; align-items: center; gap: 6px; }
.chart-tip__row b { font-variant-numeric: tabular-nums; }
.chart-tip__row span:last-child { color: var(--text-dim); }
.chart-table { margin: 12px 0 0; }
.chart-table summary { cursor: pointer; color: var(--text-dim); font-size: .85rem; }
.chart-table .table-wrap { max-height: 320px; margin-top: 8px; overflow-y: auto; }

.admin__user { cursor: pointer; }
.admin__user:hover, .admin__user:focus-visible { background: rgba(var(--accent-rgb), .07); }
.admin__status--yes { border-color: rgba(var(--win-rgb), .6); color: var(--win); }
.admin__status--blocked { border-color: rgba(255, 92, 122, .7); color: var(--danger); }
.admin-user { width: min(640px, calc(100% - 32px)); }
.admin-user .dialog__head h2 { display: flex; align-items: center; gap: 10px; }
.admin-user__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.admin-user__grid div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.admin-user__grid small { color: var(--text-dim); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.admin-user__grid b.pos { color: var(--win); }
.admin-user__grid b.neg { color: var(--danger); }
.admin-user__moves { display: grid; gap: 2px; max-height: 260px; margin: 0; padding: 0; overflow-y: auto; list-style: none; font-size: .82rem; }
.admin-user__moves li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; padding: 5px 8px; border-radius: 8px; }
.admin-user__moves li:nth-child(odd) { background: rgba(255, 255, 255, .03); }
.admin-user__moves .pos { color: var(--win); }
.admin-user__moves .neg { color: var(--danger); }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .admin-user__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- Termini e regole ------------------------------------------------------------ */
.terms { max-width: 860px; margin: 0 auto; padding: 24px 28px 32px; line-height: 1.6; }
.terms p, .terms li { color: var(--text-dim); }
.terms b { color: var(--text); }
.terms__toc { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 4px 0 8px; font-size: .9rem; }
.terms__list { display: grid; gap: 8px; padding-left: 20px; }
.terms section { scroll-margin-top: calc(var(--header-total) + 16px); }
.site-footer__legal { margin-top: 6px !important; padding-top: 0 !important; border-top: 0 !important; }
.site-footer__legal a { color: var(--text-dim); }
@media (max-width: 560px) { .terms { padding: 18px 16px 24px; } }
