/* Ciapachinze — stile. Palette ligure: ardesia, avorio, rosso San Giorgio, oro dei denari. */
:root {
  --ardesia: #1c2230;      /* fondo pagina: ardesia blu-grigia, piatta */
  --ardesia-2: #245a41;    /* panno del tavolo */
  --ardesia-3: #2d6d4f;    /* centro del panno */
  --ardesia-edge: #153c2b; /* bordo del tavolo */
  --avorio: #f6f0e1;
  --avorio-2: #e9e0cb;
  --carta: #fbf7ee;
  --inchiostro: #1b1a24;
  --rosso: #c8202f;
  --rosso-2: #a5161f;
  --oro: #d9a621;
  --oro-2: #f0c750;
  --basilico: #7fa36c;
  --mare: #2f6f8f;
  --testo: #e8e2d3;
  --testo-2: #a9b3b7;
  --card-w: 88px;
  --card-h: 128px;
  --radius: 10px;
  --ease: cubic-bezier(.22, .9, .3, 1);
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
/* il documento non scorre mai (scorrono solo le schermate): così, su iPhone, dopo una rotazione la pagina non resta "spostata" e i tocchi cadono dove si vede */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow: hidden; }
body { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--font-body);
  color: var(--testo);
  background: var(--ardesia);
  background-image:
    linear-gradient(#1c2230, #1c2230),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .05 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button { font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--oro-2); outline-offset: 2px; }
input { font: inherit; }
.hidden { display: none !important; }

/* ---------- wordmark ---------- */
.wordmark { display: inline-flex; align-items: baseline; gap: .12em; font-family: var(--font-display); font-weight: 900; letter-spacing: -.035em; line-height: 1; color: var(--avorio); font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; }
.wordmark .i { position: relative; display: inline-block; }
.wordmark .i::after { position: absolute; left: 50%; top: .02em; transform: translateX(-50%); font-size: .34em; line-height: 1; color: var(--rosso); font-family: "Segoe UI Symbol", "Apple Symbols", system-ui, sans-serif; text-shadow: 0 .05em .1em rgba(0,0,0,.3); }
.wordmark .i.h::after { content: "♥"; }
.wordmark .i.d::after { content: "♦"; top: -.02em; font-size: .4em; }
.wordmark .badge { display: inline-grid; place-items: center; width: .82em; height: 1.05em; margin-left: .18em; border-radius: .09em; background: var(--carta); color: var(--rosso); font-size: .62em; font-weight: 900; box-shadow: 0 .06em .15em rgba(0,0,0,.35); transform: rotate(9deg) translateY(-.08em); letter-spacing: -.05em; border: .04em solid var(--avorio-2); }
.wordmark.big { font-size: clamp(54px, 11.5vw, 150px); margin-bottom: 26px; }
.wordmark.small { font-size: 24px; }

/* ---------- schermate ---------- */
.screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; overflow-y: auto; overflow-x: hidden; }
.screen.off { display: none; }
.home { text-align: center; max-width: 720px; width: 100%; }
.home .tag { font-family: var(--font-display); font-style: italic; font-weight: 400; color: #c9d4d2; font-size: clamp(16px, 2.2vw, 22px); margin: 10px 0 34px; }
.home-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; text-align: left; }
@media (max-width: 640px) { .home-cards { grid-template-columns: 1fr; } }
.panel { background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 20px; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.panel h2 { font-family: var(--font-display); font-weight: 600; margin: 0 0 12px; font-size: 22px; color: var(--avorio); }
.home-cards .panel h2 { text-align: center; font-size: 24px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.field label { font-size: 13px; color: var(--testo-2); }
.field input { padding: 11px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.25); color: var(--avorio); font-size: 16px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; padding: 9px 8px; border-radius: 9px; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.2); color: var(--testo); }
.seg button.on { background: var(--avorio); color: var(--inchiostro); border-color: var(--avorio); font-weight: 700; }
.btn { padding: 12px 18px; border-radius: 12px; border: none; background: var(--rosso); color: #fff; font-weight: 700; font-size: 16px; box-shadow: 0 6px 18px rgba(200,32,47,.35); transition: transform .15s var(--ease), box-shadow .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(200,32,47,.4); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--avorio); border: 1px solid rgba(255,255,255,.25); box-shadow: none; }
.btn.oro { background: var(--oro); color: var(--inchiostro); box-shadow: 0 6px 18px rgba(217,166,33,.3); }
.btn.sm { padding: 8px 12px; font-size: 14px; border-radius: 9px; }
.btn.wide { width: 100%; margin-top: 8px; }
.home-foot { margin-top: 26px; color: var(--testo-2); font-size: 14px; }
.home-foot a, .linkish { color: var(--oro-2); cursor: pointer; text-decoration: none; background: none; border: none; padding: 0; font: inherit; }

/* lobby */
.lobby { width: min(680px, 100%); }
.code-box { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin: 6px 0 16px; }
.code { font-family: var(--font-display); font-weight: 900; font-size: 42px; letter-spacing: .12em; color: var(--oro-2); }
.seats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 8px 0 16px; }
.seat { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px dashed rgba(255,255,255,.15); min-height: 58px; }
.seat.full { border-style: solid; border-color: rgba(255,255,255,.2); }
.seat .who { flex: 1; font-weight: 700; }
.seat .team { font-size: 12px; color: var(--testo-2); }
.seat .offline { color: var(--rosso); font-size: 12px; }
.seat.team0 { box-shadow: inset 3px 0 0 var(--oro); }
.seat.team1 { box-shadow: inset 3px 0 0 var(--mare); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: var(--inchiostro); background: var(--avorio); font-family: var(--font-display); position: relative; flex: none; }
.status { color: var(--testo-2); font-size: 14px; min-height: 20px; }

/* ---------- gioco ---------- */
#game { position: fixed; inset: 0; display: grid; grid-template-rows: calc(52px + env(safe-area-inset-top, 0px)) minmax(0, 1fr) calc(64px + env(safe-area-inset-bottom, 0px)); grid-template-columns: minmax(0, 1fr); }
#game.novoice { grid-template-rows: calc(52px + env(safe-area-inset-top, 0px)) minmax(0, 1fr) env(safe-area-inset-bottom, 0px); }
.topbar { padding-top: env(safe-area-inset-top, 0px); }
.bottombar { padding-bottom: calc(env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
.screen { padding-top: calc(24px + env(safe-area-inset-top, 0px)); padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.side { padding-top: env(safe-area-inset-top, 0px); }
.toast { top: calc(64px + env(safe-area-inset-top, 0px)); }
.ach-toast { top: calc(70px + env(safe-area-inset-top, 0px)); }
#game.novoice .bottombar { display: none; }
.bottombar { display: flex; align-items: center; justify-content: center; background: linear-gradient(0deg, rgba(0,0,0,.35), rgba(0,0,0,.1)); border-top: 1px solid rgba(255,255,255,.06); padding: 0 8px; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 0 14px; min-width: 0; overflow: hidden; background: rgba(0,0,0,.22); z-index: 5; }
.topbar .spacer { flex: 1; }
.scores { display: flex; gap: 8px; align-items: center; }
.score { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border-radius: 999px; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.1); font-size: 14px; }
.score b { font-family: var(--font-display); font-size: 20px; font-weight: 700; min-width: 26px; text-align: center; }
.score .dot { width: 10px; height: 10px; border-radius: 50%; }
.score.t0 .dot { background: var(--oro); } .score.t1 .dot { background: var(--mare); }
.score .vs { color: var(--testo-2); }
.goal { font-size: 12px; color: var(--testo-2); }
.iconbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.25); color: var(--avorio); display: grid; place-items: center; font-size: 18px; position: relative; }
.iconbtn.on { background: var(--avorio); color: var(--inchiostro); }
.iconbtn .n { position: absolute; top: -6px; right: -6px; background: var(--rosso); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 6px; }

.stage-wrap { position: relative; overflow: hidden; }
.stage { position: absolute; inset: 0; }
/* tavolo in ardesia */
.felt { position: absolute; inset: 6px; border-radius: 28px; background: radial-gradient(ellipse at 50% 40%, var(--ardesia-3), var(--ardesia-2) 60%, var(--ardesia-edge)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.05), inset 0 0 80px rgba(0,0,0,.45), 0 20px 50px rgba(0,0,0,.4); }
.felt::after { content: ""; position: absolute; inset: 10px; border-radius: 22px; border: 1px solid rgba(255,255,255,.05); }
.zone-label { position: absolute; font-size: 12px; color: rgba(255,255,255,.35); letter-spacing: .04em; pointer-events: none; }

/* carte */
.card { position: absolute; left: 0; top: 0; width: var(--card-w); height: var(--card-h); transform-style: preserve-3d; transition: transform .6s var(--ease), opacity .4s; will-change: transform; cursor: default; z-index: 2; }
.card .face, .card .back { position: absolute; inset: 0; border-radius: var(--radius); backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 2px 4px rgba(0,0,0,.35), 0 8px 18px rgba(0,0,0,.25); overflow: hidden; }
.card .face { background: var(--carta); color: var(--inchiostro); border: 1px solid #d9d0b8; }
.card .back { transform: rotateY(180deg); background: var(--rosso-2); border: 5px solid var(--carta); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 6px, transparent 6px 12px), repeating-linear-gradient(-45deg, rgba(0,0,0,.12) 0 6px, transparent 6px 12px); }
.card .back::after { content: ""; position: absolute; inset: 10px; border-radius: 5px; border: 1.5px solid rgba(255,255,255,.35); }
.card.down { transform: rotateY(180deg); }
.card .face svg { width: 100%; height: 100%; display: block; }
.card.red .face { color: var(--rosso); }
.card.denari .face { background: linear-gradient(160deg, #fffaf0, #f6e9c5); border-color: #d9b96a; box-shadow: inset 0 0 0 1px rgba(217,166,33,.45); }
.card.selectable { cursor: grab; touch-action: none; }
.card.dragging { transition: none !important; cursor: grabbing; }
.card .face { transition: box-shadow .18s ease; }
.card.dragging .face { box-shadow: 0 0 0 3px var(--oro-2), 0 18px 28px rgba(0,0,0,.45), 0 40px 70px rgba(0,0,0,.4); }
.card.over-table .face { box-shadow: 0 0 0 3px var(--basilico), 0 0 26px rgba(190,230,170,.7), 0 18px 28px rgba(0,0,0,.45), 0 40px 70px rgba(0,0,0,.4); }
.card.landing { transition: transform .62s cubic-bezier(.22, 1.25, .36, 1), opacity .4s; }
.card.landing .face { transition: box-shadow .5s cubic-bezier(.22, 1, .36, 1); }
.card.selected { z-index: 6; }
.card.selected .face { box-shadow: 0 0 0 3px var(--oro-2), 0 14px 30px rgba(0,0,0,.5); }
.card.target .face { box-shadow: 0 0 0 3px var(--basilico), 0 0 24px rgba(127,163,108,.75); }
.card.target-dim .face { filter: brightness(.7); }
.card.target.alt .face { box-shadow: 0 0 0 3px var(--oro-2), 0 0 24px rgba(240,199,80,.7); }
.card.playable .face { box-shadow: 0 0 0 2px var(--oro-2), 0 0 18px rgba(240,199,80,.55), 0 8px 18px rgba(0,0,0,.3); }
.card.playable::after { content: ""; position: absolute; left: 50%; top: -12px; width: 8px; height: 8px; border-radius: 50%; background: var(--oro-2); transform: translateX(-50%); box-shadow: 0 0 10px var(--oro-2); }
.card.selected.playable::after { display: none; }
.card.no-anim { transition: none !important; }
.card.scopa-mark { z-index: 3; }
.card .face .val-hint { font-family: var(--font-body); }

/* mazzo */
.deck { position: absolute; width: var(--card-w); height: var(--card-h); transform-origin: top left; }
.deck .layer { position: absolute; inset: 0; border-radius: var(--radius); background: var(--rosso-2); border: 5px solid var(--carta); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 6px, transparent 6px 12px), repeating-linear-gradient(-45deg, rgba(0,0,0,.12) 0 6px, transparent 6px 12px); box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.deck .count { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: calc(18px / var(--deck-k, 1)); font-family: var(--font-display); letter-spacing: .02em; text-shadow: 0 2px 0 rgba(0,0,0,.45), 0 0 14px rgba(0,0,0,.5); z-index: 3; pointer-events: none; }
.deck .count:empty { display: none; }
.deck { z-index: 2; }
.pile { position: absolute; width: var(--card-w); height: var(--card-h); border-radius: var(--radius); border: 1px dashed rgba(255,255,255,.15); display: grid; place-items: center; color: rgba(255,255,255,.3); font-size: 12px; text-align: center; padding: 6px; cursor: pointer; transition: border-color .2s; transform-origin: top left; z-index: 2; }
.pile .layer { display: none; position: absolute; inset: 0; border-radius: var(--radius); background: var(--rosso-2); border: 5px solid var(--carta); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 6px, transparent 6px 12px), repeating-linear-gradient(-45deg, rgba(0,0,0,.12) 0 6px, transparent 6px 12px); box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.pile.full { border-color: transparent; }
.pile.full .layer { display: block; }
.pile.full .l3 { transform: translate(5px,5px) rotate(2deg); } .pile.full .l2 { transform: translate(2px,2px) rotate(-1deg); }
.pile:hover { border-color: rgba(255,255,255,.4); }
.pile .cnt { position: absolute; top: -10px; right: -10px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; background: var(--avorio); color: var(--inchiostro); font-weight: 900; font-size: 14px; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.4); z-index: 3; font-family: var(--font-body); }
.pile .cnt:empty { display: none; }
.pile.t1 .cnt { background: #8ec1dc; } .pile.t0 .cnt { background: var(--oro-2); }
.pile.t0 { border-color: rgba(217,166,33,.35); } .pile.t1 { border-color: rgba(47,111,143,.5); }

/* giocatori */
.player { position: absolute; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.1); transition: box-shadow .3s; z-index: 4; }
.player .name { font-weight: 700; font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .sub { font-size: 11px; color: var(--testo-2); }
.player.turn { box-shadow: 0 0 0 2px var(--oro-2), 0 0 20px rgba(240,199,80,.5); }
.player.speaking .avatar { box-shadow: 0 0 0 3px var(--basilico), 0 0 16px var(--basilico); }
.player .avatar::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid transparent; }
.player .mic { font-size: 12px; opacity: .7; }
.player.offline { opacity: .5; }
.player.label { z-index: 4; padding: 3px 10px 3px 4px; background: rgba(0,0,0,.45); border-color: rgba(255,255,255,.12); }
.player.label .avatar { width: 22px; height: 22px; font-size: 10px; }
.player.label .name { font-size: 12px; max-width: 120px; }
.player.label .sub { display: none; }
.player.label.turn { box-shadow: 0 0 0 2px var(--oro-2), 0 0 14px rgba(240,199,80,.45); }
.player.team0 .avatar { background: var(--oro-2); } .player.team1 .avatar { background: #8ec1dc; }

/* opzioni presa */
.choices { display: none !important; }
.choice { padding: 8px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.55); color: var(--avorio); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.choice:hover, .choice.hl { background: var(--avorio); color: var(--inchiostro); }
.choice .k { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--basilico); color: #fff; }
.choice .k.fifteen { background: var(--rosso); }
.choice .k.ace { background: var(--oro); color: var(--inchiostro); }
.choice.none { border-style: dashed; }
.hint { position: absolute; left: 50%; transform: translateX(-50%); color: var(--testo-2); font-size: 13px; pointer-events: none; text-align: center; z-index: 4; }

/* effetti */
.shake { animation: shake .5s; }
@keyframes shake { 0%,100% { transform: translate(0,0); } 20% { transform: translate(-4px, 2px); } 40% { transform: translate(4px, -2px); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(3px, -1px); } }
.spark { position: absolute; width: 9px; height: 9px; border-radius: 50%; pointer-events: none; z-index: 21; animation: spark 1.3s cubic-bezier(.2,.8,.3,1) forwards; box-shadow: 0 0 8px currentColor; }
@keyframes spark { 0% { transform: translate(0,0) scale(.4); opacity: 1; } 60% { opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 60px)) scale(0); opacity: 0; } }

/* pannello laterale */
.side { position: absolute; top: 0; right: 0; bottom: 0; width: 320px; background: rgba(12,20,26,.92); backdrop-filter: blur(10px); border-left: 1px solid rgba(255,255,255,.08); transform: translateX(100%); transition: transform .35s var(--ease); z-index: 30; display: flex; flex-direction: column; }
.side.open { transform: translateX(0); }
.side header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side header h3 { margin: 0; flex: 1; font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,.08); }
.tabs button { flex: 1; padding: 10px; background: none; border: none; color: var(--testo-2); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--avorio); border-bottom-color: var(--oro); }
.side .body { flex: 1; overflow: auto; padding: 12px 14px; }
.log { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.log .e { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.04); }
.log .e .who { font-weight: 700; white-space: nowrap; }
.log .e.scopa { background: rgba(127,163,108,.2); }
.log .e.buona { background: rgba(217,166,33,.2); }
.minicards { display: flex; flex-wrap: wrap; gap: 4px; }
.mini { width: 30px; height: 42px; border-radius: 4px; background: var(--carta); color: var(--inchiostro); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 900; font-size: 13px; border: 1px solid #d0c6ad; line-height: 1; text-align: center; }
.mini.red { color: var(--rosso); } .mini.denari { background: #f8ecc8; }
.mini.scopa { outline: 2px solid var(--basilico); }
.prese-team { margin-bottom: 16px; }
.prese-team h4 { margin: 0 0 6px; font-size: 13px; color: var(--testo-2); font-weight: 600; }
.chat { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.chat input { flex: 1; padding: 9px 10px; border-radius: 9px; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.3); color: var(--avorio); }
.msg { padding: 6px 8px; border-radius: 8px; font-size: 13px; background: rgba(255,255,255,.05); margin-bottom: 6px; }
.msg b { color: var(--oro-2); }

/* voce */
.voice { display: flex; gap: 8px; align-items: center; }
.vbtn { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.15); background: rgba(0,0,0,.5); color: var(--avorio); font-weight: 700; font-size: 14px; transition: background .2s, transform .1s; touch-action: none; }
.vbtn.on { background: var(--basilico); color: #fff; border-color: transparent; }
.vbtn.ptt { padding: 14px 22px; -webkit-touch-callout: none; -webkit-user-select: none; }
.vbtn.ptt.live { background: var(--rosso); color: #fff; transform: scale(1.06); box-shadow: 0 0 0 6px rgba(200,32,47,.3), 0 0 30px rgba(200,32,47,.6); }
.vbtn.mute.on { background: var(--rosso); }
.vbtn:disabled { opacity: .5; cursor: not-allowed; }
.vstate { font-size: 12px; color: var(--testo-2); }
.lvl { width: 6px; height: 16px; border-radius: 3px; background: rgba(255,255,255,.2); overflow: hidden; position: relative; }
.lvl i { position: absolute; left: 0; right: 0; bottom: 0; height: 0%; background: var(--basilico); }

/* modali */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(4px); animation: fadein .25s; }
@keyframes fadein { from { opacity: 0; } }
.modal { background: #242b3a; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 22px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: pop .35s var(--ease); }
@keyframes pop { from { transform: scale(.94) translateY(10px); opacity: 0; } }
.modal h2 { font-family: var(--font-display); font-weight: 700; margin: 0 0 6px; font-size: 26px; color: var(--avorio); }
.modal h2 small { display: block; font-size: 14px; color: var(--testo-2); font-weight: 400; font-style: italic; margin-top: 2px; }
.modal p { color: var(--testo-2); line-height: 1.5; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.tbl { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.tbl th, .tbl td { padding: 6px 8px; text-align: center; border-bottom: 1px solid rgba(255,255,255,.08); }
.tbl th { color: var(--testo-2); font-weight: 600; }
.tbl td:first-child, .tbl th:first-child { text-align: left; }
.tbl tr.tot td { font-weight: 800; font-size: 16px; color: var(--avorio); border-top: 2px solid rgba(255,255,255,.2); }
.tbl .pt { color: var(--basilico); font-weight: 800; }
.tbl .zero { color: rgba(255,255,255,.25); }
.buona-opts { display: flex; flex-direction: column; gap: 8px; }
.buona-opts button { text-align: left; padding: 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: rgba(0,0,0,.25); color: var(--avorio); font-size: 15px; }
.buona-opts button:hover { background: var(--avorio); color: var(--inchiostro); }
.rules h3 { font-family: var(--font-display); font-weight: 600; color: var(--oro-2); margin: 16px 0 4px; }
.rules ul { margin: 4px 0; padding-left: 18px; color: var(--testo-2); line-height: 1.5; }
.rules li b { color: var(--avorio); }

.toast { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); background: rgba(0,0,0,.75); color: var(--avorio); padding: 10px 16px; border-radius: 999px; z-index: 60; font-size: 14px; border: 1px solid rgba(255,255,255,.12); animation: fadein .2s; max-width: 90vw; text-align: center; }

/* responsive */
@media (max-width: 900px) {
  :root { --card-w: 68px; --card-h: 99px; --radius: 7px; }
  #game { grid-template-rows: calc(46px + env(safe-area-inset-top, 0px)) 1fr calc(58px + env(safe-area-inset-bottom, 0px)); }
  #game.novoice { grid-template-rows: calc(46px + env(safe-area-inset-top, 0px)) 1fr env(safe-area-inset-bottom, 0px); }
  .felt { inset: 4px; border-radius: 16px; }
  .side { width: min(320px, 92vw); }
  .player .name { max-width: 90px; }
  .topbar { gap: 6px; padding: 0 8px; }
  .wordmark.small { font-size: 18px; }
  .score { padding: 3px 8px 3px 5px; font-size: 12px; gap: 5px; }
  .score b { font-size: 15px; min-width: 18px; }
  .score.vs { display: none; }
  .scores { gap: 4px; }
  .iconbtn { width: 32px; height: 32px; font-size: 15px; border-radius: 8px; }

}
@media (max-width: 520px) {
  :root { --card-w: 64px; --card-h: 93px; }
  .vbtn { padding: 9px 11px; font-size: 13px; }
  .vbtn.ptt { padding: 11px 18px; }
  .choices { gap: 6px; }
  .choice { font-size: 13px; padding: 7px 10px; }
  .player { padding: 4px 8px 4px 4px; }
  .player .avatar { width: 26px; height: 26px; font-size: 12px; }
  .player .name { font-size: 12px; max-width: 80px; }
  .player .sub { font-size: 10px; }
  .pile .cnt { font-size: 10px; }
  .fx { font-size: 32px; }
    .modal { padding: 16px; border-radius: 14px; }
  .modal h2 { font-size: 22px; }
  .home .tag { margin-bottom: 20px; }
  .vbtn .lbl { display: none; }
  .vbtn.ptt .lbl { display: inline; }
  .goal { display: none; }
  .code { font-size: 32px; }
  .seats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .fx, .shake { animation-duration: .01s; }
}

/* striscia informativa su smartphone: mazzo e prese */
.mstrip { position: absolute; left: 12px; top: 10px; display: flex; justify-content: flex-start; gap: 6px; z-index: 4; font-size: 11px; color: var(--testo-2); }
.mstrip span { background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.06); border-radius: 999px; padding: 3px 8px; color: rgba(255,255,255,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mstrip #ms-mine { box-shadow: inset 2px 0 0 var(--oro); }
.mstrip #ms-theirs { box-shadow: inset 2px 0 0 var(--mare); }
.player.compact { padding: 3px 7px 3px 3px; }
.player.compact .sub { display: none; }
.player.compact .name { max-width: 64px; font-size: 11px; }
.player.compact .avatar { width: 22px; height: 22px; font-size: 10px; }

/* arco mano/campo, scritta curva, riquadro di scelta */
.dropzone, .hintarc { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; overflow: visible; }
/* zona di lancio durante il trascinamento */
.dropzone #drop-fill { fill: rgba(190,230,170,.03); transition: fill .1s linear; }
.dropzone #drop-spotfill { opacity: 0; transition: opacity .12s linear; mix-blend-mode: screen; }
.dropzone #drop-band { fill: none; stroke: rgba(190,230,170,.22); stroke-width: 10; stroke-linecap: round; filter: blur(8px); opacity: .25; }
.dropzone #drop-path { fill: none; stroke: rgba(216,240,200,.6); stroke-width: 1.5; stroke-dasharray: 2 9; stroke-linecap: round; }
.dropzone #drop-solid { fill: none; stroke: #e4f7d6; stroke-width: 2; stroke-linecap: round; opacity: 0; transition: opacity .08s linear, stroke-width .08s linear; filter: drop-shadow(0 0 6px rgba(190,230,170,.9)); }
.dropzone #drop-pulse { fill: none; stroke: #e4f7d6; stroke-width: 2; opacity: 0; }
.dropzone #drop-pulse.go { animation: dz-pulse .55s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes dz-pulse { 0% { r: 6; opacity: .9; stroke-width: 3; } 100% { r: 90; opacity: 0; stroke-width: .5; } }
/* mezzaluna: filo sottile, alone morbido che respira, due comete che scorrono */
.hintarc text { fill: var(--testo-2); font-family: var(--font-display); font-style: italic; font-size: 15px; letter-spacing: .04em; }
.hintarc #hint-aurora { fill: none; stroke: rgba(190,230,170,.35); stroke-width: 14; stroke-linecap: round; filter: blur(10px); opacity: 0; }
.hintarc #hint-glow { fill: none; stroke: rgba(216,240,200,.55); stroke-width: 1.25; stroke-linecap: round; opacity: 0; }
.hintarc #hint-comet, .hintarc #hint-comet2 { fill: none; stroke: #eefbe4; stroke-width: 2; stroke-linecap: round; opacity: 0; filter: drop-shadow(0 0 5px rgba(216,240,200,.95)); }
.hintarc.myturn #hint-aurora { animation: aurora 3.2s ease-in-out infinite; }
.hintarc.myturn #hint-glow { opacity: 1; }
.hintarc.myturn #hint-comet, .hintarc.myturn #hint-comet2 { opacity: 1; animation: comet 4.2s linear infinite; }
.hintarc.myturn text { fill: #e4f2d8; }
@keyframes aurora { 0%, 100% { opacity: .25; stroke-width: 10; } 50% { opacity: .7; stroke-width: 18; } }
@keyframes comet { from { stroke-dashoffset: 0; } to { stroke-dashoffset: calc(-1 * var(--period, 1000px)); } }
@media (prefers-reduced-motion: reduce) { .hintarc.myturn #hint-aurora, .hintarc.myturn #hint-comet, .hintarc.myturn #hint-comet2 { animation: none; opacity: .5; } }
@media (max-width: 520px) { .hintarc text { font-size: 13px; } }

.review-bar { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); z-index: 46; display: flex; align-items: center; gap: 10px; background: rgba(12,20,26,.9); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 6px 8px 6px 14px; font-size: 13px; color: var(--testo-2); max-width: 96%; }
@media (max-width: 520px) { .review-bar { font-size: 11px; padding-left: 10px; gap: 6px; } .review-bar span { display: none; } }

/* impostazioni, rientro, storico, fine partita */
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: rgba(0,0,0,.2); margin: 8px 0; cursor: pointer; color: var(--avorio); }
.opt input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--oro); }
.opt small { color: var(--testo-2); }
.resume { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; background: rgba(217,166,33,.15); border: 1px solid rgba(217,166,33,.45); border-radius: 12px; padding: 10px 14px; margin-bottom: 18px; font-size: 14px; color: var(--avorio); }
.record { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: rgba(217,166,33,.12); color: var(--avorio); font-size: 14px; text-align: center; }
.pile.theirs .cnt { display: none; }
.modal.won { animation: winpop .9s var(--ease); box-shadow: 0 0 0 3px var(--oro), 0 0 60px rgba(240,199,80,.45), 0 30px 80px rgba(0,0,0,.6); }
.modal.won h2 { background: linear-gradient(90deg, var(--oro-2), #fff7d6, var(--oro-2)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 2.5s linear infinite; }
.modal.lost { animation: losepop 1s var(--ease); box-shadow: 0 0 0 2px rgba(200,32,47,.5), 0 30px 80px rgba(0,0,0,.7); }
.modal.lost h2 { color: #e8a0a6; }
.modal.deal { animation: pop .35s var(--ease); }
.modal.won .tbl tr, .modal.lost .tbl tr { animation: rowin .5s var(--ease) both; }
.modal .tbl tr:nth-child(2) { animation-delay: .25s } .modal .tbl tr:nth-child(3) { animation-delay: .32s } .modal .tbl tr:nth-child(4) { animation-delay: .39s } .modal .tbl tr:nth-child(5) { animation-delay: .46s } .modal .tbl tr:nth-child(6) { animation-delay: .53s } .modal .tbl tr:nth-child(7) { animation-delay: .6s } .modal .tbl tr:nth-child(8) { animation-delay: .67s } .modal .tbl tr:nth-child(9) { animation-delay: .8s } .modal .tbl tr:nth-child(10) { animation-delay: .9s }
@keyframes winpop { 0% { transform: scale(.6) rotate(-4deg); opacity: 0; } 55% { transform: scale(1.06) rotate(1deg); opacity: 1; } 75% { transform: scale(.98); } 100% { transform: scale(1) rotate(0); } }
@keyframes losepop { 0% { transform: translateY(40px) scale(.96); opacity: 0; filter: grayscale(1); } 60% { opacity: 1; } 100% { transform: none; filter: none; } }
@keyframes rowin { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes shine { to { background-position: 200% center; } }
@media (prefers-reduced-motion: reduce) { .modal.won, .modal.lost, .modal .tbl tr { animation: none !important; } }

/* pulsante coppia in sala d'attesa */
.pairbtn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.3); color: var(--avorio); font-size: 13px; font-weight: 700; transition: background .2s, transform .15s; white-space: nowrap; }
.pairbtn .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mare); box-shadow: 0 0 6px var(--mare); }
.pairbtn.mine .dot { background: var(--oro-2); box-shadow: 0 0 6px var(--oro-2); }
.pairbtn.mine { border-color: rgba(240,199,80,.5); }
.pairbtn:hover { background: rgba(255,255,255,.12); transform: translateY(-1px); }

.home-cards .panel { box-shadow: 0 14px 34px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.12); border-width: 1px; }
.panel.open-table { background: linear-gradient(165deg, #c62b3b, #8e1b28); border-color: rgba(255,190,195,.45); }
.panel.join-table { background: linear-gradient(165deg, #2f7fc4, #1d5288); border-color: rgba(170,210,245,.5); }
.panel.arcade-panel { background: linear-gradient(165deg, #d9a621, #9a7212); border-color: rgba(255,235,170,.6); }
.panel.arcade-panel h2, .panel.arcade-panel .arcade-sub, .panel.arcade-panel .arcade-progress { color: #2a1f04; }
.panel.arcade-panel .arcade-sub { color: rgba(42,31,4,.85); }
.panel.arcade-panel .arcade-progress .bar { background: rgba(0,0,0,.2); } .panel.arcade-panel .arcade-progress .bar i { background: #fff3c4; }
.panel.arcade-panel .btn.oro { background: #2a1f04; color: #ffe9a8; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.home-cards .panel h2 { border-bottom-color: rgba(255,255,255,.25); }
.home-cards .panel .field label { color: rgba(255,255,255,.85); }
.panel.open-table .btn { background: #fff; color: #8e1b28; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.panel.open-table .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.panel.join-table .btn.blue { background: #fff; color: #1d5288; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.panel.open-table .seg button, .panel.join-table .seg button { background: rgba(0,0,0,.25); border-color: rgba(255,255,255,.3); color: #fff; }
.panel.open-table .seg button.on { background: #fff; color: #8e1b28; border-color: #fff; }
.panel.open-table .field input, .panel.join-table .field input { background: rgba(255,255,255,.92); color: var(--inchiostro); border-color: transparent; }
.panel.open-table .field input::placeholder, .panel.join-table .field input::placeholder { color: #8a8a8a; }
.btn.blue { background: #2f8fd6; color: #fff; box-shadow: 0 6px 18px rgba(47,143,214,.35); }
.home-cards.three { grid-template-columns: repeat(3, 1fr); }
.home-cards.four { grid-template-columns: repeat(2, 1fr); max-width: 900px; margin-left: auto; margin-right: auto; }
@media (max-width: 900px) { .home-cards.three { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .home-cards.four { grid-template-columns: 1fr; } }
.hello { display: none !important; }
.hello b { color: var(--avorio); }
.arcade-sub { color: rgba(255,255,255,.8); font-size: 14px; margin: 0 0 12px; line-height: 1.45; }
.arcade-progress { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 14px; color: var(--avorio); }
.arcade-progress .bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(0,0,0,.35); overflow: hidden; }
.arcade-progress .bar i { display: block; height: 100%; background: var(--oro-2); border-radius: 4px; }
/* mappa arcade */
.arcade { width: min(760px, 100%); }
.arcade-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.arcade-head .spacer { flex: 1; }
.stars-total { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--oro-2); }
.arcade-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 5vw, 38px); margin: 6px 0 16px; color: var(--avorio); }
.zone { margin-bottom: 22px; }
.zone h3 { font-family: var(--font-display); font-weight: 600; font-size: 18px; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.zone h3 i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tappa { text-align: left; padding: 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.25); color: var(--avorio); position: relative; transition: transform .15s, background .2s; min-height: 92px; display: flex; flex-direction: column; gap: 4px; }
.tappa:hover:not(:disabled) { transform: translateY(-2px); background: rgba(255,255,255,.08); }
.tappa:disabled { opacity: .45; cursor: not-allowed; }
.tappa .n { font-size: 11px; color: var(--testo-2); }
.tappa .town { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.tappa .who { font-size: 12px; color: var(--testo-2); }
.tappa .st { margin-top: auto; font-size: 15px; letter-spacing: 2px; color: var(--oro-2); }
.tappa .st .off { color: rgba(255,255,255,.2); }
.tappa.done { border-color: rgba(240,199,80,.5); }
.tappa.next { border-color: var(--oro-2); box-shadow: 0 0 0 1px var(--oro-2), 0 0 24px rgba(240,199,80,.35); }
.tappa .lock { position: absolute; top: 10px; right: 12px; font-size: 14px; }
/* obiettivo in gioco */
.goalbar { position: absolute; top: 10px; right: 12px; z-index: 65; }
.goalbar .goalbtn { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(0,0,0,.42); color: var(--oro-2); font-size: 15px; font-weight: 800; line-height: 1; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: transform .15s var(--spring), background .15s; }
.goalbar .goalbtn:active { transform: scale(.92); }
.goalbar .goalbtn .n { font-size: 11px; font-weight: 700; color: var(--avorio); opacity: .85; }
.goalbar .goalbtn .s { letter-spacing: -1px; font-size: 14px; }
.goalbar .goalbtn .s i { font-style: normal; opacity: .32; }
.goalbar .goalbtn.pop { animation: goalpop .9s var(--spring); }
@keyframes goalpop { 0% { transform: scale(1); } 30% { transform: scale(1.28); box-shadow: 0 0 0 6px rgba(226,169,58,.25), 0 0 22px rgba(226,169,58,.7); } 100% { transform: scale(1); } }
.goalbar.open .goalbtn { background: var(--oro-2); color: var(--inchiostro); }
.goalbar.open .goalbtn .n { color: var(--inchiostro); }
.goalbar .goalpop { position: absolute; top: 38px; right: 0; width: min(280px, 78vw); padding: 12px 14px; border-radius: 16px; background: rgba(14,18,26,.92); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 14px 40px rgba(0,0,0,.45); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--avorio); font-size: 13px; opacity: 0; transform: translateY(-6px) scale(.96); transform-origin: top right; pointer-events: none; transition: opacity .18s, transform .22s var(--spring); }
.goalbar.open .goalpop { opacity: 1; transform: none; pointer-events: auto; }
.goalbar .goalpop .town { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--testo-2); margin-bottom: 8px; }
.goalbar .goalpop > div { display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; align-items: start; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.07); line-height: 1.3; }
.goalbar .goalpop > div > span:first-child { color: var(--oro-2); font-size: 12px; letter-spacing: -1px; white-space: nowrap; padding-top: 1px; }
.goalbar .goalpop > div.ok { color: #9be39b; }
.goalbar .goalpop > div > em { display: none; font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #0f1a12; background: #9be39b; border-radius: 999px; padding: 3px 8px; align-self: center; }
.goalbar .goalpop > div.ok > em { display: inline-block; }
.goalbar .goalpop > div.ok > span:first-child { color: #9be39b; }
.goalbar .goalpop small { display: block; margin-top: 8px; color: var(--testo-2); font-size: 11px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.ach { padding: 10px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.1); text-align: center; }
.ach .ic { font-size: 26px; }
.ach .nm { font-weight: 700; font-size: 13px; color: var(--avorio); margin-top: 4px; }
.ach .ds { font-size: 11px; color: var(--testo-2); }
.ach.locked { opacity: .35; filter: grayscale(1); }
.stars-big { font-size: 44px; letter-spacing: 6px; color: var(--oro-2); text-align: center; margin: 6px 0; }
.stars-big .off { color: rgba(255,255,255,.2); }
.ach-toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 70; display: flex; gap: 12px; align-items: center; background: linear-gradient(90deg, #8a6a12, #4f3c0a); border: 1px solid var(--oro-2); border-radius: 14px; padding: 10px 16px; color: var(--avorio); box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: pop .4s var(--ease); }
.ach-toast .ic { font-size: 28px; }
.ach-toast small { display: block; color: rgba(255,255,255,.75); }

.mstrip.low { top: auto; bottom: 12px; left: 12px; }

.arcade-mode { max-width: 420px; margin-bottom: 6px; }
.arcade-mode button.on { background: var(--oro-2); border-color: var(--oro-2); color: var(--inchiostro); }

.backup { margin: 8px 0; color: var(--testo-2); font-size: 14px; }
.backup summary { cursor: pointer; color: var(--avorio); }

.stage-wrap.fxon .stage { filter: blur(2px) brightness(.55); transition: filter .25s; }
.stage-wrap .stage { transition: filter .35s; }

/* ===== annunci: Scopa! / bussata / buona del mazziere ===== */
.fxwrap { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 20; overflow: hidden; }
.fx { --fs: 46px; --c1: #c8202f; --c2: #ff8a96; --glow: rgba(255,80,100,.5); position: relative; display: grid; place-items: center; text-align: center; animation: fxlife 2.1s var(--ease) forwards; }
.fx .glow { position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, var(--glow) 0%, transparent 60%); filter: blur(10px); animation: glow 2.1s ease-out forwards; }
.fx .ring { position: absolute; width: 140px; height: 140px; border-radius: 50%; border: 2px solid var(--c2); opacity: 0; animation: ring 1.2s cubic-bezier(.1,.8,.3,1) .08s forwards; }
/* nastro: due estremità tagliate a coda di rondine */
.fx .ribbon { position: relative; padding: 12px 44px 14px; background: linear-gradient(180deg, var(--c2), var(--c1) 55%, #8f1420); color: #fff; clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 50%, 100% 100%, 0 100%, 16px 50%); box-shadow: 0 16px 36px rgba(0,0,0,.55); animation: ribbon 2.1s var(--ease) forwards; }
.fx .ribbon::before { content: ""; position: absolute; left: 20px; right: 20px; top: 5px; height: 1px; background: rgba(255,255,255,.55); }
.fx .ribbon::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: 5px; height: 1px; background: rgba(0,0,0,.25); }
.fx .t { display: block; font-family: var(--font-display); font-weight: 900; font-size: var(--fs); line-height: 1; letter-spacing: .01em; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 18px rgba(255,255,255,.35); animation: ttext 2.1s var(--ease) forwards; }
.fx small { display: block; margin-top: 10px; font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 16px; color: #fff; background: rgba(6,14,12,.78); padding: 5px 14px; border-radius: 999px; opacity: 0; animation: fxsub 2.1s ease forwards; white-space: nowrap; }
.fx .suits { position: absolute; inset: 0; }
.fx .suits i { position: absolute; left: 50%; top: 50%; font-style: normal; font-size: 24px; color: #fff; text-shadow: 0 0 10px var(--glow); opacity: 0; animation: suit 1.5s cubic-bezier(.15,.8,.3,1) forwards; transform: translate(-50%, -50%); }
.fx.oro { --c1: #c8921c; --c2: #ffe39a; --glow: rgba(240,199,80,.5); }
.fx.oro .ribbon { background: linear-gradient(180deg, #ffe9a8, #d9a621 55%, #9a7212); color: #3a2a06; }
.fx.oro .t { color: #3a2a06; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
@keyframes fxlife { 0% { opacity: 0; } 5% { opacity: 1; } 84% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ribbon { 0% { transform: scaleX(.2) scaleY(.6); opacity: 0; } 18% { transform: scaleX(1.06) scaleY(1.04); opacity: 1; } 28% { transform: scale(1); } 86% { transform: scale(1); } 100% { transform: scale(.9) translateY(-20px); } }
@keyframes ttext { 0%, 12% { opacity: 0; transform: scale(.6); } 26% { opacity: 1; transform: scale(1.06); } 34% { transform: scale(1); } 100% { opacity: 1; } }
@keyframes fxsub { 0%, 30% { opacity: 0; transform: translateY(6px); } 44% { opacity: 1; transform: none; } 100% { opacity: 1; } }
@keyframes glow { 0% { opacity: 0; transform: scale(.5); } 20% { opacity: 1; } 100% { opacity: 0; transform: scale(1.3); } }
@keyframes ring { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(3); } }
@keyframes suit { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(0); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 40px)) scale(1.1) rotate(var(--r)); } }
.stage-wrap.fxon .stage { filter: blur(3px) brightness(.5) saturate(.7); }
@media (max-width: 520px) { .fx { --fs: 38px; } .fx small { font-size: 14px; } .fx .ribbon { padding: 10px 34px 12px; } .fx .glow { width: 320px; height: 320px; } }
@media (prefers-reduced-motion: reduce) { .fx, .fx *, .fx::before, .fx::after { animation-duration: .01s !important; } }
html.theme-memphis .fx .ribbon { background: #fff; color: #1b1a24; border: 3px solid #1b1a24; box-shadow: 6px 6px 0 #1b1a24; clip-path: none; border-radius: 14px; }
html.theme-memphis .fx .t { color: #e63946; text-shadow: 3px 3px 0 #ffd23f; }
html.theme-memphis .fx.oro .t { color: #1b1a24; text-shadow: 3px 3px 0 #ffd23f; }
html.theme-memphis .fx .ribbon::before, html.theme-memphis .fx .ribbon::after { display: none; }
/* ===== 2 vs 2 in orizzontale ===== */
.rotate { position: fixed; inset: 0; z-index: 48; display: grid; place-items: center; text-align: center; background: var(--ardesia); color: var(--avorio); font-family: var(--font-display); font-size: 22px; padding: 24px; }
.rotate small { display: block; font-family: var(--font-body); font-size: 14px; color: var(--testo-2); margin-top: 6px; }
.rotate #rotate-skip { margin-top: 18px; font-size: 13px; }
.rotate .phone { width: 46px; height: 84px; border: 3px solid var(--avorio); border-radius: 10px; margin-bottom: 18px; animation: rotatephone 1.8s ease-in-out infinite; position: relative; }
.rotate .phone::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 10px; height: 3px; border-radius: 2px; background: var(--avorio); transform: translateX(-50%); }
@keyframes rotatephone { 0%, 20% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
#game.landscape { grid-template-rows: calc(38px + env(safe-area-inset-top, 0px)) minmax(0, 1fr) max(8px, env(safe-area-inset-bottom, 0px)); }
#game.landscape .bottombar { display: none; }
#game.landscape .topbar { gap: 6px; }
#game.landscape .wordmark.small { font-size: 16px; }
#game.landscape .felt { inset: 4px; border-radius: 16px; }
#game.landscape .voice { display: none; }
#game.landscape .iconbtn { width: 30px; height: 30px; font-size: 14px; }
#game.landscape .player.label .name { max-width: 80px; font-size: 11px; }
#game.landscape .player.label { padding: 2px 8px 2px 3px; }
@media (max-height: 520px) and (orientation: landscape) {
  :root { --card-w: 52px; --card-h: 76px; --radius: 6px; }
  .hintarc text { font-size: 12px; }
      .modal { max-height: 94vh; padding: 14px; }
  .modal h2 { font-size: 20px; margin-bottom: 2px; }
  .tbl th, .tbl td { padding: 3px 6px; font-size: 13px; }
}

/* ===== apertura della home: le carte entrano una alla volta ===== */
#scr-home.intro .wordmark.big { animation: introLogo .9s var(--ease) both; }

#scr-home.intro .home-cards .panel { animation: introCard .85s cubic-bezier(.2,.9,.25,1.15) both; transform-origin: 50% 110%; }
#scr-home.intro .home-cards .panel:nth-child(1) { animation-delay: .45s; }
#scr-home.intro .home-cards .panel:nth-child(2) { animation-delay: .62s; }
#scr-home.intro .home-cards .panel:nth-child(3) { animation-delay: .79s; }
#scr-home.intro .home-foot { animation: introFade .6s ease both; animation-delay: 1.1s; }
#scr-home.intro .badge { animation: introBadge 1s cubic-bezier(.2,.9,.3,1.3) both; animation-delay: .5s; }
@keyframes introLogo { 0% { opacity: 0; transform: translateY(18px) scale(.92); letter-spacing: .08em; } 100% { opacity: 1; transform: none; letter-spacing: -.035em; } }
@keyframes introFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes introCard { 0% { opacity: 0; transform: translateY(70px) rotate(-6deg) scale(.86); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes introBadge { 0% { opacity: 0; transform: rotate(-40deg) translateY(-30px) scale(.4); } 100% { opacity: 1; transform: rotate(9deg) translateY(-.08em) scale(1); } }
@media (prefers-reduced-motion: reduce) { #scr-home.intro * { animation: none !important; } }

/* ===================== HOME in stile Memphis ===================== */
html.theme-memphis #scr-home { --mem-bg: #f6f1e4; --mem-ink: #1b1a24; --mem-red: #e63946; --mem-blue: #2a7de1; --mem-yellow: #ffd23f; --mem-teal: #19c3b1; --mem-pink: #ff6fb5; --mem-lilac: #9b7bff;
  background: var(--mem-bg);
  background-image:
    linear-gradient(45deg, rgba(27,26,36,.045) 25%, transparent 25%, transparent 75%, rgba(27,26,36,.045) 75%),
    linear-gradient(45deg, rgba(27,26,36,.045) 25%, transparent 25%, transparent 75%, rgba(27,26,36,.045) 75%);
  background-size: 44px 44px, 44px 44px; background-position: 0 0, 22px 22px; color: var(--mem-ink); }
html.theme-memphis #scr-home::before, #scr-home::after { display: none; }
html.theme-memphis #scr-home::before { width: 260px; height: 260px; left: -90px; top: 18%; background: radial-gradient(circle, var(--mem-teal) 0 48%, transparent 49%), radial-gradient(circle, var(--mem-ink) 2px, transparent 2.5px); background-size: 100% 100%, 14px 14px; opacity: .9; }
html.theme-memphis #scr-home::after { width: 180px; height: 180px; right: -60px; bottom: 12%; background: repeating-linear-gradient(135deg, var(--mem-yellow) 0 10px, var(--mem-ink) 10px 13px); border: 4px solid var(--mem-ink); border-radius: 30% 70% 60% 40%; transform: rotate(12deg); }
html.theme-memphis #scr-home .home { position: relative; z-index: 1; }
#scr-home .memphis { display: none; }
html.theme-memphis #scr-home .memphis { display: block; position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
html.theme-memphis #scr-home .memphis svg { position: absolute; }
html.theme-memphis #scr-home .wordmark { color: var(--mem-ink); text-shadow: 4px 4px 0 var(--mem-yellow); }
html.theme-memphis #scr-home .wordmark.big { font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; }
html.theme-memphis #scr-home .wordmark .i::after { color: var(--mem-red); text-shadow: none; }
html.theme-memphis #scr-home .wordmark .badge { background: #fff; color: var(--mem-red); border: 2px solid var(--mem-ink); box-shadow: 3px 3px 0 var(--mem-ink); }
html.theme-memphis #scr-home .home .tag { color: var(--mem-ink); font-style: italic; font-weight: 500; background: none; display: block; padding: 0; border: none; box-shadow: none; transform: none; margin: 10px 0 18px; }
html.theme-memphis #scr-home .hello, #scr-home .hello b { color: var(--mem-ink); } #scr-home .hello { font-weight: 600; background: #fff; display: inline-block; padding: 4px 12px; border: 2px solid var(--mem-ink); box-shadow: 3px 3px 0 var(--mem-teal); margin-bottom: 22px; }
html.theme-memphis #scr-home .hello .linkish { color: var(--mem-blue); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 3px; }
html.theme-memphis #scr-home .home-cards .panel { border: 3px solid var(--mem-ink); border-radius: 22px; box-shadow: 7px 7px 0 var(--mem-ink); background-image: none; }
html.theme-memphis #scr-home .panel.open-table { background: var(--mem-red); }
html.theme-memphis #scr-home .panel.join-table { background: var(--mem-blue); }
html.theme-memphis #scr-home .panel.arcade-panel { background: var(--mem-yellow); }
html.theme-memphis #scr-home .home-cards .panel h2 { color: #fff; border-bottom: 2px solid rgba(255,255,255,.5); text-shadow: 2px 2px 0 var(--mem-ink); font-weight: 800; }
html.theme-memphis #scr-home .panel.arcade-panel h2 { color: var(--mem-ink); text-shadow: none; border-bottom-color: rgba(27,26,36,.35); }
html.theme-memphis #scr-home .panel.arcade-panel .arcade-sub, #scr-home .panel.arcade-panel .arcade-progress { color: var(--mem-ink); }
html.theme-memphis #scr-home .panel.arcade-panel .arcade-progress .bar { background: #fff; border: 2px solid var(--mem-ink); } #scr-home .panel.arcade-panel .arcade-progress .bar i { background: var(--mem-teal); }
html.theme-memphis #scr-home .field label { color: #fff; font-weight: 700; }
html.theme-memphis #scr-home .panel.arcade-panel .field label { color: var(--mem-ink); }
html.theme-memphis #scr-home .field input { background: #fff; color: var(--mem-ink); border: 2px solid var(--mem-ink); border-radius: 12px; box-shadow: none; }
html.theme-memphis #scr-home .field input::placeholder { color: #9a9a9a; }
html.theme-memphis #scr-home .seg button { background: rgba(255,255,255,.85); color: var(--mem-ink); border: 2px solid var(--mem-ink); border-radius: 12px; font-weight: 700; box-shadow: none; }
html.theme-memphis #scr-home .seg button.on { background: var(--mem-yellow); color: var(--mem-ink); border-color: var(--mem-ink); box-shadow: 3px 3px 0 var(--mem-ink); }
html.theme-memphis #scr-home .panel.open-table .seg button.on { background: var(--mem-yellow); color: var(--mem-ink); }
html.theme-memphis #scr-home .btn { border: 2px solid var(--mem-ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--mem-ink); font-weight: 800; transition: transform .12s, box-shadow .12s; }
html.theme-memphis #scr-home .btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--mem-ink); }
html.theme-memphis #scr-home .btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--mem-ink); }
html.theme-memphis #scr-home .panel.open-table .btn { background: #fff; color: var(--mem-red); }
html.theme-memphis #scr-home .panel.open-table .btn.ghost { background: var(--mem-teal); color: var(--mem-ink); border-color: var(--mem-ink); }
html.theme-memphis #scr-home .panel.join-table .btn.blue { background: var(--mem-yellow); color: var(--mem-ink); }
html.theme-memphis #scr-home .panel.arcade-panel .btn.oro { background: var(--mem-ink); color: var(--mem-yellow); box-shadow: 4px 4px 0 var(--mem-pink); }
html.theme-memphis #scr-home .home-foot { background: none; display: block; padding: 0; border: none; box-shadow: none; }
html.theme-memphis #scr-home .home-foot, #scr-home .home-foot .linkish { color: var(--mem-ink); }
html.theme-memphis #scr-home .home-foot .linkish { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--mem-red); text-underline-offset: 3px; }
html.theme-memphis #scr-home .status { color: #fff; }
html.theme-memphis #scr-home .resume { background: #fff; border: 3px solid var(--mem-ink); box-shadow: 6px 6px 0 var(--mem-teal); color: var(--mem-ink); }
html.theme-memphis #scr-home .memphis .float { animation: memfloat 6s ease-in-out infinite; }
html.theme-memphis #scr-home .memphis .float.d2 { animation-delay: -2s; } #scr-home .memphis .float.d3 { animation-delay: -4s; }
@keyframes memfloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { #scr-home .memphis .float { animation: none; } }

/* ===================== TAVOLO in stile Memphis ===================== */
html.theme-memphis #game { background: #f6f1e4; background-image:
  linear-gradient(45deg, rgba(27,26,36,.045) 25%, transparent 25%, transparent 75%, rgba(27,26,36,.045) 75%),
  linear-gradient(45deg, rgba(27,26,36,.045) 25%, transparent 25%, transparent 75%, rgba(27,26,36,.045) 75%);
  background-size: 44px 44px, 44px 44px; background-position: 0 0, 22px 22px; }
html.theme-memphis #game .topbar { background: #fff; border-bottom: 3px solid #1b1a24; }
html.theme-memphis #game .wordmark { color: #1b1a24; text-shadow: 3px 3px 0 #ffd23f; }
html.theme-memphis #game .wordmark .badge { background: #fff; color: #e63946; border: 2px solid #1b1a24; box-shadow: 2px 2px 0 #1b1a24; }
html.theme-memphis #game .score { background: #fff; border: 2px solid #1b1a24; color: #1b1a24; box-shadow: 3px 3px 0 #1b1a24; }
html.theme-memphis #game .score.t0 .dot { background: #ffd23f; border: 2px solid #1b1a24; } #game .score.t1 .dot { background: #2a7de1; border: 2px solid #1b1a24; }
html.theme-memphis #game .score.vs, #game .goal { color: #1b1a24; }
html.theme-memphis #game .iconbtn { background: #fff; color: #1b1a24; border: 2px solid #1b1a24; box-shadow: 3px 3px 0 #1b1a24; }
/* il panno: un grande "pannello" Memphis: fondo teal con bordo nero e ombra netta */
html.theme-memphis #game .felt { background: #19c3b1; background-image: radial-gradient(circle, rgba(27,26,36,.18) 1.5px, transparent 2px); background-size: 16px 16px; border: 3px solid #1b1a24; box-shadow: 8px 8px 0 #1b1a24; border-radius: 22px; }
html.theme-memphis #game .felt::after { display: none; }
/* carte: bordo nero e ombra netta invece delle ombre morbide */
html.theme-memphis #game .card .face { border: 2px solid #1b1a24; box-shadow: 3px 3px 0 #1b1a24; background: #fff; }
html.theme-memphis #game .card.denari .face { background: #fff8dc; }
html.theme-memphis #game .card .back { border: 2px solid #1b1a24; background: #e63946; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 6px, transparent 6px 12px); box-shadow: 3px 3px 0 #1b1a24; }
html.theme-memphis #game .card .back::after { border-color: rgba(255,255,255,.55); }
html.theme-memphis #game .card.selected .face { box-shadow: 0 0 0 3px #ffd23f, 4px 4px 0 #1b1a24; }
html.theme-memphis #game .card.target .face { box-shadow: 0 0 0 3px #9b7bff, 4px 4px 0 #1b1a24; }
html.theme-memphis #game .card.target.alt .face { box-shadow: 0 0 0 3px #ffd23f, 4px 4px 0 #1b1a24; }
html.theme-memphis #game .card.playable .face { box-shadow: 0 0 0 2px #ffd23f, 3px 3px 0 #1b1a24; }
html.theme-memphis #game .card.playable::after { background: #e63946; box-shadow: none; border: 2px solid #1b1a24; width: 10px; height: 10px; }
html.theme-memphis #game .deck .layer { border: 2px solid #1b1a24; background: #e63946; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 6px, transparent 6px 12px); box-shadow: 3px 3px 0 #1b1a24; }
html.theme-memphis #game .deck .count, #game .pile .cnt { color: #1b1a24; }
html.theme-memphis #game .pile.full .layer { border: 2px solid #1b1a24; background: #e63946; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 6px, transparent 6px 12px); box-shadow: 3px 3px 0 #1b1a24; }
html.theme-memphis #game .pile { border-color: rgba(27,26,36,.35); color: rgba(27,26,36,.6); }
html.theme-memphis #game .player { background: #fff; color: #1b1a24; border: 2px solid #1b1a24; box-shadow: 3px 3px 0 #1b1a24; }
html.theme-memphis #game .player .name, #game .player .sub { color: #1b1a24; }
html.theme-memphis #game .player.label { background: #fff; }
html.theme-memphis #game .player.turn { box-shadow: 0 0 0 3px #ffd23f, 3px 3px 0 #1b1a24; }
html.theme-memphis #game .player.team0 .avatar { background: #ffd23f; border: 2px solid #1b1a24; } #game .player.team1 .avatar { background: #2a7de1; color: #fff; border: 2px solid #1b1a24; }
html.theme-memphis #game .mstrip span, html.theme-memphis #game .goalbar .goalbtn, html.theme-memphis #game .goalbar .goalpop { background: #fff; color: #1b1a24; border: 2px solid #1b1a24; box-shadow: 3px 3px 0 #1b1a24; backdrop-filter: none; -webkit-backdrop-filter: none; }
html.theme-memphis #game .goalbar .goalbtn, html.theme-memphis #game .goalbar .goalpop > div > span:first-child { color: #e63946; }
html.theme-memphis #game .goalbar.open .goalbtn { background: #ffd23f; }
html.theme-memphis #game .goalbar .goalpop > div { border-top-color: rgba(27,26,36,.15); }
html.theme-memphis #game .goalbar .goalpop .town, html.theme-memphis #game .goalbar .goalpop small { color: #555; }
html.theme-memphis #game .hintarc text { fill: #1b1a24; font-weight: 600; }
html.theme-memphis #game .hintarc #hint-glow { stroke: rgba(27,26,36,.75); }
html.theme-memphis #game .hintarc #hint-aurora, html.theme-memphis #game .dropzone #drop-band { stroke: rgba(255,210,63,.6); }
html.theme-memphis #game .hintarc #hint-comet, html.theme-memphis #game .hintarc #hint-comet2, html.theme-memphis #game .dropzone #drop-solid, html.theme-memphis #game .dropzone #drop-pulse { stroke: #1b1a24; filter: none; }
html.theme-memphis #game .dropzone #drop-path { stroke: rgba(27,26,36,.7); }
html.theme-memphis #game .dropzone #drop-spotfill { mix-blend-mode: normal; }
html.theme-memphis #game .dropzone #drop-fill { fill: rgba(255,210,63,.18) !important; }
html.theme-memphis #game .bottombar { background: #fff; border-top: 3px solid #1b1a24; }
html.theme-memphis #game .vbtn { background: #fff; color: #1b1a24; border: 2px solid #1b1a24; box-shadow: 3px 3px 0 #1b1a24; }
html.theme-memphis #game .vbtn.on { background: #19c3b1; } #game .vbtn.ptt.live { background: #e63946; color: #fff; }
html.theme-memphis #game .fx .t { background: none; color: #e63946; -webkit-text-fill-color: #e63946; filter: none; text-shadow: 3px 3px 0 #ffd23f; }
html.theme-memphis #game .fx small { color: #1b1a24; background: #ffd23f; border: 2px solid #1b1a24; box-shadow: 3px 3px 0 #1b1a24; font-style: normal; font-weight: 700; }
html.theme-memphis #game .fx .ring { border-color: #1b1a24; }
html.theme-memphis #game .stage-wrap.fxon .stage { filter: brightness(.9) blur(2px); }

html.theme-memphis { background: #f6f1e4; }
html.theme-memphis body { background: #f6f1e4; }
html.theme-memphis #scr-lobby, html.theme-memphis #scr-arcade { background: #f6f1e4; background-image: linear-gradient(45deg, rgba(27,26,36,.045) 25%, transparent 25%, transparent 75%, rgba(27,26,36,.045) 75%), linear-gradient(45deg, rgba(27,26,36,.045) 25%, transparent 25%, transparent 75%, rgba(27,26,36,.045) 75%); background-size: 44px 44px, 44px 44px; background-position: 0 0, 22px 22px; color: #1b1a24; }
html.theme-memphis #scr-lobby .panel, html.theme-memphis .arcade { color: #1b1a24; }
html.theme-memphis #scr-lobby .panel { background: #fff; border: 3px solid #1b1a24; box-shadow: 7px 7px 0 #1b1a24; }
html.theme-memphis #scr-lobby h2, html.theme-memphis #scr-lobby .code, html.theme-memphis .arcade-title, html.theme-memphis .zone h3, html.theme-memphis .stars-total { color: #1b1a24; }
html.theme-memphis #scr-lobby .seat { background: #f6f1e4; border: 2px solid #1b1a24; color: #1b1a24; }
html.theme-memphis #scr-lobby .seat.team0 { box-shadow: inset 4px 0 0 #ffd23f; } html.theme-memphis #scr-lobby .seat.team1 { box-shadow: inset 4px 0 0 #2a7de1; }
html.theme-memphis #scr-lobby .status, html.theme-memphis #scr-lobby .seat .team, html.theme-memphis #arcade-note { color: #3c3a48; }
html.theme-memphis .wordmark { color: #1b1a24; text-shadow: 3px 3px 0 #ffd23f; }
html.theme-memphis .wordmark .badge { background: #fff; color: #e63946; border: 2px solid #1b1a24; box-shadow: 2px 2px 0 #1b1a24; }
html.theme-memphis .btn { border: 2px solid #1b1a24; box-shadow: 4px 4px 0 #1b1a24; color: #1b1a24; }
html.theme-memphis .btn.ghost { background: #fff; color: #1b1a24; }
html.theme-memphis .btn.oro { background: #ffd23f; } html.theme-memphis .btn:not(.ghost):not(.oro):not(.blue) { background: #e63946; color: #fff; }
html.theme-memphis .pairbtn { background: #fff; color: #1b1a24; border: 2px solid #1b1a24; }
html.theme-memphis .iconbtn { background: #fff; color: #1b1a24; border: 2px solid #1b1a24; box-shadow: 3px 3px 0 #1b1a24; }
html.theme-memphis .tappa { background: #fff; color: #1b1a24; border: 2px solid #1b1a24; box-shadow: 4px 4px 0 #1b1a24; }
html.theme-memphis .tappa .n, html.theme-memphis .tappa .who { color: #3c3a48; }
html.theme-memphis .tappa .st { color: #e63946; } html.theme-memphis .tappa .st .off { color: rgba(27,26,36,.2); }
html.theme-memphis .tappa.next { border-color: #1b1a24; box-shadow: 4px 4px 0 #ffd23f, 0 0 0 3px #ffd23f; }
html.theme-memphis .tappa:disabled { opacity: .5; }
html.theme-memphis .arcade-mode button { background: #fff; color: #1b1a24; border: 2px solid #1b1a24; }
html.theme-memphis .arcade-mode button.on { background: #ffd23f; box-shadow: 3px 3px 0 #1b1a24; }
html.theme-memphis .modal { background: #fff; color: #1b1a24; border: 3px solid #1b1a24; box-shadow: 8px 8px 0 #1b1a24; }
html.theme-memphis .modal h2, html.theme-memphis .modal p, html.theme-memphis .modal .tbl td, html.theme-memphis .modal .tbl th, html.theme-memphis .opt, html.theme-memphis .opt small, html.theme-memphis .rules ul, html.theme-memphis .rules li b, html.theme-memphis .backup, html.theme-memphis .backup summary, html.theme-memphis .modal .field label { color: #1b1a24; }
html.theme-memphis .modal h2 small { color: #3c3a48; }
html.theme-memphis .rules h3 { color: #e63946; }
html.theme-memphis .modal .field input, html.theme-memphis .opt { background: #f6f1e4; border: 2px solid #1b1a24; color: #1b1a24; }
html.theme-memphis .tbl .pt { color: #0f8f82; } html.theme-memphis .tbl .zero { color: rgba(27,26,36,.3); } html.theme-memphis .tbl tr.tot td { color: #1b1a24; border-top-color: #1b1a24; }
html.theme-memphis .tbl th, html.theme-memphis .tbl td { border-bottom-color: rgba(27,26,36,.15); }
html.theme-memphis .buona-opts button { background: #f6f1e4; color: #1b1a24; border: 2px solid #1b1a24; }
html.theme-memphis .stars-big { color: #ffd23f; -webkit-text-stroke: 1.5px #1b1a24; } html.theme-memphis .stars-big .off { color: #fff; }
html.theme-memphis .modal.won { box-shadow: 8px 8px 0 #ffd23f, 0 0 0 3px #1b1a24; } html.theme-memphis .modal.won h2 { background: none; -webkit-text-fill-color: #e63946; color: #e63946; animation: none; }
html.theme-memphis .modal.lost { box-shadow: 8px 8px 0 #2a7de1, 0 0 0 3px #1b1a24; } html.theme-memphis .modal.lost h2 { color: #2a7de1; }
html.theme-memphis .record, html.theme-memphis .ach { background: #f6f1e4; border: 2px solid #1b1a24; color: #1b1a24; }
html.theme-memphis .ach .nm, html.theme-memphis .ach .ds { color: #1b1a24; }
html.theme-memphis .toast { background: #fff; color: #1b1a24; border: 2px solid #1b1a24; box-shadow: 3px 3px 0 #1b1a24; }
html.theme-memphis .ach-toast { background: #ffd23f; color: #1b1a24; border: 2px solid #1b1a24; box-shadow: 4px 4px 0 #1b1a24; } html.theme-memphis .ach-toast small { color: #3c3a48; }
html.theme-memphis .side { background: #fff; color: #1b1a24; border-left: 3px solid #1b1a24; }
html.theme-memphis .side h3, html.theme-memphis .tabs button.on, html.theme-memphis .log .e, html.theme-memphis .msg { color: #1b1a24; }
html.theme-memphis .tabs button { color: #3c3a48; } html.theme-memphis .log .e { background: #f6f1e4; }
html.theme-memphis .chat input { background: #fff; color: #1b1a24; border: 2px solid #1b1a24; }
html.theme-memphis .rotate { background: #f6f1e4; color: #1b1a24; } html.theme-memphis .rotate small { color: #3c3a48; } html.theme-memphis .rotate .phone { border-color: #1b1a24; } html.theme-memphis .rotate .phone::after { background: #1b1a24; }
html.theme-memphis .resume { background: #fff; border: 2px solid #1b1a24; color: #1b1a24; }
html.theme-memphis .review-bar { background: #fff; color: #1b1a24; border: 2px solid #1b1a24; box-shadow: 3px 3px 0 #1b1a24; }
html.theme-memphis .mini { border: 1.5px solid #1b1a24; }

/* ===================== HOME classica: rifinitura "premium" ===================== */
html:not(.theme-memphis) #scr-home { background: #1c2230; }
html:not(.theme-memphis) #scr-home::after { display: none; }
html:not(.theme-memphis) #scr-home .home { position: relative; z-index: 1; }
html:not(.theme-memphis) #scr-home .wordmark.big { filter: none; }
html:not(.theme-memphis) #scr-home .wordmark .badge { box-shadow: 0 .06em .15em rgba(0,0,0,.35), 0 0 .5em rgba(255,255,255,.18); }
/* schede: bordo fuso con il colore, luce interna in alto, ombra colorata morbida */
html:not(.theme-memphis) #scr-home .home-cards .panel { border: none; border-radius: 22px; padding: 22px 20px 20px; box-shadow: 0 18px 40px -20px rgba(0,0,0,.7); position: relative; overflow: hidden; }
html:not(.theme-memphis) #scr-home .home-cards .panel::before { display: none; }
html:not(.theme-memphis) #scr-home .panel.open-table { background: #c62839; box-shadow: 0 18px 40px -20px rgba(0,0,0,.7); }
html:not(.theme-memphis) #scr-home .panel.join-table { background: #2b6fb8; box-shadow: 0 18px 40px -20px rgba(0,0,0,.7); }
html:not(.theme-memphis) #scr-home .panel.arcade-panel { background: #e2a93a; box-shadow: 0 18px 40px -20px rgba(0,0,0,.7); }
html:not(.theme-memphis) #scr-home .home-cards .panel h2 { position: relative; font-weight: 700; letter-spacing: .01em; border-bottom: none; padding-bottom: 12px; margin-bottom: 14px; text-shadow: none; }
html:not(.theme-memphis) #scr-home .home-cards .panel h2::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 44px; height: 3px; transform: translateX(-50%); border-radius: 2px; background: rgba(255,255,255,.7); }
html:not(.theme-memphis) #scr-home .field label { color: rgba(255,255,255,.78); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
html:not(.theme-memphis) #scr-home .panel.arcade-panel .field label { color: rgba(42,31,4,.7); }
/* selettori: binario incassato, opzione scelta che si illumina */
html:not(.theme-memphis) #scr-home .seg { background: rgba(0,0,0,.22); border-radius: 12px; padding: 4px; gap: 4px; }
html:not(.theme-memphis) #scr-home .seg button { background: transparent; border: none; color: rgba(255,255,255,.78); border-radius: 9px; padding: 9px 8px; transition: background .2s, color .2s, box-shadow .2s, transform .15s; }
html:not(.theme-memphis) #scr-home .seg button:active { transform: scale(.97); }
html:not(.theme-memphis) #scr-home .seg button.on { color: var(--inchiostro); font-weight: 800; }
html:not(.theme-memphis) #scr-home .panel.open-table .seg button.on { color: #8e1b28; }
/* campi: incassati, con alone al tocco */
html:not(.theme-memphis) #scr-home .field input { background: rgba(0,0,0,.22); color: #fff; border: none; border-radius: 12px; box-shadow: none; transition: box-shadow .2s, background .2s; }
html:not(.theme-memphis) #scr-home .field input::placeholder { color: rgba(255,255,255,.5); }
html:not(.theme-memphis) #scr-home .field input:focus { outline: none; background: rgba(0,0,0,.3); box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
/* pulsanti: superficie con luce in alto, ombra morbida, pressione */
html:not(.theme-memphis) #scr-home .btn { border-radius: 13px; font-weight: 800; letter-spacing: .01em; transition: transform .15s var(--ease), box-shadow .2s, filter .2s; }
html:not(.theme-memphis) #scr-home .btn:active { transform: translateY(1px) scale(.99); filter: brightness(.96); }
html:not(.theme-memphis) #scr-home .panel.open-table .btn { background: #f7f2e6; color: #9b1c2b; box-shadow: 0 8px 18px -8px rgba(0,0,0,.6); }
html:not(.theme-memphis) #scr-home .panel.open-table .btn.ghost { background: rgba(0,0,0,.22); color: #fff; border: none; box-shadow: none; }
html:not(.theme-memphis) #scr-home .panel.open-table .btn.ghost:hover { background: rgba(0,0,0,.3); }
html:not(.theme-memphis) #scr-home .panel.join-table .btn.blue { background: #f7f2e6; color: #1f4f85; box-shadow: 0 8px 18px -8px rgba(0,0,0,.6); }
html:not(.theme-memphis) #scr-home .panel.arcade-panel .btn.oro { background: #2a2016; color: #ffe2a0; box-shadow: 0 8px 18px -8px rgba(0,0,0,.7); }
html:not(.theme-memphis) #scr-home .panel.arcade-panel .arcade-progress .bar { height: 10px; background: rgba(0,0,0,.22); box-shadow: none; border-radius: 6px; }
html:not(.theme-memphis) #scr-home .panel.arcade-panel .arcade-progress .bar i { background: #fff3cf; box-shadow: none; border-radius: 6px; }
html:not(.theme-memphis) #scr-home .btn.wide + .btn.wide { margin-top: 10px; }
html:not(.theme-memphis) #scr-home .home-foot { margin-top: 30px; }
html:not(.theme-memphis) #scr-home .home-foot .linkish { color: rgba(255,255,255,.7); transition: color .2s; }
html:not(.theme-memphis) #scr-home .home-foot .linkish:hover { color: #fff; }

/* ===================== Movimento premium (tema classico) ===================== */
:root { --spring: cubic-bezier(.34, 1.56, .64, 1); --out: cubic-bezier(.22, 1, .36, 1); }
/* selettori: la pastiglia scivola da un'opzione all'altra */
html:not(.theme-memphis) #scr-home .seg { position: relative; isolation: isolate; }
html:not(.theme-memphis) #scr-home .seg .thumb { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 9px; background: #f7f2e6; box-shadow: 0 4px 12px rgba(0,0,0,.35); z-index: 0; transition: left .38s var(--spring), width .38s var(--spring), opacity .3s; pointer-events: none; opacity: 0; }
html:not(.theme-memphis) #scr-home .seg.ready .thumb { opacity: 1; }
html:not(.theme-memphis) #scr-home .seg button { position: relative; z-index: 1; background: transparent !important; box-shadow: none !important; transition: color .25s, transform .15s var(--out); }
html:not(.theme-memphis) #scr-home .seg button.on { color: var(--inchiostro); }
html:not(.theme-memphis) #scr-home .panel.open-table .seg button.on { color: #8e1b28; }
html:not(.theme-memphis) #scr-home .seg button:active { transform: scale(.95); }
html:not(.theme-memphis) #scr-home .seg { touch-action: pan-y; cursor: grab; }
html:not(.theme-memphis) #scr-home .seg.dragging { cursor: grabbing; }
html:not(.theme-memphis) #scr-home .seg.dragging .thumb { box-shadow: 0 8px 18px rgba(0,0,0,.45); transform: scale(1.04); }
html:not(.theme-memphis) #scr-home .seg.dragging button.on { color: rgba(255,255,255,.78); }
html:not(.theme-memphis) #scr-home .seg button.near { color: var(--inchiostro) !important; }
html:not(.theme-memphis) #scr-home .panel.open-table .seg button.near { color: #8e1b28 !important; }
/* pulsanti: onda al tocco e rimbalzo elastico */
html:not(.theme-memphis) #scr-home .btn { position: relative; overflow: hidden; transition: transform .35s var(--spring), box-shadow .25s, filter .2s; }
html:not(.theme-memphis) #scr-home .btn:active { transform: scale(.965); transition-duration: .1s; }
.ripple { position: absolute; border-radius: 50%; transform: translate(-50%, -50%) scale(0); background: radial-gradient(circle, rgba(255,255,255,.55), rgba(255,255,255,0) 60%); pointer-events: none; animation: ripple .55s var(--out) forwards; }
@keyframes ripple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
html:not(.theme-memphis) #scr-home .panel.open-table .btn .ripple, html:not(.theme-memphis) #scr-home .panel.join-table .btn.blue .ripple { background: radial-gradient(circle, rgba(0,0,0,.14), rgba(0,0,0,0) 60%); }
/* schede: si inclinano leggermente verso il dito */
html:not(.theme-memphis) #scr-home .home-cards .panel { transition: transform .5s var(--out), box-shadow .5s var(--out); transform-style: preserve-3d; will-change: transform; }
html:not(.theme-memphis) #scr-home .home-cards .panel.tilt { transition: transform .08s linear; }
/* campi: l'etichetta si schiarisce quando scrivi */
html:not(.theme-memphis) #scr-home .field:focus-within label { color: #fff; }
/* transizioni tra schermate */
.screen.enter { animation: screenIn .45s var(--out) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
#game.enter { animation: gameIn .55s var(--out) both; }
@keyframes gameIn { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }

/* modali: entrano con molla, l'ombra del fondo sfuma */
.modal { animation: modalIn .45s var(--spring); }
@keyframes modalIn { from { transform: translateY(26px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
/* badge 15 del logo: piccolo scatto quando lo tocchi */
.wordmark .badge { transition: transform .4s var(--spring); }
.wordmark:hover .badge, .wordmark:active .badge { transform: rotate(-6deg) translateY(-.14em) scale(1.08); }
/* arcade: barra che cresce con molla */
.arcade-progress .bar i { transition: width .9s var(--spring); }
@media (prefers-reduced-motion: reduce) { .screen, #game:not(.hidden), .modal, .ripple { animation: none !important; } html:not(.theme-memphis) #scr-home .seg .thumb { transition: none; } }

.toast.update { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; }

/* ===== mappa arcade a sentiero ===== */
.arcade-hero { background: linear-gradient(165deg, #24324a, #1a2334); border-radius: 22px; padding: 20px 18px 16px; margin-bottom: 18px; box-shadow: 0 18px 40px -20px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.08); }
.arcade-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 5vw, 36px); margin: 0 0 4px; color: var(--avorio); letter-spacing: -.01em; }
.arcade-tag { margin: 0 0 14px; color: var(--testo-2); font-size: 14px; font-style: italic; font-family: var(--font-display); }
.arcade-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.arcade-summary .sum { background: rgba(0,0,0,.25); border-radius: 14px; padding: 10px 6px; text-align: center; }
.arcade-summary .sum b { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--oro-2); line-height: 1.1; }
.arcade-summary .sum span { font-size: 11px; color: var(--testo-2); }
.arcade-mode { max-width: none; margin-bottom: 0; background: rgba(0,0,0,.25); border-radius: 12px; padding: 4px; gap: 4px; position: relative; }
.arcade-mode button { border: none; background: transparent; color: rgba(255,255,255,.75); border-radius: 9px; padding: 9px 8px; font-weight: 700; transition: color .25s; position: relative; z-index: 1; }
.arcade-mode button.on { background: transparent; color: var(--inchiostro); box-shadow: none; }
.arcade-mode .thumb { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 9px; background: var(--oro-2); box-shadow: 0 4px 12px rgba(0,0,0,.35); transition: left .38s var(--spring), width .38s var(--spring), opacity .3s; opacity: 0; }
.arcade-mode.ready .thumb { opacity: 1; }
#arcade-note { margin: 10px 0 0; font-size: 13px; }
#arcade-note:empty { display: none; }
.map { position: relative; margin: 0 auto 30px; }
.path-map { display: block; margin: 0 auto; max-width: 100%; }
#scr-arcade > * { max-width: 100%; box-sizing: border-box; }
.path-map .trail { fill: none; stroke: rgba(255,255,255,.16); stroke-width: 12; stroke-linecap: round; }
.path-map .trail.done { stroke: var(--oro); stroke-width: 12; }
.path-map .zone-lbl { font-family: var(--font-display); font-weight: 700; font-size: 14px; opacity: .85; letter-spacing: .02em; }
.node { position: absolute; transform: translate(-50%, -50%); width: 58px; height: 58px; border-radius: 50%; border: none; background: linear-gradient(180deg, #313c4e, #232c3a); color: var(--avorio); font-family: var(--font-display); font-weight: 800; font-size: 21px; display: grid; place-items: center; box-shadow: 0 10px 22px -8px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.12); transition: transform .25s var(--spring), box-shadow .25s; }
.node .pin { line-height: 1; display: grid; place-items: center; }
.node.four { border-radius: 18px; }
.node.done { background: linear-gradient(180deg, #f3cf5c, #d9a621); color: #3a2a06; box-shadow: 0 10px 22px -8px rgba(217,166,33,.9), inset 0 1px 0 rgba(255,255,255,.5); }
.node.next { background: linear-gradient(180deg, #e0404d, #b61d2a); color: #fff; box-shadow: 0 10px 22px -8px rgba(200,32,47,.9), inset 0 1px 0 rgba(255,255,255,.25); animation: nodepulse 1.8s ease-in-out infinite; }
.node.locked { background: #1f2735; color: rgba(255,255,255,.35); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.node:not(:disabled):hover { transform: translate(-50%, -50%) scale(1.08); }
.node:not(:disabled):active { transform: translate(-50%, -50%) scale(.96); }
.node .lbl { position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; font-family: var(--font-body); font-weight: 700; font-size: 14px; color: var(--avorio); text-align: left; line-height: 1.25; pointer-events: none; }
.node .lbl.r { left: 70px; } .node .lbl.l { right: 70px; text-align: right; }
.node .lbl b { display: block; }
.node .lbl i { font-style: normal; font-size: 12px; letter-spacing: 1px; color: var(--oro-2); } .node .lbl i em { font-style: normal; color: rgba(255,255,255,.18); }
.node.locked .lbl { color: rgba(255,255,255,.4); }
@keyframes nodepulse { 0%, 100% { box-shadow: 0 10px 22px -8px rgba(200,32,47,.9), 0 0 0 0 rgba(224,64,77,.55); } 50% { box-shadow: 0 10px 22px -8px rgba(200,32,47,.9), 0 0 0 14px rgba(224,64,77,0); } }
.starlist { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; }
.starlist div { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.2); color: var(--testo-2); font-size: 14px; }
.starlist div span { color: rgba(255,255,255,.25); font-size: 18px; }
.starlist div.ok { color: var(--avorio); background: rgba(217,166,33,.14); } .starlist div.ok span { color: var(--oro-2); }
/* scheda tappa più ricca */
.modal .opt.star { background: rgba(0,0,0,.22); border-radius: 12px; }
.modal .opt.star > span:first-child { font-family: var(--font-display); font-size: 18px; letter-spacing: -1px; width: 56px; text-align: left; color: var(--oro-2); }
html.theme-memphis .arcade-hero { background: #fff; border: 3px solid #1b1a24; box-shadow: 7px 7px 0 #1b1a24; }
html.theme-memphis .arcade-tag, html.theme-memphis .arcade-summary .sum span { color: #3c3a48; }
html.theme-memphis .arcade-summary .sum { background: #f6f1e4; border: 2px solid #1b1a24; } html.theme-memphis .arcade-summary .sum b { color: #e63946; }
html.theme-memphis .arcade-mode { background: #f6f1e4; border: 2px solid #1b1a24; } html.theme-memphis .arcade-mode .thumb { background: #ffd23f; box-shadow: none; }
html.theme-memphis .arcade-mode button { color: #1b1a24; }
html.theme-memphis .node { background: #fff; color: #1b1a24; border: 3px solid #1b1a24; box-shadow: 4px 4px 0 #1b1a24; }
html.theme-memphis .node.done { background: #ffd23f; } html.theme-memphis .node.next { background: #e63946; color: #fff; }
html.theme-memphis .node.locked { background: #e9e3d3; color: #8a8a8a; box-shadow: none; border-color: #9a9a9a; }
html.theme-memphis .node .lbl, html.theme-memphis .node .lbl i em { color: #1b1a24; } html.theme-memphis .node .lbl i { color: #e63946; }
html.theme-memphis .path-map .trail { stroke: rgba(27,26,36,.35); } html.theme-memphis .path-map .trail.done { stroke: #e63946; }
html.theme-memphis .starlist div { background: #f6f1e4; color: #1b1a24; border: 2px solid #1b1a24; }

/* ===== scelta della presa ===== */
.chooser-bg { position: absolute; inset: 0; z-index: 44; background: rgba(6,14,12,.45); animation: fadein .2s; }
.chooser { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 45; width: min(380px, 92%); background: #1e2a33; border-radius: 22px; padding: 18px 16px 12px; box-shadow: 0 30px 70px rgba(0,0,0,.6); animation: modalIn .4s var(--spring); display: flex; flex-direction: column; gap: 10px; }
.chooser .ch-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--avorio); text-align: center; margin-bottom: 2px; }
.chooser .ch-sub { text-align: center; font-size: 13px; color: var(--testo-2); margin: -6px 0 6px; }
.chooser .ch-opt { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1.5px solid rgba(255,255,255,.08); background: rgba(255,255,255,.05); color: var(--avorio); text-align: left; transition: background .15s, border-color .15s, transform .25s var(--spring); }
.chooser .ch-opt:hover, .chooser .ch-opt:active { background: rgba(255,255,255,.12); border-color: var(--oro-2); transform: scale(1.015); }
.chooser .ch-opt .cards { display: flex; gap: 6px; align-items: center; }
.chooser .ch-opt .cards .plus { color: var(--testo-2); font-weight: 800; font-size: 16px; }
.chooser .ch-opt .mini { width: 42px; height: 60px; font-size: 18px; border-radius: 6px; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.chooser .ch-opt .mini svg { width: 14px; height: 14px; }
.chooser .ch-opt .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chooser .ch-opt .k { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--basilico); color: #fff; white-space: nowrap; font-weight: 700; letter-spacing: .02em; }
.chooser .ch-opt .k.fifteen { background: var(--rosso); } .chooser .ch-opt .k.ace { background: var(--oro); color: var(--inchiostro); }
.chooser .ch-opt .sc { color: var(--oro-2); font-size: 12px; font-weight: 700; }
.chooser .ch-cancel { background: none; border: none; color: var(--testo-2); padding: 8px; font-size: 13px; margin-top: 2px; }
html.theme-memphis .chooser { background: #fff; border: 3px solid #1b1a24; box-shadow: 8px 8px 0 #1b1a24; }
html.theme-memphis .chooser .ch-title, html.theme-memphis .chooser .ch-cancel, html.theme-memphis .chooser .ch-opt { color: #1b1a24; }
html.theme-memphis .chooser .ch-sub { color: #3c3a48; }
html.theme-memphis .chooser .ch-opt { background: #f6f1e4; border: 2px solid #1b1a24; }
html.theme-memphis .chooser .ch-opt:hover { background: #ffd23f; }
#game.landscape .goalbar { right: auto; left: 60px; top: 8px; }
#game.landscape .goalbar .goalpop { right: auto; left: 0; transform-origin: top left; }

/* riquadro tappa: solo le tre stelle con la condizione */
.stars-brief { margin: 12px 0 6px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.08); padding: 4px 14px; }
.stars-brief > div { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.07); font-size: 14px; line-height: 1.35; color: var(--avorio); }
.stars-brief > div:first-child { border-top: 0; }
.stars-brief > div > span:first-child { color: var(--oro-2); font-size: 13px; letter-spacing: -1px; white-space: nowrap; }
.stars-brief > div.ok > span:first-child { color: #9be39b; }
.stars-brief > div.ok > span:last-child { color: #9be39b; }
html.theme-memphis .stars-brief { background: #fff; border: 2px solid #1b1a24; box-shadow: 3px 3px 0 #1b1a24; }
html.theme-memphis .stars-brief > div { color: #1b1a24; border-top-color: rgba(27,26,36,.15); }
html.theme-memphis .stars-brief > div > span:first-child { color: #e63946; }

.rotate .rotate-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.rotate #rotate-skip { margin-top: 0; }

/* riepilogo tappa */
.starlist div.ko > span { color: #e0707a; }
.starlist div.ko { opacity: .75; }
.res-table, .next-brief { margin: 10px 0 0; border-radius: 12px; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.08); padding: 8px 12px; }
.res-table summary, .next-brief summary { cursor: pointer; font-size: 13px; color: var(--testo-2); }
.next-brief summary b { color: var(--avorio); }
.res-table .tbl { margin-top: 8px; font-size: 13px; }
.stars-brief.compact { margin: 8px 0 0; padding: 2px 10px; }
.stars-brief.compact > div { padding: 7px 0; font-size: 13px; }
.goalbar .goalbtn .timer { font-variant-numeric: tabular-nums; margin-left: 2px; }
.goalbar .goalbtn .timer.late { color: #ff9a9a; }
html.theme-memphis .res-table, html.theme-memphis .next-brief { background: #fff; border: 2px solid #1b1a24; }
html.theme-memphis .res-table summary, html.theme-memphis .next-brief summary { color: #3c3a48; } html.theme-memphis .next-brief summary b { color: #1b1a24; }

/* guida installazione iPhone */
.install { position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); animation: fadein .25s; }
.install-card { position: relative; width: min(440px, 100%); background: #242b3a; color: var(--avorio); border: 1px solid rgba(255,255,255,.12); border-radius: 22px; padding: 22px 20px 16px; box-shadow: 0 30px 80px rgba(0,0,0,.6); text-align: center; animation: modalIn .45s var(--spring); }
.install-card::after { content: ""; position: absolute; left: 50%; bottom: -12px; width: 22px; height: 22px; background: #242b3a; border-right: 1px solid rgba(255,255,255,.12); border-bottom: 1px solid rgba(255,255,255,.12); transform: translateX(-50%) rotate(45deg); }
.install-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,.08); color: var(--avorio); font-size: 14px; cursor: pointer; }
.install-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 8px 20px rgba(0,0,0,.4); margin-bottom: 8px; }
.install-card h3 { margin: 4px 0 6px; font-family: var(--font-display); font-size: 22px; }
.install-card p { margin: 0 0 10px; font-size: 14px; color: var(--testo-2); }
.install-card ol { text-align: left; margin: 0 0 10px; padding-left: 22px; font-size: 15px; line-height: 1.5; }
.install-card ol li + li { margin-top: 6px; }
.ios-share { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: #fff; color: #2b6fb8; vertical-align: middle; margin: 0 2px; }
.install-note { font-size: 12px !important; }
.install-card .btn.wide { margin-top: 4px; }
.install-card .linkish { display: block; margin: 10px auto 0; font-size: 12px; color: var(--testo-2); }
html.theme-memphis .install-card { background: #fff; color: #1b1a24; border: 3px solid #1b1a24; box-shadow: 8px 8px 0 #1b1a24; } html.theme-memphis .install-card::after { background: #fff; border-color: #1b1a24; } html.theme-memphis .install-card p { color: #3c3a48; }

/* mini tutorial animato (loop 9 s): tocca Condividi → il foglio sale → scorre → tocca la voce → icona sulla Home */
.tut { margin: 4px auto 12px; width: 100%; max-width: 300px; }
.tut-phone { position: relative; width: 170px; height: 300px; margin: 0 auto; border-radius: 26px; background: #0e1118; border: 3px solid #3a4150; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.tut-page { position: absolute; inset: 0; background: #1c2230; padding: 26px 14px; }
.tut-logo { display: block; font-family: var(--font-display); font-weight: 800; color: var(--avorio); font-size: 17px; margin-bottom: 10px; letter-spacing: -.02em; }
.tut-page i { display: block; height: 44px; border-radius: 10px; margin-top: 8px; background: #c62839; opacity: .9; } .tut-page i:nth-child(3) { background: #2b6fb8; } .tut-page i:nth-child(4) { background: #e2a93a; }
.tut-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: #f2f2f7; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; font-size: 9px; color: #333; }
.tut-url { background: #e3e3e8; border-radius: 8px; padding: 4px 8px; }
.tut-sharebtn { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: #0a7aff; }
.tut-sheet { position: absolute; left: 0; right: 0; bottom: 0; height: 230px; background: #f2f2f7; border-radius: 14px 14px 0 0; transform: translateY(100%); color: #111; font-size: 9.5px; overflow: hidden; animation: tut-sheet 9s infinite; }
.tut-head { padding: 10px 12px 8px; border-bottom: 1px solid #ddd; display: flex; flex-direction: column; } .tut-head b { font-size: 11px; } .tut-head small { color: #777; font-size: 8px; }
.tut-list { padding: 6px 0; animation: tut-scroll 9s infinite; }
.tut-row { padding: 7px 12px; border-bottom: 1px solid #e6e6ea; background: #fff; }
.tut-row.tut-target { font-weight: 700; animation: tut-hl 9s infinite; }
.tut-plus { display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1.5px solid #111; border-radius: 3px; margin-right: 6px; font-size: 10px; line-height: 1; }
.tut-done { position: absolute; inset: 0; background: #1c2230; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--avorio); font-size: 10px; opacity: 0; animation: tut-done 9s infinite; }
.tut-done img { width: 44px; height: 44px; border-radius: 11px; box-shadow: 0 6px 14px rgba(0,0,0,.5); }
.tut-finger { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 0 0 4px rgba(255,255,255,.25), 0 4px 10px rgba(0,0,0,.4); left: 138px; top: 268px; animation: tut-finger 9s infinite; }
.tut-cap { position: relative; height: 20px; margin-top: 10px; font-size: 12px; color: var(--testo-2); text-align: center; }
.tut-cap span { position: absolute; left: 0; right: 0; opacity: 0; animation: tut-cap 9s infinite; }
.tut-cap .c2 { animation-delay: 2.2s; } .tut-cap .c3 { animation-delay: 4.4s; } .tut-cap .c4 { animation-delay: 6.6s; }
@keyframes tut-finger {
  0%   { left: 138px; top: 268px; transform: scale(1); opacity: 0; }
  8%   { left: 138px; top: 268px; opacity: 1; }
  12%  { transform: scale(.8); }                     /* tocco su Condividi */
  16%  { transform: scale(1); }
  30%  { left: 80px; top: 230px; }                   /* dito sull'elenco */
  36%  { left: 80px; top: 230px; }
  46%  { left: 80px; top: 120px; }                   /* scorre verso l'alto */
  54%  { left: 80px; top: 196px; transform: scale(1); }
  58%  { transform: scale(.8); }                     /* tocco sulla voce */
  62%  { transform: scale(1); opacity: 1; }
  70%  { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes tut-sheet {
  0%, 12% { transform: translateY(100%); }
  20%, 62% { transform: translateY(0); }
  70%, 100% { transform: translateY(100%); }
}
@keyframes tut-scroll {
  0%, 36% { transform: translateY(0); }
  46%, 100% { transform: translateY(-78px); }
}
@keyframes tut-hl {
  0%, 56% { background: #fff; }
  58%, 66% { background: #ffe9a8; }
  70%, 100% { background: #fff; }
}
@keyframes tut-done {
  0%, 68% { opacity: 0; }
  74%, 94% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes tut-cap {
  0% { opacity: 0; transform: translateY(4px); }
  4%, 22% { opacity: 1; transform: none; }
  26%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .tut * { animation: none !important; } .tut-sheet { transform: none; } .tut-cap .c3 { opacity: 1; } }

/* amici */
html:not(.theme-memphis) #scr-home .panel.friends-panel { background: #3f7d5a; box-shadow: 0 18px 40px -20px rgba(0,0,0,.7); }
html.theme-memphis #scr-home .panel.friends-panel { background: #9b7bff; }
.friends-me { font-size: 13px; color: rgba(255,255,255,.85); margin: 0 0 10px; }
.friends-me b { font-family: var(--font-body); letter-spacing: .15em; background: rgba(0,0,0,.22); padding: 3px 8px; border-radius: 8px; color: #fff; }
.friends-me .linkish { color: #fff; text-decoration: underline; margin-left: 6px; font-size: 13px; }
.friends-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.friends-empty { font-size: 13px; color: rgba(255,255,255,.85); margin: 0; line-height: 1.4; }
.friend { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.22); border-radius: 12px; padding: 8px 10px; color: #fff; }
.friend .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.3); flex: none; }
.friend.on .dot { background: #7CFC9A; box-shadow: 0 0 10px #7CFC9A; }
.friend .fname { flex: 1; display: flex; flex-direction: column; min-width: 0; } .friend .fname b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .friend .fname small { font-size: 11px; opacity: .8; }
.friend .iconbtn.sm { width: 28px; height: 28px; font-size: 12px; background: rgba(0,0,0,.2); border: none; color: #fff; border-radius: 8px; }
.friend .btn.sm { padding: 6px 12px; }
.friend-add { display: flex; gap: 8px; } .friend-add input { flex: 1; min-width: 0; }
#scr-home .panel.friends-panel .field input, #scr-home .panel.friends-panel .friend-add input { background: rgba(0,0,0,.22); color: #fff; border: none; border-radius: 12px; padding: 10px 12px; font: inherit; }
#scr-home .panel.friends-panel .friend-add input::placeholder { color: rgba(255,255,255,.55); text-transform: none; letter-spacing: 0; }
html:not(.theme-memphis) #scr-home .panel.friends-panel .btn { background: #f7f2e6; color: #245a3d; }
.lobby-friends { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 8px 0; }
.lobby-friends .lbl { font-size: 12px; color: var(--testo-2); text-transform: uppercase; letter-spacing: .08em; }
html.theme-memphis .friend { background: #fff; color: #1b1a24; border: 2px solid #1b1a24; } html.theme-memphis .friends-me, html.theme-memphis .friends-empty { color: #1b1a24; } html.theme-memphis .friends-me b { background: #fff; color: #1b1a24; border: 2px solid #1b1a24; }

.friend .bell { width: 32px; height: 32px; border-radius: 9px; border: none; background: rgba(0,0,0,.2); color: #ffe08a; display: grid; place-items: center; cursor: pointer; transition: transform .2s var(--spring), background .2s; }
.friend .bell:active { transform: scale(.9); }
.friend .bell.sent { color: rgba(255,255,255,.45); }
.friend .bell.ring { animation: bellring .9s ease-in-out; }
@keyframes bellring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(18deg); } 30% { transform: rotate(-16deg); } 45% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 75% { transform: rotate(4deg); } }
html.theme-memphis .friend .bell { background: #ffd23f; color: #1b1a24; border: 2px solid #1b1a24; }
