* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #060a14;            /* spazio profondo */
  --panel: #0d1526;         /* pannelli scuri */
  --panel-edge: #1c2c4a;
  --felt: #14406b;          /* tavolo olografico */
  --felt-dark: #0a2240;
  --rail: #232f4a;          /* bordo metallico */
  --neon: #19d3ff;          /* ciano neon */
  --neon-2: #ff2ea6;        /* magenta */
  --bone: #e6f1ff;          /* testo chiaro */
  --gold: #19d3ff;          /* accento principale (ciano) */
  --red-btn: linear-gradient(#0fa3d6, #0a5d99);
  --card-w: 62px;
  --card-h: 92px;
  --font-display: "Orbitron", "Segoe UI", sans-serif;
}

html { height: 100%; }

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(25,211,255,.08), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(255,46,166,.06), transparent 50%),
    var(--bg);
  color: var(--bone);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

button, input, select { touch-action: manipulation; }

.hidden { display: none !important; }

.screen {
  max-width: 1000px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(12px + env(safe-area-inset-bottom));
}

h1 {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--neon);
  text-shadow: 0 0 18px rgba(25,211,255,.6);
  font-size: clamp(1.7rem, 6vw, 2.8rem);
  margin: 14px 0 2px;
  letter-spacing: .06em;
}
.h1-sub {
  display: block;
  font-size: .4em;
  color: var(--neon-2);
  letter-spacing: .3em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(255,46,166,.6);
}

h2 { font-family: var(--font-display); font-weight: 500; letter-spacing: .04em; }

/* ===== Home ===== */
.story-box {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-left: 3px solid var(--neon-2);
  border-radius: 10px;
  padding: 14px 18px;
  max-width: 640px;
  margin: 18px auto;
  line-height: 1.55;
  font-size: .95rem;
}

.profile-box {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  padding: 12px 18px;
  max-width: 640px;
  margin: 0 auto 18px;
}
.profile-badge { font-weight: 700; font-size: 1.05rem; }
.profile-bankroll { color: var(--neon); font-weight: 700; }
.profile-stats { opacity: .8; font-size: .9rem; }

.menu-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  margin: 0 auto 22px;
}
.menu-btn { width: 100%; font-size: 1.05rem; padding: 14px; }

/* ===== Hub (mondi/shop/personalizza) ===== */
.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.bankroll-chip {
  background: var(--panel);
  border: 1px solid var(--neon);
  color: var(--neon);
  border-radius: 16px;
  padding: 5px 14px;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(25,211,255,.25);
}

.banner {
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 14px;
  font-weight: 600;
  text-align: center;
}
.banner-win { background: rgba(25,211,255,.12); border: 1px solid var(--neon); color: var(--neon); }
.banner-loss { background: rgba(255,46,166,.1); border: 1px solid var(--neon-2); color: var(--neon-2); }

#worlds-list { display: flex; flex-direction: column; gap: 12px; }
.world-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 14px 18px;
}
.world-card.locked { opacity: .55; }
.world-icon { font-size: 2.2rem; }
.world-info { flex: 1; }
.world-name { font-family: var(--font-display); font-size: 1.1rem; color: var(--neon); }
.world-desc { font-size: .88rem; opacity: .85; margin: 3px 0; }
.world-meta { font-size: .8rem; color: var(--bone); opacity: .75; }
.world-play { min-width: 120px; }

.fund-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.shop-section { font-family: var(--font-display); font-weight: 500; margin: 14px 0 10px; }
.shop-section .hint { font-family: "Segoe UI", sans-serif; font-size: .75rem; opacity: .6; }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.shop-item {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shop-icon { font-size: 2rem; }
.shop-name { font-weight: 700; }
.shop-desc { font-size: .8rem; opacity: .75; flex: 1; }

.customize-box {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 18px;
  max-width: 560px;
  margin: 0 auto;
}
.cust-preview { text-align: center; font-size: 1.3rem; font-weight: 700; margin-bottom: 14px; }
.cust-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cust-row input {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--panel-edge);
  background: #08101f;
  color: var(--bone);
  font-size: 1rem;
  width: 180px;
}
.pick-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-btn {
  background: #08101f;
  border: 2px solid var(--panel-edge);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--bone);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pick-btn .pick-label { font-size: .75rem; }
.pick-btn.selected { border-color: var(--neon); box-shadow: 0 0 10px rgba(25,211,255,.4); }

.rules-box {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 14px 20px;
  max-width: 640px;
  margin: 0 auto;
}
.rules-box summary { cursor: pointer; font-weight: 600; color: var(--neon); }
.rules-box ul { margin: 10px 0 4px 20px; line-height: 1.5; }

/* ===== Bottoni generici ===== */
.btn {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  background: #1a2a47;
  color: var(--bone);
  border: 1px solid var(--panel-edge);
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.25); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(#19d3ff, #0a7db8);
  color: #02141f;
  border: 1px solid #0a5d99;
  text-shadow: none;
}
.btn-danger {
  background: transparent;
  border: 1px solid var(--neon-2);
  color: var(--neon-2);
}

/* ===== Header partita ===== */
#game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: .95rem;
}
#brand { font-family: var(--font-display); color: var(--neon); font-size: 1rem; }

/* ===== Tavolo ovale ===== */
#table-wrap { position: relative; padding: 8px 0 4px; }

#table-oval {
  position: relative;
  width: min(100%, 820px);
  height: clamp(300px, 48vw, 420px);
  margin: 0 auto;
  border-radius: 50% / 46%;
  background: radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-dark) 78%);
  border: 10px solid var(--rail);
  outline: 2px solid rgba(25,211,255,.5);
  box-shadow:
    inset 0 0 50px rgba(0,0,0,.6),
    0 0 24px rgba(25,211,255,.18),
    0 8px 24px rgba(0,0,0,.7);
}
/* Quando il tavolo ha l'immagine-feltro del livello: niente ovale disegnato,
   solo il render 3:2 a tema. I posti restano sovrapposti ai bordi. */
#table-oval.has-felt {
  width: min(100%, 940px);
  height: auto;
  aspect-ratio: 3 / 2;
  border: none;
  outline: none;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
}
/* Il feltro sta in un livello dietro i posti, con i bordi sfumati nel nero:
   così il tavolo si fonde dolcemente con lo sfondo, senza un contorno netto. */
#table-oval.has-felt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--felt-img);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  /* La sagoma del tavolo arriva dalla maschera alpha generata: angoli davvero
     trasparenti e bordo netto. Se mancasse, si ripiega sulla vecchia sfumatura. */
  --felt-fallback: radial-gradient(ellipse 112% 106% at 50% 50%, #000 70%, transparent 100%);
  -webkit-mask-image: var(--felt-mask, var(--felt-fallback));
  mask-image: var(--felt-mask, var(--felt-fallback));
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  filter: drop-shadow(0 16px 32px rgba(0,0,0,.6));
}
#table-oval.has-felt #table-center { z-index: 1; }

#table-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#pot-display {
  background: rgba(0,0,0,.5);
  color: var(--neon);
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 14px;
  font-size: .95rem;
  border: 1px solid rgba(25,211,255,.4);
}

#center-cards { display: flex; gap: 10px; }
.center-slot { text-align: center; }
.center-slot .pile-info {
  font-size: .7rem;
  margin-top: 3px;
  opacity: .9;
  background: rgba(0,0,0,.4);
  border-radius: 8px;
  padding: 1px 6px;
}

/* ===== Posti dei giocatori ===== */
.seat {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(4,8,16,.85);
  border: 2px solid var(--panel-edge);
  border-radius: 22px;
  padding: 6px 14px;
  min-width: 118px;
  text-align: center;
  font-size: .85rem;
  z-index: 2;
}
.seat.current { border-color: var(--neon); box-shadow: 0 0 14px rgba(25,211,255,.7); }
.seat.folded { opacity: .45; }
.seat .seat-cards { display: flex; gap: 3px; justify-content: center; min-height: 34px; }
.seat .seat-cards .card { width: 23px; height: 33px; border-radius: 4px; padding: 0; }
.seat .seat-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; margin: 0 auto; }
.seat .seat-name .dealer-chip {
  display: inline-block;
  background: var(--bone);
  color: #02141f;
  border-radius: 50%;
  width: 16px; height: 16px;
  line-height: 16px;
  font-size: .65rem;
  font-weight: 800;
  margin-left: 4px;
}
.seat .seat-chips { color: var(--neon); font-weight: 600; }
.seat .seat-status { font-size: .72rem; min-height: 1em; opacity: .9; }

/* Il mio posto: evidenziato, con le carte scoperte e grandi + punteggio */
.seat.me {
  background: rgba(3,9,20,.92);
  border-color: var(--neon);
  box-shadow: 0 0 20px rgba(25,211,255,.45);
  padding: 8px 14px;
  z-index: 4;
}
.seat.me .seat-token { width: 50px; height: 50px; }
.seat.me .seat-cards.big { gap: 5px; min-height: 0; }
.seat.me .seat-cards.big .card {
  width: 48px; height: 70px; border-radius: 7px; padding: 4px 5px;
}
.seat.me .seat-cards.big .card .v { font-size: 1.05rem; }
.seat.me .seat-cards.big .card .s { font-size: 1.3rem; }
.seat .seat-score { margin-top: 4px; font-weight: 700; color: var(--gold); font-size: .82rem; }

/* ===== Badge dell'ultima azione ===== */
.seat-badge {
  display: inline-block; margin-top: 3px;
  font-size: .64rem; font-weight: 800; letter-spacing: .03em;
  padding: 2px 9px; border-radius: 10px;
  background: rgba(255,255,255,.1); color: var(--bone);
  border: 1px solid rgba(255,255,255,.18); white-space: nowrap;
}
.seat-badge.just { animation: badge-pop .3s cubic-bezier(.2,1.6,.4,1); }
@keyframes badge-pop {
  0% { transform: scale(.4); opacity: 0; }
  60% { transform: scale(1.14); }
  100% { transform: scale(1); opacity: 1; }
}
.seat-badge.bet, .seat-badge.raise { background: rgba(46,204,113,.22); border-color: #2ecc71; color: #8affc0; }
.seat-badge.call  { background: rgba(25,211,255,.2);  border-color: var(--neon); color: #bff0ff; }
.seat-badge.knock { background: rgba(160,170,190,.16); border-color: #9aa7bf; color: #e3eaf7; }
.seat-badge.fold  { background: rgba(255,70,70,.16);   border-color: #ff5b5b; color: #ffb4b4; }
.seat-badge.allin { background: rgba(255,196,0,.22);   border-color: #ffd34d; color: #ffe9a8; text-shadow: 0 0 8px rgba(255,211,77,.6); }
.seat-badge.thinking { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); opacity: .85; font-weight: 600; }

/* ===== Anello del timer di turno (attorno all'avatar) ===== */
.turn-ring {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform: rotate(-90deg); pointer-events: none; z-index: 5;
}
.turn-ring .tr-track { fill: none; stroke: rgba(0,0,0,.5); stroke-width: 7; }
.turn-ring .tr-prog {
  fill: none; stroke: var(--neon); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 276.5; stroke-dashoffset: 0;
  animation: tr-deplete linear forwards;
  filter: drop-shadow(0 0 3px var(--neon));
}
@keyframes tr-deplete { to { stroke-dashoffset: 276.5; } }
.turn-ring.me .tr-prog { stroke: #ffd34d; filter: drop-shadow(0 0 4px #ffd34d); }

/* ===== Evidenziazione del vincitore ===== */
.seat.winner { border-color: #ffd34d !important; z-index: 5; animation: seat-win 1.1s ease-in-out infinite; }
@keyframes seat-win {
  0%, 100% { box-shadow: 0 0 10px rgba(255,211,77,.5); }
  50%      { box-shadow: 0 0 28px rgba(255,211,77,.95), 0 0 52px rgba(255,211,77,.45); }
}
.seat.winner .seat-token { border-color: #ffd34d; box-shadow: 0 0 16px rgba(255,211,77,.8); }
.seat.winner::before {
  content: "👑"; position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
  font-size: 1rem; filter: drop-shadow(0 0 6px rgba(255,211,77,.9));
  animation: crown-bob 1.2s ease-in-out infinite;
}
@keyframes crown-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-3px); }
}

/* ===== Pulsante mazziere flottante (scivola fra i posti) ===== */
.dealer-button {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 28%, #ffffff, #d8dee9 58%, #aab2c4);
  color: #0a1020; font-weight: 800; font-size: .78rem;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.6), 0 0 10px rgba(255,255,255,.35);
  z-index: 3;
  transition: left .55s cubic-bezier(.4,.8,.3,1), top .55s cubic-bezier(.4,.8,.3,1);
}

/* ===== Gettoni che volano nel piatto ===== */
.fly-chip {
  position: fixed; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7d0, #ffcf45 45%, #b8860b 100%);
  border: 2px solid rgba(255,243,192,.7);
  box-shadow: 0 0 10px rgba(255,207,69,.8), inset 0 0 4px rgba(0,0,0,.3);
  z-index: 60; pointer-events: none;
  transition: transform .65s cubic-bezier(.4,.55,.3,1), opacity .65s ease-in;
}

/* ===== Carte ===== */
.card {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: var(--card-w);
  height: var(--card-h);
  background: #f2f6fc;
  border-radius: 7px;
  border: 1px solid #6e7f9c;
  padding: 5px;
  color: #16202e;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0,0,0,.6);
  text-align: left;
}
.card .v { font-size: 1.1rem; }
.card .s { font-size: 1.4rem; align-self: flex-end; }
.card.back {
  background: #060a12 url("assets/card-back.png") center / cover no-repeat;
  border-color: #c9a23766;
}
.card.suit-cuori { color: #d6275a; }
.card.suit-quadri { color: #d6275a; }
.card.suit-fiori { color: #16202e; }
.card.suit-picche { color: #16202e; }

.hand { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* Carta appena girata al centro */
@keyframes flip-in {
  0%   { transform: rotateY(90deg) scale(1.2); }
  60%  { transform: rotateY(0deg) scale(1.15); }
  100% { transform: rotateY(0deg) scale(1); }
}
.card.just-revealed {
  animation: flip-in .6s ease-out;
  box-shadow: 0 0 18px rgba(25,211,255,.95);
  border-color: var(--neon);
}

.mini-cards { display: flex; gap: 4px; justify-content: center; margin-top: 6px; }
.mini-cards .card { width: 36px; height: 52px; padding: 3px; border-radius: 5px; }
.mini-cards .card .v { font-size: .78rem; }
.mini-cards .card .s { font-size: .85rem; }

/* ===== Barra inferiore ===== */
/* Dock dei comandi: compatto, flotta nell'angolo in basso a destra del tavolo,
   senza coprire le carte centrali né gli altri giocatori. */
#actions-area {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(320px, 42%);
  background: linear-gradient(180deg, rgba(12,18,34,.92), rgba(6,10,20,.95));
  border: 1px solid rgba(120,170,255,.32);
  border-radius: 14px;
  padding: 10px 11px;
  box-shadow: 0 12px 30px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(3px);
}

#bet-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
/* Comandi compatti dentro al dock */
#actions-area .btn-mini { padding: 7px 9px; font-size: .7rem; border-radius: 8px; }
#actions-area #bet-amount { width: 70px; padding: 8px 6px; font-size: .9rem; }
#actions-area #bet-slider { min-width: 96px; }
#actions-area .btn-action { min-width: 84px; padding: 11px 8px; font-size: .82rem; letter-spacing: .03em; border-radius: 11px; }
#action-buttons { gap: 8px; }

/* ===== Pulsanti premium (stile sala da gioco) ===== */
.btn-mini {
  background: linear-gradient(180deg, rgba(34,50,84,.95), rgba(16,26,46,.95));
  color: #d4e7ff;
  border: 1px solid rgba(120,170,255,.4);
  border-radius: 10px;
  padding: 9px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .76rem;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
  transition: transform .1s ease, border-color .15s, box-shadow .15s, filter .15s;
}
.btn-mini:hover { transform: translateY(-1px); border-color: var(--neon); box-shadow: 0 0 14px rgba(25,211,255,.45), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-mini:active { transform: translateY(0); filter: brightness(.92); }

#bet-amount {
  width: 92px;
  padding: 9px 8px;
  border-radius: 10px;
  border: 1px solid rgba(120,170,255,.4);
  background: rgba(3,8,18,.85);
  color: #eaf6ff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .98rem;
  text-align: center;
  box-shadow: inset 0 0 10px rgba(0,0,0,.6);
}
#bet-amount:focus { outline: none; border-color: var(--neon); box-shadow: 0 0 12px rgba(25,211,255,.45), inset 0 0 10px rgba(0,0,0,.6); }

/* Slider della puntata, personalizzato */
#bet-slider {
  flex: 1; min-width: 130px; height: 26px;
  -webkit-appearance: none; appearance: none;
  background: transparent; cursor: pointer;
}
#bet-slider::-webkit-slider-runnable-track {
  height: 8px; border-radius: 6px;
  background: linear-gradient(90deg, #0a3a5c, #19d3ff);
  box-shadow: inset 0 0 6px rgba(0,0,0,.6), 0 0 10px rgba(25,211,255,.35);
}
#bet-slider::-moz-range-track {
  height: 8px; border-radius: 6px;
  background: linear-gradient(90deg, #0a3a5c, #19d3ff);
  box-shadow: inset 0 0 6px rgba(0,0,0,.6);
}
#bet-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -7px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ffffff, #19d3ff 55%, #0a6f9c);
  border: 2px solid #d6fbff;
  box-shadow: 0 0 14px rgba(25,211,255,.9), 0 2px 4px rgba(0,0,0,.5);
}
#bet-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ffffff, #19d3ff 55%, #0a6f9c);
  border: 2px solid #d6fbff;
  box-shadow: 0 0 14px rgba(25,211,255,.9), 0 2px 4px rgba(0,0,0,.5);
}

#action-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.btn-action {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 13px;
  padding: 14px 10px;
  min-width: 108px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .98rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #02121c;
  cursor: pointer;
  background: linear-gradient(180deg, #34c8ff, #0a78c8);
  box-shadow:
    0 8px 18px rgba(0,0,0,.5),
    0 0 18px rgba(25,211,255,.35),
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -4px 9px rgba(0,0,0,.28);
  transition: transform .1s ease, box-shadow .16s ease, filter .16s;
}
.btn-action::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 48%;
  background: linear-gradient(180deg, rgba(255,255,255,.4), transparent);
  pointer-events: none;
}
.btn-action:hover { transform: translateY(-2px); filter: brightness(1.07); }
.btn-action:active { transform: translateY(0); filter: brightness(.94); }
.btn-action:disabled {
  opacity: .42; filter: grayscale(.35); cursor: not-allowed; transform: none;
  box-shadow: 0 3px 8px rgba(0,0,0,.4);
}
/* Codice colore delle azioni (come nelle sale vere) */
#btn-call    { background: linear-gradient(180deg, #34c8ff, #0a78c8); box-shadow: 0 8px 18px rgba(0,0,0,.5), 0 0 18px rgba(25,211,255,.4), inset 0 1px 0 rgba(255,255,255,.55), inset 0 -4px 9px rgba(0,0,0,.28); }
#btn-betraise{ background: linear-gradient(180deg, #4fe6a6, #109a64); box-shadow: 0 8px 18px rgba(0,0,0,.5), 0 0 18px rgba(57,217,138,.45), inset 0 1px 0 rgba(255,255,255,.55), inset 0 -4px 9px rgba(0,0,0,.28); color: #02160f; }
#btn-knock   { background: linear-gradient(180deg, #7b8db0, #3c4c6e); color: #f2f7ff; box-shadow: 0 8px 18px rgba(0,0,0,.5), 0 0 14px rgba(120,150,200,.35), inset 0 1px 0 rgba(255,255,255,.4), inset 0 -4px 9px rgba(0,0,0,.28); }
.btn-action.btn-red, #btn-fold {
  background: linear-gradient(180deg, #ff5c86, #c0144f);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,.5), 0 0 18px rgba(255,60,110,.45), inset 0 1px 0 rgba(255,255,255,.45), inset 0 -4px 9px rgba(0,0,0,.28);
}

/* ===== Overlay ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,5,12,.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.overlay-box {
  background: var(--panel);
  border: 2px solid var(--neon);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 0 30px rgba(25,211,255,.25);
}
.overlay-box.wide { max-width: 620px; }
.overlay-box h2 { color: var(--neon); margin-bottom: 10px; }
.overlay-box p { margin-bottom: 12px; line-height: 1.4; }

#event-body { margin: 10px 0 16px; }
#event-body .hand { margin: 10px 0; }
#event-body table { margin: 0 auto; border-collapse: collapse; }
#event-body td, #event-body th { padding: 5px 12px; border-bottom: 1px solid rgba(230,241,255,.2); }
.win { color: var(--neon); font-weight: 700; }

/* ===== Splash / loading ===== */
#splash-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.splash-inner { text-align: center; }
@keyframes splash-pulse {
  0%, 100% { text-shadow: 0 0 20px rgba(25,211,255,.8); transform: scale(1); }
  50% { text-shadow: 0 0 50px rgba(25,211,255,1), 0 0 80px rgba(255,46,166,.5); transform: scale(1.06); }
}
.splash-spade {
  font-size: 5rem;
  color: var(--neon);
  animation: splash-pulse 1.6s ease-in-out infinite;
}
.splash-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 10vw, 4.2rem);
  letter-spacing: .25em;
  margin: 8px 0 0;
}
.splash-sub {
  color: var(--neon-2);
  letter-spacing: .4em;
  text-transform: uppercase;
  font-size: .85rem;
  margin: 6px 0 30px;
}
.splash-bar {
  width: min(280px, 70vw);
  height: 6px;
  margin: 0 auto;
  background: #0c1626;
  border: 1px solid var(--panel-edge);
  border-radius: 4px;
  overflow: hidden;
}
@keyframes splash-load { from { width: 0; } to { width: 100%; } }
.splash-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon), var(--neon-2));
  animation: splash-load 2.4s ease-out forwards;
}
.splash-hint { margin-top: 14px; font-size: .75rem; opacity: .45; }

/* ===== Mappa galattica ===== */
#map-box {
  position: relative;
  height: clamp(420px, 64vh, 580px);
  background:
    radial-gradient(1.5px 1.5px at 15% 25%, #fff8, transparent),
    radial-gradient(1px 1px at 45% 70%, #fff6, transparent),
    radial-gradient(2px 2px at 70% 15%, #fff7, transparent),
    radial-gradient(1px 1px at 85% 45%, #fff5, transparent),
    radial-gradient(1.5px 1.5px at 30% 85%, #fff6, transparent),
    radial-gradient(1px 1px at 60% 40%, #fff4, transparent),
    radial-gradient(ellipse at 30% 30%, rgba(25,211,255,.05), transparent 60%),
    radial-gradient(ellipse at 75% 70%, rgba(255,46,166,.05), transparent 60%),
    #04070f;
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  overflow: hidden;
}
#map-route, #map-route svg { position: absolute; inset: 0; width: 100%; height: 100%; }
#map-nodes { position: absolute; inset: 0; }

/* Orbite e rotta di conquista */
.orbit {
  fill: none;
  stroke: rgba(25,211,255,.16);
  stroke-width: .28;
  stroke-dasharray: .9 1.3;
}
@keyframes route-march { to { stroke-dashoffset: -6.4; } }
.route-path {
  fill: none;
  stroke: var(--neon);
  stroke-width: .45;
  stroke-linecap: round;
  stroke-dasharray: 1.6 1.6;
  opacity: .65;
  filter: drop-shadow(0 0 1px #19d3ff);
  animation: route-march 1.6s linear infinite;
}

/* Il sole */
.sun {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}
@keyframes sun-pulse {
  0%, 100% { box-shadow: 0 0 28px #ffd34d, 0 0 70px rgba(255,138,61,.55), 0 0 130px rgba(255,77,46,.3); }
  50% { box-shadow: 0 0 40px #ffe27a, 0 0 100px rgba(255,138,61,.75), 0 0 170px rgba(255,77,46,.45); }
}
@keyframes sun-spin { to { transform: rotate(360deg); } }
.sun-core {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #fff 0%, #ffe27a 30%, #ffb74d 62%, #ff7a2e 100%);
  animation: sun-pulse 3.6s ease-in-out infinite;
}
.sun-rays {
  position: absolute;
  inset: -28px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255,211,77,.14) 0deg 7deg, transparent 7deg 20deg);
  animation: sun-spin 30s linear infinite;
}

/* Stelle e cometa */
@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: .9; } }
.twinkle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  animation: twinkle 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes comet-fly {
  0% { transform: translate(-8vw, -4vh) rotate(24deg); opacity: 0; }
  6% { opacity: 1; }
  16% { transform: translate(60vw, 36vh) rotate(24deg); opacity: 0; }
  100% { transform: translate(60vw, 36vh) rotate(24deg); opacity: 0; }
}
.comet {
  position: absolute;
  top: 8%;
  left: 4%;
  width: 70px;
  height: 2.5px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, rgba(190,240,255,.9));
  animation: comet-fly 13s linear infinite;
  pointer-events: none;
}

/* Pianeti */
@keyframes planet-bob {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-5px); }
}
.planet-node {
  position: absolute;
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  color: var(--bone);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 2;
  animation: planet-bob 5s ease-in-out infinite;
  transition: filter .15s;
}
.planet-node:hover { filter: brightness(1.25); }
.planet-node:hover .art-planet { filter: drop-shadow(0 0 16px rgba(25,211,255,.85)); }
.planet-art { position: relative; display: block; }
.planet-art .art-planet { display: block; margin: 0 auto; filter: drop-shadow(0 0 8px rgba(25,211,255,.3)); }
.planet-node.locked .art-planet .art-planet,
.planet-node.locked .art-planet svg { filter: grayscale(.85) brightness(.55); }
@keyframes frontier-ring {
  0% { box-shadow: 0 0 0 0 rgba(25,211,255,.7); }
  100% { box-shadow: 0 0 0 16px rgba(25,211,255,0); }
}
.planet-node.frontier .planet-art {
  border-radius: 50%;
  animation: frontier-ring 1.8s ease-out infinite;
}
.map-node-name {
  font-family: var(--font-display);
  font-size: .72rem;
  color: var(--neon);
  background: rgba(4,8,16,.7);
  padding: 1px 8px;
  border-radius: 8px;
  white-space: nowrap;
}
.map-ship {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
  animation: hero-hover 3.2s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(25,211,255,.5));
}
.map-hint { text-align: center; font-size: .82rem; opacity: .65; margin-top: 12px; }

/* Zoom sul pianeta */
@keyframes pf-pop {
  0% { transform: scale(.3); opacity: 0; }
  70% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.planet-focus {
  background: var(--panel);
  border: 2px solid var(--neon);
  border-radius: 16px;
  padding: 24px 28px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 0 40px rgba(25,211,255,.3);
  animation: pf-pop .35s ease-out;
}
@keyframes pf-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.pf-art { display: flex; justify-content: center; animation: pf-float 4s ease-in-out infinite; }
.pf-art svg { filter: drop-shadow(0 0 24px rgba(25,211,255,.5)); }
.planet-focus h2 {
  font-family: var(--font-display);
  color: var(--neon);
  margin: 10px 0 6px;
  letter-spacing: .06em;
}
.planet-focus p { margin-bottom: 8px; line-height: 1.45; }
.pf-stats { font-size: .85rem; color: var(--neon); opacity: .9; }
.pf-actions { display: flex; gap: 12px; justify-content: center; margin-top: 14px; }
.pf-actions .btn-play { padding: 10px 26px; font-size: 1rem; }
.pf-actions .btn-play:disabled { opacity: .4; cursor: not-allowed; }

/* ===== Mondo: scena point-and-click ===== */
.world-blurb { text-align: center; opacity: .8; margin-bottom: 14px; font-size: .92rem; }

.world-scene {
  position: relative;
  height: clamp(360px, 56vh, 480px);
  border-radius: 14px;
  border: 1px solid var(--panel-edge);
  overflow: hidden;
}

/* Scena illustrata: l'immagine riempie esattamente il riquadro,
   così gli hotspot in percentuale restano allineati agli edifici */
.world-scene.photo {
  height: auto;
  aspect-ratio: 1536 / 947;
  max-height: 76vh;
  width: min(100%, calc(76vh * 1.622));
  margin: 0 auto;
  background-size: 100% 100%;
  background-position: center;
  border-color: rgba(25,211,255,.35);
  box-shadow: 0 0 30px rgba(25,211,255,.15), 0 12px 30px rgba(0,0,0,.6);
}
/* Ambientazioni per mondo */
.scene-neoterra {
  background:
    radial-gradient(1px 1px at 20% 15%, #fff7, transparent),
    radial-gradient(1.5px 1.5px at 70% 10%, #fff6, transparent),
    linear-gradient(to bottom, #050d22 0%, #0a1f44 45%, #11315c 70%, #0a1830 71%, #08111f 100%);
}
.scene-ferrox {
  background:
    radial-gradient(1px 1px at 30% 12%, #fff5, transparent),
    radial-gradient(ellipse at 50% 100%, rgba(255,110,40,.25), transparent 60%),
    linear-gradient(to bottom, #1a0a08 0%, #3a1410 45%, #592412 70%, #2a100a 71%, #190a06 100%);
}
.scene-aquaris {
  background:
    radial-gradient(ellipse at 30% 0%, rgba(120,230,255,.15), transparent 50%),
    radial-gradient(1.5px 1.5px at 60% 20%, #bff7, transparent),
    linear-gradient(to bottom, #02202e 0%, #054258 45%, #07677e 70%, #03303f 71%, #021c26 100%);
}
.scene-nebula {
  background:
    radial-gradient(ellipse at 25% 20%, rgba(255,46,166,.2), transparent 50%),
    radial-gradient(ellipse at 75% 35%, rgba(140,80,255,.22), transparent 55%),
    radial-gradient(1px 1px at 45% 12%, #fff8, transparent),
    linear-gradient(to bottom, #14062b 0%, #2a0d4e 50%, #3d1668 70%, #1c0a33 71%, #0e051c 100%);
}
.scene-oblivion {
  background:
    radial-gradient(ellipse at 50% 35%, rgba(25,211,255,.1), transparent 40%),
    radial-gradient(ellipse at 50% 35%, #000 20%, transparent 60%),
    linear-gradient(to bottom, #030308 0%, #0a0a18 55%, #11112a 70%, #060610 71%, #030307 100%);
}

.scene-decor {
  position: absolute;
  transform: translate(-50%, -50%);
  opacity: .55;
  pointer-events: none;
  filter: saturate(.8);
}

/* Skyline lontana + palco isometrico */
.scene-skyline { position: absolute; left: 0; right: 0; pointer-events: none; }
.scene-skyline svg { width: 100%; height: 100%; display: block; }
.scene-skyline.far { bottom: 70%; height: 24%; opacity: .5; }
.scene-skyline.near { bottom: 28.5%; height: 44%; }

.iso-stage { position: absolute; inset: 0; pointer-events: none; }
.iso-stage svg { width: 100%; height: 100%; display: block; }

@keyframes marker-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.poi-marker {
  display: block;
  font-size: 1.5rem;
  line-height: 1;
  animation: marker-bounce 1.2s ease-in-out infinite;
  text-shadow: 0 0 10px currentColor;
}

.scene-ship.iso {
  bottom: auto;
  transform: translate(-50%, -86%);
}
.scene-grid {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 29%;
  pointer-events: none;
  background:
    repeating-linear-gradient(to top, rgba(25,211,255,.10) 0 1px, transparent 1px 17px),
    repeating-linear-gradient(90deg, rgba(25,211,255,.05) 0 1px, transparent 1px 54px);
}

/* Traffico aereo */
@keyframes car-ltr { from { left: -16%; } to { left: 106%; } }
@keyframes car-rtl { from { left: 106%; } to { left: -16%; } }
.flying-car {
  position: absolute;
  left: -16%;
  z-index: 1;
  pointer-events: none;
  animation: car-ltr linear infinite;
  filter: drop-shadow(0 0 6px rgba(25,211,255,.35));
}
.flying-car.rev { animation-name: car-rtl; }
.flying-car.rev svg { transform: scaleX(-1); }

/* Passanti lungo la strada (mossi via JS sulla diagonale) */
.walker {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.6));
}

/* Il tuo personaggio nella scena (scala prospettica con la profondità) */
.scene-player {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -94%) scale(var(--psc, 1));
  transform-origin: bottom center;
  pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.65));
}
.scene-player-inner { display: block; }
.scene-player.face-left .scene-player-inner { transform: scaleX(-1); }
@keyframes walk-bob {
  0%, 100% { transform: translateY(0) rotate(-1.6deg); }
  50% { transform: translateY(-4px) rotate(1.6deg); }
}
.scene-player.walking .scene-player-inner svg { animation: walk-bob .34s ease-in-out infinite; }

/* Insegne al neon che tremolano */
@keyframes neon-flicker {
  0%, 88%, 100% { opacity: 1; }
  90% { opacity: .35; }
  92% { opacity: 1; }
  95% { opacity: .55; }
  97% { opacity: 1; }
}
.poi .art-building text { animation: neon-flicker 7s infinite; }
.world-scene { cursor: pointer; }

.poi {
  position: absolute;
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  color: var(--bone);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 2;
  transition: transform .15s;
}
.poi:hover { transform: translate(-50%, -50%) scale(1.12); }
.poi-icon {
  font-size: 2.1rem;
  filter: drop-shadow(0 0 8px rgba(25,211,255,.55)) drop-shadow(0 3px 4px rgba(0,0,0,.7));
}
.poi-label {
  background: rgba(4,8,16,.85);
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.3;
}
.poi-label small { color: var(--neon); }
.poi.locked { opacity: .55; }
.poi.locked .poi-icon { filter: grayscale(.6) drop-shadow(0 3px 4px rgba(0,0,0,.7)); }

/* ===== Grafica SVG (personaggi, edifici, navicella) ===== */
.art { display: block; }

/* ===== Landing (home in stile poker-adventure) ===== */
.home-landing {
  position: relative;
  max-width: none;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff8, transparent),
    radial-gradient(1px 1px at 38% 9%, #fff6, transparent),
    radial-gradient(2px 2px at 64% 22%, #fff7, transparent),
    radial-gradient(1px 1px at 87% 12%, #fff6, transparent),
    radial-gradient(ellipse at 50% 108%, rgba(25,211,255,.28), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(255,46,166,.16), transparent 50%),
    linear-gradient(to bottom, #050a18 0%, #0a1530 45%, #122448 72%, #0a1426 73%, #060b16 100%);
}
.landing-top {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 14px;
  z-index: 5;
}
.landing-logo { text-align: center; padding-top: calc(14px + env(safe-area-inset-top)); position: relative; z-index: 2; }
.landing-logo svg { margin: 0 auto; }

.landing-hero {
  position: absolute;
  left: clamp(4px, 6vw, 90px);
  bottom: 64px;
  z-index: 1;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.7));
}
@keyframes chip-float {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}
.landing-chips { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.floating-chip {
  position: absolute;
  animation: chip-float 4.5s ease-in-out infinite;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.6));
}

.landing-panel {
  position: relative;
  z-index: 3;
  max-width: 350px;
  margin: 18px auto 0;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--neon-2);
  box-shadow: 0 0 30px rgba(255,46,166,.25), 0 12px 30px rgba(0,0,0,.6);
  background: #0d1526;
}
.panel-title {
  background: linear-gradient(#ff4fb5, #b3186f);
  color: #fff;
  font-family: var(--font-display);
  text-align: center;
  font-size: 1rem;
  letter-spacing: .12em;
  padding: 10px;
}
.panel-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
#landing-name {
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--panel-edge);
  background: #08101f;
  color: var(--bone);
  font-size: 1.05rem;
  text-align: center;
}
.panel-sub {
  text-align: center;
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .15em;
  color: var(--neon);
}
.figure-pick { display: flex; gap: 12px; justify-content: center; }
.figure-card {
  width: 92px;
  height: 76px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: #08101f;
  border: 2px solid var(--panel-edge);
  border-radius: 24px;
  cursor: pointer;
  padding-top: 6px;
}
.figure-card.selected {
  background: linear-gradient(#19d3ff33, #0a7db855);
  border-color: var(--neon);
  box-shadow: 0 0 12px rgba(25,211,255,.5);
}
.btn-play {
  background: linear-gradient(#ffe27a, #dfa92e);
  color: #3a2a05;
  border: 1px solid #a87f1c;
  border-radius: 22px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
  letter-spacing: .08em;
  box-shadow: 0 4px 0 #8a6a14, 0 8px 18px rgba(0,0,0,.5);
  transition: transform .08s, box-shadow .08s;
}
.btn-play:hover { filter: brightness(1.08); }
.btn-play:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a6a14; }

.landing-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: 26px;
  background: rgba(4,8,16,.85);
  border-top: 1px solid var(--panel-edge);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.bar-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--bone);
  padding: 4px 10px;
  border-radius: 8px;
  transition: transform .12s, background .12s;
}
.bar-btn:hover { transform: scale(1.15); background: rgba(25,211,255,.12); }

@media (max-width: 640px) {
  .landing-hero { left: -24px; bottom: 56px; opacity: .9; }
  .landing-hero svg { width: 150px; }
  .floating-chip svg { width: 40px; }
  .landing-panel { max-width: 300px; }
}

.hero-ship .art-ship { filter: drop-shadow(0 6px 14px rgba(25,211,255,.25)); }

/* ===== Lobby (scelta del torneo) ===== */
#lobby-screen {
  max-width: 1200px;
  position: relative;
  padding-top: calc(8px + env(safe-area-inset-top));
}
.lobby-skyline {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 180px;
  opacity: .22;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
}
.lobby-skyline svg { width: 100%; height: 100%; }

.lobby-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.player-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(8,14,26,.7);
  border: 1px solid var(--neon);
  border-radius: 12px;
  padding: 8px 14px 8px 8px;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(25,211,255,.2);
  color: var(--bone);
  text-align: left;
}
.player-panel:hover { filter: brightness(1.12); }
.pp-avatar {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #1b2a4d, #0a1326);
  border: 2px solid var(--neon);
  border-radius: 10px;
  flex-shrink: 0;
}
.pp-emoji { font-size: 1.7rem; }
.pp-info { display: flex; flex-direction: column; gap: 2px; min-width: 130px; }
.pp-name { font-weight: 700; font-size: 1rem; }
.pp-level { font-size: .72rem; opacity: .8; }
.pp-bar { height: 6px; background: #0c1626; border-radius: 4px; overflow: hidden; }
.pp-bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--neon), var(--neon-2)); }
.pp-rep { font-size: .72rem; color: #ffd34d; font-weight: 600; }

.lobby-logo { flex: 1; display: flex; justify-content: center; align-items: center; }
.lobby-logo svg { max-width: 100%; }

.lobby-top-right { display: flex; align-items: center; gap: 10px; }
.credits-chip {
  background: rgba(8,14,26,.7);
  border: 1px solid #ffce4d;
  color: #ffd34d;
  border-radius: 16px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(255,206,77,.25);
}
.icon-btn {
  background: rgba(8,14,26,.7);
  border: 1px solid var(--panel-edge);
  color: var(--bone);
  border-radius: 10px;
  width: 42px; height: 42px;
  font-size: 1.3rem;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--neon); }

.lobby-subtitle {
  position: relative;
  z-index: 1;
  text-align: center;
  font-family: var(--font-display);
  letter-spacing: .25em;
  text-transform: uppercase;
  opacity: .75;
  margin: 10px 0 14px;
  font-size: .85rem;
}

/* Griglia dei tavoli */
.tables-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.table-card {
  background: linear-gradient(180deg, rgba(13,21,38,.92), rgba(6,11,22,.95));
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 0 22px rgba(0,0,0,.5);
  transition: transform .12s, box-shadow .12s;
}
.table-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 26px color-mix(in srgb, var(--accent) 60%, transparent), inset 0 0 22px rgba(0,0,0,.5);
}
.table-card.locked { filter: grayscale(.55) brightness(.7); }
.tc-head { text-align: center; }
.tc-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
  font-size: 1.05rem;
  text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
}
.tc-range { display: block; font-size: .72rem; color: var(--accent); opacity: .85; }
.tc-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 58%, rgba(255,255,255,.05), rgba(0,0,0,.35));
}
.tc-art svg { filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); }
.tc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
  border-radius: 8px;
  display: block;
}
.dlg-img {
  width: 150px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,.6);
}

/* ===== Personaggi: ritratti, selettore, token al tavolo ===== */
.landing-hero-img {
  height: clamp(210px, 40vh, 300px);
  width: auto;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.7));
  -webkit-mask-image: radial-gradient(ellipse 62% 78% at 50% 44%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 78% at 50% 44%, #000 62%, transparent 100%);
}
.char-grid { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.char-card {
  --accent: #19d3ff;
  width: 84px;
  border: 2px solid var(--panel-edge);
  border-radius: 12px;
  background: #08101f;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.char-card img { width: 100%; height: 92px; object-fit: cover; object-position: top center; display: block; }
.char-card .char-name { font-size: .62rem; color: var(--bone); padding: 3px 2px; text-align: center; }
.char-card.selected { border-color: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent); }
.char-card.selected .char-name { color: var(--accent); font-weight: 700; }

.pp-avatar { overflow: hidden; padding: 0; }
.pp-img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.cust-hero-img {
  height: 160px;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.6));
  -webkit-mask-image: radial-gradient(ellipse 62% 78% at 50% 44%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 78% at 50% 44%, #000 62%, transparent 100%);
}

.seat-row { display: flex; align-items: center; justify-content: center; gap: 5px; margin-bottom: 3px; }
.seat-token {
  position: relative;
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--neon);
  background: #0a0e1a;
  box-shadow: 0 0 10px rgba(25,211,255,.35);
}
.seat-token img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
.seat.current .seat-token { border-color: var(--gold); box-shadow: 0 0 14px rgba(201,162,39,.6); }
@media (max-width: 640px) {
  .seat-token { width: 34px; height: 34px; }
}
.tc-lock {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
}
.tc-badge {
  position: absolute;
  top: 0; right: 2px;
  background: rgba(0,0,0,.6);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 700;
  padding: 1px 7px;
}
.tc-prize { text-align: center; }
.tc-prize-label { display: block; font-size: .62rem; letter-spacing: .2em; opacity: .6; }
.tc-prize-amount { display: block; font-weight: 700; font-size: 1.05rem; color: var(--bone); }
.tc-play {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  padding: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.table-card:not(.locked) .tc-play:hover {
  background: var(--accent);
  color: #02141f;
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* Barra inferiore della lobby */
.lobby-bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.lobby-bar-btn {
  background: rgba(8,14,26,.7);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 10px;
  color: var(--bone);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: border-color .12s, transform .12s;
}
.lobby-bar-btn:hover { transform: translateY(-2px); border-color: var(--neon); }
.lobby-bar-btn .bb-ico { font-size: 1.5rem; }
.lobby-bar-btn b { font-size: .9rem; }
.lobby-bar-btn small { font-size: .68rem; opacity: .65; }
.lobby-bar-btn.event {
  border-color: var(--neon-2);
  background: linear-gradient(180deg, rgba(255,46,166,.15), rgba(8,14,26,.7));
  box-shadow: 0 0 14px rgba(255,46,166,.25);
}
.lobby-bar-btn.event b { color: var(--neon-2); }
@keyframes bb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,211,77,.5); }
  100% { box-shadow: 0 0 0 8px rgba(255,211,77,0); }
}
.lobby-bar-btn.alert { border-color: #ffd34d; animation: bb-pulse 1.4s ease-out infinite; }
.lobby-bar-btn.alert small { color: #ffd34d; opacity: 1; font-weight: 700; }

/* Pannelli (classifica / missioni) */
.panel-box { position: relative; max-height: 84vh; overflow-y: auto; }
.panel-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none; border: none;
  color: var(--bone); font-size: 1.3rem; cursor: pointer; opacity: .7;
}
.panel-close:hover { opacity: 1; }
.panel-box h2 { color: var(--neon); margin-bottom: 14px; }

.quest {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.quest.done { border-color: #ffd34d; box-shadow: 0 0 12px rgba(255,211,77,.2); }
.quest.claimed { opacity: .55; }
.quest-icon { font-size: 2rem; flex-shrink: 0; }
.quest-main { flex: 1; }
.quest-giver { font-family: var(--font-display); color: var(--neon); font-size: .9rem; }
.quest-text { font-size: .86rem; opacity: .9; margin: 3px 0; }
.quest-reward { font-size: .78rem; color: #ffd34d; }
.quest-side { text-align: center; min-width: 92px; }
.quest-status { font-size: .82rem; margin-bottom: 6px; font-weight: 700; }

.lb-mine { text-align: center; margin-bottom: 10px; }
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th, .lb-table td { padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,.1); text-align: left; }
.lb-table th { color: var(--neon); font-size: .8rem; }
.lb-rank { font-weight: 700; opacity: .8; width: 40px; }
.lb-score { text-align: right; color: #ffd34d; white-space: nowrap; }
.lb-table tr.me { background: rgba(25,211,255,.14); }
.lb-table tr.me td { color: var(--neon); font-weight: 700; }

@media (max-width: 820px) {
  .tables-grid { grid-template-columns: repeat(2, 1fr); }
  .lobby-logo { display: none; }
  .lobby-bar { grid-template-columns: repeat(3, 1fr); }
  .lobby-skyline { height: 120px; }
}
@media (max-width: 420px) {
  .tables-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pp-info { min-width: 96px; }
}

@keyframes ship-glow-pulse {
  0%, 100% { opacity: .9; }
  50% { opacity: .35; }
}
.ship-glow { animation: ship-glow-pulse 1.6s ease-in-out infinite; }

@keyframes hero-hover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.hero-ship { animation: hero-hover 3.2s ease-in-out infinite; }

.scene-ship {
  position: absolute;
  left: 4%;
  bottom: 2%;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.6));
}

.poi .art { filter: drop-shadow(0 4px 8px rgba(0,0,0,.65)); }
.poi:hover .art-building, .poi:hover .art-shop { filter: drop-shadow(0 0 12px rgba(25,211,255,.7)); }
.poi:hover .art-npc { filter: drop-shadow(0 0 12px rgba(255,46,166,.7)); }

.map-node-icon { position: relative; display: block; }
.map-node-icon .art-planet { display: block; margin: 0 auto; }
.map-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.map-node.locked .art-planet { filter: grayscale(.85) brightness(.6); }

.dialog-icon .art { margin: 0 auto; }
.cust-hero { display: flex; justify-content: center; margin-bottom: 8px; }

/* ===== Reputazione e dialoghi ===== */
.chip-group { display: flex; gap: 8px; align-items: center; }
.rep-chip {
  background: var(--panel);
  border: 1px solid #ffd34d;
  color: #ffd34d;
  border-radius: 16px;
  padding: 5px 14px;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(255,211,77,.2);
}
.profile-rep { color: #ffd34d; font-weight: 600; }

.dialog-box { max-width: 460px; }
.dialog-icon { font-size: 3rem; margin-bottom: 6px; }
#dialog-text { white-space: pre-line; }
#dialog-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ===== Warp (viaggio verso un mondo) ===== */
.overlay.warp { background: #02050c; overflow: hidden; }
@keyframes warp-zoom {
  from { transform: scale(.2); opacity: 0; }
  40% { opacity: 1; }
  to { transform: scale(1.15); opacity: 1; }
}
@keyframes warp-streaks {
  from { transform: scale(1); opacity: .2; }
  to { transform: scale(3); opacity: 0; }
}
.warp-stars {
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(2px 60px at 20% 50%, #fff9, transparent),
    radial-gradient(2px 80px at 40% 30%, #fff7, transparent),
    radial-gradient(2px 70px at 60% 70%, #fff8, transparent),
    radial-gradient(2px 90px at 80% 40%, #fff6, transparent),
    radial-gradient(2px 50px at 50% 85%, #fff7, transparent);
  animation: warp-streaks 1.4s ease-in infinite;
}
.warp-content { text-align: center; animation: warp-zoom 1.4s ease-out forwards; }
.warp-icon { font-size: 5rem; }
.warp-label {
  font-family: var(--font-display);
  color: var(--neon);
  margin-top: 10px;
  letter-spacing: .1em;
}

/* ===== Carte che volano verso il centro ===== */
.fly-card {
  position: fixed;
  z-index: 60;
  width: 36px;
  height: 52px;
  padding: 3px;
  pointer-events: none;
  transition: transform .85s cubic-bezier(.5, 0, .8, 1), opacity .85s;
}
.fly-card .v { font-size: .78rem; }
.fly-card .s { font-size: .85rem; }

/* ===== ACEFALL! — sequenza spettacolare ===== */
.overlay.acefall {
  background: radial-gradient(ellipse at center, rgba(10,20,40,.86), rgba(2,4,10,.97) 70%);
  overflow: hidden;
  perspective: 900px;
}

/* Lampo iniziale a tutto schermo */
@keyframes af-flash {
  0% { opacity: 0; }
  6% { opacity: .95; }
  100% { opacity: 0; }
}
.af-flash {
  position: absolute; inset: 0;
  background: radial-gradient(circle, #fff 0%, rgba(255,234,170,.7) 30%, transparent 70%);
  opacity: 0;
  animation: af-flash 1s ease-out forwards;
}

/* Raggi di luce rotanti dietro al titolo */
@keyframes af-rays-spin { to { transform: rotate(360deg); } }
.af-rays {
  position: absolute;
  top: 50%; left: 50%;
  width: 180vmax; height: 180vmax;
  margin: -90vmax 0 0 -90vmax;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255,211,77,.10) 0deg 6deg,
    transparent 6deg 18deg);
  animation: af-rays-spin 14s linear infinite;
  opacity: .55;
  mix-blend-mode: screen;
}

/* Onde d'urto concentriche */
@keyframes af-ring {
  0% { transform: scale(0); opacity: .9; }
  100% { transform: scale(5); opacity: 0; }
}
.af-rings { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.af-rings span {
  position: absolute;
  width: 26vmin; height: 26vmin;
  border-radius: 50%;
  border: 3px solid rgba(255,211,77,.85);
  box-shadow: 0 0 40px rgba(255,211,77,.6);
  animation: af-ring 1.8s ease-out infinite;
}
.af-rings span:nth-child(2) { animation-delay: .5s; border-color: rgba(25,211,255,.8); box-shadow: 0 0 40px rgba(25,211,255,.6); }
.af-rings span:nth-child(3) { animation-delay: 1s;  border-color: rgba(255,46,166,.8); box-shadow: 0 0 40px rgba(255,46,166,.6); }

/* Pioggia di semi e gettoni generata via JS */
.af-particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.af-particle {
  position: absolute;
  font-size: var(--sz, 2rem);
  will-change: transform, opacity;
  animation: af-fly var(--dur, 1.6s) cubic-bezier(.18,.7,.3,1) var(--del, 0s) forwards;
  opacity: 0;
  text-shadow: 0 0 12px currentColor;
}
@keyframes af-fly {
  0%   { opacity: 0; transform: translate(0,0) rotate(0deg) scale(.2); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1); }
}
@keyframes af-coin-fall {
  0%   { opacity: 0; transform: translateY(-12vh) rotate(0deg); }
  10%  { opacity: 1; }
  100% { opacity: .9; transform: translateY(112vh) rotate(var(--rot)); }
}
.af-coin {
  position: absolute; top: 0;
  font-size: var(--sz, 1.5rem);
  color: #ffd34d;
  text-shadow: 0 0 12px rgba(255,211,77,.9);
  animation: af-coin-fall var(--dur, 2.2s) linear var(--del, 0s) forwards;
  opacity: 0;
}

/* Contenuto centrale: scossa + ingresso */
@keyframes af-shake {
  0%, 100% { transform: translate(0,0); }
  10% { transform: translate(-6px, 4px); }
  20% { transform: translate(7px, -3px); }
  30% { transform: translate(-5px, -5px); }
  40% { transform: translate(6px, 5px); }
  50% { transform: translate(-4px, 3px); }
  60% { transform: translate(3px, -4px); }
  70% { transform: translate(-2px, 2px); }
  80% { transform: translate(2px, 1px); }
}
.acefall-content {
  text-align: center;
  position: relative;
  z-index: 2;
  animation: af-shake .7s ease-out;
}

@keyframes acefall-title-in {
  0%  { transform: scale(.1) rotate(-14deg); opacity: 0; filter: blur(8px); }
  55% { transform: scale(1.3) rotate(3deg);  opacity: 1; filter: blur(0); }
  72% { transform: scale(.92) rotate(-1deg); }
  100%{ transform: scale(1) rotate(0deg);    opacity: 1; }
}
@keyframes acefall-glow {
  0%, 100% { text-shadow: 0 0 24px rgba(255,211,77,.9), 0 0 6px #fff; }
  50%      { text-shadow: 0 0 70px rgba(255,46,166,1), 0 0 120px rgba(25,211,255,.85); }
}
.acefall-title {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 16vw, 7rem);
  font-weight: 700;
  letter-spacing: .14em;
  background: linear-gradient(180deg, #fff 0%, #ffe9a8 38%, #ffc83d 62%, #ff9d2e 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,.25);
  animation: acefall-title-in .9s cubic-bezier(.2,1.4,.4,1) forwards,
             acefall-glow 1.3s ease-in-out .9s infinite;
}
/* Bagliore replicato dietro al testo (il clip nasconde il text-shadow) */
.acefall-title::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0;
  z-index: -1;
  color: transparent;
  animation: acefall-glow 1.3s ease-in-out .9s infinite;
}
@keyframes acefall-spade-drop {
  0%   { transform: translateY(-80px) rotate(-180deg); opacity: 0; }
  70%  { transform: translateY(8px) rotate(10deg); opacity: 1; }
  100% { transform: translateY(0) rotate(0deg); opacity: 1; }
}
.acefall-spades span {
  display: inline-block;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  margin: 0 8px;
  animation: acefall-spade-drop .6s cubic-bezier(.2,1.5,.4,1) backwards;
}
.acefall-spades span:nth-child(1) { color: var(--neon);   animation-delay: .05s; }
.acefall-spades span:nth-child(2) { color: #1f6; animation-delay: .15s; }
.acefall-spades span:nth-child(3) { color: var(--neon-2); animation-delay: .25s; }
.acefall-spades span:nth-child(4) { color: #ff7b3a; animation-delay: .35s; }
.acefall-spades span:nth-child(5) { color: var(--neon);   animation-delay: .45s; }
.acefall-sub { margin-top: 10px; opacity: .9; letter-spacing: .04em; }
.acefall-player {
  font-family: var(--font-display);
  color: #ffe9a8;
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  margin-top: 12px;
  text-shadow: 0 0 18px rgba(255,211,77,.8);
}
@keyframes af-amount-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.af-amount {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 6vw, 2.4rem);
  color: #fff;
  padding: 4px 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,211,77,.18), rgba(255,157,46,.28));
  border: 1px solid rgba(255,211,77,.6);
  box-shadow: 0 0 30px rgba(255,211,77,.35);
  animation: af-amount-pop .5s cubic-bezier(.2,1.6,.4,1) 1.1s backwards;
}

/* ===== Banner risultato mano (elegante, non bloccante) ===== */
@keyframes rb-in {
  from { transform: translate(-50%, -24px) scale(.96); opacity: 0; }
  to   { transform: translate(-50%, 0) scale(1); opacity: 1; }
}
.result-banner {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 48;
  width: min(440px, calc(100% - 24px));
  cursor: pointer;
  animation: rb-in .45s cubic-bezier(.2,1.2,.4,1);
}
.rb-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px 14px 16px;
  background: linear-gradient(135deg, rgba(16,24,40,.96), rgba(10,16,30,.96));
  border: 1px solid rgba(25,211,255,.45);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 30px rgba(25,211,255,.18);
  backdrop-filter: blur(6px);
}
.result-banner.acefall .rb-card {
  border-color: rgba(255,211,77,.6);
  box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 36px rgba(255,211,77,.3);
}
@keyframes rb-icon-pop {
  0% { transform: scale(.3) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.25) rotate(8deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.rb-icon {
  font-size: 2rem;
  line-height: 1;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 10px rgba(255,211,77,.7));
  animation: rb-icon-pop .5s cubic-bezier(.2,1.6,.4,1);
}
.rb-text { flex: 1 1 auto; min-width: 0; text-align: left; }
.rb-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--bone);
  letter-spacing: .02em;
}
.result-banner.acefall .rb-title { color: #ffe9a8; }
.rb-lines { margin-top: 3px; }
.rb-line {
  font-size: .82rem;
  line-height: 1.35;
  color: rgba(230,241,255,.82);
}
.rb-line b, .rb-line .amt { color: var(--neon); font-weight: 700; }
.rb-line .rb-note { display: block; margin-top: 2px; font-size: .72rem; color: rgba(230,241,255,.55); font-style: italic; }

/* ===== Badge ===== */
.badge-svg { display: block; filter: drop-shadow(0 0 5px rgba(var(--bgw, 25,211,255), .7)); }

/* Badge sul posto in partita (accanto al personaggio) */
.seat-token-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.seat-badge-eq {
  position: absolute; right: -8px; bottom: -8px;
  width: 28px; height: 28px; padding: 0; border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); transition: transform .15s; z-index: 4;
}
.seat.me .seat-badge-eq { width: 30px; height: 30px; right: -9px; bottom: -9px; }
.seat-badge-eq:hover { transform: scale(1.16); }
.bc-empty {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(8,12,24,.85); border: 1px dashed rgba(150,180,255,.55);
  color: rgba(180,200,255,.85); font-weight: 700; font-size: .85rem;
}

/* Toast di sblocco */
.badge-toast {
  position: fixed; left: 50%; top: 16px; transform: translate(-50%, -26px);
  display: flex; align-items: center; gap: 12px; z-index: 80;
  background: linear-gradient(135deg, rgba(16,24,42,.97), rgba(10,16,30,.97));
  border: 1px solid rgba(255,211,77,.6); border-radius: 14px; padding: 10px 18px 10px 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 30px rgba(255,211,77,.3);
  opacity: 0; transition: transform .4s cubic-bezier(.2,1.2,.4,1), opacity .4s;
}
.badge-toast.show { transform: translate(-50%, 0); opacity: 1; }
.badge-toast .bt-txt { display: flex; flex-direction: column; }
.badge-toast .bt-txt b { color: #ffe9a8; font-family: var(--font-display); font-size: .9rem; }
.badge-toast .bt-txt span { font-size: .8rem; color: rgba(230,241,255,.85); }

/* Pop-up di scelta */
.badge-picker { text-align: left; }
.badge-cat { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 2px 8px; border-bottom: 1px solid rgba(120,160,220,.2); padding-bottom: 4px; }
.bc-title { font-family: var(--font-display); font-weight: 700; color: var(--neon); font-size: .9rem; }
.bc-stat { font-size: .78rem; color: rgba(230,241,255,.65); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.badge-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px; border-radius: 12px; cursor: pointer; color: var(--bone);
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  transition: transform .12s, border-color .15s, background .15s;
}
.badge-cell.unlocked:hover { transform: translateY(-2px); background: rgba(25,211,255,.1); border-color: rgba(25,211,255,.5); }
.badge-cell.sel { border-color: #ffd34d; box-shadow: 0 0 14px rgba(255,211,77,.4); background: rgba(255,211,77,.08); }
.badge-cell.locked { cursor: not-allowed; }
.badge-cell.locked .bc-svg { filter: grayscale(.9) brightness(.5); opacity: .55; }
.badge-cell.locked .badge-svg { filter: none; }
.bc-label { font-size: .68rem; font-weight: 700; color: rgba(230,241,255,.82); }
.badge-cell.locked .bc-label { color: rgba(180,200,235,.6); font-weight: 600; }
.bc-lock { position: absolute; top: 4px; right: 6px; font-size: .7rem; }
.badge-cell.none { flex-direction: row; gap: 8px; justify-content: center; padding: 12px; margin-bottom: 2px; }
.badge-cell.none .bc-empty { width: 26px; height: 26px; }

/* Badge nel profilo home + personalizza */
.h2-avwrap { position: relative; display: inline-flex; flex-shrink: 0; }
.h2-badge { position: absolute; right: -7px; bottom: -7px; display: flex; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.h2-badge:empty { display: none; }
.cust-badge-btn { display: inline-flex; align-items: center; gap: 10px; }
.cust-badge { display: inline-flex; }
.cust-badge:empty::before { content: "∅"; color: rgba(180,200,255,.6); font-size: 1.2rem; }

/* ===== Hub premium (negozio + profilo) ===== */
body.bg-hub {
  background:
    radial-gradient(ellipse at 50% -8%, rgba(90,60,210,.28), transparent 55%),
    radial-gradient(ellipse at 92% 112%, rgba(255,46,166,.1), transparent 50%),
    radial-gradient(ellipse at 50% 120%, #15204a 0%, #0a1024 46%, #06070f 100%);
  background-attachment: fixed;
}
.hub2 .hub-header {
  background: linear-gradient(110deg, rgba(14,20,40,.9), rgba(10,16,30,.55));
  border: 1px solid rgba(120,170,255,.3); border-radius: 14px; padding: 10px 14px;
}
.hub2 .hub-header h2 { font-family: var(--font-display); color: #eaf2ff; font-size: 1.1rem; }
.hub2 .bankroll-chip { background: rgba(0,0,0,.4); border-color: rgba(255,211,77,.5); color: #ffd34d; box-shadow: 0 0 12px rgba(255,211,77,.2); }

.hub2-section { font-family: var(--font-display); font-weight: 700; color: var(--neon); font-size: .95rem; letter-spacing: .03em; margin: 20px 2px 12px; }
.hub2-section .hint { font-family: "Segoe UI", sans-serif; font-weight: 400; font-size: .72rem; opacity: .6; color: var(--bone); }

/* --- Profilo --- */
.prof-wrap { max-width: 640px; margin: 0 auto; }
.prof-hero {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(135deg, rgba(18,26,50,.92), rgba(10,16,30,.92));
  border: 1px solid rgba(120,170,255,.35); border-radius: 18px; padding: 16px 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
}
.prof-hero-art { position: relative; flex-shrink: 0; }
.prof-hero-art .cust-hero { margin: 0; }
.prof-hero-art .cust-hero-img { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; object-position: center 14%; border: 2px solid rgba(150,190,255,.7); }
.prof-badge { position: absolute; right: -8px; bottom: -8px; display: flex; }
.prof-badge:empty { display: none; }
.prof-hero-info { flex: 1; min-width: 0; }
.prof-name { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: #fff; }
.prof-level { font-size: .82rem; color: #9fb6ff; margin: 3px 0 6px; }
.prof-xp { height: 7px; background: rgba(255,255,255,.15); border-radius: 4px; overflow: hidden; max-width: 280px; }
.prof-xp i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #7a3be0, #19d3ff); }
.prof-rep { margin-top: 6px; font-size: .8rem; color: #ffd34d; }

.prof-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.stat-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 8px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(18,26,50,.85), rgba(10,16,30,.85));
  border: 1px solid rgba(120,170,255,.22);
}
.sc-ico { font-size: 1.5rem; }
.sc-val { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--neon); }
.sc-label { font-size: .68rem; color: rgba(225,235,255,.7); text-align: center; }

.prof-badge-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 12px 16px; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, rgba(18,26,50,.9), rgba(10,16,30,.9));
  border: 1px solid rgba(255,211,77,.4); color: var(--bone);
  transition: border-color .15s, transform .12s;
}
.prof-badge-btn:hover { border-color: #ffd34d; transform: translateY(-1px); }
.prof-badge-big { display: flex; flex-shrink: 0; }
.pb-text { flex: 1; display: flex; flex-direction: column; }
.pb-text b { font-family: var(--font-display); color: #ffe9a8; }
.pb-text small { font-size: .76rem; color: rgba(225,235,255,.6); }
.pb-chevron { font-size: 1.6rem; color: rgba(255,211,77,.7); }

.prof-card {
  background: linear-gradient(160deg, rgba(16,22,44,.9), rgba(9,13,26,.9));
  border: 1px solid rgba(120,170,255,.25); border-radius: 16px; padding: 16px 18px;
}
.prof-sub { font-weight: 700; color: #cfe0ff; margin: 14px 0 8px; font-size: .85rem; }
.prof-sub:first-child { margin-top: 0; }
.prof-sub .hint { font-weight: 400; opacity: .55; font-size: .72rem; }
.prof-card .cust-row { margin-bottom: 4px; }
.prof-card .cust-row input { background: rgba(8,14,28,.9); border-color: rgba(120,170,255,.3); }

/* --- Negozio premium --- */
.hub2 .fund-box {
  align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(20,28,54,.9), rgba(10,16,30,.9));
  border: 1px solid rgba(255,211,77,.35); border-radius: 16px;
}
.fund-ico { font-size: 2rem; flex-shrink: 0; }
.fund-info { flex: 1; }
.fund-title { font-family: var(--font-display); font-weight: 700; color: #ffe9a8; }
.fund-desc { font-size: .8rem; opacity: .75; margin-top: 2px; }
.hub2 .shop-item {
  background: linear-gradient(160deg, rgba(18,26,50,.9), rgba(10,16,30,.9));
  border: 1px solid rgba(120,170,255,.25); border-radius: 16px; padding: 16px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.hub2 .shop-item:hover { transform: translateY(-3px); border-color: rgba(25,211,255,.5); box-shadow: 0 14px 30px rgba(0,0,0,.45), 0 0 24px rgba(25,211,255,.2); }
.hub2 .shop-icon { font-size: 2.4rem; filter: drop-shadow(0 0 10px rgba(25,211,255,.3)); }
.hub2 .shop-name { font-family: var(--font-display); font-size: 1rem; color: #eaf2ff; }
.hub2 .pick-btn { background: rgba(8,14,28,.85); border-color: rgba(120,170,255,.3); }
.hub2 .pick-btn.selected { border-color: var(--neon); box-shadow: 0 0 12px rgba(25,211,255,.45); }

@media (max-width: 560px) {
  .prof-hero { flex-direction: column; text-align: center; }
  .prof-xp { margin: 0 auto; }
}

/* ===== Multiplayer ===== */
.mp-body { max-width: 640px; margin: 0 auto; }
.mp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mp-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 22px 18px; border-radius: 18px;
  background: linear-gradient(160deg, rgba(18,26,50,.92), rgba(10,16,30,.92));
  border: 1px solid rgba(120,170,255,.3);
}
.mp-card.mp-wide { grid-column: 1 / -1; }
.mp-card h3 { font-family: var(--font-display); color: #eaf2ff; font-size: 1.05rem; }
.mp-card p { font-size: .86rem; color: rgba(225,235,255,.75); line-height: 1.45; }
.mp-ico { font-size: 2.4rem; }
.mp-card .btn { margin-top: 4px; }
.mp-code-input {
  width: 100%; text-align: center; letter-spacing: .4em; font-family: var(--font-display);
  font-size: 1.4rem; text-transform: uppercase; padding: 10px; border-radius: 10px;
  background: rgba(8,14,28,.9); border: 1px solid rgba(120,170,255,.4); color: #fff;
}
.mp-room { background: linear-gradient(160deg, rgba(18,26,50,.92), rgba(10,16,30,.92)); border: 1px solid rgba(120,170,255,.3); border-radius: 18px; padding: 18px; }
.mp-codebox { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid rgba(120,160,220,.2); }
.mp-codelabel { font-size: .75rem; color: rgba(200,215,255,.7); }
.mp-code { font-family: var(--font-display); font-size: 2.2rem; letter-spacing: .3em; color: var(--neon); text-shadow: 0 0 18px rgba(25,211,255,.5); padding-left: .3em; }
.mp-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 16px 0; }
.mp-player { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); }
.mp-player.ready { border-color: rgba(46,204,113,.6); box-shadow: 0 0 14px rgba(46,204,113,.2); }
.mp-player.host { border-color: rgba(255,211,77,.5); }
.mp-av { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; object-position: center 14%; border: 2px solid rgba(150,190,255,.6); background: #0a0e1a; }
.mp-pname { font-weight: 700; font-size: .85rem; }
.mp-pstate { font-size: .72rem; color: rgba(220,230,255,.7); }
.mp-player.ready .mp-pstate { color: #7dffb0; }
.mp-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mp-actions .btn-primary { flex: 1; }
.mp-hint { margin-top: 12px; font-size: .8rem; color: rgba(210,225,255,.6); text-align: center; line-height: 1.5; }

/* Tavoli pubblici */
.mp-lead { text-align: center; color: rgba(220,230,255,.75); font-size: .9rem; margin-bottom: 14px; line-height: 1.5; }
.mp-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.mp-table {
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  padding: 14px; border-radius: 14px; color: var(--bone);
  background: linear-gradient(135deg, rgba(18,26,50,.92), rgba(10,16,30,.92));
  border: 1px solid rgba(120,170,255,.25);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.mp-table:hover { transform: translateY(-3px); border-color: var(--ta, var(--neon)); box-shadow: 0 12px 26px rgba(0,0,0,.45), 0 0 22px var(--ta, rgba(25,211,255,.4)); }
.mpt-ico { font-size: 1.8rem; flex-shrink: 0; filter: drop-shadow(0 0 8px var(--ta, var(--neon))); }
.mpt-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mpt-name { font-family: var(--font-display); color: #eaf2ff; }
.mpt-meta { font-size: .72rem; color: rgba(200,215,255,.6); }
.mpt-cta { font-size: .78rem; font-weight: 700; color: var(--ta, var(--neon)); white-space: nowrap; }
.mp-private-btn { width: 100%; margin-top: 16px; }
.mp-backlink { display: inline-block; margin-bottom: 12px; color: var(--neon); }

@media (max-width: 520px) { .mp-grid { grid-template-columns: 1fr; } .mp-tables { grid-template-columns: 1fr; } }

/* ===== Impostazioni ===== */
.settings { text-align: left; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 4px; border-bottom: 1px solid rgba(120,160,220,.15); }
.set-row label { font-weight: 600; }
.settings input[type=range] { flex: 1; max-width: 210px; accent-color: var(--neon); }
.toggle { width: 50px; height: 27px; border-radius: 999px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.22); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.toggle span { position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: left .2s; }
.toggle.on { background: var(--neon); border-color: var(--neon); }
.toggle.on span { left: 25px; }
.seg { display: flex; gap: 4px; }
.seg button { padding: 7px 11px; border-radius: 8px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15); color: var(--bone); cursor: pointer; font-size: .8rem; }
.seg button.sel { background: rgba(25,211,255,.18); border-color: var(--neon); color: var(--neon); }
.set-tut { margin-top: 16px; width: 100%; }

/* ===== QA mobile: overlay scrollabili + header compatto ===== */
.overlay-box, .panel-box { max-height: 88vh; overflow-y: auto; }
.tut-card { max-height: 92vh; overflow-y: auto; }
@media (max-width: 560px) {
  #game-header { flex-wrap: wrap; row-gap: 4px; font-size: .78rem; padding: 7px 10px; }
  #game-header #brand { font-size: .92rem; }
  .h2-top { flex-wrap: wrap; row-gap: 8px; }
  .h2-credits { padding: 7px 12px; }
  .h2-pxp { max-width: 32vw; }
  .badge-grid { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); }
  .set-row { flex-wrap: wrap; }
  .seg button { padding: 6px 9px; font-size: .76rem; }
}

/* ===== Tutorial "Come si gioca" ===== */
.overlay.tut { background: rgba(2,5,12,.92); z-index: 70; }
@keyframes tut-in { from { transform: translateY(18px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.tut-card {
  position: relative;
  width: min(560px, 100%);
  background: linear-gradient(160deg, #0e1730, #0a1120);
  border: 1px solid rgba(25,211,255,.5);
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 36px rgba(25,211,255,.18);
  animation: tut-in .35s cubic-bezier(.2,1.1,.4,1);
}
.tut-close {
  position: absolute; top: 10px; right: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  color: var(--bone); cursor: pointer; font-size: .9rem; line-height: 1;
}
.tut-close:hover { background: rgba(255,80,80,.25); border-color: #ff6b6b; }
.tut-stage {
  min-height: 188px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(25,211,255,.06), transparent 70%), rgba(0,0,0,.28);
  border: 1px solid rgba(120,160,220,.16);
  border-radius: 14px; padding: 16px; margin-bottom: 14px; overflow: hidden;
}
.tut-text h2 { color: var(--neon); font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 6px; }
#tut-body { color: rgba(230,241,255,.9); line-height: 1.5; font-size: .92rem; }
#tut-body b { color: #fff; }
.tut-dim { color: rgba(230,241,255,.55); font-size: .85em; }

.tut-dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0 12px; }
.tut-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.2); transition: all .2s; }
.tut-dot.on { background: var(--neon); box-shadow: 0 0 8px var(--neon); transform: scale(1.25); }
.tut-nav { display: flex; align-items: center; gap: 10px; }
.tut-nav .btn-primary { margin-left: auto; }
#tut-skip { color: rgba(230,241,255,.5); }

/* Carte nello stage */
.tut-stage .card { width: 46px; height: 66px; padding: 4px 5px; border-radius: 6px; }
.tut-stage .card .v { font-size: .9rem; }
.tut-stage .card .s { font-size: 1.05rem; }
.tut-stage .tut-row.small .card { width: 32px; height: 46px; }
.tut-row { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tut-label { font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: rgba(160,190,255,.75); }
.tut-op { font-size: 1.3rem; font-weight: 700; color: rgba(230,241,255,.8); }
.tut-score {
  min-width: 46px; height: 50px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: #ffe9a8;
  background: rgba(255,211,77,.12); border: 1px solid rgba(255,211,77,.5); border-radius: 10px; padding: 0 8px;
}
.tut-note { font-size: .82rem; color: rgba(230,241,255,.75); }
.tut-note s { opacity: .6; }
.tut-pot { margin-top: 4px; font-weight: 700; color: var(--neon); background: rgba(0,0,0,.45); border: 1px solid rgba(25,211,255,.4); border-radius: 12px; padding: 3px 14px; font-size: .85rem; }
.tut-pot span { margin-right: 4px; }

/* Pagina "come si vince" */
.tut-ways { display: flex; gap: 10px; width: 100%; justify-content: center; flex-wrap: wrap; }
.tut-way { flex: 1 1 0; min-width: 120px; max-width: 160px; text-align: center; padding: 14px 8px; border-radius: 12px; font-size: .82rem; }
.tut-way .tw-ico { font-size: 1.8rem; margin-bottom: 6px; }
.tut-way.low  { background: rgba(25,211,255,.12); border: 1px solid rgba(25,211,255,.5); }
.tut-way.high { background: rgba(46,204,113,.12); border: 1px solid rgba(46,204,113,.5); }
.tut-way.ace  { background: rgba(255,211,77,.12); border: 1px solid rgba(255,211,77,.55); }

/* Pagina scarti */
.tut-discard { display: flex; flex-direction: column; align-items: center; gap: 8px; }
@keyframes tut-flip { 0% { transform: rotateY(90deg); } 100% { transform: rotateY(0); } }
.card.tut-flip { animation: tut-flip .6s ease-out; box-shadow: 0 0 16px rgba(25,211,255,.8); border-color: var(--neon); }
.tut-arrow { font-size: .82rem; color: #ff9d3a; font-weight: 700; }
@keyframes tut-fly-away { 0% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(38px) scale(.7) rotate(-18deg); opacity: .15; } }
.tut-fly { display: inline-block; animation: tut-fly-away 1.4s ease-in-out infinite alternate; }

/* Pagina ACEFALL */
.tut-acefall { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tut-row.empty { min-height: 50px; align-items: center; }
.tut-empty { color: rgba(230,241,255,.45); font-style: italic; border: 1px dashed rgba(255,255,255,.2); border-radius: 8px; padding: 10px 22px; }
@keyframes tut-ace-glow { 0%,100% { text-shadow: 0 0 16px rgba(255,211,77,.8); transform: scale(1); } 50% { text-shadow: 0 0 36px rgba(255,46,166,1), 0 0 60px rgba(25,211,255,.7); transform: scale(1.06); } }
.tut-ace-burst { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: #ffe9a8; letter-spacing: .08em; animation: tut-ace-glow 1.6s ease-in-out infinite; }

/* Pagina scontro */
.tut-show { display: flex; gap: 8px; width: 100%; justify-content: center; }
.tut-player { flex: 1 1 0; max-width: 150px; text-align: center; padding: 10px 6px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); font-size: .82rem; }
.tut-pscore { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.tut-player.win-low  { border-color: rgba(25,211,255,.6);  box-shadow: 0 0 16px rgba(25,211,255,.25); }
.tut-player.win-high { border-color: rgba(46,204,113,.6);  box-shadow: 0 0 16px rgba(46,204,113,.25); }
.tut-player.mid { opacity: .6; }
.tut-tag { display: block; margin-top: 6px; font-size: .66rem; font-weight: 700; }
.tut-tag.low  { color: var(--neon); }
.tut-tag.high { color: #6ff0a0; }
.tut-tag.none { color: rgba(255,120,120,.85); }

/* Pagina puntate */
.tut-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tut-act { padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: .82rem; border: 1px solid; }
.tut-act.knock { color: #dfe6f5; border-color: #9aa7bf; background: rgba(160,170,190,.14); }
.tut-act.bet, .tut-act.raise { color: #8affc0; border-color: #2ecc71; background: rgba(46,204,113,.16); }
.tut-act.call { color: #bff0ff; border-color: var(--neon); background: rgba(25,211,255,.16); }
.tut-act.fold { color: #ffb4b4; border-color: #ff5b5b; background: rgba(255,70,70,.14); }

/* Pagina finale */
@keyframes tut-ready-spin { 0%,100% { transform: rotate(-6deg) scale(1); } 50% { transform: rotate(6deg) scale(1.08); } }
.tut-ready { font-size: 4.5rem; color: var(--neon); text-shadow: 0 0 30px rgba(25,211,255,.8); animation: tut-ready-spin 2.4s ease-in-out infinite; }

@media (max-width: 640px) {
  .tut-card { padding: 18px 14px 14px; }
  .tut-ways, .tut-show { flex-direction: column; align-items: center; }
  .tut-way, .tut-player { max-width: none; width: 100%; }
}
.rb-next {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(25,211,255,.45);
  background: rgba(25,211,255,.1);
  color: var(--neon);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.rb-next:hover { background: rgba(25,211,255,.25); transform: scale(1.08); }

/* ===== Level-up: toast di salita di livello ===== */
.levelup-toast {
  position: fixed; left: 50%; top: 16px; transform: translate(-50%, -26px);
  display: flex; align-items: center; gap: 14px; z-index: 85;
  background: linear-gradient(135deg, rgba(20,16,42,.97), rgba(10,16,30,.97));
  border: 1px solid rgba(182,119,255,.6); border-radius: 14px; padding: 10px 20px 10px 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 32px rgba(182,119,255,.35);
  opacity: 0; transition: transform .4s cubic-bezier(.2,1.2,.4,1), opacity .4s;
}
.levelup-toast.show { transform: translate(-50%, 0); opacity: 1; }
.lu-ring {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: #fff;
  background: radial-gradient(circle at 38% 30%, #c79bff, #7a3be0 70%);
  border: 2px solid rgba(255,255,255,.55); box-shadow: 0 0 16px rgba(182,119,255,.7);
}
.lu-txt { display: flex; flex-direction: column; }
.lu-txt b { font-family: var(--font-display); color: #e7d4ff; font-size: .95rem; }
.lu-txt span { font-size: .8rem; color: rgba(230,225,255,.85); }

/* ===== Missioni del giorno ===== */
.missions-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 4px 0 10px; font-family: var(--font-display); color: var(--neon); font-size: .95rem;
}
.missions-head.camp { color: #ffd34d; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.missions-head small { font-family: var(--font-body, inherit); font-weight: 400; font-size: .74rem; color: rgba(220,230,255,.6); }
.quest.daily { border-color: rgba(25,211,255,.3); }
.quest.daily.done { border-color: #2ecc71; box-shadow: 0 0 12px rgba(46,204,113,.22); }
.quest.daily.claimed { opacity: .5; }
.daily-bar { margin-top: 7px; height: 6px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.daily-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--neon), var(--neon-2)); border-radius: 4px; transition: width .3s; }

/* ===== Storico mani ===== */
.hist-ico { font-size: 1.7rem; }
.hist-list { display: flex; flex-direction: column; gap: 10px; }
.hist-item {
  border-radius: 12px; overflow: hidden;
  background: rgba(255,255,255,.04); border: 1px solid var(--panel-edge);
}
.hist-item.won { border-color: rgba(255,211,77,.45); }
.hist-item.acefall { border-color: rgba(182,119,255,.55); box-shadow: 0 0 14px rgba(182,119,255,.18); }
.hist-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; }
.hist-head:hover { background: rgba(255,255,255,.04); }
.hist-res { font-family: var(--font-display); font-size: .9rem; min-width: 92px; color: #eaf2ff; }
.hist-item.won .hist-res { color: #ffe9a8; }
.hist-item.acefall .hist-res { color: #d9b8ff; }
.hist-meta { flex: 1; font-size: .76rem; color: rgba(220,230,255,.6); }
.hist-chev { font-size: 1.5rem; color: rgba(180,200,255,.6); transition: transform .2s; }
.hist-item.open .hist-chev { transform: rotate(90deg); }
.hist-detail { max-height: 0; overflow: hidden; transition: max-height .28s ease; padding: 0 14px; }
.hist-item.open .hist-detail { max-height: 460px; padding: 0 14px 14px; }
.hist-sub { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: rgba(160,190,255,.7); margin: 10px 0 5px; }
.hist-cards { display: flex; gap: 5px; flex-wrap: wrap; }
.hc-card {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 34px; padding: 0 5px; border-radius: 5px;
  background: #f5f8ff; color: #1a2336; font-weight: 700; font-size: .85rem;
  border: 1px solid #26324a;
}
.hc-card.red { color: #d6275a; }
.hist-cards i { color: rgba(220,230,255,.5); }
.hist-lines { font-size: .82rem; line-height: 1.5; color: rgba(230,241,255,.9); }
.hist-lines .amt { color: #ffd34d; font-weight: 700; }
.hist-win { margin-top: 8px; font-size: .78rem; color: var(--neon); }

/* ===== Emote ai tavoli multiplayer ===== */
.emote-dock { position: fixed; left: 14px; bottom: 16px; z-index: 40; display: flex; align-items: flex-end; gap: 8px; }
.emote-toggle {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  font-size: 1.4rem; line-height: 1;
  background: linear-gradient(135deg, rgba(20,28,54,.95), rgba(10,16,30,.95));
  border: 1px solid rgba(120,170,255,.45); box-shadow: 0 6px 18px rgba(0,0,0,.45);
  transition: transform .12s, border-color .15s;
}
.emote-toggle:hover { transform: scale(1.08); border-color: var(--neon); }
.emote-bar {
  display: none; flex-wrap: wrap; gap: 6px; max-width: 220px; padding: 8px;
  border-radius: 14px; background: linear-gradient(135deg, rgba(16,24,42,.97), rgba(10,16,30,.97));
  border: 1px solid rgba(120,170,255,.4); box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.emote-bar.open { display: flex; }
.emote-pick {
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 1.4rem; line-height: 1;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  transition: transform .1s, background .12s;
}
.emote-pick:hover { transform: scale(1.15); background: rgba(25,211,255,.18); }

.emote-layer { position: absolute; inset: 0; pointer-events: none; z-index: 25; }
@keyframes emote-pop {
  0% { transform: translate(-50%, -10px) scale(.4); opacity: 0; }
  18% { transform: translate(-50%, -42px) scale(1.1); opacity: 1; }
  72% { transform: translate(-50%, -52px) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -78px) scale(.9); opacity: 0; }
}
.emote-bubble {
  position: absolute; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50% 50% 50% 6px;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
  background: linear-gradient(135deg, #fff, #dfe9ff); color: #10182c;
  border: 2px solid rgba(25,211,255,.7); box-shadow: 0 6px 18px rgba(0,0,0,.5);
  animation: emote-pop 2.6s ease-out forwards;
}
@media (max-width: 560px) {
  .emote-dock { left: 10px; bottom: 12px; }
  .emote-toggle { width: 42px; height: 42px; }
}

/* ===== Profilo: grafico andamento + statistiche di dettaglio ===== */
.prof-chart {
  background: linear-gradient(160deg, rgba(16,22,44,.9), rgba(9,13,26,.9));
  border: 1px solid rgba(120,170,255,.25); border-radius: 14px;
  padding: 10px; margin-bottom: 14px;
}
.prof-chart .bk-chart { width: 100%; height: auto; display: block; }
.prof-chart .chart-empty { text-align: center; padding: 22px 10px; font-size: .82rem; color: rgba(220,230,255,.55); }
.prof-adv {
  background: linear-gradient(160deg, rgba(16,22,44,.9), rgba(9,13,26,.9));
  border: 1px solid rgba(120,170,255,.22); border-radius: 14px; overflow: hidden;
}
.adv-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid rgba(120,160,220,.12); }
.adv-row:last-child { border-bottom: none; }
.adv-ico { font-size: 1.15rem; width: 22px; text-align: center; }
.adv-label { flex: 1; font-size: .86rem; color: rgba(225,235,255,.8); }
.adv-val { font-family: var(--font-display); font-weight: 700; color: var(--neon); font-size: .9rem; }

/* ===== Amici & inviti ===== */
.mp-home-actions { display: flex; gap: 10px; margin-top: 16px; }
.mp-home-actions .mp-private-btn { flex: 1; margin-top: 0; }
.friends-list { display: flex; flex-direction: column; gap: 8px; }
.friend-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--panel-edge);
}
.friend-av { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; object-position: center 14%; border: 2px solid rgba(150,190,255,.5); background: #0a0e1a; flex-shrink: 0; }
.friend-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.friend-info b { font-size: .9rem; }
.friend-state { font-size: .74rem; color: rgba(220,230,255,.7); }
.friend-invite { flex-shrink: 0; border-color: rgba(46,204,113,.5); color: #8affc0; }
.friend-invite:hover { border-color: #2ecc71; box-shadow: 0 0 14px rgba(46,204,113,.35); }

/* Tavoli multiplayer in stile lobby + contatore persone attive */
.mp-card2 { cursor: pointer; }
.tc-active {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: rgba(8,12,24,.78); border: 1px solid rgba(120,160,220,.3); color: rgba(220,230,255,.65);
  backdrop-filter: blur(2px);
}
.tc-active.on { color: #8affc0; border-color: rgba(46,204,113,.55); box-shadow: 0 0 12px rgba(46,204,113,.25); }

/* Box codice amico */
.fc-box {
  background: linear-gradient(160deg, rgba(18,26,50,.92), rgba(10,16,30,.92));
  border: 1px solid rgba(120,170,255,.3); border-radius: 16px; padding: 14px; margin-bottom: 16px;
}
.fc-mine { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid rgba(120,160,220,.18); }
.fc-label { flex: 1; min-width: 130px; font-size: .76rem; color: rgba(200,215,255,.7); }
.fc-code { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: .22em; color: var(--neon); text-shadow: 0 0 16px rgba(25,211,255,.5); padding-left: .22em; }
.fc-add { display: flex; gap: 10px; margin-top: 12px; }
.fc-add .mp-code-input { flex: 1; font-size: 1.1rem; letter-spacing: .28em; }
.fc-add .btn { flex-shrink: 0; }

/* ===== Personaggi bloccati nel picker + negozio ===== */
.char-card.locked img { filter: grayscale(.55) brightness(.68); }
.char-lock { display: block; margin-top: 2px; font-size: .68rem; font-weight: 700; color: #ffd34d; }
.shop-char-art {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden;
  background: radial-gradient(circle at 50% 28%, rgba(120,150,220,.18), #0a0e1a 72%);
  border: 1px solid var(--accent, rgba(120,170,255,.3)); margin: 0 auto 8px;
  box-shadow: 0 0 14px -4px var(--accent, transparent);
}
.shop-char-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; display: block; }

/* ===== Dorsi delle carte: skin (CSS) + anteprime ===== */
.card.back.back-neon {
  background: repeating-linear-gradient(45deg, #0a1330 0 6px, #143a7a 6px 12px);
  border: 1px solid #2f74d6; box-shadow: inset 0 0 9px rgba(50,150,255,.5);
}
.card.back.back-gold {
  background: radial-gradient(circle at 50% 38%, #6e4d16, #241804 78%);
  border: 1px solid #caa23a; box-shadow: inset 0 0 9px rgba(255,205,90,.45);
}
.card.back.back-void {
  background: radial-gradient(circle at 50% 42%, #2c1a54, #06030e 80%);
  border: 1px solid #7d40d6; box-shadow: inset 0 0 11px rgba(165,95,255,.5);
}
.cb-swatch { width: 34px; height: 46px; border-radius: 6px; flex-shrink: 0; display: inline-block; padding: 0; }
.shop-item .cb-swatch { width: 48px; height: 66px; margin: 0 auto 4px; }
.cb-pick { flex-direction: column; gap: 4px; height: auto; padding: 8px; }

/* ===== Quick-chat (frasi) + bollicina testo ===== */
.emote-bar { flex-direction: column; align-items: flex-start; max-width: 264px; }
.emote-row { display: flex; flex-wrap: wrap; gap: 6px; }
.phrase-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.12); }
.phrase-pick {
  padding: 6px 10px; border-radius: 999px; cursor: pointer; font-size: .76rem; white-space: nowrap;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: var(--bone);
}
.phrase-pick:hover { background: rgba(25,211,255,.18); border-color: var(--neon); }
.emote-bubble.text {
  width: auto; max-width: 150px; height: auto; padding: 7px 12px;
  border-radius: 14px 14px 14px 6px; font-size: .82rem; font-weight: 700;
  white-space: normal; text-align: center; line-height: 1.2;
}
/* Battute dei rivali: tono "trash-talk" caldo, distinto dalle emote del giocatore */
.emote-bubble.rival-bubble {
  max-width: 170px; font-size: .8rem; font-weight: 700;
  background: linear-gradient(135deg, #fff7e6, #ffe6c2); color: #3a2410;
  border-color: rgba(255,170,70,.85);
  box-shadow: 0 6px 18px rgba(0,0,0,.5), 0 0 14px rgba(255,160,60,.35);
  animation: emote-pop 3s ease-out forwards;
}
/* Tag dello stile del rivale sotto al nome (stile riconoscibile a colpo d'occhio) */
.seat-persona {
  font-size: .58rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #ffcf8a; opacity: .85; margin-top: -1px; line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
@media (max-width: 560px) { .seat-persona { font-size: .5rem; } }

/* ===== Bonus quotidiano: striscia 7 giorni ===== */
.streak-strip { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.streak-day {
  flex: 1 1 0; min-width: 52px; max-width: 84px; text-align: center; padding: 8px 4px;
  border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--panel-edge); opacity: .65;
}
.streak-day .sd-num { display: block; font-family: var(--font-display); font-size: .8rem; color: rgba(220,230,255,.85); }
.streak-day .sd-rew { display: block; font-size: .7rem; color: #ffd34d; margin-top: 2px; }
.streak-day.done { opacity: 1; border-color: rgba(46,204,113,.5); background: rgba(46,204,113,.08); }
.streak-day.active { opacity: 1; border-color: var(--neon); box-shadow: 0 0 14px rgba(25,211,255,.35); background: rgba(25,211,255,.1); }
.streak-day.big { background: linear-gradient(160deg, rgba(255,211,77,.14), rgba(255,140,40,.08)); border-color: rgba(255,211,77,.5); }
.streak-day.big .sd-num { color: #ffe9a8; }
.streak-claim { width: 100%; margin-top: 6px; }

/* ===== Suggerimenti (modalità allenamento) ===== */
.hint-bar {
  text-align: center; font-size: .82rem; padding: 6px 12px; border-radius: 10px; margin-bottom: 8px;
  border: 1px solid rgba(120,170,255,.3); background: rgba(10,16,30,.78);
}
.hint-bar b { font-family: var(--font-display); }
.hint-bar.good { border-color: rgba(46,204,113,.6); color: #8affc0; }
.hint-bar.mid  { border-color: rgba(255,211,77,.55); color: #ffe9a8; }
.hint-bar.bad  { border-color: rgba(255,90,90,.55); color: #ffb4b4; }

/* ===== Selettore lingua ===== */
.set-select {
  background: rgba(8,14,28,.9); border: 1px solid rgba(120,170,255,.4); color: var(--bone);
  border-radius: 8px; padding: 6px 10px; font-size: .85rem; max-width: 160px;
}
.rb-progress {
  height: 4px;
  background: rgba(255,255,255,.08);
  border-radius: 0 0 16px 16px;
  overflow: hidden;
}
.rb-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--neon), var(--neon-2));
}
.result-banner.acefall .rb-bar { background: linear-gradient(90deg, #ffd34d, #ff9d2e); }

/* Carte avversarie rivelate allo scontro */
.seat.revealed .seat-score { color: var(--neon); }
.seat.revealed .seat-cards { min-height: 0; }
.seat.revealed .seat-cards .card {
  width: 27px; height: 39px; padding: 2px 3px; border-radius: 4px;
  box-shadow: 0 0 10px rgba(25,211,255,.55);
  animation: reveal-pop .4s ease-out backwards;
}
.seat.revealed .seat-cards .card .v { font-size: .62rem; line-height: 1; }
.seat.revealed .seat-cards .card .s { font-size: .74rem; align-self: flex-end; }
@keyframes reveal-pop {
  0% { transform: rotateY(90deg) scale(.7); opacity: 0; }
  100% { transform: rotateY(0) scale(1); opacity: 1; }
}

/* ===== Schermate full-bleed (caricamento + homepage) ===== */
.fullbleed {
  max-width: none; margin: 0; padding: 0;
  width: 100%; min-height: 100vh;
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #05070e;
}
#splash-screen.fullbleed { background-image: url("assets/bg-loading.jpg"); }

/* Schermo che mostra un'immagine intera con sopra zone cliccabili precise:
   il contenitore ha lo stesso rapporto dell'immagine, così le percentuali
   degli hotspot cadono SEMPRE sugli stessi punti del disegno. */
.fullart-screen {
  max-width: none; margin: 0; padding: 0;
  width: 100%; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: #05070e;
}
.fullart {
  position: relative;
  aspect-ratio: 1448 / 1086;
  width: min(100vw, calc(100vh * 1448 / 1086));
  max-height: 100vh;
}
.fa-bg { width: 100%; height: 100%; display: block; object-fit: fill; }
.hot {
  position: absolute;
  background: transparent; border: 0; border-radius: 14px;
  cursor: pointer; z-index: 2;
  transition: background .14s, box-shadow .14s;
}
.hot:hover, .hot:focus-visible {
  background: rgba(120,200,255,.14);
  box-shadow: inset 0 0 0 2px rgba(140,210,255,.65), 0 0 18px rgba(60,170,255,.35);
  outline: none;
}
.hot:active { background: rgba(120,200,255,.24); }

/* --- Homepage: pannello giocatore in alto a sinistra --- */
.hp-profile {
  position: absolute; left: 2%; top: 2.6%; z-index: 3;
  display: flex; align-items: center; gap: 3.5%;
  width: 33%; padding: 1.1% 1.5%;
  background: linear-gradient(100deg, rgba(8,12,28,.93), rgba(8,12,28,.55));
  border: 1px solid rgba(120,170,255,.55); border-radius: 14px;
  box-shadow: 0 0 22px rgba(40,140,255,.3), inset 0 0 18px rgba(0,0,0,.5);
  cursor: pointer; text-align: left;
}
.hp-profile:hover { border-color: var(--neon); box-shadow: 0 0 28px rgba(40,160,255,.55); }
.hpp-av {
  width: 23%; aspect-ratio: 1 / 1; flex-shrink: 0;
  border-radius: 12px; object-fit: cover; object-position: center 16%;
  border: 2px solid rgba(150,190,255,.75); background: #0a0e1a;
}
.hpp-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.hpp-name {
  font-family: var(--font-display); font-weight: 700; color: #eaf2ff;
  font-size: clamp(.82rem, 1.9vw, 1.2rem);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hpp-lvl { font-size: clamp(.55rem, 1.2vw, .76rem); color: #9fb6ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hpp-xp { height: 7px; background: rgba(255,255,255,.16); border-radius: 4px; overflow: hidden; }
.hpp-xp-fill { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #7a3be0, #19d3ff); }
.hpp-cred {
  margin-top: 2px; font-family: var(--font-display); font-weight: 700; color: var(--gold);
  font-size: clamp(.72rem, 1.5vw, .98rem); text-shadow: 0 0 10px rgba(201,162,39,.5);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .hp-profile { width: 52%; gap: 6px; }
}

/* ===== Homepage v2 (disegnata in codice) ===== */
#homepage-screen.home2 {
  max-width: none; margin: 0; padding: 0;
  width: 100%; min-height: 100vh;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.h2-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(ellipse at 50% 118%, #1c0f44 0%, #0a0820 46%, #05060f 100%);
}
.h2-stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 18% 28%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 72% 18%, #cfe8ff, transparent),
    radial-gradient(1px 1px at 42% 46%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 86% 38%, #ffd9f4, transparent),
    radial-gradient(1px 1px at 9% 64%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 61% 60%, #bff, transparent),
    radial-gradient(1px 1px at 31% 14%, #fff, transparent);
  background-repeat: no-repeat;
  animation: h2-twinkle 4.5s ease-in-out infinite;
}
@keyframes h2-twinkle { 0%, 100% { opacity: .5; } 50% { opacity: .95; } }
.h2-glow {
  position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%);
  width: 75vmax; height: 52vmax;
  background: radial-gradient(ellipse at center, rgba(122,59,224,.38), rgba(25,211,255,.12) 42%, transparent 70%);
  filter: blur(34px);
  animation: h2-glow-pulse 6.5s ease-in-out infinite;
}
@keyframes h2-glow-pulse { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
.h2-grid {
  position: absolute; left: 50%; bottom: -2%;
  width: 260%; height: 56%;
  transform: translateX(-50%) perspective(360px) rotateX(71deg);
  transform-origin: 50% 100%;
  background-image:
    linear-gradient(rgba(122,80,255,.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25,211,255,.42) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: h2-grid-move 3s linear infinite;
  -webkit-mask-image: linear-gradient(to top, #000 6%, transparent 80%);
  mask-image: linear-gradient(to top, #000 6%, transparent 80%);
}
@keyframes h2-grid-move { to { background-position: 0 50px; } }
.h2-particles { position: absolute; inset: 0; }
.h2-mote {
  position: absolute; bottom: -4%;
  width: var(--s, 5px); height: var(--s, 5px); border-radius: 50%;
  background: radial-gradient(circle, #fff, rgba(var(--c), .9) 45%, transparent 70%);
  box-shadow: 0 0 8px rgba(var(--c), .8);
  opacity: 0;
  animation: h2-rise var(--dur, 12s) linear var(--del, 0s) infinite;
}
@keyframes h2-rise {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: .85; } 90% { opacity: .7; }
  100% { transform: translateY(-104vh); opacity: 0; }
}
.h2-vignette { position: absolute; inset: 0; background: radial-gradient(125% 100% at 50% 38%, transparent 54%, rgba(0,0,0,.62) 100%); }

.h2-top, .h2-hero, .h2-cards { position: relative; z-index: 1; }

/* Barra alta */
.h2-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: calc(16px + env(safe-area-inset-top)) 20px 0;
}
.h2-profile {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(110deg, rgba(12,18,38,.92), rgba(12,18,38,.5));
  border: 1px solid rgba(120,170,255,.5); border-radius: 16px;
  padding: 9px 16px 9px 9px; cursor: pointer; text-align: left;
  box-shadow: 0 0 24px rgba(40,140,255,.22), inset 0 0 18px rgba(0,0,0,.4);
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.h2-profile:hover { border-color: var(--neon); box-shadow: 0 0 30px rgba(25,211,255,.45); transform: translateY(-1px); }
.h2-av { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; object-position: center 16%; border: 2px solid rgba(150,190,255,.8); background: #0a0e1a; flex-shrink: 0; }
.h2-pinfo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.h2-pname { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: #eaf2ff; white-space: nowrap; }
.h2-plvl { font-size: .72rem; color: #9fb6ff; white-space: nowrap; }
.h2-pxp { width: 150px; max-width: 38vw; height: 6px; background: rgba(255,255,255,.16); border-radius: 4px; overflow: hidden; }
.h2-pxp i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #7a3be0, #19d3ff); }
.h2-top-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.h2-credits { font-family: var(--font-display); font-weight: 700; color: #ffd34d; background: rgba(0,0,0,.4); border: 1px solid rgba(255,211,77,.5); border-radius: 999px; padding: 8px 16px; text-shadow: 0 0 10px rgba(255,211,77,.5); }
.h2-icon { width: 40px; height: 40px; border-radius: 12px; background: rgba(12,18,38,.8); border: 1px solid rgba(120,170,255,.4); color: var(--bone); font-size: 1.1rem; cursor: pointer; transition: all .15s; }
.h2-icon:hover { border-color: var(--neon); background: rgba(25,211,255,.15); }

/* Logo + emblema */
.h2-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 12px 16px; }
.h2-emblem { position: relative; width: clamp(110px, 20vw, 180px); height: clamp(110px, 20vw, 180px); display: flex; align-items: center; justify-content: center; margin-bottom: -6px; }
.h2-spade { position: relative; z-index: 1; font-size: clamp(4.5rem, 12vw, 8rem); color: #d6efff; line-height: 1; text-shadow: 0 0 30px rgba(25,211,255,.9), 0 0 60px rgba(122,59,224,.55); animation: h2-spade-pulse 3.6s ease-in-out infinite; }
@keyframes h2-spade-pulse {
  0%, 100% { transform: scale(1); text-shadow: 0 0 30px rgba(25,211,255,.9), 0 0 60px rgba(122,59,224,.55); }
  50% { transform: scale(1.06); text-shadow: 0 0 52px rgba(25,211,255,1), 0 0 92px rgba(255,46,166,.55); }
}
.h2-rings { position: absolute; inset: 0; }
.h2-rings::before, .h2-rings::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 86%; height: 86%; border-radius: 50%;
  border: 1px solid rgba(25,211,255,.45);
  animation: h2-ring 3.6s ease-out infinite;
}
.h2-rings::after { animation-delay: 1.8s; border-color: rgba(255,46,166,.4); }
@keyframes h2-ring { 0% { transform: scale(.55); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
.h2-logo { filter: drop-shadow(0 0 28px rgba(25,211,255,.4)); line-height: 0; }
.h2-logo svg { max-width: min(560px, 82vw); height: auto; }
.h2-tagline { margin-top: 8px; font-family: var(--font-display); letter-spacing: .5em; font-size: clamp(.6rem, 2vw, .9rem); color: rgba(210,225,255,.7); padding-left: .5em; }

/* Le 3 sezioni */
.h2-cards { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; padding: 10px 20px calc(30px + env(safe-area-inset-bottom)); }
.h2-card {
  --c: 25,211,255;
  position: relative; overflow: hidden;
  width: min(280px, 92vw);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 26px 18px 22px;
  background: linear-gradient(165deg, rgba(16,22,44,.94), rgba(9,13,26,.94));
  border: 1px solid rgba(var(--c), .5); border-radius: 18px;
  cursor: pointer; color: var(--bone);
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.h2-card.single { --c: 25,211,255; }
.h2-card.multi  { --c: 178,90,255; }
.h2-card.shop   { --c: 255,196,61; }
.h2-card:hover { transform: translateY(-6px); border-color: rgba(var(--c), .95); box-shadow: 0 22px 46px rgba(0,0,0,.55), 0 0 42px rgba(var(--c), .5); }
.h2-card:active { transform: translateY(-2px); }
.h2-cardglow { position: absolute; left: 50%; top: -40%; transform: translateX(-50%); width: 140%; height: 80%; background: radial-gradient(ellipse at center, rgba(var(--c), .3), transparent 70%); opacity: .6; transition: opacity .2s; pointer-events: none; }
.h2-card:hover .h2-cardglow { opacity: 1; }
.h2-cardico {
  width: 66px; height: 66px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
  background: rgba(var(--c), .12); border: 1px solid rgba(var(--c), .55);
  color: rgb(var(--c)); text-shadow: 0 0 16px rgba(var(--c), .7);
  box-shadow: inset 0 0 18px rgba(var(--c), .15);
}
.h2-cardtitle { font-family: var(--font-display); font-weight: 700; letter-spacing: .08em; font-size: 1.12rem; color: rgb(var(--c)); margin-top: 4px; }
.h2-cardsub { font-size: .8rem; color: rgba(225,235,255,.7); text-align: center; }
.h2-soon {
  position: absolute; top: 12px; right: -34px;
  transform: rotate(38deg);
  background: linear-gradient(90deg, #ff2ea6, #b25bf7);
  color: #fff; font-size: .6rem; font-weight: 800; letter-spacing: .1em;
  padding: 3px 36px; box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

@media (max-width: 760px) {
  .h2-cards { gap: 12px; }
  .h2-card { width: min(340px, 92vw); flex-direction: row; align-items: center; gap: 14px; padding: 16px 18px; text-align: left; }
  .h2-card .h2-cardico { width: 50px; height: 50px; font-size: 1.5rem; flex-shrink: 0; }
  .h2-card .h2-cardtitle { margin-top: 0; }
  .h2-card .h2-cardsub { text-align: left; }
  .h2-cardtitle, .h2-cardsub { align-self: flex-start; }
  .h2-pname { font-size: .92rem; }
}

/* --- Schermata di login / accesso --- */
#login-screen.fullbleed {
  background-image: linear-gradient(rgba(4,7,16,.72), rgba(4,7,16,.85)), url("assets/bg-loading.jpg");
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: min(380px, 88vw);
  padding: clamp(20px, 4vmin, 34px) clamp(18px, 4vw, 30px);
  background: linear-gradient(180deg, rgba(10,14,30,.92), rgba(6,9,20,.95));
  border: 1px solid rgba(120,170,255,.5);
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(40,140,255,.35), inset 0 0 26px rgba(0,0,0,.5);
  text-align: center;
}
.login-spade { font-size: clamp(2.2rem, 7vw, 3rem); color: var(--neon); text-shadow: 0 0 20px rgba(40,180,255,.9); line-height: 1; }
.login-title { font-family: var(--font-display); font-weight: 700; letter-spacing: .18em; color: #eaf2ff; margin: 6px 0 2px; font-size: clamp(1.4rem, 5vw, 2rem); }
.login-sub { color: #9fb6ff; font-size: clamp(.72rem, 1.8vw, .9rem); margin-bottom: 18px; }
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; margin: 8px 0; padding: 12px 14px;
  border-radius: 12px; border: 1px solid rgba(255,255,255,.18);
  font-family: var(--font-display); font-weight: 700; font-size: clamp(.78rem, 2vw, .95rem);
  cursor: pointer; color: #fff; transition: transform .12s, box-shadow .12s, filter .12s;
}
.auth-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.auth-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px;
  background: rgba(255,255,255,.9); color: #111; font-weight: 900; font-size: .95rem;
}
.auth-google   { background: #ffffff; color: #1f2733; border-color: #ffffff; }
.auth-google .auth-ic { background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); color: #fff; }
.auth-facebook { background: #1877f2; border-color: #1877f2; }
.auth-facebook .auth-ic { background: #fff; color: #1877f2; }
.auth-email    { background: linear-gradient(180deg, #5fe9ff, #19a7ff); color: #02141f; border-color: rgba(180,240,255,.9); }
.auth-email .auth-ic { background: rgba(2,20,31,.85); color: #eaf6ff; }
.auth-guest {
  width: 100%; margin-top: 10px; padding: 11px; cursor: pointer;
  background: transparent; border: 1px solid rgba(160,180,220,.4); border-radius: 12px;
  color: #cfe0ff; font-size: clamp(.72rem, 1.8vw, .88rem);
}
.auth-guest:hover { border-color: var(--neon); color: #fff; }
.login-note { margin-top: 14px; font-size: clamp(.56rem, 1.4vw, .68rem); color: rgba(180,196,230,.6); line-height: 1.4; }

/* --- Barra di caricamento futuristica --- */
.load-wrap {
  position: absolute; left: 50%; bottom: 13%;
  transform: translateX(-50%);
  width: min(560px, 80vw); text-align: center;
}
.load-label {
  font-family: var(--font-display);
  font-size: clamp(.6rem, 1.6vw, .8rem);
  letter-spacing: .42em; text-transform: uppercase;
  color: #bfe6ff; margin-bottom: 12px;
  text-shadow: 0 0 14px rgba(40,180,255,.7);
}
.load-track {
  position: relative; height: 16px; border-radius: 9px;
  background: linear-gradient(180deg, rgba(4,10,24,.92), rgba(2,6,16,.92));
  border: 1px solid rgba(90,200,255,.55);
  box-shadow: 0 0 18px rgba(40,160,255,.35), inset 0 0 14px rgba(0,0,0,.85);
  overflow: hidden;
  clip-path: polygon(11px 0, 100% 0, calc(100% - 11px) 100%, 0 100%);
}
.load-fill {
  position: absolute; top: 0; bottom: 0; left: 0; width: 0%;
  background: linear-gradient(90deg, #1aa3ff, #8a5bff 55%, #ff36c6);
  box-shadow: 0 0 16px rgba(120,170,255,.9);
  transition: width .18s ease-out;
}
.load-fill::after {
  content: ""; position: absolute; inset: 0; width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  animation: load-shine 1.1s linear infinite;
}
@keyframes load-shine { from { transform: translateX(-130%); } to { transform: translateX(380%); } }
.load-ticks {
  position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(2,8,18,.9) calc(10% - 1px) 10%);
}
.load-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; }
.load-status { font-size: clamp(.58rem, 1.5vw, .76rem); color: #9fb6ff; letter-spacing: .06em; }
.load-pct {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(.85rem, 2vw, 1.15rem);
  color: #eaf6ff; text-shadow: 0 0 12px rgba(60,180,255,.85);
}
.load-skip {
  position: absolute; left: 0; right: 0; bottom: 4%;
  text-align: center; color: rgba(200,215,255,.5);
  font-size: clamp(.55rem, 1.4vw, .7rem); letter-spacing: .3em; text-transform: uppercase;
}

/* Sfondo dietro la lobby dei tornei */
body.bg-tables {
  background-image:
    linear-gradient(rgba(4,7,16,.80), rgba(4,7,16,.93)),
    url("assets/bg-tables.jpg");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  background-repeat: no-repeat;
}
body.bg-tables .lobby-skyline { display: none; }

/* Sfondo del tavolo: nero pieno di base; sopra ci sta la scena animata #game-bg. */
body.bg-game { background: #000; }

/* ===== Sfondo animato a tema dietro al tavolo ===== */
#game-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  pointer-events: none;
  --accent-rgb: 25,211,255;   /* sovrascritto per livello da startMatch */
}
/* La schermata di gioco riempie l'altezza così il tavolo sta al centro */
#game-screen { display: flex; flex-direction: column; min-height: 100vh; }
/* Il contenuto della partita sta sopra lo sfondo */
#game-screen > #game-header,
#game-screen > #table-wrap { position: relative; z-index: 1; }
/* Il tavolo viene centrato verticalmente nello spazio sotto l'header */
#game-screen > #table-wrap { margin-top: auto; margin-bottom: auto; }

/* Città neon sfocata di profondità (riusa bg-tables.jpg) */
.gb-scene {
  position: absolute; inset: -8%;
  background: url("assets/bg-tables.jpg") center/cover no-repeat;
  filter: blur(9px) brightness(.3) saturate(1.3);
  transform: scale(1.1);
  animation: gb-pan 64s ease-in-out infinite alternate;
}
@keyframes gb-pan {
  from { transform: scale(1.1) translate(-1.5%, -1%); }
  to   { transform: scale(1.16) translate(1.5%, 1%); }
}

/* Velo a tinta del livello sopra la città */
.gb-tint {
  position: absolute; inset: 0;
  background: radial-gradient(120% 95% at 50% 36%, rgba(var(--accent-rgb), .24), transparent 70%);
  mix-blend-mode: screen; opacity: .85;
}

/* Alone pulsante dietro al tavolo */
.gb-glow {
  position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%);
  width: min(86vw, 940px); aspect-ratio: 3 / 2; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(var(--accent-rgb), .5), transparent 62%);
  filter: blur(46px);
  animation: gb-pulse 5.6s ease-in-out infinite;
}
@keyframes gb-pulse {
  0%, 100% { opacity: .4;  transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: .72; transform: translate(-50%, -50%) scale(1.07); }
}

/* Particelle/luci che salgono lente (generate in JS, tinte col livello) */
.gb-particles { position: absolute; inset: 0; }
.gb-mote {
  position: absolute; bottom: -6%;
  width: var(--s, 6px); height: var(--s, 6px); border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.95) 0%, rgba(var(--accent-rgb), .9) 42%, transparent 70%);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), .85);
  opacity: 0;
  animation: gb-rise var(--dur, 14s) linear var(--del, 0s) infinite;
}
@keyframes gb-rise {
  0%   { transform: translate(0, 0); opacity: 0; }
  10%  { opacity: var(--op, .8); }
  90%  { opacity: var(--op, .8); }
  100% { transform: translate(var(--drift, 0px), -112vh); opacity: 0; }
}

/* Vignettatura: scurisce i bordi così il tavolo risalta */
.gb-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(125% 105% at 50% 48%, transparent 50%, rgba(0,0,0,.6) 100%);
}
@media (prefers-reduced-motion: reduce) {
  .gb-scene, .gb-glow, .gb-mote { animation: none; }
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  :root { --card-w: 50px; --card-h: 74px; }
  #table-oval { height: clamp(260px, 60vw, 340px); }
  .seat { min-width: 92px; padding: 4px 8px; font-size: .75rem; }
  .seat .seat-name { max-width: 110px; }
  .seat .seat-cards { min-height: 26px; }
  .seat .seat-cards .card { width: 18px; height: 26px; }
  .seat.me .seat-cards.big .card { width: 38px; height: 56px; }
  .seat.me .seat-token { width: 40px; height: 40px; }
  /* Su mobile il dock torna a tutta larghezza, sotto il tavolo */
  #actions-area {
    position: static; right: auto; bottom: auto;
    width: 100%; margin-top: 10px;
  }
  #dock-info { text-align: center; }
  #action-buttons { justify-content: center; }
  #action-buttons .btn-action { flex: 1; min-width: 0; padding: 14px 4px; }
  #bet-controls { justify-content: center; }
  #game-header { font-size: .8rem; }
  .world-card { flex-direction: column; text-align: center; }
}

/* Telefoni stretti: posti più piccoli così i 6 non si accavallano */
@media (max-width: 480px) {
  .seat { min-width: 74px; padding: 3px 6px; font-size: .66rem; border-radius: 14px; }
  .seat .seat-name { max-width: 80px; }
  .seat .seat-chips { font-size: .66rem; }
  .seat-token { width: 30px; height: 30px; }
  .seat.me .seat-token { width: 36px; height: 36px; }
  .seat .seat-cards .card { width: 15px; height: 22px; }
  .seat.me .seat-cards.big .card { width: 32px; height: 48px; }
  .seat-badge-eq, .seat.me .seat-badge-eq { width: 22px; height: 22px; right: -6px; bottom: -6px; }
  #actions-area .btn-action { padding: 12px 3px; font-size: .82rem; }
  .dealer-button { width: 22px; height: 22px; font-size: .66rem; }
}

/* ===== Feel del tavolo v3 ===== */
/* Pulse del piatto quando cresce */
@keyframes pot-bump { 0% { transform: scale(1); } 40% { transform: scale(1.16); color: #ffe9a8; } 100% { transform: scale(1); } }
#pot-display.bump { animation: pot-bump .5s ease; }

/* Respiro luminoso sul giocatore di turno */
@keyframes turn-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(25,211,255,.6); }
  50%      { box-shadow: 0 0 22px rgba(25,211,255,.95), 0 0 42px rgba(25,211,255,.4); }
}
.seat.current { animation: turn-pulse 1.5s ease-in-out infinite; }

/* Pile di gettoni accanto ai posti (estetica, altezza ~ stack) */
/* Pila di gettoni stile casinò: una colonnina per taglio, valore sull'ultima fiche */
.chip-stack {
  position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%);
  display: flex; gap: 3px; align-items: flex-end; height: 32px;
  pointer-events: none; z-index: 2;
}
.pchip-col { position: relative; width: 18px; height: 32px; }
.pchip-stack { position: absolute; left: 0; bottom: 0; width: 18px; height: 100%; }
.pchip {
  position: absolute; left: 0; width: 18px; height: 18px; border-radius: 50%;
  background: repeating-conic-gradient(var(--edge) 0deg 20deg, var(--body) 20deg 40deg);
  box-shadow: 0 1px 2px rgba(0,0,0,.55);
}
.pchip::after {
  content: ""; position: absolute; inset: 2.5px; border-radius: 50%;
  background: radial-gradient(circle at 50% 36%, rgba(255,255,255,.42), rgba(255,255,255,0) 62%), var(--body);
  border: 1px dashed rgba(255,255,255,.4);
}
.pchip em {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-style: normal; font-weight: 800; font-size: .44rem; color: var(--txt, #fff);
  text-shadow: 0 1px 1px rgba(0,0,0,.4); z-index: 2;
}
.pchip.d1    { --body:#e9edf2; --edge:#b9c2cf; --txt:#1a2330; }
.pchip.d5    { --body:#d2362f; --edge:#ffffff; --txt:#ffffff; }
.pchip.d25   { --body:#1f9d4d; --edge:#ffffff; --txt:#ffffff; }
.pchip.d100  { --body:#23272e; --edge:#dfe6f0; --txt:#ffffff; }
.pchip.d500  { --body:#6f2da8; --edge:#ffffff; --txt:#ffffff; }
.pchip.d1000 { --body:#e0a32e; --edge:#5a3c12; --txt:#3a2606; }
.pchip.d5000 { --body:#c2532b; --edge:#ffe2c2; --txt:#ffffff; }
.seat.me .chip-stack { bottom: auto; top: -28px; }

/* Comandi siediti/alzati (multiplayer, stile blackjack online) */
.seat-sit, .seat-stand {
  position: absolute; z-index: 6; pointer-events: auto; cursor: pointer;
  font-family: var(--font-display); border: none;
}
.seat-sit {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 1.35rem; font-weight: 800; line-height: 1; color: #fff;
  background: radial-gradient(circle at 50% 34%, #4cf09a, #1c9d5a);
  box-shadow: 0 0 0 3px rgba(56,224,138,.28), 0 4px 12px rgba(0,0,0,.5);
  animation: sit-pulse 1.6s ease-in-out infinite;
}
.seat-sit.waiting {
  background: radial-gradient(circle at 50% 34%, #9aa7bd, #5d6b82);
  box-shadow: 0 3px 10px rgba(0,0,0,.5); animation: none; cursor: default;
}
.seat-stand {
  left: 50%; bottom: -30px; transform: translateX(-50%);
  padding: 3px 11px; border-radius: 999px; font-size: .64rem; font-weight: 700; letter-spacing: .05em;
  background: rgba(20,26,44,.92); color: #ffd9a8; border: 1px solid rgba(255,170,70,.55);
  box-shadow: 0 3px 9px rgba(0,0,0,.45);
}
.seat-stand:hover { background: rgba(40,30,18,.95); }
@keyframes sit-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(56,224,138,.28), 0 4px 12px rgba(0,0,0,.5); }
  50%      { box-shadow: 0 0 0 8px rgba(56,224,138,.10), 0 4px 14px rgba(0,0,0,.55); }
}
@media (prefers-reduced-motion: reduce) { .seat-sit { animation: none; } }

/* Celebrazione del vincitore: anello, monete che piovono, lampo dorato */
.win-burst {
  position: fixed; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  border: 3px solid rgba(255,220,120,.9); z-index: 60; pointer-events: none;
  animation: win-burst-a .9s ease-out forwards;
}
@keyframes win-burst-a { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(12); opacity: 0; } }
.win-coin {
  position: fixed; z-index: 61; font-size: 1.2rem; color: #ffd24d; pointer-events: none;
  text-shadow: 0 0 8px rgba(255,200,60,.85); animation: coin-fall var(--dur, 1s) var(--del, 0s) ease-in forwards;
}
@keyframes coin-fall {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(var(--dy, 100px)) rotate(220deg); opacity: 0; }
}
.win-flash {
  position: fixed; inset: 0; z-index: 55; pointer-events: none; animation: win-flash-a 1.05s ease-out forwards;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(255,210,90,.26), transparent 70%);
}
@keyframes win-flash-a { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .seat.current, #pot-display.bump { animation: none; }
}

/* ===== Sala Trofei ===== */
.trophy-share-btn { width: 100%; margin-bottom: 14px; }
.trophy-list { display: flex; flex-direction: column; gap: 8px; }
.trophy {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--panel-edge); opacity: .72;
}
.trophy.unlocked { opacity: 1; border-color: rgba(255,211,77,.5); background: rgba(255,211,77,.06); }
.tr-ico { font-size: 1.7rem; width: 34px; text-align: center; flex-shrink: 0; filter: grayscale(.6) opacity(.8); }
.trophy.unlocked .tr-ico { filter: none; }
.tr-main { flex: 1; min-width: 0; }
.tr-name { font-family: var(--font-display); font-size: .9rem; color: #eaf2ff; }
.trophy.unlocked .tr-name { color: #ffe9a8; }
.tr-desc { font-size: .76rem; color: rgba(220,230,255,.65); margin: 1px 0 5px; }
.tr-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.tr-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd34d, #ff8a3d); border-radius: 3px; }
.trophy.unlocked .tr-bar i { background: linear-gradient(90deg, #ffe9a8, #f4b53a); }
.tr-prog { font-size: .74rem; color: rgba(220,230,255,.7); white-space: nowrap; flex-shrink: 0; }

.trophy-toast {
  position: fixed; left: 50%; top: 16px; transform: translate(-50%, -26px);
  display: flex; align-items: center; gap: 12px; z-index: 86;
  background: linear-gradient(135deg, rgba(28,22,10,.97), rgba(14,10,4,.97));
  border: 1px solid rgba(255,211,77,.7); border-radius: 14px; padding: 10px 20px 10px 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 32px rgba(255,211,77,.35);
  opacity: 0; transition: transform .4s cubic-bezier(.2,1.2,.4,1), opacity .4s;
}
.trophy-toast.show { transform: translate(-50%, 0); opacity: 1; }
.trophy-toast .tt-ico { font-size: 1.8rem; }
.trophy-toast .tt-txt { display: flex; flex-direction: column; }
.trophy-toast .tt-txt b { font-family: var(--font-display); color: #ffe9a8; font-size: .9rem; }
.trophy-toast .tt-txt span { font-size: .8rem; color: rgba(235,228,210,.85); }
