/* ================= SCOUT LIVE v2: telefono in orizzontale, schermo intero ================= */
body.scout-on { overflow: hidden; }
.sa-root { position: fixed; inset: 0; z-index: 100; background: radial-gradient(circle at 50% 0%, #6327b4, #32135d 70%); }
.sa {
  height: 100vh; height: 100dvh; display: grid; color: #fff;
  grid-template-columns: minmax(140px, 22%) 1fr minmax(140px, 21%); grid-template-rows: auto 1fr; gap: 8px;
  padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  font-family: var(--font-body); user-select: none; -webkit-user-select: none;
}
.sa button { font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* --- testata: menu · punteggio · cronometro · punteggio · falli --- */
.sa-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.sa-ico { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 22px; flex: 0 0 auto; }
.sa-sc { text-align: center; min-width: 60px; }
.sa-sc b { font-family: var(--font-display); font-weight: 400; font-size: 40px; line-height: 1; display: block; }
.sa-sc small { font-size: 10px; font-weight: 900; letter-spacing: 1px; color: var(--orange); }
.sa-sc.us { margin-left: auto; }
.sa-clock { display: flex; align-items: center; gap: 8px; background: #000; border: 3px solid var(--orange); border-radius: 14px; padding: 2px 12px; color: #ffda41; font-family: var(--font-display); }
.sa-clock i { font-style: normal; font-size: 18px; }
.sa-clock span { font-size: 32px; letter-spacing: 2px; }
.sa-clock em { font-style: normal; color: #fff; background: var(--orange); border-radius: 6px; padding: 0 6px; font-size: 18px; }
.sa-clock.run { border-color: #7dff9b; color: #7dff9b; }
.sa-clock.end { animation: pulse 1.2s infinite; }
.sa-tf { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; color: #e0d3f2; }
.sa-tf i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; }
.sa-tf i.on { background: var(--orange); border-color: var(--orange); }

/* --- colonna sinistra: i 5 in campo --- */
.sa-court { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.sa-p {
  flex: 1; min-height: 0; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 8px;
  background: #fff; color: var(--ink); border-radius: 14px; border: 3px solid transparent; padding: 2px 10px; text-align: left; transition: transform .12s, background .12s;
}
.sa-p b { grid-row: span 2; font-family: var(--font-display); font-weight: 400; font-size: clamp(22px, 6.5vh, 34px); color: var(--blue-700); min-width: 1.4em; text-align: center; }
.sa-p .nm { font-weight: 900; font-size: clamp(11px, 3.2vh, 15px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-p .info { font-size: 11px; color: var(--muted); font-weight: 800; }
.sa-p .info i { color: var(--loss); font-style: normal; letter-spacing: 1px; }
.sa-p.f4 .info i { color: var(--orange-600); }
.sa-p.out5 { background: #fde3e3; }
.sa-p.sel { border-color: var(--orange); background: #fff8da; transform: translateX(6px); }
.sa-p.want { animation: want 1s ease-in-out infinite; }
.sa-p.hit { animation: land .4s cubic-bezier(.2,1.6,.4,1); }
@keyframes want { 50% { box-shadow: 0 0 0 4px var(--orange); } }
.sa-subbtn { flex: 0 0 auto; padding: 8px; border-radius: 12px; border: 2px solid rgba(255,255,255,.45); background: transparent; color: #fff; font-weight: 900; font-size: 14px; }

/* --- centro: pulsanti azione --- */
.sa-pad { display: flex; flex-direction: column; min-height: 0; }
.sa-prompt { text-align: center; font-weight: 800; font-size: 14px; padding: 2px 0 6px; color: #e0d3f2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa.armed .sa-prompt { color: #ffed9b; }
.sa-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: 1fr 1fr .72fr; gap: 6px; }
.sa-a { border: 0; border-radius: 12px; color: #fff; font-weight: 900; font-size: clamp(13px, 3.8vh, 19px); box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .06s, box-shadow .06s; min-height: 0; padding: 0 2px; }
.sa-a:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.sa-a.make { background: var(--win); }
.sa-a.make.big { background: linear-gradient(135deg, #19a463, #0f7a48); }
.sa-a.miss { background: #7c6c96; }
.sa-a.neutral { background: var(--blue-500); }
.sa-a.good { background: #8b5ebe; }
.sa-a.bad { background: #c2410c; }
.sa-a.foul { background: var(--loss); grid-column: 1 / -1; letter-spacing: 2px; }
.sa-a.on { outline: 4px solid #fff; outline-offset: -4px; transform: scale(.96); }

/* --- colonna destra: avversari, annulla, ultime azioni --- */
.sa-side { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.sa-opp { background: rgba(255,255,255,.1); border-radius: 14px; padding: 6px; text-align: center; }
.sa-opp span { display: block; font-size: 11px; font-weight: 900; color: #e0d3f2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; }
.sa-opp div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.sa-opp button { height: clamp(38px, 11vh, 56px); border: 0; border-radius: 10px; background: #fff; color: var(--blue-800); font-family: var(--font-display); font-size: 22px; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.sa-opp button:active { transform: translateY(2px); }
.sa-undo { padding: 10px; border-radius: 12px; border: 0; background: #fdff33; color: #343200; font-weight: 900; font-size: 16px; box-shadow: 0 3px 0 #a6a614; }
.sa-feed { list-style: none; margin: 0; padding: 0; overflow: hidden; flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.sa-feed li { background: rgba(255,255,255,.08); border-radius: 8px; padding: 4px 6px; line-height: 1.25; }
.sa-feed .ft { font-family: var(--font-display); color: var(--orange); margin-right: 4px; }
.sa-feed .fa.make { color: #7dff9b; font-weight: 900; }
.sa-feed .fa.miss, .sa-feed .fo { color: #c3b7d4; }
.sa-feed .fa.foul, .sa-feed .fa.bad { color: #ff9b9b; }
.sa-feed .fa.good, .sa-feed .fa.neutral { color: #dec7f9; }

/* --- snackbar con "annulla" --- */
.sa-snack {
  position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translate(-50%, 160%); z-index: 4;
  display: flex; align-items: center; gap: 14px; background: #fff; color: var(--ink); padding: 8px 8px 8px 16px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 14px; transition: transform .25s cubic-bezier(.2,1.4,.4,1); max-width: 92vw;
}
.sa-snack.on { transform: translate(-50%, 0); }
.sa-snack span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-snack button { border: 0; border-radius: 999px; background: var(--orange); color: #fff; font-weight: 900; padding: 8px 14px; white-space: nowrap; }

/* --- pannelli (menu, cambi, tabellino, azioni) --- */
.sa-sheet { position: fixed; inset: 0; z-index: 5; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 8px; animation: fadeIn .15s; }
.sa-sheet-box { background: #fff; color: var(--ink); border-radius: 18px; padding: 14px; width: min(560px, 94vw); max-height: 94dvh; overflow: auto; animation: pop .25s cubic-bezier(.2,1.4,.4,1); }
.sa-sheet-box.wide { width: min(900px, 96vw); }
.sa-sheet-box h3 { margin: 0 0 10px; color: var(--blue-800); }
.sa-sheet-box h3 small { color: var(--muted); font-size: 12px; font-weight: 700; }
.sa-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sa-menu button { padding: 12px; border-radius: 12px; border: 2px solid #e5dbf3; background: #faf7fe; font-weight: 800; font-size: 15px; color: var(--ink); text-align: left; }
.sa-menu button.end { background: var(--blue-700); color: #fff; border-color: var(--blue-700); }
.sa-time { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-weight: 800; }
.sa-time input { width: 90px; padding: 10px; border-radius: 10px; border: 2px solid #e5dbf3; font-weight: 900; text-align: center; font-size: 16px; }
.sa-time button { padding: 10px 16px; text-align: center; }
.sa-close { margin-top: 10px; width: 100%; padding: 12px; border-radius: 12px; border: 0; background: var(--blue-100); color: var(--blue-800); font-weight: 900; font-size: 15px; }
.sa-close.primary { background: var(--orange); color: #fff; }
.sa-subs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; }
.sa-subs h4 { margin: 0 0 6px; color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: 1px; }
.sa-sub { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; width: 100%; margin-bottom: 6px; padding: 6px 10px; border: 3px solid transparent; background: #faf7fe; border-radius: 12px; text-align: left; color: var(--ink); }
.sa-sub b { grid-row: span 2; font-family: var(--font-display); font-weight: 400; font-size: 26px; color: var(--blue-700); min-width: 1.4em; text-align: center; }
.sa-sub span { font-weight: 900; }
.sa-sub small { color: var(--muted); font-weight: 700; }
.sa-sub.pick { border-color: var(--orange); background: #fff8da; }
.sa-sub.out5 { background: #fde3e3; }
.sa-arrow { align-self: center; font-size: 30px; color: var(--orange); }

/* --- invito a ruotare il telefono --- */
.sa-rotate { display: none; position: fixed; inset: 0; z-index: 6; background: #32135d; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; }
.sa-rotate h2 { font-family: var(--font-display); font-weight: 400; font-size: 34px; margin: 0; letter-spacing: 1px; }
.sa-rotate p { margin: 0; max-width: 320px; color: #e0d3f2; font-weight: 700; }
.sa-rotate .btn.ghost { background: transparent; color: #fff; box-shadow: none; text-decoration: underline; }
.rot-phone { font-size: 84px; animation: rot 2.4s ease-in-out infinite; }
@keyframes rot { 0%, 20% { transform: rotate(0); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@media (orientation: portrait) and (max-width: 900px) {
  .sa:not(.portrait-ok) .sa-rotate { display: flex; }
}

/* --- schermi bassi (telefono in orizzontale) --- */
@media (max-height: 420px) {
  .sa { gap: 6px; }
  .sa-sc b { font-size: 32px; }
  .sa-clock span { font-size: 26px; }
  .sa-ico { width: 38px; height: 38px; }
  .sa-prompt { font-size: 12px; padding-bottom: 4px; }
}

/* --- ripiego verticale (se l'utente sceglie "continua in verticale") --- */
@media (orientation: portrait) {
  .sa-root:has(.portrait-ok) { overflow-y: auto; overflow-x: hidden; }
  .sa.portrait-ok { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; height: auto; min-height: 100dvh; }
  .sa.portrait-ok > * { min-width: 0; }
  .sa.portrait-ok .sa-pad { min-height: auto; }
  .sa.portrait-ok .sa-prompt { white-space: normal; }
  .sa.portrait-ok .sa-grid { flex: none; }
  .sa.portrait-ok .sa-sc b { font-size: 34px; }
  .sa.portrait-ok .sa-clock span { font-size: 26px; }
  .sa.portrait-ok .sa-top { flex-wrap: wrap; justify-content: center; }
  .sa.portrait-ok .sa-sc.us, .sa.portrait-ok .sa-tf { margin-left: 0; }
  .sa.portrait-ok .sa-court { flex-direction: row; flex-wrap: wrap; }
  .sa.portrait-ok .sa-p { flex: 1 1 18%; grid-template-columns: 1fr; text-align: center; padding: 6px 2px; }
  .sa.portrait-ok .sa-p b { grid-row: auto; font-size: 26px; }
  .sa.portrait-ok .sa-p .info { font-size: 10px; }
  .sa.portrait-ok .sa-subbtn { flex: 1 1 100%; }
  .sa.portrait-ok .sa-grid { grid-template-columns: repeat(3, 1fr); grid-template-rows: none; grid-auto-rows: minmax(52px, 1fr); }
  .sa.portrait-ok .sa-side { flex-direction: row; flex-wrap: wrap; }
  .sa.portrait-ok .sa-opp { flex: 1; }
  .sa.portrait-ok .sa-feed { display: none; }
  .sa-subs { grid-template-columns: 1fr; }
  .sa-arrow { display: none; }
}

.sa-menu button.danger { color: var(--loss); border-color: #f5c2c2; background: #fff5f5; }
.sa-warn { color: var(--ink); font-weight: 600; line-height: 1.45; margin: 0 0 6px; }
.sa-confirm { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sa-close.danger { background: var(--loss); color: #fff; }
.scout-cta-btns { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }

/* scout: pannello "da dove ha tirato" */
.zone-sheet { padding: 4px; }
.zone-box { width: min(620px, 96vw); padding: 10px 12px; display: flex; flex-direction: column; }
.zone-box h3 { margin: 0 0 6px; font-size: 17px; }
.zone-court { display: flex; justify-content: center; }
.zone-court .scourt { width: auto; height: min(62dvh, 380px); max-width: 100%; }
.zone-act { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-weight: 800; color: var(--blue-800); }
.zone-act .sa-close { margin: 0; width: auto; padding: 10px 22px; }
@media (orientation: portrait) { .zone-court .scourt { height: auto; width: 100%; } }

/* popup fine quarto */
.qend-box { width: min(420px, 94vw); text-align: center; }
.qend-box h3 { font-size: 22px; }
.qend-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 6px 0 12px; font-weight: 800; color: #5e4f73; }
.qend-score b { font: 400 40px var(--font-title, Anton, sans-serif); color: var(--blue-800, #4b1d8f); }
.qend-score span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qend-note { margin: 0 0 10px; font-weight: 800; color: #f2c200; }
@media (max-height: 460px) { .qend-box { padding: 10px 14px; } .qend-box h3 { font-size: 18px; margin: 0; } .qend-score { margin: 2px 0 6px; } .qend-score b { font-size: 30px; } }

.qend-fouls { margin: 0 0 10px; font-weight: 800; color: #1a9e5c; }
.qend-fouls small { color: #7e7094; font-weight: 700; }
@media (max-height: 460px) { .qend-fouls { margin: 0 0 6px; font-size: 13px; } }

/* scout condiviso: aiutanti e compiti */
.join-score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; font-weight: 800; color: #5e4f73; margin-bottom: 10px; }
.join-score b { font: 400 38px var(--font-title, Anton, sans-serif); color: var(--blue-800, #4b1d8f); }
.join-who { font-weight: 800; color: var(--blue-800, #4b1d8f); margin: 0 0 4px; }
.join-h { margin: 6px 0 8px; color: var(--blue-800, #4b1d8f); } .join-h small { color: #7e7094; font-weight: 700; }
.join-take { margin-top: 14px; } .join-take p { margin: 4px 0 10px; font-weight: 700; }
.focus-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.focus-pick button { border: 2px solid #e8e1f4; background: #fff; border-radius: 14px; padding: 10px; text-align: left; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 2px; color: var(--blue-800, #4b1d8f); }
.focus-pick button b { font-size: 15px; } .focus-pick button small { color: #7e7094; font-weight: 700; }
.focus-pick button.on { border-color: var(--orange, #f2c200); background: #fffbe7; box-shadow: 0 4px 12px rgba(242,194,0,.25); }
.help-pill { background: #1a9e5c !important; }
.help-n { font-weight: 900; font-size: 13px; color: #fff; background: rgba(255,255,255,.14); border-radius: 999px; padding: 2px 8px; }
.sa-subbtn.info { display: flex; align-items: center; justify-content: center; font-size: 13px; opacity: .85; text-align: center; }
.sa-helpers { margin: 0 0 10px; font-weight: 700; font-size: 14px; color: #5e4f73; } .sa-helpers small { color: #7e7094; }
.fby { margin-left: 6px; font-size: 11px; font-weight: 800; color: #7e7094; background: rgba(145,126,174,.15); border-radius: 999px; padding: 1px 7px; }
.sa-opp.focus-chip { border: 0; cursor: pointer; font: 800 14px var(--font-body); color: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sa-opp.focus-chip small { opacity: .7; font-weight: 700; font-size: 11px; }
.sa-grid.fx { grid-template-columns: repeat(3, 1fr); grid-template-rows: none; grid-auto-rows: 1fr; }
.sa-grid.fx-shots { grid-template-columns: repeat(2, 1fr); }
.sa-grid.fx-fouls { grid-template-columns: 1fr; }
.sa-grid.fx .sa-a { font-size: clamp(16px, 2.6vw, 24px); }

/* checklist delle statistiche */
.claim-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.claim { display: flex; align-items: center; gap: 8px; border: 2px solid #e8e1f4; border-radius: 12px; padding: 8px 10px; font-weight: 800; color: var(--blue-800, #4b1d8f); background: #fff; cursor: pointer; min-height: 42px; flex-wrap: wrap; }
.claim input { width: 20px; height: 20px; accent-color: #f2c200; margin: 0; }
.claim.on { border-color: #f2c200; background: #fffbe7; }
.claim.taken { opacity: .6; cursor: not-allowed; background: #f6f4f8; }
.claim small { width: 100%; font-size: 11.5px; color: #7e7094; margin-left: 28px; margin-top: -4px; }
.claim-note { margin: 8px 0 0; font-size: 13px; font-weight: 700; color: #7e7094; }
.join-admin { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: #fffbe7; color: #796100; font-weight: 700; }
.sa-helpers.pend { color: #796100; background: #fffbe7; border-radius: 10px; padding: 6px 10px; }
.sa-grid.fx-2 { grid-template-columns: repeat(2, 1fr); } .sa-grid.fx-1 { grid-template-columns: 1fr; }
.sa-none { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff; font-weight: 800; text-align: center; padding: 10px; }
.sa-none button { border: 0; border-radius: 12px; padding: 10px 16px; font: 900 15px var(--font-body); background: #f2c200; color: #fff; cursor: pointer; }
button.sa-subbtn.info { border: 0; cursor: pointer; font: 800 12.5px var(--font-body); }
.claim-free { margin: 8px 0 0; font-size: 13px; font-weight: 800; color: #796100; background: #fffbe7; border-radius: 10px; padding: 6px 10px; }
.sa-vid input { flex: 1; min-width: 0; width: auto; text-align: left; }
.sa-mic.on { background: #e53935; color: #fff; animation: micPulse 1.2s ease-in-out infinite; }
@keyframes micPulse { 50% { box-shadow: 0 0 0 6px rgba(229,57,53,.35); } }
