:root {
  --blue-900: #0d0f14;
  --blue-800: #14181f;
  --blue-700: #2e3646;
  --blue-500: #5a6e8e;
  --blue-100: #eceff4;
  --orange: #22c55e;
  --orange-600: #1ea74b;
  --white: #ffffff;
  --ink: #0b0d10;
  --muted: #6d727a;
  --win: #19a463;
  --loss: #d64545;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(13,15,20, .18);
  --font-display: 'Anton', Impact, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(160deg, #f7f8fa 0%, #e6eaf1 60%, #d6dce7 100%);
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
a { color: var(--blue-700); }

/* sfondo con pennellate stile locandina */
.bg-stripes {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
}
.bg-stripes::before, .bg-stripes::after {
  content: ''; position: absolute; width: 160%; height: 140px; left: -30%;
  background: linear-gradient(90deg, transparent, rgba(90,110,142,.18), rgba(90,110,142,.05), transparent);
  transform: rotate(-12deg); animation: sweep 14s ease-in-out infinite alternate;
}
.bg-stripes::before { top: 18%; }
.bg-stripes::after { top: 68%; height: 90px; background: linear-gradient(90deg, transparent, rgba(34,197,94,.2), transparent); animation-duration: 18s; }
@keyframes sweep { from { transform: rotate(-12deg) translateX(-8%); } to { transform: rotate(-9deg) translateX(8%); } }

/* ---------- header / nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(90deg, var(--blue-900), var(--blue-700));
  color: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.25);
}
.topbar-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand img { width: 46px; height: 46px; border-radius: 50%; border: 2px solid #fff; transition: transform .6s cubic-bezier(.3,1.6,.5,1); }
.brand:hover img { transform: rotate(360deg) scale(1.08); }
.brand b { font-family: var(--font-display); font-size: 22px; letter-spacing: 1px; line-height: 1; }
.brand small { display: block; white-space: nowrap; font-size: 11px; color: var(--orange); font-weight: 900; letter-spacing: 2px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: #e6eaf1; text-decoration: none; font-weight: 800; padding: 8px 12px; border-radius: 999px;
  display: flex; align-items: center; gap: 6px; transition: background .2s, color .2s, transform .2s;
}
.nav a:hover { background: rgba(255,255,255,.12); transform: translateY(-2px); }
.nav a.active { background: var(--orange); color: #fff; }
.nav .ico { font-size: 18px; }
.user-chip { display: flex; white-space: nowrap; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.user-chip button { background: rgba(255,255,255,.15); border: 0; color: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 800; }
.user-chip button:hover { background: var(--orange); }

@media (max-width: 860px) {
  .nav {
    position: fixed; bottom: 0; left: 0; right: 0; margin: 0; justify-content: space-around;
    background: var(--blue-900); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30;
    box-shadow: 0 -4px 18px rgba(0,0,0,.25);
  }
  .nav a { flex-direction: column; gap: 0; font-size: 10px; padding: 6px 6px; border-radius: 12px; }
  .nav a:hover { transform: none; }
  .nav .ico { font-size: 20px; }
  .brand b { font-size: 18px; }
  .user-chip { margin-left: auto; }
  .user-chip .who { display: none; }
  main { padding-bottom: 90px !important; }
}

main { max-width: 1100px; margin: 0 auto; padding: 22px 16px 40px; }
.page { animation: pageIn .45s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pageIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

h1.title {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 6vw, 46px); letter-spacing: 1px;
  margin: 4px 0 18px; color: var(--blue-800); text-transform: uppercase; display: flex; align-items: center; gap: 12px;
}
h1.title .ball { font-size: .8em; display: inline-block; animation: bounce 1.2s ease-in-out infinite; }
h2.section {
  font-family: var(--font-display); font-weight: 400; letter-spacing: 1px; text-transform: uppercase;
  background: var(--blue-800); color: #fff; display: inline-block; padding: 6px 18px; border-radius: 10px;
  transform: skew(-8deg); margin: 26px 0 12px; font-size: 22px;
}
h2.section span { display: inline-block; transform: skew(8deg); }

.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
  position: relative; overflow: hidden;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.stagger > * { opacity: 0; animation: rise .5s cubic-bezier(.2,.9,.3,1.2) forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.btn {
  border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 900; cursor: pointer;
  background: var(--orange); color: #fff; box-shadow: 0 6px 0 var(--orange-600);
  transition: transform .1s, box-shadow .1s, filter .2s; text-transform: uppercase; letter-spacing: .5px;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--orange-600); }
.btn.blue { background: var(--blue-700); box-shadow: 0 6px 0 var(--blue-900); }
.btn.ghost { background: var(--blue-100); color: var(--blue-800); box-shadow: 0 6px 0 #cdd2dc; }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.field { display: block; margin-bottom: 12px; }
.field label { display: block; font-weight: 800; font-size: 13px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.field input, .field select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 2px solid #dadde4; background: #f8faff;
  font-weight: 700; color: var(--ink); transition: border .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(90,110,142,.15); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; }
.login-card {
  width: 100%; max-width: 860px; display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0;
  animation: pop .7s cubic-bezier(.2,1.4,.4,1);
}
@keyframes pop { from { opacity: 0; transform: scale(.85) rotate(-2deg); } to { opacity: 1; transform: none; } }
.login-hero {
  background: radial-gradient(circle at 30% 20%, var(--blue-500), var(--blue-900) 75%);
  color: #fff; padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  position: relative; overflow: hidden;
}
.login-hero img { width: 150px; height: 150px; border-radius: 50%; box-shadow: 0 0 0 6px rgba(255,255,255,.25), 0 20px 40px rgba(0,0,0,.4); animation: logoIn 1s cubic-bezier(.2,1.4,.4,1); }
@keyframes logoIn { from { transform: rotate(-540deg) scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
.login-hero h1 { font-family: var(--font-display); font-weight: 400; font-size: 40px; margin: 16px 0 0; letter-spacing: 2px; }
.login-hero p { margin: 4px 0 0; color: var(--orange); font-weight: 900; letter-spacing: 3px; }
.jersey-preview { margin-top: 18px; position: relative; width: 170px; }
.jersey-preview svg { width: 100%; filter: drop-shadow(0 12px 18px rgba(0,0,0,.35)); }
.login-form { padding: 30px; }
.login-form h2 { font-family: var(--font-display); font-weight: 400; color: var(--blue-800); font-size: 30px; margin: 0 0 6px; letter-spacing: 1px; }
.login-form .hint { color: var(--muted); margin: 0 0 18px; }
.login-form .btn { width: 100%; margin-top: 6px; }
.link-btn { background: none; border: 0; color: var(--blue-700); font-weight: 800; cursor: pointer; margin-top: 16px; text-decoration: underline; padding: 0; }
.error { color: var(--loss); font-weight: 800; min-height: 1.4em; margin: 6px 0; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@media (max-width: 720px) {
  .login-card { grid-template-columns: 1fr; }
  .login-hero { padding: 24px; }
  .login-hero img { width: 110px; height: 110px; }
  .jersey-preview { width: 120px; }
}

/* ---------- home ---------- */
.hero-welcome {
  background: linear-gradient(120deg, var(--blue-800), var(--blue-500)); color: #fff;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.hero-welcome h1 { font-family: var(--font-display); font-weight: 400; margin: 0; font-size: clamp(28px, 5vw, 42px); letter-spacing: 1px; }
.hero-welcome p { margin: 4px 0 0; font-weight: 700; opacity: .9; }
.big-num {
  font-family: var(--font-display); font-size: 64px; line-height: 1; color: var(--orange);
  text-shadow: 3px 3px 0 var(--blue-900); animation: wiggle 3s ease-in-out infinite;
}
@keyframes wiggle { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.hero-welcome .ball-deco { position: absolute; right: -30px; bottom: -40px; font-size: 140px; opacity: .15; animation: spin 12s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.next-match .vs { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; }
.team-badge { flex: 1; text-align: center; font-weight: 900; font-size: 17px; }
.team-badge .circle {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center;
  background: var(--blue-100); color: var(--blue-800); font-family: var(--font-display); font-size: 24px; overflow: hidden;
}
.team-badge .circle img { width: 100%; height: 100%; object-fit: cover; }
.vs-txt { font-family: var(--font-display); font-size: 30px; color: var(--orange); }
.countdown { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.countdown div { background: var(--blue-800); color: #fff; border-radius: 12px; padding: 8px 10px; min-width: 62px; text-align: center; }
.countdown b { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 400; }
.countdown small { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; opacity: .8; }
.meta { color: var(--muted); font-weight: 700; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.pill.home { background: var(--blue-100); color: var(--blue-800); }
.pill.away { background: #ddfae9; color: var(--orange-600); }
.pill.win { background: #dcf6e8; color: var(--win); }
.pill.loss { background: #fde3e3; color: var(--loss); }
.pill.star { background: var(--orange); color: #fff; }
.pill.ok { background: var(--blue-700); color: #fff; }
.pill.no { background: #eeeff1; color: var(--muted); }

.status-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; font-weight: 900; margin-top: 12px; }
.status-banner .emoji { font-size: 34px; animation: bounce 1.4s ease-in-out infinite; }
.status-banner.yes { background: linear-gradient(90deg, var(--orange), #51e789); color: #fff; }
.status-banner.wait { background: var(--blue-100); color: var(--blue-800); }
.status-banner.not { background: #eeeff1; color: var(--muted); }

/* ---------- tiles stats ---------- */
.tile { text-align: center; padding: 16px 10px; }
.tile .val { font-family: var(--font-display); font-size: 40px; color: var(--blue-800); line-height: 1.1; }
.tile .lbl { font-weight: 900; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.tile::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--blue-500), var(--orange)); }
.tile.hot .val { color: var(--orange); }
.ring { width: 96px; height: 96px; margin: 0 auto 4px; }
.ring circle { fill: none; stroke-width: 10; }
.ring .bg { stroke: var(--blue-100); }
.ring .fg { stroke: var(--orange); stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.2,.9,.3,1); transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring text { font-family: var(--font-display); font-size: 22px; fill: var(--blue-800); }

.chart { width: 100%; height: 220px; }
.chart .bar { fill: var(--blue-500); transform-origin: bottom; transform-box: fill-box; animation: grow .8s cubic-bezier(.2,.9,.3,1.2) backwards; }
.chart .bar.best { fill: var(--orange); }
.chart text { font-size: 11px; fill: var(--muted); font-weight: 800; font-family: var(--font-body); }
.chart .v { fill: var(--blue-800); font-size: 12px; }
@keyframes grow { from { transform: scaleY(0); } }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.stats { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
table.stats th { background: var(--blue-800); color: #fff; padding: 8px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; text-align: center; }
table.stats th:first-child { border-radius: 10px 0 0 0; text-align: left; }
table.stats th:last-child { border-radius: 0 10px 0 0; }
table.stats td { padding: 8px 10px; border-bottom: 1px solid #eceef2; text-align: center; font-weight: 700; }
table.stats td:first-child { text-align: left; }
table.stats tr:hover td { background: #f6f7fa; }
table.stats tr.me td { background: #e5fbed; }
table.stats tfoot td { font-weight: 900; background: var(--blue-100); }
table.stats input { width: 54px; padding: 4px; border-radius: 8px; border: 1px solid #d3d8df; text-align: center; font-weight: 700; }
table.stats tr.bad td { background: #fde3e3; }

/* ---------- calendario ---------- */
.match-row {
  display: grid; grid-template-columns: 86px 1fr auto; gap: 14px; align-items: center; padding: 0; margin-bottom: 12px;
  transition: transform .25s, box-shadow .25s; cursor: default;
}
.match-row:hover { transform: translateX(6px) rotate(-.3deg); box-shadow: 0 14px 34px rgba(13,15,20,.25); }
.match-row.past { opacity: .85; }
.match-row.next { outline: 3px solid var(--orange); }
.date-badge { background: var(--blue-800); color: #fff; text-align: center; padding: 14px 6px; height: 100%; display: flex; flex-direction: column; justify-content: center; }
.date-badge b { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1; }
.date-badge span { font-weight: 900; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.date-badge small { font-size: 11px; opacity: .8; text-transform: uppercase; }
.match-info { padding: 12px 0; min-width: 0; }
.match-info .teams { font-weight: 900; font-size: 17px; color: var(--blue-900); }
.match-info .teams .us { color: var(--blue-700); }
.match-info .meta { font-size: 13px; margin-top: 4px; flex-direction: row; flex-wrap: wrap; gap: 10px; }
.match-info .meta a { color: var(--muted); }
.match-right { padding: 12px 16px 12px 0; text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.score { font-family: var(--font-display); font-size: 28px; color: var(--blue-800); letter-spacing: 1px; }
@media (max-width: 600px) {
  .match-row { grid-template-columns: 72px 1fr; }
  .match-right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; padding: 0 14px 12px; border-top: 1px dashed #e1e4ea; padding-top: 10px; }
  .date-badge { grid-row: span 1; }
}

.record { display: flex; gap: 14px; flex-wrap: wrap; }
.record .card { flex: 1; min-width: 120px; text-align: center; }
.record b { font-family: var(--font-display); font-size: 44px; font-weight: 400; display: block; }
.record .w b { color: var(--win); }
.record .l b { color: var(--loss); }

/* ---------- squadra ---------- */
.leader { display: flex; align-items: center; gap: 14px; }
.leader .rank { font-family: var(--font-display); font-size: 48px; color: var(--orange); width: 50px; text-align: center; }
.leader h3 { margin: 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.leader p { margin: 2px 0 0; font-weight: 900; font-size: 18px; color: var(--blue-900); }
.leader .v { margin-left: auto; font-family: var(--font-display); font-size: 34px; color: var(--blue-700); }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.roster-item { text-align: center; padding: 12px 8px; transition: transform .3s; }
.roster-item:hover { transform: translateY(-6px) rotate(-2deg); }
.roster-item svg { width: 80px; }
.roster-item b { display: block; font-size: 14px; margin-top: 4px; }
.roster-item small { color: var(--muted); font-weight: 800; }

/* ---------- jersey ---------- */
.jersey .body { fill: var(--blue-700); }
.jersey .trim { fill: none; stroke: var(--orange); stroke-width: 5; }
.jersey .num { font-family: var(--font-display); fill: #fff; text-anchor: middle; }
.jersey .nm { font-family: var(--font-body); font-weight: 900; fill: #fff; text-anchor: middle; letter-spacing: 1px; }
.jersey.alt .body { fill: #fff; }
.jersey.alt .num, .jersey.alt .nm { fill: var(--blue-800); }

/* ---------- coach minigame ---------- */
.steps { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.steps button { flex: 1; min-width: 150px; }
.hud { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.hud .counter { font-family: var(--font-display); font-size: 34px; color: var(--blue-800); }
.hud .counter em { color: var(--orange); font-style: normal; }
.progress { flex: 1; min-width: 160px; height: 14px; background: var(--blue-100); border-radius: 999px; overflow: hidden; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--blue-500), var(--orange)); border-radius: 999px; transition: width .4s cubic-bezier(.2,1.4,.4,1); }

.conveyor {
  position: relative; overflow: hidden; padding: 26px 0; border-radius: var(--radius);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 40px, transparent 40px 80px),
    linear-gradient(180deg, #44a363, #398752);
  box-shadow: inset 0 8px 0 rgba(0,0,0,.12), inset 0 -8px 0 rgba(0,0,0,.12), var(--shadow);
  touch-action: pan-y; cursor: grab;
}
.conveyor:active { cursor: grabbing; }
.conveyor::before, .conveyor::after { content: ''; position: absolute; top: 0; bottom: 0; width: 60px; z-index: 2; pointer-events: none; }
.conveyor::before { left: 0; background: linear-gradient(90deg, #398752, transparent); }
.conveyor::after { right: 0; background: linear-gradient(-90deg, #398752, transparent); }
.track { display: flex; gap: 16px; width: max-content; will-change: transform; }
.pcard {
  width: 130px; flex: 0 0 auto; background: #fff; border-radius: 16px; padding: 10px 8px 12px; text-align: center;
  box-shadow: 0 8px 0 rgba(0,0,0,.15); cursor: pointer; user-select: none; transition: transform .2s, opacity .3s, filter .3s;
  border: 3px solid transparent;
}
.pcard:hover { transform: translateY(-8px) rotate(-3deg); border-color: var(--orange); }
.pcard svg { width: 84px; pointer-events: none; }
.pcard b { display: block; font-size: 13px; pointer-events: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard.taken { filter: grayscale(1); opacity: .45; transform: scale(.9); }
.pcard.taken::after { content: '✔ convocato'; display: block; font-size: 11px; font-weight: 900; color: var(--win); }
.speed { display: flex; gap: 6px; }

.bench { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 18px auto 0; max-width: 640px; }
@media (max-width: 600px) { .bench { grid-template-columns: repeat(4, 1fr); } }
.slot {
  aspect-ratio: 1; border-radius: 14px; border: 3px dashed #c1c6d1; display: grid; place-items: center;
  background: rgba(255,255,255,.6); position: relative; transition: transform .2s;
}
.slot.filled { border: 3px solid var(--blue-700); background: #fff; cursor: pointer; animation: land .4s cubic-bezier(.2,1.6,.4,1); }
.slot.filled:hover { transform: scale(1.05); }
.slot.filled:hover::after { content: '✕'; position: absolute; top: -8px; right: -8px; background: var(--loss); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; }
.slot svg { width: 70%; }
.slot .slot-n { font-family: var(--font-display); color: #c1c6d1; font-size: 22px; }
.slot .slot-name { position: absolute; bottom: 2px; left: 0; right: 0; font-size: 10px; font-weight: 900; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 3px; }
@keyframes land { from { transform: scale(1.4); } to { transform: scale(1); } }
.flyer { position: fixed; z-index: 100; pointer-events: none; transition: all .6s cubic-bezier(.5,-0.3,.4,1.3); }

.court-wrap { position: relative; max-width: min(480px, 62vh); margin: 0 auto; }
.court { width: 100%; display: block; border-radius: var(--radius); box-shadow: var(--shadow); }
.spot {
  position: absolute; width: 86px; transform: translate(-50%, -50%); text-align: center; cursor: pointer;
  transition: transform .25s;
}
.spot:hover { transform: translate(-50%, -50%) scale(1.08); }
.spot .disc {
  width: 66px; height: 66px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.85); border: 3px dashed var(--blue-700); font-family: var(--font-display); color: var(--blue-700); font-size: 18px;
  animation: pulse 1.6s ease-in-out infinite;
}
.spot.filled .disc { background: var(--blue-700); color: #fff; border: 3px solid var(--orange); font-size: 30px; animation: land .4s cubic-bezier(.2,1.6,.4,1); }
.spot.drop .disc { background: var(--orange); color: #fff; transform: scale(1.15); }
.spot .lbl { display: inline-block; margin-top: 4px; background: var(--blue-900); color: #fff; font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 999px; white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.6); } 50% { box-shadow: 0 0 0 12px rgba(34,197,94,0); } }
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 14px 10px; scroll-snap-type: x mandatory; position: sticky; bottom: 0; z-index: 10; margin-top: 12px;
  background: rgba(13,15,20,.92); border-radius: 18px 18px 0 0; backdrop-filter: blur(6px); }
@media (max-width: 860px) { .chips { bottom: 66px; } }
.chip {
  flex: 0 0 auto; scroll-snap-align: start; display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px;
  background: #fff; box-shadow: 0 4px 0 #cdd2dc; cursor: grab; font-weight: 900; user-select: none; touch-action: pan-x; border: 3px solid transparent;
  transition: transform .2s, opacity .2s;
}
.chip .n { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-700); color: #fff; display: grid; place-items: center; font-family: var(--font-display); }
.chip.sel { border-color: var(--orange); transform: translateY(-4px); }
.chip.used { opacity: .35; }
.drag-ghost { position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, -50%) rotate(-6deg) scale(1.1); }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); font-weight: 800; }
.empty .big { font-size: 60px; display: block; animation: bounce 1.4s infinite; }

/* ---------- toast & confetti ---------- */
#toast {
  position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 40px); opacity: 0; z-index: 200;
  background: var(--blue-900); color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 900;
  transition: all .35s cubic-bezier(.2,1.4,.4,1); pointer-events: none; box-shadow: var(--shadow); max-width: 90vw; text-align: center;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#toast.err { background: var(--loss); }
.confetti { position: fixed; top: -20px; width: 10px; height: 16px; z-index: 150; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

.loader { display: grid; place-items: center; min-height: 60vh; font-size: 60px; }
.loader span { animation: bounce .6s ease-in infinite alternate; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1; min-width: 140px; }
.muted { color: var(--muted); }
.mt { margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.flyer svg { width: 100%; }
.flyer.chip-fly { width: auto !important; }

.export-bar { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- capitano ---------- */
.pill.cap { background: var(--orange); color: #fff; }
.cap-banner { background: linear-gradient(90deg, var(--blue-700), var(--orange)) !important; }
.roster-item.is-cap, .slot.is-cap { position: relative; }
.roster-item.is-cap::before, .slot.is-cap::before, .spot.is-cap .disc::after {
  content: 'C'; position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--orange); color: #fff; border: 2px solid #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 15px; box-shadow: 0 2px 6px rgba(0,0,0,.25); z-index: 2;
}
.spot .disc { position: relative; }
.spot.is-cap .disc::after { top: -8px; right: -8px; }
.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.cap-card { position: relative; border: 3px solid transparent; cursor: pointer; text-align: center; padding: 12px 8px; font: inherit; transition: transform .25s, border-color .25s; }
.cap-card:hover { transform: translateY(-6px) rotate(-2deg); }
.cap-card svg { width: 80px; }
.cap-card b { display: block; font-size: 14px; margin-top: 4px; color: var(--ink); }
.cap-card small { color: var(--muted); font-weight: 800; }
.cap-card .band {
  position: absolute; top: 6px; right: 6px; transform: scale(0); width: 34px; height: 34px; border-radius: 50%;
  background: var(--orange); color: #fff; border: 3px solid #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 20px; box-shadow: 0 4px 10px rgba(0,0,0,.3); transition: transform .4s cubic-bezier(.2,1.6,.4,1);
}
.cap-card.on { border-color: var(--orange); transform: translateY(-6px); }
.cap-card.on .band { transform: scale(1) rotate(-12deg); }
.cbadge { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; background: var(--orange); color: #fff; border: 3px solid #fff; display: grid; place-items: center; font-family: var(--font-display); font-size: 22px !important; }

/* ---------- bacheca ---------- */
.nav .ico { position: relative; }
.nav-badge { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  background: var(--loss); color: #fff; font: 900 11px/18px var(--font-body); font-style: normal; text-align: center; display: none; }
.nav-badge.on { display: block; animation: land .5s cubic-bezier(.2,1.6,.4,1); }
.board-banner { background: linear-gradient(90deg, var(--blue-800), var(--blue-500)); color: #fff; text-decoration: none; }
.notif-card { padding: 14px 18px; }
.notif-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.notif-row > div:not(.notif-actions) { flex: 1; min-width: 200px; }
.notif-ico { font-size: 34px; }
.notif-ico.on { animation: wiggle 1.2s ease-in-out infinite; }
.notif-actions { display: flex; gap: 8px; }
.ios-steps { margin: 6px 0 0; padding-left: 20px; font-weight: 700; color: var(--muted); }
.ios-steps li { margin: 2px 0; }
.kbd { font-size: 14px; }
.composer textarea { margin-top: 6px; resize: vertical; min-height: 84px; }
.composer-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.composer-bar #cnt { margin-left: auto; font-weight: 800; font-size: 13px; }
.wa-check { display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--blue-800); cursor: pointer; }
.wa-check input { width: 18px; height: 18px; accent-color: #25d366; }
.msgs { display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 14px; align-items: flex-start; opacity: 0; animation: rise .5s cubic-bezier(.2,.9,.3,1.2) forwards; border-left: 6px solid var(--blue-500); }
.msg.coach { border-left-color: var(--orange); }
.av { flex: 0 0 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: var(--blue-100); position: relative; }
.av.coach { background: #ddfae9; }
.av.cap { background: var(--blue-700); color: #fff; font-family: var(--font-display); font-size: 22px; }
.av.cap i { position: absolute; right: -4px; top: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--orange); border: 2px solid #fff;
  font: 400 13px/18px var(--font-display); font-style: normal; text-align: center; }
.msg-body { flex: 1; min-width: 0; }
.msg-body header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-body header b { color: var(--blue-900); }
.msg-body time { color: var(--muted); font-size: 13px; font-weight: 700; margin-left: auto; }
.tag { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px; border-radius: 999px; background: var(--blue-100); color: var(--blue-800); }
.tag.coach { background: var(--orange); color: #fff; }
.tag.captain { background: var(--blue-700); color: #fff; }
.msg-body p { margin: 8px 0 10px; font-size: 16px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.msg-body footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seen { color: var(--muted); font-weight: 800; font-size: 13px; }
.btn.wa { background: #25d366; color: #fff; box-shadow: 0 6px 0 #1aa34f; text-decoration: none; }

/* ---------- calendario admin ---------- */
.pill.friendly { background: #eeeff1; color: var(--blue-800); }
.cal-actions { display: flex; justify-content: flex-end; margin: 16px 0 0; }
.new-game { margin-top: 12px; border: 3px dashed var(--orange); animation: pop .4s cubic-bezier(.2,1.4,.4,1); }
/* niente zoom: niente doppio tocco, input a 16px (iOS zooma sui campi più piccoli) */
html, body { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
input, select, textarea { font-size: max(16px, 1em); }
