/* =========================================================
   FantaCliente AD HOC — tema "mobile game"
   ========================================================= */
:root {
  --brand: #36A23A;
  --brand-hi: #6BEB7E;
  --brand-lo: #1E6E29;
  --ink: #0B1A10;          /* contorni da cartoon */
  --bg: #0c1f15;
  --panel: #173527;
  --panel-2: #1f4433;
  --panel-hi: #285640;
  --text: #ffffff;
  --muted: #a6c6b3;
  --dim: #6f927e;
  --gold: #FFC93C;
  --gold-hi: #FFEA8A;
  --silver: #DCE6EE;
  --bronze: #E59A5C;
  --pos: #6BEB7E;
  --neg: #FF6B6B;
  --r: 22px;
  --nav-h: 78px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: "Lilita One", "Outfit", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text); font-size: 16px; line-height: 1.35; min-height: 100vh;
  background:
    radial-gradient(90% 45% at 50% 0%, rgba(107, 235, 126, .28), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, #11301f 0%, #0c1f15 55%, #08150e 100%);
  background-attachment: fixed;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 400; line-height: 1.05; letter-spacing: .01em; }
.ic { width: 24px; height: 24px; display: inline-block; flex: none; vertical-align: middle; }
.ic.s { width: 18px; height: 18px; }
.ic.m { width: 32px; height: 32px; }
.ic.l { width: 44px; height: 44px; }
.ic.xl { width: 64px; height: 64px; }
.game { font-family: var(--display); font-weight: 400; letter-spacing: .02em; }
.outline { text-shadow: 0 2px 0 var(--ink), 0 -1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 3px 0 rgba(0,0,0,.35); }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: linear-gradient(180deg, #0b1a10 0%, rgba(11,26,16,.92) 100%);
  border-bottom: 3px solid var(--ink);
  box-shadow: 0 4px 0 rgba(0,0,0,.25);
}
.brand { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.brand img { height: 10px; width: auto; }
.brand .fc { font-family: var(--display); font-size: 22px; line-height: 1; color: #fff; }
.brand .fc em { font-style: normal; color: var(--brand-hi); }
.top-right { display: flex; align-items: center; gap: 8px; }
.res {
  display: flex; align-items: center; gap: 4px; padding: 3px 10px 3px 4px; border-radius: 999px;
  background: #0b1a10; box-shadow: inset 0 0 0 2px #2a4a38; font-family: var(--display); font-size: 16px;
}
.res .ic { width: 26px; height: 26px; margin: -4px 0; }
.me-chip {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 24px;
  background: linear-gradient(180deg, #3a7a52, #22513a); border: 3px solid var(--ink);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.25), 0 3px 0 var(--ink);
}

.view { padding: 18px 16px calc(var(--nav-h) + 34px + var(--safe-b)); animation: viewin .35s var(--ease); }
@keyframes viewin { from { opacity: 0; transform: translateY(10px) scale(.99); } }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 560px; margin: 0 auto; height: calc(var(--nav-h) + var(--safe-b)); padding: 0 6px var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch;
  background: linear-gradient(180deg, #1d4031, #12291d);
  border-top: 3px solid var(--ink); box-shadow: 0 -4px 0 rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.08);
}
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-family: var(--display); font-size: 12px; color: var(--dim); letter-spacing: .03em;
  transition: color .2s;
}
.tabbar a .ic { width: 34px; height: 34px; filter: grayscale(.85) brightness(.75); transition: transform .3s var(--bounce), filter .2s; }
.tabbar a.on { color: #fff; }
.tabbar a.on::before {
  content: ""; position: absolute; inset: 6px 4px; border-radius: 18px; z-index: -1;
  background: linear-gradient(180deg, #3b7a55, #275a3e); box-shadow: inset 0 2px 0 rgba(255,255,255,.2), inset 0 0 0 2px var(--ink);
}
.tabbar a.on .ic { filter: none; transform: translateY(-8px) scale(1.25); }
.tabbar a.on .lbl { transform: translateY(-4px); }
.tabbar a.fab .fab-btn {
  width: 66px; height: 66px; margin-top: -34px; border-radius: 22px; display: grid; place-items: center;
  background: linear-gradient(180deg, #8af59a 0%, #3fb84b 45%, #24872f 100%);
  border: 3px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.5), inset 0 -6px 0 rgba(0,0,0,.2), 0 5px 0 var(--ink), 0 10px 24px rgba(107,235,126,.45);
  transition: transform .3s var(--bounce);
  animation: fabglow 2.4s ease-in-out infinite;
}
@keyframes fabglow { 50% { box-shadow: inset 0 3px 0 rgba(255,255,255,.5), inset 0 -6px 0 rgba(0,0,0,.2), 0 5px 0 var(--ink), 0 10px 34px rgba(107,235,126,.75); } }
.tabbar a.fab .fab-btn .ic { width: 38px; height: 38px; filter: none; transform: none; }
.tabbar a.fab.on::before { display: none; }
.tabbar a.fab.on .fab-btn { transform: rotate(45deg) scale(1.05); }
.tabbar a.fab .lbl { margin-top: 4px; color: #fff; }

/* ---------- pannelli ---------- */
.card {
  position: relative; border-radius: var(--r); padding: 16px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 3px solid var(--ink);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 4px 0 var(--ink), 0 8px 18px rgba(0,0,0,.25);
}
.stack > * + * { margin-top: 12px; }
.title { font-size: 34px; margin: 2px 0 6px; color: #fff; text-shadow: 0 3px 0 var(--ink), 0 0 1px var(--ink); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; }
.title-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.title-row .ic { width: 52px; height: 52px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.35)); animation: wobble 3s ease-in-out infinite; }
.title-row .title { margin: 0; }
@keyframes wobble { 50% { transform: rotate(-6deg) scale(1.05); } }
.subtitle { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.section-h {
  font-family: var(--display); font-size: 18px; color: #fff; margin: 26px 2px 12px;
  display: flex; align-items: center; gap: 10px; text-shadow: 0 2px 0 var(--ink);
}
.section-h .ic { width: 30px; height: 30px; }
.section-h::after { content: ""; flex: 1; height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(255,255,255,.15), transparent); }
.muted { color: var(--muted); }
small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.hide { display: none !important; }

/* ---------- pulsanti 3D ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 20px; border-radius: 16px;
  font-family: var(--display); font-size: 19px; letter-spacing: .03em; color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.45);
  background: linear-gradient(180deg, #5d8a74 0%, #3e6a55 50%, #2f5644 100%);
  border: 3px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.35), inset 0 -5px 0 rgba(0,0,0,.2), 0 5px 0 var(--ink);
  transition: transform .08s, box-shadow .08s, filter .2s;
}
.btn:active { transform: translateY(4px); box-shadow: inset 0 3px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.2), 0 1px 0 var(--ink); }
.btn:disabled { filter: grayscale(1) brightness(.7); pointer-events: none; }
.btn.primary { background: linear-gradient(180deg, #9af7a7 0%, #4cc759 40%, #2a9436 100%); }
.btn.gold { background: linear-gradient(180deg, #fff09a 0%, #ffc93c 45%, #e8961a 100%); color: #fff; }
.btn.danger { background: linear-gradient(180deg, #ffa3a3 0%, #f15353 45%, #c42a35 100%); }
.btn.blue { background: linear-gradient(180deg, #a3e2ff 0%, #45a6f5 45%, #2369d1 100%); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); text-shadow: none; }
.btn.block { width: 100%; }
.btn.big { min-height: 62px; font-size: 22px; border-radius: 20px; }
.btn.sm { min-height: 38px; padding: 4px 14px; font-size: 15px; border-radius: 12px; box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.2), 0 3px 0 var(--ink); }
.btn .ic { width: 30px; height: 30px; margin: -6px 0; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

/* punti */
.pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 58px;
  padding: 3px 10px; border-radius: 12px; font-family: var(--display); font-size: 19px; white-space: nowrap;
  border: 3px solid var(--ink); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.4);
  background: linear-gradient(180deg, #6b8a7a, #435f51);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 3px 0 var(--ink);
}
.pill.pos { background: linear-gradient(180deg, #8ff29b, #33a840); }
.pill.neg { background: linear-gradient(180deg, #ff9d9d, #d93a44); }
.pts { font-family: var(--display); white-space: nowrap; letter-spacing: .02em; }
.pts.pos { color: var(--pos); }
.pts.neg { color: var(--neg); }
.pts.zero { color: var(--muted); }

.avatar {
  width: 46px; height: 46px; flex: none; border-radius: 15px; display: grid; place-items: center; font-size: 25px;
  background: linear-gradient(180deg, #4f8a69, #2c5a43); border: 3px solid var(--ink);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.3), inset 0 -3px 0 rgba(0,0,0,.2);
}
.avatar.sm { width: 38px; height: 38px; font-size: 20px; border-radius: 12px; }
.avatar.xl { width: 68px; height: 68px; font-size: 38px; border-radius: 20px; }
.avatar.xxl { width: 108px; height: 108px; font-size: 60px; border-radius: 30px; }
.avatar.round { border-radius: 50%; }

/* rarità clienti */
.r-common { --r1: #c5d3dc; --r2: #7f95a3; --rg: rgba(197,211,220,.25); }
.r-rare   { --r1: #8fdcff; --r2: #2c79e6; --rg: rgba(70,170,255,.35); }
.r-epic   { --r1: #e2a8ff; --r2: #8040e6; --rg: rgba(176,100,255,.4); }
.r-legend { --r1: #fff09a; --r2: #f0a01c; --rg: rgba(255,201,60,.45); }
.avatar.rar { background: linear-gradient(180deg, var(--r1), var(--r2)); }
.rar-tag {
  display: inline-block; font-family: var(--display); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  padding: 1px 8px; border-radius: 6px; color: #fff; border: 2px solid var(--ink);
  background: linear-gradient(180deg, var(--r1), var(--r2)); text-shadow: 0 1px 0 rgba(0,0,0,.5);
}

/* segmented */
.seg {
  display: flex; padding: 5px; gap: 5px; border-radius: 18px; margin-bottom: 16px;
  background: #0b1a10; border: 3px solid var(--ink); box-shadow: inset 0 3px 6px rgba(0,0,0,.4);
}
.seg button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 4px; border-radius: 13px; font-family: var(--display); font-size: 15px; color: var(--dim);
  transition: transform .2s var(--bounce);
}
.seg button .ic { width: 24px; height: 24px; filter: grayscale(.8) brightness(.8); }
.seg button.on {
  color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.45);
  background: linear-gradient(180deg, #5d8a74, #34604b); border: 2px solid var(--ink);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 3px 0 var(--ink); transform: translateY(-2px);
}
.seg button.on .ic { filter: none; }
.seg button.on.bonus { background: linear-gradient(180deg, #8ff29b, #33a840); }
.seg button.on.malus { background: linear-gradient(180deg, #ff9d9d, #d93a44); }

/* righe */
.list > * + * { margin-top: 10px; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; width: 100%; text-align: left;
  border-radius: 18px; background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 3px solid var(--ink); box-shadow: inset 0 2px 0 rgba(255,255,255,.1), 0 4px 0 var(--ink);
  transition: transform .1s;
}
.row:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255,255,255,.1), 0 1px 0 var(--ink); }
.row.me { background: linear-gradient(180deg, #3f8a58, #286b3f); }
.row.off { opacity: .45; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row.me .row-main small { color: #d2f5dc; }
.row .pts { font-size: 22px; text-shadow: 0 2px 0 var(--ink); }
.rank {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px;
  font-family: var(--display); font-size: 17px; color: #fff; background: #0b1a10; text-shadow: 0 1px 0 #000;
}
.chev { color: var(--dim); }
.chev .ic { width: 20px; height: 20px; }

/* ---------- hero giocatore ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 18px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255,255,255,.28), transparent 50%),
    linear-gradient(160deg, #5fd36d 0%, #2e9b3b 45%, #1a6326 100%);
  border: 3px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.35), inset 0 -6px 0 rgba(0,0,0,.15), 0 5px 0 var(--ink), 0 14px 30px rgba(54,162,58,.35);
}
.hero::before {
  content: ""; position: absolute; inset: -50%; pointer-events: none; opacity: .18;
  background: repeating-conic-gradient(from 0deg at 85% 15%, #fff 0deg 8deg, transparent 8deg 22deg);
  animation: spin 40s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero > * { position: relative; }
.hero-row { display: flex; align-items: center; gap: 14px; }
.hero .avatar { background: linear-gradient(180deg, #ffffff55, #ffffff22); }
.kicker { font-family: var(--display); font-size: 14px; letter-spacing: .05em; color: #eaffea; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.hero-name { font-family: var(--display); font-size: 32px; line-height: 1; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stats > div {
  background: rgba(11,26,16,.55); border-radius: 16px; padding: 8px 6px; text-align: center;
  border: 2px solid rgba(11,26,16,.8); box-shadow: inset 0 2px 0 rgba(255,255,255,.08);
}
.stats .ic { width: 30px; height: 30px; margin: -2px auto 2px; display: block; }
.stats b { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1; text-shadow: 0 2px 0 var(--ink); }
.stats small { color: #cfe9d6; font-size: 12px; }
.stats .pos { color: var(--gold-hi); }
.stats .neg { color: #ffb0b0; }
.hero .btn { margin-top: 14px; }

.month-nav {
  display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; gap: 10px;
}
.month-nav b {
  flex: 1; text-align: center; font-family: var(--display); font-weight: 400; font-size: 19px; text-transform: capitalize;
  padding: 7px; border-radius: 14px; background: #0b1a10; border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; gap: 6px;
}
.month-nav b .ic { width: 26px; height: 26px; }
.month-nav button {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, #5d8a74, #34604b); border: 3px solid var(--ink);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 3px 0 var(--ink);
}
.month-nav button .ic { width: 20px; height: 20px; }
.month-nav button:disabled { opacity: .3; }

/* ---------- podio ---------- */
.podium-3 { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 6px; margin: 6px 0 16px; }
.pod { text-align: center; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.pod .avatar { width: 60px; height: 60px; font-size: 32px; border-radius: 50%; margin-bottom: 6px; }
.pod.p1 .avatar { width: 80px; height: 80px; font-size: 44px; background: linear-gradient(180deg, #fff09a, #f0a01c); box-shadow: 0 0 0 4px rgba(255,201,60,.35), 0 0 30px rgba(255,201,60,.55); }
.pod.p2 .avatar { background: linear-gradient(180deg, #ffffff, #a9b8c4); }
.pod.p3 .avatar { background: linear-gradient(180deg, #ffd0a6, #c46f2c); }
.pod .crown { width: 40px; height: 40px; margin-bottom: -10px; position: relative; z-index: 2; animation: wobble 2.5s ease-in-out infinite; }
.pod .nm { font-weight: 700; font-size: 14px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod .pts { font-size: 20px; text-shadow: 0 2px 0 var(--ink); }
.pod .step {
  width: 100%; margin-top: 6px; border-radius: 14px 14px 4px 4px; display: grid; place-items: center;
  font-family: var(--display); font-size: 34px; color: #fff; text-shadow: 0 3px 0 var(--ink); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill;
  border: 3px solid var(--ink); border-bottom: 0; box-shadow: inset 0 3px 0 rgba(255,255,255,.4);
}
.pod.p1 .step { height: 92px; background: linear-gradient(180deg, #ffe680, #f0a01c); }
.pod.p2 .step { height: 66px; background: linear-gradient(180deg, #f3f7fa, #9fb0bd); }
.pod.p3 .step { height: 50px; background: linear-gradient(180deg, #ffc89a, #c46f2c); }

.banner {
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 16px; margin-bottom: 16px;
  font-weight: 600; font-size: 14px; background: #0b1a10; border: 3px solid var(--ink);
}
.banner .ic { width: 38px; height: 38px; }
.banner.open { background: linear-gradient(180deg, #23573a, #183f2a); box-shadow: inset 0 0 0 2px rgba(107,235,126,.4); }
.banner b { font-family: var(--display); font-weight: 400; font-size: 17px; display: block; letter-spacing: .02em; }
.banner.open b { color: var(--pos); }

/* ---------- carte cliente (collezionabili) ---------- */
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ccard {
  position: relative; border-radius: 20px; padding: 12px 10px 12px; text-align: center; overflow: hidden;
  background: linear-gradient(180deg, var(--r1), var(--r2));
  border: 3px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.5), inset 0 -5px 0 rgba(0,0,0,.18), 0 5px 0 var(--ink), 0 10px 22px var(--rg);
}
.ccard::after {
  content: ""; position: absolute; top: -60%; left: -80%; width: 50%; height: 220%; transform: rotate(25deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); animation: shine 4.5s ease-in-out infinite;
}
.ccard.r-common::after { display: none; }
@keyframes shine { 0%, 60% { left: -80%; } 100% { left: 140%; } }
.ccard .art {
  margin: 4px auto 8px; width: 74px; height: 74px; border-radius: 18px; display: grid; place-items: center; font-size: 44px;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.55), rgba(255,255,255,.1) 70%);
  border: 3px solid var(--ink); box-shadow: inset 0 -4px 0 rgba(0,0,0,.15);
}
.ccard .nm {
  display: block; font-family: var(--display); font-size: 15px; line-height: 1.1; min-height: 34px; color: #fff;
  text-shadow: 0 2px 0 var(--ink), 0 0 2px var(--ink); display: flex; align-items: center; justify-content: center;
}
.ccard .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 6px; }
.ccard .cost-b {
  display: inline-flex; align-items: center; gap: 2px; font-family: var(--display); font-size: 15px; padding: 1px 8px 1px 2px;
  background: rgba(11,26,16,.65); border-radius: 999px; color: var(--gold-hi);
}
.ccard .cost-b .ic { width: 22px; height: 22px; }
.ccard .pts-b {
  font-family: var(--display); font-size: 18px; padding: 0 10px; border-radius: 10px; background: rgba(11,26,16,.65);
}
.ccard .pts-b.pos { color: var(--pos); } .ccard .pts-b.neg { color: var(--neg); } .ccard .pts-b.zero { color: #fff; }
.ccard .rar-tag { position: absolute; top: 8px; left: 8px; font-size: 9px; padding: 0 6px; }
.ccard.captain { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px; }
.ccard.captain .art { margin: 0; width: 92px; height: 92px; font-size: 56px; }
.ccard.captain .info { flex: 1; min-width: 0; }
.ccard.captain .nm { justify-content: flex-start; font-size: 22px; min-height: 0; margin: 4px 0; }
.ccard.captain .foot { justify-content: flex-start; }
.ccard .cap-badge {
  position: absolute; top: 6px; right: 6px; display: flex; align-items: center; gap: 2px;
  font-family: var(--display); font-size: 14px; color: #fff; text-shadow: 0 2px 0 var(--ink);
}
.ccard .cap-badge .ic { width: 34px; height: 34px; animation: wobble 2.5s ease-in-out infinite; }
.ccard.empty-slot {
  --r1: #1d3a2b; --r2: #142b1f; display: grid; place-items: center; min-height: 170px; color: var(--dim);
  border-style: dashed; box-shadow: none; font-family: var(--display);
}
.ccard.empty-slot::after { display: none; }

.budget {
  position: sticky; top: calc(64px + var(--safe-t)); z-index: 10; margin: 0 -16px 14px; padding: 10px 16px 12px;
  background: linear-gradient(180deg, #0b1a10, rgba(11,26,16,.95)); border-bottom: 3px solid var(--ink);
}
.budget-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); font-size: 17px; }
.budget-top span { display: flex; align-items: center; gap: 4px; }
.budget-top .ic { width: 28px; height: 28px; margin: -4px 0; }
.bar {
  height: 20px; border-radius: 999px; background: #050d08; border: 3px solid var(--ink); overflow: hidden; margin-top: 6px;
  box-shadow: inset 0 3px 4px rgba(0,0,0,.5);
}
.bar i {
  display: block; height: 100%; border-radius: 999px; transition: width .4s var(--bounce);
  background: linear-gradient(180deg, #fff09a 0%, #ffc93c 45%, #e8961a 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.6);
}
.bar.over i { background: linear-gradient(180deg, #ffa3a3, #d93a44); }

.pick { cursor: pointer; }
.pick.sel { background: linear-gradient(180deg, #3f8a58, #286b3f); }
.pick .check {
  width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: #0b1a10; border: 2px solid #2a4a38; color: transparent; transition: all .25s var(--bounce);
}
.pick.sel .check { background: linear-gradient(180deg, #9af7a7, #2a9436); border-color: var(--ink); color: #fff; transform: scale(1.1) rotate(-6deg); }
.pick .check .ic { width: 18px; height: 18px; }
.pick .cost { display: flex; align-items: center; gap: 2px; font-family: var(--display); font-size: 19px; color: var(--gold-hi); white-space: nowrap; text-shadow: 0 2px 0 var(--ink); }
.pick .cost .ic { width: 28px; height: 28px; }
.pick.dim { opacity: .4; }
.capbtn {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 2px 10px 2px 4px; border-radius: 10px;
  font-family: var(--display); font-size: 13px; color: var(--muted); background: #0b1a10; border: 2px solid #2a4a38;
}
.capbtn .ic { width: 22px; height: 22px; filter: grayscale(1); }
.capbtn.on { color: #fff; background: linear-gradient(180deg, #ffe680, #e8961a); border-color: var(--ink); text-shadow: 0 1px 0 var(--ink); }
.capbtn.on .ic { filter: none; }
.savebar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 25;
  max-width: 560px; margin: 0 auto; padding: 12px 16px 14px;
  background: linear-gradient(180deg, transparent, rgba(8,21,14,.95) 35%);
}

/* ---------- segnala ---------- */
.search {
  width: 100%; padding: 14px 16px; border-radius: 16px; margin-bottom: 14px; outline: none;
  background: #0b1a10; border: 3px solid var(--ink); box-shadow: inset 0 3px 6px rgba(0,0,0,.4);
  color: #fff; font: inherit; font-weight: 600;
}
.search:focus { box-shadow: inset 0 3px 6px rgba(0,0,0,.4), 0 0 0 3px rgba(107,235,126,.5); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px;
  border-radius: 20px; text-align: center; color: #fff; overflow: hidden;
  background: linear-gradient(180deg, var(--r1), var(--r2)); border: 3px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.45), inset 0 -4px 0 rgba(0,0,0,.18), 0 5px 0 var(--ink);
  font-family: var(--display); font-size: 15px; line-height: 1.1; text-shadow: 0 2px 0 var(--ink), 0 0 2px var(--ink);
  transition: transform .1s;
}
.tile:active { transform: translateY(4px); box-shadow: inset 0 3px 0 rgba(255,255,255,.45), 0 1px 0 var(--ink); }
.tile .e {
  width: 64px; height: 64px; display: grid; place-items: center; font-size: 38px; border-radius: 16px; text-shadow: none;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.55), rgba(255,255,255,.1) 70%); border: 3px solid var(--ink);
}
.tile .star { position: absolute; top: 6px; right: 6px; }
.tile .star .ic { width: 26px; height: 26px; }
.chosen { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px; }
.chosen b { flex: 1; font-family: var(--display); font-weight: 400; font-size: 20px; line-height: 1.1; }
.rules > * + * { margin-top: 10px; }
.rule {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px;
  border-radius: 18px; background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 3px solid var(--ink); box-shadow: inset 0 2px 0 rgba(255,255,255,.1), 0 4px 0 var(--ink);
  transition: transform .15s var(--bounce);
}
.rule:active { transform: scale(.98); }
.rule .e {
  font-size: 26px; width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 14px;
  background: #0b1a10; box-shadow: inset 0 2px 4px rgba(0,0,0,.5);
}
.rule .t { flex: 1; min-width: 0; }
.rule .t b { display: block; font-weight: 700; font-size: 15px; line-height: 1.2; }
.rule .t small { color: var(--muted); display: block; margin-top: 2px; line-height: 1.25; }
.rule.sel { background: linear-gradient(180deg, #4fae62, #2a7a3a); transform: scale(1.02); box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 4px 0 var(--ink), 0 0 0 3px rgba(107,235,126,.5); }
.rule.sel.neg { background: linear-gradient(180deg, #d65b5b, #9c2a33); box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 4px 0 var(--ink), 0 0 0 3px rgba(255,107,107,.5); }
.rule.sel .t small { color: #f0fff3; }
.sendbar { position: sticky; bottom: calc(var(--nav-h) + 16px + var(--safe-b)); margin-top: 18px; z-index: 5; }

textarea, input[type=text], input[type=password], input[type=number], input[type=search], select {
  width: 100%; padding: 13px 14px; border-radius: 14px; outline: none; color: #fff; font: inherit; font-weight: 600;
  background: #0b1a10; border: 3px solid var(--ink); box-shadow: inset 0 3px 6px rgba(0,0,0,.4);
}
textarea:focus, input:focus, select:focus { box-shadow: inset 0 3px 6px rgba(0,0,0,.4), 0 0 0 3px rgba(107,235,126,.5); }
select option { background: #0b1a10; }
textarea { min-height: 86px; resize: vertical; }
::placeholder { color: var(--dim); font-weight: 500; }
label.f { display: block; margin-bottom: 14px; }
label.f > span, .f-l { display: block; margin-bottom: 6px; font-family: var(--display); font-size: 15px; letter-spacing: .02em; color: #e3f5e8; }
label.chk { display: flex; align-items: center; gap: 12px; font-weight: 700; margin-bottom: 14px; }
label.chk input { width: 24px; height: 24px; accent-color: var(--brand); }
.hint { color: var(--dim); font-size: 12px; margin-top: 6px; font-family: "Outfit", sans-serif; letter-spacing: 0; }

.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.emoji-pick label input { position: absolute; opacity: 0; pointer-events: none; }
.emoji-pick label span {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; font-size: 26px;
  background: #0b1a10; border: 3px solid transparent; transition: transform .2s var(--bounce);
}
.emoji-pick label input:checked + span {
  background: linear-gradient(180deg, #9af7a7, #2a9436); border-color: var(--ink); transform: scale(1.12) rotate(-4deg);
  box-shadow: 0 3px 0 var(--ink);
}

/* ---------- feed ---------- */
.ev { padding: 14px; }
.ev + .ev { margin-top: 14px; }
.ev.pos { background: linear-gradient(180deg, #245c3a, #173b27); }
.ev.neg { background: linear-gradient(180deg, #5a2a2e, #3a1a1f); }
.ev-head { display: flex; align-items: center; gap: 10px; }
.ev-head a { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; font-weight: 700; }
.ev-head a b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-head time { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ev-body {
  display: flex; align-items: center; gap: 12px; margin: 12px 0 2px; padding: 10px; border-radius: 16px;
  background: rgba(11,26,16,.5);
}
.ev-body .e { font-size: 30px; width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.08); }
.ev-body .l { flex: 1; font-weight: 800; font-size: 17px; line-height: 1.2; }
.ev-body .pill { font-size: 22px; padding: 4px 10px; }
.ev blockquote { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.25); font-style: italic; color: #e3f0e7; }
.hits { margin-top: 10px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.hits span { background: rgba(11,26,16,.6); padding: 3px 10px; border-radius: 999px; color: #fff; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.hits span b { font-family: var(--display); font-weight: 400; font-size: 15px; }
.hits span.pos b { color: var(--pos); } .hits span.neg b { color: var(--neg); }
.hits .ic { width: 18px; height: 18px; }
.hits em { font-style: normal; }
.ev-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.by { font-size: 12px; color: var(--muted); font-weight: 600; flex: 1; min-width: 110px; }
.reacts { display: flex; gap: 4px; }
.reacts button {
  border-radius: 12px; padding: 3px 7px; font-size: 16px; min-width: 36px; font-family: var(--display);
  background: rgba(11,26,16,.6); border: 2px solid transparent; transition: transform .25s var(--bounce);
}
.reacts button:active { transform: scale(1.35) rotate(-8deg); }
.reacts button.on { background: linear-gradient(180deg, #ffe680, #e8961a); border-color: var(--ink); color: #fff; text-shadow: 0 1px 0 var(--ink); }
.icon-btn { padding: 6px; color: var(--muted); border-radius: 10px; }
.icon-btn .ic { width: 20px; height: 20px; }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); font-weight: 600; }
.empty .big { font-size: 64px; display: block; margin-bottom: 10px; }
.empty .ic { width: 84px; height: 84px; margin: 0 auto 10px; display: block; animation: wobble 3s ease-in-out infinite; }

/* ---------- profilo / dettagli ---------- */
.profile { text-align: center; padding: 22px 16px 18px; }
.profile .avatar { margin: 0 auto 12px; }
.profile h2 { font-size: 32px; text-shadow: 0 3px 0 var(--ink); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; }
.profile p { margin: 4px 0 0; }
.profile.rar { background: linear-gradient(180deg, var(--r1), var(--r2)); }
.profile.rar p { color: #fff; text-shadow: 0 1px 0 var(--ink); font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.kpis > div { border-radius: 16px; padding: 8px 6px; text-align: center; background: rgba(11,26,16,.6); border: 2px solid var(--ink); }
.kpis .ic { width: 28px; height: 28px; display: block; margin: 0 auto 2px; }
.kpis b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.05; text-shadow: 0 2px 0 var(--ink); }
.kpis small { color: #cfe9d6; font-size: 12px; }

.hall .card + .card { margin-top: 14px; }
.hall-m { font-family: var(--display); font-size: 21px; text-transform: capitalize; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; text-shadow: 0 2px 0 var(--ink); }
.hall-m a { font-size: 14px; text-transform: none; color: var(--pos); }
.podium { display: flex; flex-direction: column; gap: 8px; }
.podium > div { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 6px 8px; border-radius: 12px; background: rgba(11,26,16,.45); }
.podium > div span:nth-child(2) { flex: 1; }
.podium .pts { font-size: 18px; }
.hall-cl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.hall-cl > div { background: rgba(11,26,16,.45); border-radius: 12px; padding: 8px 10px; }
.hall-cl b { color: #fff; display: block; font-size: 14px; margin: 3px 0 1px; }
.medal { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; font-family: var(--display); font-size: 17px; color: #fff; border: 2.5px solid var(--ink); text-shadow: 0 1px 0 var(--ink); box-shadow: inset 0 2px 0 rgba(255,255,255,.5); }
.medal.m1 { background: linear-gradient(180deg, #fff09a, #f0a01c); }
.medal.m2 { background: linear-gradient(180deg, #ffffff, #9fb0bd); }
.medal.m3 { background: linear-gradient(180deg, #ffc89a, #c46f2c); }

/* ---------- auth ---------- */
.auth { padding: calc(30px + var(--safe-t)) 18px 40px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.auth-hero { text-align: center; margin-bottom: 26px; position: relative; }
.auth-hero .logo-wrap img { height: 14px; display: inline-block; margin-bottom: 18px; }
.auth-hero .rays {
  position: absolute; left: 50%; top: 40px; width: 360px; height: 360px; margin-left: -180px; z-index: -1; opacity: .35;
  background: repeating-conic-gradient(from 0deg, rgba(255,233,138,.55) 0deg 10deg, transparent 10deg 24deg);
  mask-image: radial-gradient(circle, #000 20%, transparent 65%); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 65%);
  animation: spin 30s linear infinite;
}
.auth-hero .big-ic { width: 130px; height: 130px; filter: drop-shadow(0 8px 0 rgba(0,0,0,.35)); animation: bob 3s ease-in-out infinite; }
.auth-hero h1 {
  font-size: 64px; line-height: .9; margin-top: 8px; color: #fff;
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink);
}
.auth-hero h1 em { font-style: normal; color: var(--brand-hi); }
.auth-hero p { color: var(--muted); margin: 14px auto 0; font-size: 17px; max-width: 300px; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-4deg); } }
.note-first {
  margin-top: 18px; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; border-radius: 16px; padding: 10px 14px;
  background: linear-gradient(180deg, #4a3a10, #33280b); color: var(--gold-hi); border: 3px solid var(--ink);
}
.note-first .ic { width: 40px; height: 40px; }

/* ---------- sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.65); opacity: 0; transition: opacity .25s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 90vh; overflow: auto;
  background: linear-gradient(180deg, #1f4433, #132b1f); border: 3px solid var(--ink); border-bottom: 0;
  border-radius: 28px 28px 0 0; padding: 12px 18px calc(24px + var(--safe-b));
  box-shadow: inset 0 3px 0 rgba(255,255,255,.12); transform: translateY(100%); transition: transform .4s var(--bounce);
}
.sheet::before { content: ""; display: block; width: 46px; height: 6px; border-radius: 9px; background: #0b1a10; margin: 0 auto 16px; }
.sheet h3 { font-size: 28px; margin-bottom: 16px; text-shadow: 0 3px 0 var(--ink); }
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; top: calc(12px + var(--safe-t)); transform: translate(-50%, -180%); z-index: 90;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px; font-weight: 700; font-size: 15px;
  background: linear-gradient(180deg, #3f8a58, #286b3f); color: #fff; border: 3px solid var(--ink);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 4px 0 var(--ink), 0 10px 30px rgba(0,0,0,.5);
  transition: transform .4s var(--bounce);
}
#toast.show { transform: translate(-50%, 0); }
#toast.err { background: linear-gradient(180deg, #d65b5b, #9c2a33); }

/* ---------- celebrazione ---------- */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; width: 100%; height: 100%; }
.celebrate {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; text-align: center; padding: 24px; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, rgba(54,162,58,.55), rgba(5,12,7,.95) 65%); animation: fadein .2s;
}
.celebrate.neg { background: radial-gradient(circle at 50% 45%, rgba(217,58,68,.5), rgba(5,12,7,.95) 65%); }
.celebrate::before {
  content: ""; position: absolute; left: 50%; top: 45%; width: 900px; height: 900px; margin: -450px 0 0 -450px;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.12) 0deg 9deg, transparent 9deg 20deg);
  animation: spin 12s linear infinite;
}
.celebrate > div { position: relative; }
.celebrate .word {
  display: block; font-family: var(--display); font-size: 68px; line-height: 1; color: var(--gold-hi);
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink);
  animation: pop .5s var(--bounce);
}
.celebrate.neg .word { color: #ff8a8a; animation: shake .6s; }
.celebrate .p {
  display: block; font-family: var(--display); font-size: 96px; line-height: 1; margin-top: 6px; color: #fff;
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 7px 0 var(--ink);
  animation: pop .55s .12s var(--bounce) both;
}
.celebrate .p.pos { color: var(--pos); }
.celebrate .p.neg { color: var(--neg); }
.celebrate .m { font-size: 20px; font-weight: 800; margin-top: 14px; max-width: 320px; text-shadow: 0 2px 0 var(--ink); }
.celebrate .m small { display: block; font-weight: 600; color: #d6efdc; font-size: 15px; margin-top: 6px; }
@keyframes pop { from { transform: scale(0) rotate(-10deg); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes shake { 0%,100% { transform: none; } 20%,60% { transform: translateX(-14px) rotate(-6deg); } 40%,80% { transform: translateX(14px) rotate(6deg); } }

.skel { height: 130px; border-radius: var(--r); background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: skel 1.3s infinite; border: 3px solid var(--ink); }
.skel + .skel { margin-top: 12px; }
@keyframes skel { to { background-position: -200% 0; } }

.splash { min-height: 100vh; display: grid; place-items: center; }
.splash .ic { width: 110px; height: 110px; animation: bob 1.4s ease-in-out infinite; }

.menu > * + * { margin-top: 10px; }
.menu .row .ic.l { margin: -4px 0; }
.adm-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.adm-actions > * { flex: 1; }
.rules-intro > div { display: flex; gap: 12px; align-items: center; font-size: 15px; }
.rules-intro .ic { width: 40px; height: 40px; }
.rules-intro b { color: var(--gold-hi); }
.profile.rar .avatar { background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.6), rgba(255,255,255,.15) 70%); }
.profile .rar-tag { font-size: 12px; padding: 2px 10px; }
@media (max-width: 400px) { .title { font-size: 29px; } .title-row .ic { width: 44px; height: 44px; } }
.emoji-groups {
  max-height: 300px; overflow-y: auto; padding: 4px 10px 6px; border-radius: 16px;
  background: #0b1a10; border: 3px solid var(--ink); box-shadow: inset 0 3px 6px rgba(0,0,0,.4);
  overscroll-behavior: contain;
}
.emoji-groups .eg-label {
  position: sticky; top: -4px; z-index: 1; padding: 8px 2px 6px; background: #0b1a10;
  font-family: var(--display); font-size: 13px; letter-spacing: .04em; color: var(--muted);
}
.emoji-groups .emoji-pick { margin-bottom: 4px; gap: 4px; }
.emoji-groups .emoji-pick label span { width: 44px; height: 44px; font-size: 24px; background: rgba(255,255,255,.05); }
