/* Torneo Galilei — Made By Antonio Sacco 5As */
:root {
  --navy: #0b1f4b;
  --navy-2: #13306e;
  --gold: #f5b301;
  --gold-2: #ffd257;
  --bg: #f2f4f8;
  --card: #ffffff;
  --card-2: #f7f8fb;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e7ef;
  --green: #16a34a;
  --red: #dc2626;
  --live: #ef4444;
  --pitch: #1f8a4c;
  --pitch-2: #23985a;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --radius: 16px;
  --head: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070d1c;
    --card: #101a33;
    --card-2: #0c1530;
    --text: #e8edf7;
    --muted: #93a0bb;
    --line: #1f2c4d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--body);
  min-height: 100vh; display: flex; flex-direction: column;
  padding-bottom: calc(68px + var(--safe-b));
}
a { color: inherit; text-decoration: none; }
img { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head); letter-spacing: .3px; margin: 0; line-height: 1.1; }
h1 { font-size: 30px; }
h2 { font-size: 23px; }
h3 { font-size: 18px; }

/* ---------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand-logo { width: 46px; height: 46px; flex: none; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-family: var(--head); font-size: 22px; letter-spacing: .5px; text-transform: uppercase; line-height: 1; }
.brand-text small { font-size: 11.5px; opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: none; gap: 4px; }
.topnav a { padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; opacity: .85; }
.topnav a:hover { background: rgba(255, 255, 255, .1); opacity: 1; }
.topnav a.active { background: rgba(255, 255, 255, .16); opacity: 1; color: var(--gold-2); }
.staff-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); flex: none; }
.staff-btn.on { background: var(--gold); color: var(--navy); }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
  box-shadow: 0 -4px 18px rgba(15, 23, 42, .08);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.bottomnav a .ico { font-size: 19px; line-height: 1.1; filter: grayscale(.5); }
.bottomnav a.active { color: var(--navy-2); }
.bottomnav a.active .ico { filter: none; }
@media (prefers-color-scheme: dark) { .bottomnav a.active { color: var(--gold-2); } }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .topnav { display: flex; }
  .bottomnav { display: none; }
}

.offline { background: #b45309; color: #fff; text-align: center; font-size: 13px; padding: 6px 12px; }

.app { width: 100%; max-width: 1180px; margin: 0 auto; padding: 18px 16px 30px; flex: 1; }
.loading { padding: 80px 0; text-align: center; color: var(--muted); font-weight: 600; }
.ball { display: inline-block; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 22px 16px 26px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.madeby { font-size: 13.5px; }
.madeby strong { color: var(--text); }

/* ---------- generic */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.section { margin-top: 26px; }
.section > .sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.sec-head a { color: var(--navy-2); font-weight: 600; font-size: 14px; }
@media (prefers-color-scheme: dark) { .sec-head a { color: var(--gold-2); } }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.pad { padding: 16px; }
.grid { display: grid; gap: 12px; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-2.wide-left { grid-template-columns: 1.4fr 1fr; } }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); padding: 7px 13px; border-radius: 999px; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
@media (prefers-color-scheme: dark) { .chip.active { background: var(--gold); color: var(--navy); border-color: var(--gold); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; cursor: pointer;
  padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14.5px; background: var(--navy); color: #fff;
  min-height: 42px; transition: transform .08s, filter .15s; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.gold { background: var(--gold); color: var(--navy); }
.btn.ghost { background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--red); }
.btn.green { background: var(--green); }
.btn.sm { padding: 6px 11px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--muted); font-size: 16px; }
.icon-btn:hover { background: var(--card-2); color: var(--text); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); text-transform: uppercase; letter-spacing: .3px; }
.badge.live { background: var(--live); color: #fff; border-color: var(--live); }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.2s infinite; }
.badge.fin { background: var(--card-2); }
.badge.gold { background: var(--gold); color: var(--navy); border-color: var(--gold); }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- logos & photos */
.logo { width: 36px; height: 36px; border-radius: 10px; flex: none; object-fit: contain; background: var(--card-2); }
.logo.ph { display: grid; place-items: center; color: #fff; font-family: var(--head); font-weight: 800; font-size: 15px; letter-spacing: .5px; }
.logo.lg { width: 76px; height: 76px; border-radius: 20px; font-size: 28px; }
.logo.md { width: 52px; height: 52px; border-radius: 14px; font-size: 20px; }
.logo.sm { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; background: var(--card-2); }
.avatar.ph { display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 15px; }
.avatar.lg { width: 96px; height: 96px; font-size: 32px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }

/* ---------- hero */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; color: #fff; padding: 22px 20px;
  background:
    radial-gradient(circle at 85% 20%, rgba(245, 179, 1, .35), transparent 45%),
    linear-gradient(135deg, var(--navy) 0%, #1a3f8f 100%);
}
.hero::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%;
  border: 18px solid rgba(255, 255, 255, .06);
}
.hero h1 { font-size: 34px; text-transform: uppercase; }
.hero p { margin: 6px 0 0; opacity: .85; }
.hero .kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; position: relative; z-index: 1; }
.kpi { background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 10px 8px; text-align: center; }
.kpi b { display: block; font-family: var(--head); font-size: 26px; line-height: 1; color: var(--gold-2); }
.kpi span { font-size: 11px; opacity: .85; text-transform: uppercase; letter-spacing: .4px; }
.announce { margin-top: 14px; background: rgba(245, 179, 1, .16); border: 1px solid rgba(245, 179, 1, .4); padding: 10px 12px; border-radius: 12px; font-size: 14px; position: relative; z-index: 1; }

/* ---------- match card */
.match { display: block; padding: 12px 14px; position: relative; }
.match + .match { border-top: 1px solid var(--line); }
.match-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.match-top .badge { font-size: 10.5px; }
.match-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.mt { display: flex; align-items: center; gap: 9px; min-width: 0; font-weight: 700; }
.mt.away { flex-direction: row-reverse; text-align: right; }
.mt .tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score { font-family: var(--head); font-size: 28px; font-weight: 800; min-width: 74px; text-align: center; letter-spacing: 1px; }
.score.sched { font-size: 16px; color: var(--muted); font-family: var(--body); font-weight: 700; letter-spacing: 0; }
.score small { display: block; font-size: 11px; font-family: var(--body); color: var(--muted); letter-spacing: 0; font-weight: 600; }
.match.is-live { background: linear-gradient(90deg, rgba(239, 68, 68, .07), transparent 60%); }
.match.is-live .score { color: var(--live); }
.winner { color: var(--green); }
.list-card { overflow: hidden; }
a.match:hover, a.lrow:hover { background: var(--card-2); }

/* ---------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; text-align: center; padding: 10px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { text-align: center; padding: 9px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .tl { text-align: left; }
.tbl .pos { width: 34px; font-weight: 800; font-family: var(--head); font-size: 17px; color: var(--muted); }
.tbl tr.q1 .pos { color: var(--green); }
.tbl .pts { font-weight: 800; font-family: var(--head); font-size: 18px; }
.tbl .team-cell { display: flex; align-items: center; gap: 9px; font-weight: 600; min-width: 150px; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--card-2); }
.form { display: inline-flex; gap: 3px; }
.form i { width: 18px; height: 18px; border-radius: 5px; font-style: normal; font-size: 10px; font-weight: 800; color: #fff; display: grid; place-items: center; }
.form .W { background: var(--green); } .form .D { background: #94a3b8; } .form .L { background: var(--red); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); display: inline-block; animation: pulse 1.2s infinite; flex: none; }

/* ---------- ranking list */
.lrow { display: flex; align-items: center; gap: 11px; padding: 10px 14px; }
.lrow + .lrow { border-top: 1px solid var(--line); }
.lrow .rk { width: 24px; text-align: center; font-family: var(--head); font-weight: 800; font-size: 18px; color: var(--muted); flex: none; }
.lrow .who { flex: 1; min-width: 0; }
.lrow .who b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .who span { font-size: 12.5px; color: var(--muted); }
.lrow .val { font-family: var(--head); font-weight: 800; font-size: 24px; min-width: 34px; text-align: right; }
.lrow.top1 .rk { color: var(--gold); }
.rank-card h3 { display: flex; align-items: center; gap: 8px; padding: 14px 14px 6px; }
.bar { height: 6px; border-radius: 4px; background: var(--card-2); overflow: hidden; margin-top: 5px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #f59e0b); border-radius: 4px; }

/* ---------- team & player pages */
.team-hero { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 20px; color: #fff; position: relative; overflow: hidden; }
.team-hero h1 { font-size: 32px; }
.team-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .45)); }
.team-hero > * { position: relative; z-index: 1; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.stat { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px; text-align: center; }
.stat b { display: block; font-family: var(--head); font-size: 26px; line-height: 1.05; }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; font-weight: 600; }

.pitch {
  position: relative; border-radius: 16px; overflow: hidden; padding: 18px 8px; display: flex; flex-direction: column; justify-content: space-around; gap: 10px;
  background: repeating-linear-gradient(0deg, var(--pitch) 0 40px, var(--pitch-2) 40px 80px); min-height: 380px;
  border: 3px solid rgba(255, 255, 255, .5); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}
.pitch::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid rgba(255, 255, 255, .45); }
.pitch::after { content: ""; position: absolute; left: 50%; top: 50%; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); }
.pitch .box { position: absolute; left: 50%; width: 46%; height: 13%; transform: translateX(-50%); border: 2px solid rgba(255, 255, 255, .45); }
.pitch .box.top { top: -2px; border-top: 0; } .pitch .box.bot { bottom: -2px; border-bottom: 0; }
.pitch-row { display: flex; justify-content: space-around; position: relative; z-index: 1; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 84px; color: #fff; text-align: center; }
.slot .avatar { width: 50px; height: 50px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.slot .nm { font-size: 11.5px; font-weight: 700; line-height: 1.15; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); background: rgba(0, 0, 0, .28); padding: 2px 6px; border-radius: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.slot .empty-slot { width: 50px; height: 50px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .7); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.slot select { width: 84px; font-size: 11.5px; padding: 3px; border-radius: 6px; border: 0; background: rgba(255, 255, 255, .92); color: #0f172a; }

.player-hero { display: flex; gap: 16px; align-items: center; }
.ptag { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- events timeline */
.timeline { display: grid; }
.ev { display: grid; grid-template-columns: 1fr 52px 1fr; align-items: center; gap: 8px; padding: 8px 12px; font-size: 14px; }
.ev + .ev { border-top: 1px dashed var(--line); }
.ev .min { text-align: center; font-weight: 800; font-family: var(--head); font-size: 16px; color: var(--muted); }
.ev .side { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ev .side.away { justify-content: flex-end; text-align: right; }
.ev .side span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- big scoreboard */
.scoreboard { padding: 20px 14px; border-radius: 22px; color: #fff; background: linear-gradient(135deg, var(--navy), #1a3f8f); text-align: center; }
.sb-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.sb-team { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.sb-team .tn { font-size: 15px; line-height: 1.2; }
.sb-score { font-family: var(--head); font-size: 54px; font-weight: 800; line-height: 1; letter-spacing: 2px; }
.sb-meta { margin-top: 8px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 13px; opacity: .9; }
.clock { font-family: var(--head); font-size: 20px; font-weight: 700; color: var(--gold-2); }

/* ---------- forms */
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: var(--card-2); border-radius: 11px; padding: 10px 12px; min-height: 44px;
  font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); }
textarea.input { min-height: 80px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--navy-2); }
.img-pick { display: flex; align-items: center; gap: 12px; }
.img-pick input[type=file] { display: none; }
.err { color: var(--red); font-size: 13.5px; font-weight: 600; min-height: 1em; }
.search { position: relative; }
.search .input { padding-left: 38px; }
.search::before { content: "🔎"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: .6; }

/* ---------- modal */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(5, 10, 25, .55); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); box-shadow: 0 -10px 40px rgba(0, 0, 0, .3); animation: up .2s; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 8px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
@media (min-width: 640px) { .modal-back { align-items: center; } .modal { border-radius: 22px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: #111827; color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 80; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--red); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* ---------- admin */
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs a { flex: none; padding: 9px 14px; border-radius: 12px; font-weight: 700; font-size: 14px; background: var(--card); border: 1px solid var(--line); }
.admin-tabs a.active { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.login-box { max-width: 420px; margin: 30px auto; }
.adm-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.adm-row + .adm-row { border-top: 1px solid var(--line); }
.adm-row .who { flex: 1; min-width: 0; }
.adm-row .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-row .who span { font-size: 12.5px; color: var(--muted); }
.adm-actions { display: flex; gap: 4px; flex: none; }

/* ---------- referee live panel */
.ref-head { position: sticky; top: 60px; z-index: 20; margin: -4px -16px 12px; padding: 10px 16px; background: var(--bg); }
.ref-sb { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; background: linear-gradient(135deg, var(--navy), #1a3f8f); color: #fff; border-radius: 18px; padding: 12px; }
.ref-sb .sb-team { font-size: 13px; }
.ref-sb .sb-score { font-size: 42px; }
.ref-controls { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ref-controls .btn { flex: 1; min-width: 120px; }
.ref-tools { display: grid; gap: 8px; margin-bottom: 10px; }
.pl-list { display: grid; gap: 8px; }
.pl { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pl-main { display: flex; align-items: center; gap: 11px; padding: 10px 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; }
.pl-main .num { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-family: var(--head); font-weight: 800; font-size: 16px; color: #fff; flex: none; }
.pl-main .who { flex: 1; min-width: 0; }
.pl-main .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-main .who span { font-size: 12.5px; color: var(--muted); }
.pl-mini { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 45%; }
.pl-mini i { font-style: normal; font-size: 12px; font-weight: 700; background: var(--card-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px 6px; white-space: nowrap; }
.pl.open { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245, 179, 1, .35); }
.pl-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 0 12px 12px; }
.st { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.st button { height: 54px; border: 0; font-size: 26px; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.st .minus { background: rgba(220, 38, 38, .12); color: var(--red); }
.st .plus { background: rgba(22, 163, 74, .14); color: var(--green); }
.st button:active { filter: brightness(.85); }
.st .mid { text-align: center; line-height: 1.1; }
.st .mid b { display: block; font-family: var(--head); font-size: 24px; }
.st .mid span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.team-label { font-family: var(--head); font-size: 17px; font-weight: 700; margin: 14px 2px 6px; display: flex; align-items: center; gap: 8px; text-transform: uppercase; }

/* ---------- vote */
.vote-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; padding: 2px; }
.vp { display: flex; align-items: center; gap: 9px; padding: 9px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); cursor: pointer; text-align: left; }
.vp b { display: block; font-size: 13.5px; line-height: 1.2; }
.vp span { font-size: 11.5px; color: var(--muted); }
.vp.sel { border-color: var(--gold); background: rgba(245, 179, 1, .14); box-shadow: 0 0 0 2px rgba(245, 179, 1, .4); }
.mvp-first { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, #f5b301, #ffda6b); color: var(--navy); }
.mvp-first .avatar { border: 3px solid #fff; }

/* ================= ricerca ================= */
.topbar { gap: 8px; }
.search-big .input { font-size: 17px; min-height: 52px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.search-results { margin-top: 6px; }
.res-title { margin: 18px 2px 8px; display: flex; align-items: center; gap: 8px; }
.res-title span { font-family: var(--body); font-size: 12px; font-weight: 700; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--muted); }
.lrow .go { color: var(--muted); font-size: 22px; line-height: 1; flex: none; transition: transform .18s; }
.wrap-chips { flex-wrap: wrap; overflow: visible; }
.home-search {
  display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 14px 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--muted); font-weight: 500;
}

/* ================= home più ordinata ================= */
.section > .sec-head h2 { display: flex; align-items: center; gap: 8px; }
.spot { display: block; padding: 18px 16px; text-align: center; position: relative; overflow: hidden; }
.spot::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 120%, rgba(245, 179, 1, .18), transparent 60%); pointer-events: none; }
.spot-label { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.spot-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 14px 0; }
.spot-team { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 15px; min-width: 0; }
.spot-team b { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.spot-vs { font-family: var(--head); font-size: 26px; font-weight: 800; color: var(--gold); }
.mvp-cta { display: flex; align-items: center; gap: 14px; padding: 18px 16px; border-radius: var(--radius); background: linear-gradient(135deg, #f5b301, #ffd257); color: var(--navy); box-shadow: var(--shadow); }
.mvp-cta .btn { background: var(--navy); color: #fff; }
.mvp-star { font-size: 34px; }
.float-ball { position: absolute; right: 18px; top: 14px; font-size: 44px; opacity: .9; z-index: 1; }
.hero-logo { float: right; width: 190px; height: auto; margin: -12px -6px 0 16px; position: relative; z-index: 1; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .35)); }
@media (max-width: 560px) { .hero-logo { width: 96px; margin: -8px -6px 2px 8px; } .hero h1 { font-size: 28px; } }

/* ================= banner GOL ================= */
.goal-banner {
  position: fixed; left: 50%; top: calc(74px + env(safe-area-inset-top, 0px)); z-index: 70; display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, var(--gold), #ffd257); color: var(--navy); border-radius: 18px; padding: 12px 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35); max-width: calc(100% - 32px); width: max-content; font-weight: 700;
  transform: translate(-50%, -140%); opacity: 0; pointer-events: none; transition: transform .45s cubic-bezier(.2, .9, .3, 1.25), opacity .3s;
}
.goal-banner.show { transform: translate(-50%, 0); opacity: 1; }
.goal-banner .ball { font-size: 34px; display: inline-block; animation: spin 1s linear infinite; }
.goal-banner .big { font-family: var(--head); font-size: 30px; font-weight: 800; letter-spacing: 1px; line-height: 1; }
.goal-banner .gb-score { font-size: 13px; padding-left: 12px; border-left: 2px solid rgba(11, 31, 75, .25); }
.goal-banner .gb-score b { font-family: var(--head); font-size: 22px; }
@media (max-width: 520px) { .goal-banner .gb-score { display: none; } }

/* ================= interazioni ================= */
a.card, .match, .lrow, .chip, .vp, .pl, .admin-tabs a, .home-search, .mvp-cta, .staff-btn { transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease; }
@media (hover: hover) {
  a.card:hover, .home-search:hover, .mvp-cta:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(15, 23, 42, .14); }
  .lrow:hover .go { transform: translateX(3px); }
  .chip:hover { border-color: var(--gold); }
}
a.card:active, .match:active, .lrow:active, .chip:active, .vp:active, .home-search:active, .mvp-cta:active { transform: scale(.98); }
.staff-btn:active { transform: scale(.92); }

/* ================= animazioni ================= */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes flash { 0% { background-color: rgba(245, 179, 1, .55); } 100% { background-color: transparent; } }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(25deg); } }
@keyframes shine { from { background-position: -200% 0; } to { background-position: 200% 0; } }

@media (prefers-reduced-motion: no-preference) {
  .float-ball { animation: float 3.2s ease-in-out infinite; }
  .app.enter .hero-logo { animation: pop .7s .1s both; }
  .app.enter > * { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
  .app.enter > *:nth-child(2) { animation-delay: .06s; }
  .app.enter > *:nth-child(3) { animation-delay: .12s; }
  .app.enter > *:nth-child(4) { animation-delay: .18s; }
  .app.enter > *:nth-child(5) { animation-delay: .24s; }
  .app.enter > *:nth-child(6) { animation-delay: .3s; }
  .app.enter > *:nth-child(n+7) { animation-delay: .36s; }
  .app.enter .grid-2 > *, .app.enter .grid-3 > *, .app.enter .statgrid > * { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
  .app.enter .grid-2 > *:nth-child(2), .app.enter .grid-3 > *:nth-child(2) { animation-delay: .1s; }
  .app.enter .grid-3 > *:nth-child(3) { animation-delay: .16s; }
  .app.enter .grid-3 > *:nth-child(n+4) { animation-delay: .22s; }
  .app.enter .statgrid > *:nth-child(even) { animation-delay: .08s; }
  .app.enter .lrow, .app.enter .match, .app.enter .tbl tbody tr, .app.enter .pl, .app.enter .adm-row { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
  .app.enter .lrow:nth-child(2), .app.enter .match:nth-child(2), .app.enter .tbl tbody tr:nth-child(2), .app.enter .pl:nth-child(2), .app.enter .adm-row:nth-child(2) { animation-delay: .05s; }
  .app.enter .lrow:nth-child(3), .app.enter .match:nth-child(3), .app.enter .tbl tbody tr:nth-child(3), .app.enter .pl:nth-child(3), .app.enter .adm-row:nth-child(3) { animation-delay: .1s; }
  .app.enter .lrow:nth-child(4), .app.enter .match:nth-child(4), .app.enter .tbl tbody tr:nth-child(4), .app.enter .pl:nth-child(4), .app.enter .adm-row:nth-child(4) { animation-delay: .15s; }
  .app.enter .lrow:nth-child(n+5), .app.enter .match:nth-child(n+5), .app.enter .tbl tbody tr:nth-child(n+5), .app.enter .pl:nth-child(n+5), .app.enter .adm-row:nth-child(n+5) { animation-delay: .2s; }
  .app.enter .bar > i { transform-origin: left; animation: grow .9s .25s cubic-bezier(.2, .7, .2, 1) both; }
  .app.enter .slot { animation: rise .5s .2s both; }
  .app.enter .sb-score, .app.enter .mvp-first .avatar { animation: pop .6s .2s both; }
  .flash { animation: flash 1.6s ease-out; }
  .sb-score.flash, .score.flash { animation: pop .6s, flash 1.6s ease-out; border-radius: 10px; }
  .pl.open .pl-stats { animation: rise .25s ease-out both; }
  .vp.sel { animation: pop .35s; }
  .badge.gold { background-image: linear-gradient(110deg, #f5b301 40%, #ffe9a6 50%, #f5b301 60%); background-size: 200% 100%; animation: shine 3s linear infinite; }
  .app.enter .b-col { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
  .app.enter .b-col:nth-child(2) { animation-delay: .08s; }
  .app.enter .b-col:nth-child(3) { animation-delay: .16s; }
  .app.enter .b-col:nth-child(4) { animation-delay: .24s; }
  .app.enter .b-col:nth-child(n+5) { animation-delay: .32s; }
  .champion { animation: pop .7s .4s both; }
  .bm.is-live { animation: livePulse 1.8s ease-in-out infinite; }
}
@keyframes livePulse { 50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, .18); } }

/* ================= tabellone ================= */
:root { --bline: #9fb0cc; }
@media (prefers-color-scheme: dark) { :root { --bline: #3b4c75; } }
.bracket-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 4px 2px 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: thin; }
.bracket-wide { display: none; }
@media (min-width: 900px) { .bracket-wide { display: block; } .bracket-narrow { display: none; } .bracket-wrap { margin: 0; padding-left: 2px; padding-right: 2px; } }
.bracket { display: flex; align-items: stretch; min-width: max-content; min-height: 300px; margin: 0 auto; width: max-content; }
.bracket-wide .bracket { min-height: 460px; }
.b-col { display: flex; flex-direction: column; width: 206px; flex: none; }
.b-col-title { text-align: center; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); height: 26px; line-height: 26px; }
.b-col-body { flex: 1; display: flex; flex-direction: column; }
.pair { flex: 1; display: flex; flex-direction: column; position: relative; }
.bslot { flex: 1; display: flex; flex-direction: column; justify-content: center; position: relative; padding: 7px 18px; }
/* lineette */
.b-col.out .bslot::after { content: ""; position: absolute; top: 50%; right: 0; width: 18px; border-top: 2px solid var(--bline); }
.b-col.out .pair:not(.single)::after { content: ""; position: absolute; right: 0; top: 25%; bottom: 25%; border-right: 2px solid var(--bline); border-radius: 0 6px 6px 0; }
.b-col.in .bslot::before { content: ""; position: absolute; top: 50%; left: 0; width: 18px; border-top: 2px solid var(--bline); }
.b-col.both .bslot::after { content: ""; position: absolute; top: 50%; right: 0; width: 18px; border-top: 2px solid var(--bline); }
.b-col.rtl.out .bslot::after { right: auto; left: 0; }
.b-col.rtl.out .pair:not(.single)::after { right: auto; left: 0; border-right: 0; border-left: 2px solid var(--bline); border-radius: 6px 0 0 6px; }
.b-col.rtl.in .bslot::before { left: auto; right: 0; }
/* riquadro partita */
.bm { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; font-size: 13px; position: relative; z-index: 1; }
a.bm:hover { border-color: var(--gold); transform: translateY(-2px); }
.bm.ghost { visibility: hidden; height: 76px; }
.bm-top { display: flex; justify-content: space-between; gap: 6px; font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 4px 9px; background: var(--card-2); text-transform: uppercase; letter-spacing: .3px; }
.bm-team { display: flex; align-items: center; gap: 7px; padding: 5px 9px; min-height: 34px; }
.bm-team + .bm-team { border-top: 1px solid var(--line); }
.bm-team .logo.sm { width: 22px; height: 22px; font-size: 9px; border-radius: 6px; }
.bm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bm-team b { font-family: var(--head); font-size: 18px; line-height: 1; }
.bm-team b small { font-size: 11px; color: var(--muted); font-family: var(--body); }
.bm-team.tbd .bm-name { color: var(--muted); font-weight: 500; font-style: italic; font-size: 12px; }
.tbd-logo { background: var(--card-2) !important; color: var(--muted); border: 1px dashed var(--line); }
.bm-team.win { background: rgba(22, 163, 74, .1); }
.bm-team.win .bm-name { font-weight: 800; }
.bm-team.lose { opacity: .5; }
.bm.is-live { border-color: var(--live); }
.bm .live-txt { color: var(--live); }
.bm.bye { opacity: .75; border-style: dashed; box-shadow: none; }
.b-col.final .bm, .final-stack > .bm { border: 2px solid var(--gold); box-shadow: 0 6px 22px rgba(245, 179, 1, .25); }
.final-stack { position: relative; }
.final-stack .champion { position: absolute; left: 0; right: 0; bottom: calc(100% + 12px); }
.final-stack .third-box { position: absolute; left: 0; right: 0; top: calc(100% + 14px); }
.third-box .bm { border: 1px solid var(--line) !important; box-shadow: var(--shadow) !important; }
.champion { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: linear-gradient(135deg, #f5b301, #ffd257); color: var(--navy); font-weight: 700; }
.champion b { font-family: var(--head); font-size: 20px; display: block; line-height: 1.1; }
.narrow-extra { display: grid; gap: 12px; max-width: 320px; margin: 8px auto 0; }
.swipe-hint { margin: 6px 0 0; }
/* creazione tabellone */
.bk-head { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 8px; }
.bk-row { display: grid; grid-template-columns: 22px 1fr auto 1fr 96px; gap: 6px; align-items: center; margin-bottom: 8px; }
.bk-row .input { min-height: 40px; padding: 6px 8px; font-size: 14px; }
.bk-n { font-family: var(--head); font-weight: 800; color: var(--muted); text-align: center; }
.bk-vs { font-size: 12px; color: var(--muted); font-weight: 700; }
@media (max-width: 560px) {
  .bk-row { grid-template-columns: 22px 1fr 1fr; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
  .bk-row .bk-vs { display: none; }
  .bk-row .bk-time { grid-column: 2 / 4; }
}

/* ================= foto giocatori ================= */
/* sul campo */
.slot { width: 92px; }
.slot-face { position: relative; display: block; }
.slot .avatar, .slot .empty-slot { width: 60px; height: 60px; }
.slot .avatar { border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .4); }
a.slot:hover .avatar { transform: scale(1.08); }
.slot .avatar { transition: transform .2s; }
.slot-num { position: absolute; right: -4px; bottom: -2px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--gold); color: var(--navy); font: 800 12px/22px var(--head); text-align: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.slot-st { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.slot-st i { font-style: normal; font-size: 10.5px; font-weight: 800; background: rgba(255, 255, 255, .92); color: #0f172a; border-radius: 6px; padding: 1px 4px; }
.pitch { min-height: 440px; }
@media (max-width: 420px) { .slot { width: 76px; } .slot .avatar, .slot .empty-slot { width: 52px; height: 52px; } }

/* figurine della rosa */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.pcard { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
@media (hover: hover) { .pcard:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(15, 23, 42, .18); } .pcard:hover .pc-photo img { transform: scale(1.06); } }
.pcard:active { transform: scale(.98); }
.pc-photo { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--tc); }
.pc-photo::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(transparent, rgba(0, 0, 0, .45)); pointer-events: none; }
.pc-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.pc-ph { display: grid; place-items: center; width: 100%; height: 100%; color: #fff; font-family: var(--head); font-weight: 800; font-size: 44px; }
.pc-num { position: absolute; left: 8px; bottom: 6px; z-index: 1; color: #fff; font: 800 30px/1 var(--head); text-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.pc-role { position: absolute; right: 8px; top: 8px; z-index: 1; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; letter-spacing: .4px; }
.pc-cards { position: absolute; right: 8px; bottom: 8px; z-index: 1; display: flex; gap: 3px; }
.pc-card { width: 16px; height: 21px; border-radius: 3px; font-size: 10px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.pc-card.y { background: #facc15; color: #422006; } .pc-card.r { background: #dc2626; color: #fff; }
.pc-body { padding: 10px 10px 12px; display: flex; flex-direction: column; border-top: 4px solid var(--tc); }
.pc-body > b { font-size: 13px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-body .pc-last { font-family: var(--head); font-size: 19px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.pc-class { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; text-align: center; }
.pc-stats div { background: var(--card-2); border-radius: 8px; padding: 4px 2px; }
.pc-stats b { display: block; font: 800 18px/1.1 var(--head); }
.pc-stats span { font-size: 9.5px; color: var(--muted); font-weight: 700; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .app.enter .pcard { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
  .app.enter .pcard:nth-child(2) { animation-delay: .05s; } .app.enter .pcard:nth-child(3) { animation-delay: .1s; }
  .app.enter .pcard:nth-child(4) { animation-delay: .15s; } .app.enter .pcard:nth-child(n+5) { animation-delay: .2s; }
}
/* pagina giocatore */
.ph-big { width: 132px; height: 132px; border-radius: 22px; object-fit: cover; flex: none; border: 4px solid var(--tc); box-shadow: var(--shadow); font-size: 46px; }
@media (max-width: 480px) { .player-hero { flex-direction: column; text-align: center; } .player-hero .ptag, .player-hero .row { justify-content: center; } .ph-big { width: 180px; height: 180px; } }
/* MVP per partita */
.vote-match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 14px; text-align: center; }
.vm-team { display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--head); font-size: 17px; }
.vm-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vm-score { font-family: var(--head); font-size: 32px; font-weight: 800; }
.mvp-match { display: block; padding: 12px 14px; }
.mm-teams { display: flex; align-items: center; gap: 8px; font-family: var(--head); font-size: 16px; }
.mm-teams b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-teams b:last-of-type { text-align: right; }
.mm-score { font-weight: 800; font-size: 18px; padding: 2px 10px; border-radius: 8px; background: var(--card-2); }
.mm-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.mm-lead { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.code-input { font-family: ui-monospace, Consolas, monospace; font-size: 26px; font-weight: 800; letter-spacing: 4px; text-align: center; text-transform: uppercase; }
.code-chip { font-family: ui-monospace, Consolas, monospace; font-weight: 800; letter-spacing: 1px; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.code-class { border-bottom: 1px solid var(--line); padding: 0 12px; }
.code-class summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; }
.code-class summary::-webkit-details-marker { display: none; }
.code-class summary::before { content: "▸"; transition: transform .2s; }
.code-class[open] summary::before { transform: rotate(90deg); }
.code-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.code-item { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; background: var(--card-2); }
.code-item .muted { flex: 1; }
.code-item.revoked .code-chip { text-decoration: line-through; opacity: .5; }
#print-sheet { display: none; }
@media print {
  body.printing > *:not(#print-sheet) { display: none !important; }
  body.printing { background: #fff !important; }
  body.printing #print-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; color: #000; }
  .ticket { border: 1px dashed #888; padding: 10px 8px; text-align: center; break-inside: avoid; font-family: Arial, sans-serif; }
  .t-logo { width: 46px; height: auto; display: block; margin: 0 auto 2px; }
  .t-head { font-weight: 800; font-size: 12px; }
  .t-sub { font-size: 10px; margin-top: 2px; }
  .t-code { font-family: Consolas, monospace; font-size: 26px; font-weight: 800; letter-spacing: 3px; margin: 8px 0; }
  .t-foot { font-size: 8.5px; line-height: 1.3; word-break: break-all; }
}

/* ---------- chip selezionati, notifiche */
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
@media (prefers-color-scheme: dark) { .chip.on { background: var(--gold); color: var(--navy); border-color: var(--gold); } }
.chip .logo.sm { width: 20px; height: 20px; font-size: 9px; vertical-align: middle; margin-right: 2px; }
.push-teams { flex-wrap: wrap; overflow: visible; }
.push-status .row { flex-wrap: wrap; }
.push-status.on { border: 2px solid var(--green); }
.push-ico { font-size: 34px; line-height: 1; }
.push-type { align-items: flex-start; border-bottom: 1px solid var(--line); padding: 12px 0; }
.push-type:last-child { border-bottom: 0; }
.push-type > span { display: flex; flex-direction: column; gap: 2px; }
.push-type input { margin-top: 2px; flex: none; }
.steps { margin: 8px 0 4px; padding-left: 22px; line-height: 1.7; }
.follow-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.follow-btn { white-space: nowrap; }
.team-hero .follow-btn:not(.ghost) { background: var(--gold); color: var(--navy); }
.team-hero .follow-btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); }

/* ---------- azioni arbitro in attesa di invio */
.outbox { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -12px); z-index: 70; background: #1e3a8a; color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13.5px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 24px); text-align: center; }
.outbox.show { opacity: 1; transform: translate(-50%, 0); transition-delay: .9s; }
.outbox.err { background: #b45309; transition-delay: 0s; }
.outbox .spin { display: inline-block; animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- galleria foto */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.g-item { position: relative; display: block; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--card-2); aspect-ratio: 1; cursor: pointer; }
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.g-item:hover img { transform: scale(1.04); }
.g-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery.admin .g-item { cursor: default; }
.g-del { position: absolute; top: 6px; right: 6px; background: rgba(0, 0, 0, .6) !important; color: #fff; }
.photo-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.photo-strip::-webkit-scrollbar { display: none; }
.photo-strip .g-item { flex: none; width: 128px; }
@media (max-width: 600px) { .gallery { grid-template-columns: repeat(3, 1fr); gap: 4px; } .g-item { border-radius: 8px; } .gallery:not(.admin) .g-cap { display: none; } }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; animation: fade .15s; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; padding: 50px 12px calc(16px + var(--safe-b)); background: none; box-shadow: none; border-radius: 0; overflow: visible; animation: none; width: auto; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 6px; }
.lightbox figcaption { color: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; margin-top: 12px; font-size: 14px; text-align: center; }
.lightbox figcaption a:not(.btn) { color: var(--gold-2); }
.lightbox figcaption .muted { color: #cbd5e1; }
.lightbox figcaption .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .4); }
.lb-close { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; color: #fff; background: rgba(255, 255, 255, .12) !important; z-index: 2; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 46px; height: 64px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 34px; cursor: pointer; }
.lb-nav.prev { left: 8px; }
.lb-nav.next { right: 8px; }
@media (max-width: 600px) { .lb-nav { display: none; } }

/* ---------- riepilogo finale */
.rp-head { display: flex; align-items: center; gap: 16px; border-bottom: 3px solid var(--gold); padding-bottom: 14px; margin-bottom: 18px; }
.rp-head img { width: 80px; height: 80px; flex: none; }
.rp-head h1 { margin: 0; font-size: 30px; }
.rp-head p { margin: 4px 0 0; color: var(--muted); }
.rp-podium { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 10px; align-items: end; margin: 6px 0 20px; }
.rp-pod { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); text-align: center; }
.rp-pod b { font-family: var(--head); font-size: 22px; }
.rp-pod.p1 { order: 2; padding: 22px 8px; background: linear-gradient(160deg, #fff4cc, #ffe27a); border-color: var(--gold); color: #3b2a00; }
.rp-pod.p1 .muted { color: #6b5200; }
.rp-pod.p2 { order: 1; }
.rp-pod.p3 { order: 3; }
.rp-medal { font-size: 34px; line-height: 1; }
.rp-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 20px; }
.rp-kpis div { text-align: center; padding: 10px 4px; border-radius: 12px; background: var(--card-2); }
.rp-kpis b { display: block; font-family: var(--head); font-size: 26px; line-height: 1.1; }
.rp-kpis span { font-size: 12px; color: var(--muted); }
.rp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.rp-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.rp-box h3 { margin: 0 0 6px; }
.rp-box .tbl td { padding: 5px 6px; }
.rp-title { margin: 24px 0 8px; }
.rp-phase { break-inside: avoid; margin-bottom: 12px; }
.rp-phase h3 { margin: 10px 0 4px; color: var(--navy-2); }
@media (prefers-color-scheme: dark) { .rp-phase h3 { color: var(--gold-2); } }
.rp-res td { padding: 6px; vertical-align: top; }
.rp-res td.win { font-weight: 800; }
.rp-res td.pts { white-space: nowrap; text-align: center; width: 70px; }
.rp-foot { margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); text-align: center; }
@media (max-width: 640px) { .rp-kpis { grid-template-columns: repeat(3, 1fr); } .rp-grid { grid-template-columns: 1fr; } .rp-pod b { font-size: 17px; } .rp-head h1 { font-size: 23px; } }
@media print {
  body:not(.printing) .topbar, body:not(.printing) .bottomnav, body:not(.printing) .footer, body:not(.printing) .offline, body:not(.printing) .outbox,
  body:not(.printing) .toast, body:not(.printing) .goal-banner, body:not(.printing) .no-print { display: none !important; }
  body:not(.printing) { background: #fff !important; color: #000 !important; }
  body:not(.printing) .app { padding: 0 !important; max-width: none !important; }
  .rp-sheet { box-shadow: none !important; border: 0 !important; padding: 0 !important; background: #fff !important; color: #000 !important; }
  .rp-sheet .muted, .rp-kpis span, .rp-foot { color: #444 !important; }
  .rp-pod, .rp-kpis div { background: #f4f4f4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-pod.p1 { background: #ffe9a3 !important; }
  .rp-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .rp-kpis { grid-template-columns: repeat(6, 1fr) !important; }
  .rp-box, .rp-podium { break-inside: avoid; }
  @page { margin: 14mm; }
}
