:root{color-scheme:dark;--bg:#090910;--card:#12121c;--card2:#181824;--line:#303044;--text:#f8f8fb;--muted:#a8a8b8;--righello:#ff008a;--righello2:#c80070;--home:#00b8c9;--away:#8c6cff}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{width:100%;height:100%;min-height:100%;overflow:hidden;overscroll-behavior:none;touch-action:manipulation;-webkit-text-size-adjust:100%}body{position:fixed;inset:0;margin:0;background:linear-gradient(#06101c,#0a1829);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text)}button,input,textarea{font:inherit}button{color:white;touch-action:manipulation;user-select:none;-webkit-user-select:none}.hidden{display:none!important}
.app{max-width:720px;margin:auto;width:100%;height:100dvh;min-height:100dvh;overflow:hidden;padding:env(safe-area-inset-top) 14px env(safe-area-inset-bottom)}
.auth{margin-top:9vh;background:var(--card);padding:22px;border-radius:22px;border:1px solid var(--line);max-height:calc(100dvh - 40px);overflow-y:auto}.auth h1{margin:0 0 8px}.auth p{color:var(--muted)}.tabs,.row{display:flex;gap:10px}.tabs{margin:20px 0 12px}.tab,.auth button,.sheet>button{border:1px solid var(--line);background:#14263d;padding:14px;border-radius:13px;font-weight:800}.tab{flex:1}.tab.active,.auth form button{background:#1677ff}.panel{display:none}.panel.active{display:block}.auth input,.sheet input,.sheet textarea{width:100%;margin:8px 0;padding:14px;border:1px solid #34506d;border-radius:12px;background:#071421;color:white}.auth form button{width:100%;border:0}.adminBtn{width:100%;margin-top:12px;background:#0c1c30!important;color:#8bc9ff!important;border-color:#3b5c82!important}.error{margin-top:12px;padding:12px;border-radius:12px;background:#521b25;color:#ff9ca7}
.createRosterHint{display:grid;gap:5px;margin:8px 0 12px;padding:13px 14px;border:1px solid rgba(0,184,201,.5);border-radius:14px;background:linear-gradient(135deg,rgba(0,184,201,.12),rgba(255,0,138,.08));text-align:left}.createRosterHint b{font-size:14px;color:#fff}.createRosterHint span{font-size:13px;line-height:1.32;color:#b9d3e8}
#match{height:100%;display:flex;flex-direction:column;overflow:hidden}header{display:grid;grid-template-columns:46px 1fr auto;align-items:center;border-bottom:1px solid var(--line);padding:12px 2px;flex:0 0 auto}header button{background:transparent;border:0;font-size:25px}.matchHeaderNames{text-align:center;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#status{font-size:13px}.online{color:#63e28a}.offline{color:#ff747f}
.scoreboard{display:grid;grid-template-columns:1fr 1.5fr 1fr;gap:8px;align-items:center;text-align:center;padding:16px 0 10px;flex:0 0 auto}.team{display:flex;flex-direction:column;align-items:center;gap:7px}.crest{display:grid;place-items:center;width:54px;height:64px;border-radius:18px 18px 25px 25px;border:2px solid;font-size:22px;font-weight:900}.crest.home{border-color:var(--home);color:#58a9ff}.crest.away{border-color:var(--away);color:#ff7373}.team strong{font-size:13px;max-width:105px;overflow:hidden;text-overflow:ellipsis}#clock{border:0;background:transparent;font-size:clamp(40px,12vw,64px);font-weight:900;letter-spacing:-2px}.score{display:flex;justify-content:center;align-items:center;gap:14px;font-size:30px}.score button{border:0;border-bottom:3px solid var(--home);background:transparent;font-size:36px;font-weight:900;min-width:44px}.score button:last-child{border-color:var(--away)}#phase{display:inline-block;margin-top:6px;padding:5px 13px;border:1px solid #23538c;border-radius:999px;background:#102b4a;color:#8bc9ff;font-weight:800;font-size:13px}.middle small{display:block;margin-top:7px;color:var(--muted);font-size:10px}
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;flex:0 0 auto}.grid button{min-height:100px;border:1px solid #ffffff25;border-radius:16px;font-size:31px;font-weight:900;display:flex;flex-direction:column;align-items:center;justify-content:center;box-shadow:inset 0 1px #ffffff22}.grid b{font-size:11px;margin-top:8px;max-width:100%;padding:0 4px;overflow:hidden;text-overflow:ellipsis}.green{background:linear-gradient(#287e37,#155a27)}.red{background:linear-gradient(#b92e35,#821921)}.blue{background:linear-gradient(#15518e,#0b3563)}.yellow{background:linear-gradient(#b88600,#7d5c00)}.orange{background:linear-gradient(#c44727,#812515)}.purple{background:linear-gradient(#553298,#321d68)}
.recent{margin-top:10px;border:1px solid var(--line);border-radius:16px;overflow:hidden;flex:1 1 auto;min-height:0;display:flex;flex-direction:column}.recentHead{display:flex;justify-content:space-between;align-items:center;padding:11px}.recent h2{font-size:17px;margin:0}.recentHead button{border:1px solid #75414a;background:transparent;color:#ff919c;border-radius:10px;padding:8px}#events{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}.eventrow{display:grid;grid-template-columns:57px 38px 1fr;gap:8px;align-items:center;padding:10px 12px;border-top:1px solid var(--line)}.eventrow time{color:#b8c4d3}.eventrow .ico{font-size:22px}.eventrow b{display:block}.eventrow small{color:var(--muted)}
footer{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;padding:9px 0 0;flex:0 0 auto}footer button{border:1px solid var(--line);border-radius:12px;background:#15273d;padding:12px 5px;font-size:10px;font-weight:800}footer button:last-child{background:#1269df}
.overlay{position:fixed;inset:0;background:#000b;display:flex;align-items:center;justify-content:center;padding:18px;z-index:20;overscroll-behavior:none}.sheet{position:relative;width:min(620px,100%);background:#0d1b2d;border:1px solid #2d4867;border-radius:22px;padding:24px 18px;max-height:90vh;overflow-y:auto;box-shadow:0 24px 80px #000a}.centerSheet{text-align:center}.sheet h2{margin:0 42px 15px}.sheet>button{width:100%;margin:6px 0}.sheet .x{position:absolute;right:12px;top:9px;width:42px;background:transparent;border:0;font-size:28px}.sheet .row button{flex:1;border:1px solid var(--line);background:#162a42;padding:13px;border-radius:12px}.sheet .danger{color:#ff8e99;border-color:#71313a;background:transparent}.confirmSheet{max-width:430px}.accessSheet{max-width:430px}.accessCode{font-size:42px;font-weight:900;letter-spacing:8px;margin:18px 0;padding:18px;border:1px dashed #4d7eb6;border-radius:16px;background:#071522}.toast{position:fixed;left:50%;bottom:80px;transform:translateX(-50%);background:#142a43;border:1px solid #315171;padding:12px 18px;border-radius:13px;z-index:50;box-shadow:0 10px 30px #0008;white-space:nowrap}
.uploadButton{display:block;padding:18px;border:1px dashed #4c78a8;border-radius:16px;background:#102640;font-weight:800;margin:15px 0}.uploadButton input{display:none}.progressWrap{margin:18px 0}.progressTrack{height:14px;background:#071522;border-radius:999px;overflow:hidden;border:1px solid #284866}.progressBar{height:100%;width:0;background:linear-gradient(90deg,#1677ff,#57b7ff);transition:width .3s ease}.progressWrap div:last-child{margin-top:9px;color:#a9bed5}
.rosterSheet{width:min(680px,100%)}.rosterTeamBlock{padding:13px;border-radius:16px;margin:10px 0}.homeRosterBlock{background:#0c2543;border:1px solid #245b96}.awayRosterBlock{background:#37151c;border:1px solid #8d3543}.rosterRow{display:grid;grid-template-columns:94px 1fr 48px;gap:8px;margin:7px 0;transition:opacity .22s,transform .22s,background .22s}.rosterRow input{margin:0}.rosterNumberCell{display:grid;grid-template-columns:34px 1fr;gap:5px}.starterToggle{min-height:100%;border:1px solid rgba(61,220,132,.42);border-radius:10px;background:rgba(31,151,82,.12);color:#9ff0bf;font-size:13px;font-weight:950}.rosterRow.isStarter .starterToggle{background:#22a65a;color:#fff;border-color:#75f1a7}.removePlayer{border:0;border-radius:10px;background:#8c2632;color:white;font-size:24px;font-weight:900;transition:transform .25s,background .25s,color .25s}.removePlayer.confirmDelete{background:#168844;color:white;transform:rotate(360deg)}.rosterRow.pendingDelete{filter:saturate(.8)}.rosterRow.deleting{opacity:0;transform:translateX(40px)}
.cameraSyncButton{background:linear-gradient(135deg,#172b19,#0f4528)!important;border-color:#2aa861!important;color:#ddffe8!important}.starterLegend{display:flex;justify-content:space-between;align-items:center;margin:8px 0 6px;padding:8px 10px;border-radius:11px;background:rgba(255,255,255,.06);color:#dcecff;font-size:12px;font-weight:850}.starterLegend b{padding:3px 9px;border-radius:999px;background:#263247;color:#c8d6ea}.starterLegend b.starterFull{background:#146b38;color:#d9ffe8}.rosterRow.isStarter{border-radius:12px;outline:2px solid #3ddc84;background:rgba(31,151,82,.22)}.starterChip{display:none;position:absolute;right:58px;top:2px;padding:3px 7px;border-radius:999px;background:#22a65a;color:#eafff2;font-size:10px;font-weight:950;letter-spacing:.2px;box-shadow:0 5px 16px #0007}.rosterRow.isStarter .starterChip{display:inline-block}.rosterRow.pendingDelete{transform:translateX(-10px);box-shadow:18px 0 0 #8c2632}
.cameraSyncHero{width:100%;min-height:170px;margin:10px 0 12px;padding:24px 18px;border:1px solid rgba(255,0,138,.74);border-radius:30px;background:radial-gradient(circle at 10% 30%,rgba(255,0,138,.34),transparent 42%),linear-gradient(135deg,rgba(55,12,45,.96),rgba(9,18,39,.96));box-shadow:0 20px 54px rgba(0,0,0,.38),inset 0 0 0 1px rgba(255,255,255,.04);color:#fff;text-align:center;display:grid;place-items:center;gap:8px}.cameraSyncHeroIcon{font-size:42px;line-height:1;filter:drop-shadow(0 10px 18px rgba(0,0,0,.5))}.cameraSyncHero b{font-size:clamp(27px,8vw,45px);font-weight:950;line-height:.98;text-transform:uppercase;letter-spacing:.02em}.cameraSyncHero small{max-width:540px;color:rgba(255,255,255,.72);font-size:clamp(15px,4.2vw,22px);font-weight:750;line-height:1.22}
.reviewFixPanel{display:grid;gap:10px;margin:10px 0 12px;padding:14px;border:1px solid rgba(255,80,103,.64);border-radius:20px;background:linear-gradient(135deg,rgba(57,16,25,.96),rgba(17,20,38,.96));box-shadow:0 18px 42px rgba(0,0,0,.32)}.reviewFixPanel div{display:grid;gap:4px}.reviewFixPanel b{color:#fff;font-size:17px;font-weight:950}.reviewFixPanel small{color:rgba(255,226,232,.78);font-size:13px;font-weight:750;line-height:1.28}.reviewFixPanel button{width:100%;min-height:48px;border-radius:14px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.08);color:#fff;font-size:14px;font-weight:950}.reviewFixPanel #reviewIntervalButton{background:linear-gradient(135deg,#ff007a,#be1e55);border-color:rgba(255,130,190,.58)}.reviewFixPanel #reviewContinueButton{background:rgba(255,255,255,.08);color:#ffdce4}
.chooserSheet{width:min(620px,100%);max-height:88vh}.chooserGrid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.choiceCard{min-height:82px;border:1px solid #36577c;background:#122944;border-radius:16px;padding:14px;color:white;font-weight:800;text-align:left;display:flex;align-items:center}.choiceCard .num{display:inline-grid;place-items:center;min-width:44px;height:44px;border-radius:11px;background:#1d69c9;margin-right:10px}.choice-home{border-color:#2c83df;background:#0e3158}.choice-away{border-color:#c84a59;background:#4a1720}.teamChoice{min-height:150px;text-align:center;justify-content:center;font-size:22px}.teamChooser .chooserGrid{margin-top:18px}.chooserTeamBadge{padding:10px 14px;border-radius:999px;font-weight:900;text-align:center;margin:0 45px 12px}.homeBadge{background:#123d6d;color:#81c1ff;border:1px solid #2f7dc7}.awayBadge{background:#551b24;color:#ff9ca6;border:1px solid #bd4655}.exitTint{background:linear-gradient(#3b1118,#19090d);border-color:#9e3342}.exitTint .choiceCard{background:#5a1923;border-color:#c94b5d}.exitTint .num{background:#b52d3d}.enterTint{background:linear-gradient(#10341e,#081b10);border-color:#2c8d50}.enterTint .choiceCard{background:#174b2b;border-color:#3db366}.enterTint .num{background:#238947}
.adminPage{position:static;overflow:auto;height:auto;min-height:100%;background:#07111f}.adminPage main{max-width:1500px;margin:auto;padding:30px}.adminHead{display:flex;justify-content:space-between;align-items:center;gap:20px}.adminHead a,.download{background:#1677ff;color:white;text-decoration:none;padding:10px 14px;border-radius:10px}.adminSearchWrap{display:flex;align-items:center;gap:14px;margin:22px 0}.adminSearchWrap input{flex:1;padding:15px 17px;border-radius:13px;border:1px solid #35516f;background:#0d1b2d;color:white;font-size:16px}.adminSearchWrap span{color:#8bc9ff;white-space:nowrap}.adminPage section{margin-top:24px}.tableWrap{overflow:auto;border:1px solid #29425f;border-radius:16px}.adminPage table{width:100%;border-collapse:collapse;background:#0d1b2d}.adminPage th,.adminPage td{padding:15px;border-bottom:1px solid #243850;text-align:left;white-space:nowrap}.adminPage th{color:#8bc9ff}.adminPage .timer{font-size:22px;font-weight:900}.adminPage code{font-size:11px;color:#aac8e8}.activeRow{background:#0d1b2d}.finishedSection h2{color:#a6aeb9}.finishedRow{background:#181b20;color:#9ba4af}.finishedRow .download{background:#4f5966}.liveDot{color:#51df79;font-weight:900}
@media(max-width:390px){.grid button{min-height:88px}.grid b{font-size:9px}.scoreboard{grid-template-columns:.85fr 1.5fr .85fr;padding-top:8px}.crest{width:46px;height:55px}.chooserGrid{grid-template-columns:1fr}.teamChoice{min-height:110px}}
@media(max-height:740px){.scoreboard{padding:7px 0}.grid{gap:6px}.grid button{min-height:72px}.grid b{margin-top:4px}.recent{margin-top:6px}}

.teamAiTap{position:relative;cursor:pointer;border-radius:16px}
.teamAiTap::after{content:"AI";position:absolute;right:2px;top:-3px;padding:2px 5px;border-radius:999px;background:#151522;border:1px solid rgba(255,255,255,.24);font-size:9px;font-weight:950;letter-spacing:.4px;color:#fff;box-shadow:0 4px 12px rgba(0,0,0,.35)}
.teamAiTap_home::after{border-color:var(--home);color:#71f4ff}
.teamAiTap_away::after{border-color:var(--away);color:#cabfff}
.teamAiSheet{width:min(520px,calc(100vw - 24px));max-height:86dvh!important;padding:18px 14px!important}
.teamAiHead{display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:center;margin:2px 42px 14px 0;text-align:left}
.teamAiHead h2{margin:0!important;font-size:22px;line-height:1.08}
.teamAiHead p{margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.25}
.teamAiBadge{display:grid;place-items:center;min-width:56px;height:42px;border-radius:14px;background:#1b1b29;border:1px solid #414158;font-size:12px;font-weight:950}
.teamAiBadgeHome{border-color:var(--home);color:#77f3ff;background:rgba(0,184,201,.12)}
.teamAiBadgeAway{border-color:var(--away);color:#c8bdff;background:rgba(140,108,255,.13)}
.teamAiCards{display:grid;gap:9px;max-height:52dvh;overflow:auto;-webkit-overflow-scrolling:touch;padding-right:2px}
.teamAiSection{display:grid;gap:8px;padding:8px;border-radius:16px;background:rgba(255,255,255,.025);border:1px solid rgba(255,255,255,.05)}
.teamAiSection h3{margin:0 0 1px;color:#fff;font-size:12px;font-weight:950;letter-spacing:.08em;text-transform:uppercase;opacity:.82}
.teamAiCard{padding:12px;border:1px solid #36364b;border-radius:14px;background:#151522;text-align:left}
.teamAiCard b{display:block;font-size:14px;margin-bottom:5px}
.teamAiCard p{margin:0;color:#d3d3df;font-size:13px;line-height:1.32}
.teamAiType_phrase{border-color:rgba(255,0,138,.55);background:rgba(255,0,138,.10)}
.teamAiType_warning{border-color:#b74350;background:rgba(160,33,48,.14)}
.teamAiType_player{border-color:rgba(0,184,201,.45)}
.teamAiActions{display:grid;grid-template-columns:1.15fr .85fr .85fr;gap:8px;margin-top:12px}
.teamAiActions button{border:1px solid #45455e;border-radius:12px;background:#202033;color:#fff;padding:12px 8px;font-weight:900;font-size:12px}
.teamAiActions button:first-child{background:linear-gradient(135deg,var(--righello),var(--righello2));border-color:transparent}
@media(max-width:520px){.teamAiActions{grid-template-columns:1fr}.teamAiActions button{min-height:46px}}
.teamAiEmpty{padding:18px;border:1px dashed #45455e;border-radius:14px;color:#c7c7d3;text-align:center;font-size:13px;line-height:1.35}


/* ---------------- RIGHELLO THEME v1.5 ---------------- */
body {
  background:
    radial-gradient(circle at 50% -20%, rgba(255,0,138,.18), transparent 38%),
    linear-gradient(180deg,#08080f,#10101a);
}

.auth {
  margin-top: 4vh;
  background: rgba(18,18,28,.97);
  border-color: #35354a;
  box-shadow: 0 22px 70px rgba(0,0,0,.5);
}

.authLogo {
  display: block;
  width: min(280px,80%);
  height: auto;
  margin: 0 auto 16px;
}

.headerLogo {
  width: 86px;
  height: 22px;
  object-fit: contain;
  opacity: .92;
}

#match header {
  grid-template-columns: 44px 86px 1fr auto;
  gap: 8px;
}

.tab.active,
.auth form button,
#saveRoster,
#confirmYes {
  background: linear-gradient(135deg,var(--righello),var(--righello2)) !important;
  border-color: transparent !important;
}

.adminBtn {
  color: #fff !important;
  border-color: rgba(255,0,138,.55) !important;
  background: rgba(255,0,138,.12) !important;
}

#phase {
  border-color: rgba(255,0,138,.55);
  background: rgba(255,0,138,.12);
  color: #ff8dc9;
}

.grid button {
  background: linear-gradient(145deg,#242438,#151522);
  border-color:#3a3a50;
}

.grid button.blue {
  background: linear-gradient(145deg,#ff138f,#b70067);
}

.grid button.yellow {
  background: linear-gradient(145deg,#a97d00,#6f5200);
}

.grid button.orange {
  background: linear-gradient(145deg,#a3323d,#671c25);
}

.grid button.purple {
  background: linear-gradient(145deg,#5942aa,#372470);
}

.crest.home {
  border-color: var(--home);
  color: var(--home);
}

.crest.away {
  border-color: var(--away);
  color: var(--away);
}

.crest.hasLogo {
  background: rgba(255,255,255,.06);
  padding: 4px;
}

.crest.hasLogo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.45));
}

.score button {
  border-color: var(--home);
}

.score button:last-child {
  border-color: var(--away);
}

.homeRosterBlock {
  background: rgba(0,184,201,.10);
  border-color: rgba(0,184,201,.65);
}

.awayRosterBlock {
  background: rgba(140,108,255,.11);
  border-color: rgba(140,108,255,.65);
}

.homeBadge {
  background: rgba(0,184,201,.14);
  color: #72edf6;
  border-color: var(--home);
}

.awayBadge {
  background: rgba(140,108,255,.15);
  color: #c4b8ff;
  border-color: var(--away);
}

.choice-home {
  border-color: var(--home) !important;
  background: rgba(0,184,201,.14) !important;
}

.choice-home .num {
  background: var(--home) !important;
  color:#061114;
}

.choice-away {
  border-color: var(--away) !important;
  background: rgba(140,108,255,.16) !important;
}

.choice-away .num {
  background: var(--away) !important;
  color:#fff;
}

/* ---------------- AUTH ACTIVE ROOMS ---------------- */
.joinIntro {
  font-weight: 900;
  font-size: 16px;
  margin: 6px 0 10px;
}

.activeRoomsList {
  display: grid;
  gap: 10px;
  max-height: 43vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.activeRoomCard {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 15px;
  border-radius: 15px;
  border: 1px solid #39394e;
  background: #171722;
  text-align: left;
}

.activeRoomCard.selected {
  border-color: var(--righello);
  box-shadow: 0 0 0 2px rgba(255,0,138,.18);
  background: rgba(255,0,138,.10);
}

.activeRoomTeams {
  font-weight: 900;
  font-size: 16px;
}

.activeRoomTeams b {
  color: var(--righello);
}

.activeRoomMeta,
.roomsLoading,
.noRooms {
  color: var(--muted);
  font-size: 13px;
}

.noRooms,
.roomsLoading {
  padding: 18px;
  border: 1px dashed #36364a;
  border-radius: 14px;
  text-align: center;
}

.joinPinPanel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #303044;
}

.selectedRoomLabel {
  font-weight: 900;
  color:#fff;
  margin-bottom: 4px;
}

/* ---------------- FIX PLAYER CHOOSER ---------------- */
.overlay {
  padding:
    max(14px, env(safe-area-inset-top))
    12px
    max(14px, env(safe-area-inset-bottom));
  overflow: hidden;
}

.chooserSheet {
  width: min(560px, calc(100vw - 24px)) !important;
  height: auto;
  max-height: calc(100dvh - max(28px, env(safe-area-inset-top)) - max(28px, env(safe-area-inset-bottom))) !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px !important;
}

.chooserSheet h2 {
  flex: 0 0 auto;
  margin: 8px 46px 14px !important;
  line-height: 1.12;
}

.chooserTeamBadge {
  flex: 0 0 auto;
  margin: 0 48px 10px !important;
}

.chooserGrid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  width: 100%;
  padding: 2px 2px 12px;
}

.choiceCard {
  width: 100%;
  min-width: 0;
  min-height: 76px;
  overflow: hidden;
  flex: 0 0 auto;
}

.choiceCard > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.15;
}

.choiceCard .num {
  flex: 0 0 48px;
}

.teamChoice {
  min-height: 112px;
  justify-content: center;
  font-size: 21px;
}

.exitTint,
.enterTint {
  background: #11111b !important;
}

.exitTint .chooserGrid {
  background: rgba(150,25,45,.10);
  border-radius: 16px;
  padding: 10px;
}

.enterTint .chooserGrid {
  background: rgba(20,145,75,.10);
  border-radius: 16px;
  padding: 10px;
}

/* ---------------- ADMIN ---------------- */
.adminLogin {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.adminLoginCard {
  width: min(430px,100%);
  background:#15151f;
  border:1px solid #36364a;
  border-radius:22px;
  padding:24px;
  text-align:center;
  box-shadow:0 24px 80px rgba(0,0,0,.55);
}

.adminLoginLogo {
  width: 245px;
  max-width: 90%;
  margin-bottom: 12px;
}

.adminLoginCard input {
  width:100%;
  padding:14px;
  border:1px solid #3a3a50;
  border-radius:12px;
  background:#0d0d15;
  color:#fff;
  margin:10px 0;
}

.adminLoginCard button,
#adminLogout,
.download {
  border:0;
  border-radius:10px;
  padding:11px 15px;
  background:linear-gradient(135deg,var(--righello),var(--righello2));
  color:#fff;
  font-weight:900;
  cursor:pointer;
}

.adminBrand {
  display:flex;
  align-items:center;
  gap:16px;
}

.adminLogo {
  width:150px;
  height:auto;
}

.adminHeadActions {
  display:flex;
  gap:10px;
  align-items:center;
}

.adminPage {
  background:#0a0a12;
}

.adminPage table {
  background:#15151f;
}

.adminPage th {
  color:#ff7fc1;
}

.adminPage .download {
  background:linear-gradient(135deg,var(--righello),var(--righello2));
}

.finishedRow {
  background:#202029;
  color:#9999a8;
}

@media(max-width:600px){
  .authLogo{width:230px}
  #match header{grid-template-columns:42px 72px 1fr auto}
  .headerLogo{width:72px}
  .adminHead{align-items:flex-start;flex-direction:column}
  .adminHeadActions{width:100%}
  .adminHeadActions>*{flex:1;text-align:center}
  .adminBrand{align-items:flex-start;flex-direction:column}
}


/* ---------------- LOGO UFFICIALE RIGHELLO v1.6 ---------------- */
.authLogo,
.headerLogo,
.adminLogo,
.adminLoginLogo {
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.authLogo {
  width: min(330px, 88%);
  max-height: 110px;
}

.headerLogo {
  width: 92px;
  height: 28px;
}

.adminLogo {
  width: 170px;
  max-height: 54px;
}

.adminLoginLogo {
  width: min(310px, 92%);
  max-height: 100px;
}

@media (max-width: 600px) {
  .authLogo {
    width: min(290px, 90%);
  }

  .headerLogo {
    width: 78px;
    height: 24px;
  }

  .adminLogo {
    width: 145px;
  }
}


/* ---------------- UX FIXES v1.7 ---------------- */
.auth {
  margin-top: 1.5vh !important;
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 18px) !important;
  padding: 16px 18px 14px !important;
  overflow: hidden !important;
  position: relative;
}
.authLogo { width: min(245px,72%) !important; max-height:72px !important; margin:0 auto 6px !important; }
.auth h1 { font-size: clamp(30px,8vw,44px); margin: 8px 0 5px; }
.auth p { margin:0 0 12px; font-size:15px; line-height:1.32; }
.auth input { padding:12px 14px; margin:7px 0; }
.auth form button { padding:12px; }
.tabs { margin:12px 0 8px; }
.tab { padding:11px; }
.adminBtn {
  position:absolute; top:10px; right:10px; width:auto !important;
  padding:7px 10px !important; margin:0 !important; border-radius:9px !important;
  font-size:11px !important; opacity:.72;
}
.activeRoomsList { max-height:42vh; gap:8px; }
.activeRoomCard {
  padding:13px 14px;
  background:linear-gradient(145deg,#1b1b27,#14141e) !important;
  border-color:#343447 !important;
}
.activeRoomCard.selected {
  background:linear-gradient(145deg,#282034,#1c1726) !important;
  border-color:#a63a77 !important;
  box-shadow:0 0 0 2px rgba(255,0,138,.08) !important;
}
.activeRoomTeams b { color:#c477a5 !important; }
.activeRoomMeta { color:#9999aa !important; }

.rosterWarning {
  flex:0 0 auto; margin:8px 8px 0; padding:9px 12px;
  border:1px solid #b48924; background:rgba(180,137,36,.14);
  color:#f1ce72; border-radius:11px; font-size:12px; line-height:1.25;
}
.ghostButton { background:transparent !important; border:1px solid #4a4a60 !important; color:#c3c3d1 !important; }

.confirmText { font-size:18px; line-height:1.35; }
.tieDecisionSheet{width:min(690px,calc(100vw - 44px));margin:auto;padding:42px 34px 44px;border:1px solid rgba(80,142,210,.46);border-radius:28px;background:#0e2135;box-shadow:0 28px 90px rgba(0,0,0,.7),inset 0 0 0 1px rgba(255,255,255,.04);text-align:center;color:#fff}.tieDecisionSheet h2{margin:0 0 24px;font-size:clamp(36px,7vw,48px);font-weight:950;line-height:1.05}.tieDecisionSheet p{max-width:560px;margin:0 auto 34px;color:rgba(255,255,255,.68);font-size:clamp(24px,5.2vw,31px);font-weight:650;line-height:1.18}.tieDecisionActions{display:grid;grid-template-columns:1fr 1fr;gap:24px}.tieDecisionActions button{min-height:142px;border-radius:28px;color:#fff;font-size:clamp(27px,5.8vw,36px);font-weight:1000;letter-spacing:.01em;box-shadow:0 18px 34px rgba(0,0,0,.45),inset 0 0 0 1px rgba(255,255,255,.08)}#tieExtraTime{border:1px solid rgba(255,0,138,.8);background:linear-gradient(135deg,#ff0b93,#b90065)}#tiePenalties{border:1px solid rgba(47,141,230,.8);background:linear-gradient(135deg,#207bd7,#0f3f74)}@media(max-width:560px){.tieDecisionSheet{padding:36px 32px}.tieDecisionActions{gap:20px}.tieDecisionActions button{min-height:132px;border-radius:26px}}
.penaltyPanel{margin:10px 0 14px;padding:24px 26px;border:1px solid rgba(255,0,138,.72);border-radius:30px;background:radial-gradient(circle at 0 0,rgba(255,0,138,.28),transparent 38%),linear-gradient(135deg,rgba(45,10,45,.94),rgba(7,15,31,.96));box-shadow:0 18px 50px rgba(0,0,0,.42);color:#fff}.penaltyPanelHead{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}.penaltyPanel h2{margin:0;color:#ff5bb3;font-size:clamp(31px,7vw,42px);font-weight:1000;letter-spacing:.02em}.penaltyPanelHead span{padding-top:8px;color:rgba(255,255,255,.68);font-size:clamp(14px,3.8vw,20px);font-weight:750;text-align:right}.penaltyRows{display:grid;gap:13px;max-height:238px;overflow-y:auto;overscroll-behavior:contain;padding-right:4px}.penaltyRow{display:grid;grid-template-columns:minmax(86px,150px) 1fr;align-items:center;gap:14px}.penaltyRow b{font-size:clamp(20px,4.5vw,26px);font-weight:950;overflow:hidden;text-overflow:ellipsis}.penaltyDots{display:flex;flex-wrap:wrap;gap:9px}.penaltyDot{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;border:2px solid rgba(255,255,255,.24);background:rgba(255,255,255,.08);color:#fff;font-size:30px;font-weight:1000;line-height:1}.penaltyDot.isGoal{border-color:#35c978;background:rgba(23,122,68,.46);color:#67f19a}.penaltyDot.isMiss{border-color:#dd536c;background:rgba(143,34,56,.48);color:#ff6d84}.penaltyDot.isNext{cursor:pointer;box-shadow:0 0 0 4px rgba(255,255,255,.04),0 0 22px rgba(255,0,138,.18)}.penaltyDot.isEmpty{opacity:.42}.penaltyKickSheet{width:min(690px,calc(100vw - 44px));margin:auto;padding:34px 30px 42px;border:1px solid rgba(70,135,200,.55);border-radius:29px;background:#0e2135;box-shadow:0 28px 90px rgba(0,0,0,.76),inset 0 0 0 1px rgba(255,255,255,.04);color:#fff;position:relative}.penaltyKickSheet .x{position:absolute;right:24px;top:25px;font-size:46px;background:transparent;border:0;color:#fff}.penaltyKickTeamBadge{width:min(430px,78%);margin:0 auto 28px;padding:18px 20px;border:2px solid #0bd2e6;border-radius:30px;background:rgba(0,208,230,.10);text-align:center;color:#76eef4;font-size:clamp(25px,5.6vw,34px);font-weight:1000}.penaltyKickSheet h2{margin:0 0 28px;font-size:clamp(38px,8vw,48px);font-weight:1000}.penaltyResultButton{width:100%;min-height:138px;margin-top:20px;border-radius:26px;color:#fff;text-align:left;padding:0 28px;font-size:clamp(28px,6vw,34px);font-weight:1000}.penaltyResultButton.scored{border:2px solid #64ef94;background:#2a8647}.penaltyResultButton.missed{border:2px solid #ff617a;background:#842b3a}@media(max-width:560px){.penaltyPanel{padding:22px 24px}.penaltyRows{max-height:214px}.penaltyRow{grid-template-columns:1fr;gap:8px}.penaltyDot{width:43px;height:43px}.penaltyKickSheet{padding:34px 30px}.penaltyResultButton{min-height:126px}}
.confirmEventCard { display:grid; gap:12px; text-align:left; }
.confirmTeam { text-align:center; font-weight:900; color:#ff73bd; font-size:17px; padding-bottom:8px; border-bottom:1px solid #3a3a4d; }
.confirmLine { padding:13px 14px; border-radius:13px; background:#171725; border:1px solid #34344a; }
.confirmLine span { float:right; color:#bcbccc; font-weight:800; }
.confirmOut { border-color:#8b3c47; background:rgba(139,60,71,.12); }
.confirmIn { border-color:#348b5a; background:rgba(52,139,90,.12); }

.numberEntryBox { width:100%; display:grid; gap:14px; }
.numberEntryBox p { margin:0; color:#c0c0cf; line-height:1.4; }
.numberEntryBox input { width:100%; padding:16px; border-radius:13px; border:1px solid #4a4a64; background:#0d0d16; color:#fff; font-size:20px; }
.numberEntryActions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.numberEntryActions button { padding:14px 10px; border-radius:12px; border:1px solid #43435a; background:#202032; color:#fff; font-weight:850; }
.numberEntryActions button:last-child { background:linear-gradient(135deg,var(--righello),var(--righello2)); border:0; }

.rosterReviewHint { margin:12px 0 8px; text-align:center; color:#ffd07a; font-size:13px; font-weight:750; }
.saveRosterLocked { filter:grayscale(.8); opacity:.5; cursor:not-allowed; background:#383844 !important; }
.saveRosterReady { opacity:1; filter:none; background:linear-gradient(135deg,var(--righello),var(--righello2)) !important; }

@media(max-height:760px){
  .authLogo{width:200px !important;max-height:54px !important}
  .auth h1{font-size:30px}
  .auth p{font-size:13px}
  .auth input{padding:10px 12px}
  .tabs{margin:8px 0 6px}
}


/* ===== v1.8 ===== */
.rosterWarning{width:calc(100% - 20px);margin:8px 10px 0;padding:10px 12px;border:1px solid #d39a24;border-radius:12px;background:rgba(211,154,36,.12);color:#ffd373;font-weight:800;text-align:center;cursor:pointer}
.clockGate{flex:0 0 auto;padding:10px 0}.clockGate button{width:100%;min-height:190px;border:1px solid rgba(255,0,138,.55);border-radius:22px;background:linear-gradient(145deg,rgba(255,0,138,.25),rgba(255,0,138,.08));display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;color:white;text-align:center}.clockGate span{font-size:58px}.clockGate b{font-size:25px}.clockGate small{max-width:560px;padding:0 18px;color:rgba(255,255,255,.72);font-size:16px;font-weight:750;line-height:1.25}
#replayButton.replayPending{filter:brightness(.45);transform:scale(.98);border-color:#ff8ac7}#replayButton.replayPending small{display:block!important;color:#fff;font-weight:900;font-size:13px;margin-top:5px}
.numberEntrySheet{align-self:center!important;margin:auto!important;max-height:calc(100dvh - 130px)!important}.numberEntryBox input{autocomplete:off}.numberEntryActions{grid-template-columns:1fr!important}.numberEntryActions #skipJersey{display:none!important}
.replayRadial{position:fixed;inset:0;z-index:90;background:rgba(4,4,10,.72);backdrop-filter:blur(5px);touch-action:none}.radialCenter{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:112px;height:112px;border-radius:50%;background:#151522;border:3px solid #ff008a;display:grid;place-items:center;font-weight:900}.radialSlice{position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border:2px solid rgba(255,255,255,.28);background:rgba(140,108,255,.20);border-radius:20px;font-size:27px;transition:.12s}.radialSlice b{font-size:13px}.radialSlice.active{background:#8c6cff;border-color:white;transform:scale(1.04)}.radialUp{left:25%;right:25%;top:8%;height:27%}.radialDown{left:25%;right:25%;bottom:8%;height:27%}.radialLeft{left:5%;top:36%;bottom:36%;width:30%}.radialRight{right:5%;top:36%;bottom:36%;width:30%}
.replacePhotoButton{margin:12px 0;background:#1a1a2a;border-color:#48485f}.saveRosterUnlockedNow{opacity:1!important;filter:none!important}
.playerNameCell{display:grid;gap:3px;min-width:0}.playerNameCell input{width:100%}.sourceClubMicro{display:block;margin-left:2px;color:#9ed7ff;font-size:10px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rosterSpecialHint{margin:0 0 12px;padding:12px 14px;border:1px solid rgba(255,0,138,.55);border-radius:14px;background:rgba(255,0,138,.12);color:#ffddea;line-height:1.32;font-size:13px}.rosterSpecialHint b{color:#fff}.secondRosterPhotoButton{background:linear-gradient(135deg,#15466f,#10263f)!important;border-color:#4a8fd3!important}.enrichmentBadge{display:inline-block;margin-top:5px;padding:3px 9px;border-radius:999px;border:1px solid rgba(255,255,255,.18);font-size:10px;font-weight:900;color:#dcecff;background:#171722}.enrichment_running,.enrichment_queued{border-color:#ffb84a;color:#ffe2a8;background:rgba(255,184,74,.12)}.enrichment_partial,.enrichment_blocked{border-color:#ff6f8b;color:#ffc5d0;background:rgba(255,111,139,.12)}.enrichment_identity_ready{border-color:#4a8fd3;color:#cce7ff;background:rgba(74,143,211,.12)}.enrichment_ready,.enrichment_stats_ready{border-color:#42d083;color:#baffd3;background:rgba(66,208,131,.12)}
.matchSheetSummary{margin:0 0 12px;padding:12px 14px;border:1px solid rgba(99,170,255,.42);border-radius:14px;background:rgba(15,39,70,.74);display:grid;grid-template-columns:1fr 1fr;gap:7px 12px}.matchSheetSummary h3{grid-column:1/-1;margin:0 0 2px;font-size:14px;color:#fff}.matchSheetSummary div{display:grid;gap:2px;min-width:0}.matchSheetSummary b{font-size:10px;color:#8bc9ff;text-transform:uppercase;letter-spacing:.04em}.matchSheetSummary span{font-size:12px;color:#eef6ff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media(max-width:520px){.matchSheetSummary{grid-template-columns:1fr}}
.timedConfirmButton[disabled]{opacity:.45;pointer-events:none}
@media(max-height:760px){.clockGate button{min-height:140px}.numberEntrySheet{max-height:calc(100dvh - 90px)!important}}


/* v1.8.1 modal ergonomics */
.numberEntrySheet{position:relative!important;top:auto!important;transform:none!important;margin:auto!important;width:min(560px,calc(100vw - 28px))!important;max-height:min(620px,calc(100dvh - 190px))!important;padding:20px 16px!important}
.numberEntryBox{display:flex;flex-direction:column;gap:14px}.numberEntryBox p{margin:0;line-height:1.4}.numberEntryBox input{font-size:30px!important;min-height:72px!important}
#chooser:has(.numberEntrySheet){align-items:center!important;padding-top:max(70px,env(safe-area-inset-top))!important;padding-bottom:max(70px,env(safe-area-inset-bottom))!important}

/* ===== v1.9 ===== */
*{-webkit-touch-callout:none}.teamButton{border:0;background:transparent;color:inherit;padding:0}.headerSpacer{min-width:0}.statusIcons{position:relative;display:flex;gap:8px;align-items:center}.statusIcons>button{width:34px;height:34px;border:1px solid #3a3a4c;border-radius:50%;background:#171722;font-size:18px;padding:0}.statusIcons #connectionInfo{color:#66e68c}.statusPopover{position:absolute;right:0;top:42px;width:245px;padding:11px 12px;background:#171722;border:1px solid #44445a;border-radius:12px;color:#ddd;line-height:1.35;font-size:12px;z-index:50;box-shadow:0 10px 30px #0008}
#match header{grid-template-columns:44px 78px 1fr auto}.durationPicker{margin:8px 0}.durationTitle{font-size:13px;color:#aaa;margin-bottom:7px}.durationOptions{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.durationOption{border:1px solid #3a3a4d;background:#171722;color:#ddd;border-radius:10px;padding:8px 4px;font-size:11px}.durationOption.active{border-color:#ff008a;background:rgba(255,0,138,.16);color:#fff}.durationOption b{font-size:12px}
#matchFooter{grid-template-columns:1fr 1fr}#matchFooter button{font-size:12px}.stoppageButton{grid-column:1/-1;min-height:72px!important;background:linear-gradient(145deg,#5b3b0b,#2e210b)!important;border-color:#d99b31!important}.stoppageButton span{font-size:25px!important}
#replayButton,.replayRadial,.replayRadial *{user-select:none!important;-webkit-user-select:none!important;-webkit-touch-callout:none!important;touch-action:none!important}.replayGestureActive{overflow:hidden!important}.replayRadial{position:fixed;inset:0;z-index:999;background:rgba(5,4,12,.78);backdrop-filter:blur(7px)}.radialCenter{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:112px;height:112px;border-radius:50%;background:#161522;border:4px solid #ff008a;display:grid;place-items:center;font-weight:950;z-index:4}.radialWedge{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;background:rgba(124,94,225,.22);color:#fff;transition:.12s;pointer-events:none}.radialWedge span{font-size:34px}.radialWedge b{font-size:16px}.wedgeUp{clip-path:polygon(50% 50%,0 0,100% 0)}.wedgeRight{clip-path:polygon(50% 50%,100% 0,100% 100%)}.wedgeDown{clip-path:polygon(50% 50%,100% 100%,0 100%)}.wedgeLeft{clip-path:polygon(50% 50%,0 100%,0 0)}.wedgeUp span,.wedgeUp b{transform:translateY(-28vh)}.wedgeDown span,.wedgeDown b{transform:translateY(28vh)}.wedgeLeft span,.wedgeLeft b{transform:translateX(-31vw)}.wedgeRight span,.wedgeRight b{transform:translateX(31vw)}.radialWedge.active{background:rgba(255,0,138,.78)}
.choiceCard .playerMeta{margin-left:auto}.summarySheet{max-height:82dvh;overflow:auto}.summaryStats{display:grid;grid-template-columns:repeat(5,1fr);gap:7px}.summaryStats>div{padding:12px 4px;background:#171722;border-radius:12px;text-align:center}.summaryStats b{display:block;font-size:24px;color:#ff58b0}.summaryStats span{font-size:10px;color:#aaa}.summaryEvents{margin-top:14px;display:grid;gap:8px}.summaryEvents>div{display:grid;grid-template-columns:50px 1fr;gap:4px 8px;padding:10px;border:1px solid #353548;border-radius:11px}.summaryEvents span{grid-column:2;color:#aaa;font-size:12px}
@media(max-width:430px){.durationOptions{grid-template-columns:repeat(3,1fr)}.summaryStats{grid-template-columns:repeat(3,1fr)}}


/* ---------------- v1.10 ---------------- */
.durationOption{
  background:#171722!important;
  border:1px solid #45455a!important;
  color:#b8b8c7!important;
  box-shadow:none!important;
  opacity:.82;
}
.durationOption.active{
  background:linear-gradient(135deg,#ff008a,#c80070)!important;
  border-color:#ff7fc4!important;
  color:#fff!important;
  opacity:1;
  box-shadow:0 0 0 3px rgba(255,0,138,.22),0 8px 22px rgba(255,0,138,.22)!important;
  transform:translateY(-1px);
}
.durationOption.debugDuration{border-style:dashed!important}
.joinPinSheet{width:min(430px,calc(100vw - 28px));padding:24px!important}
.joinPinSheet input{font-size:28px;text-align:center;letter-spacing:7px;margin:16px 0}
.primaryAction{width:100%;background:linear-gradient(135deg,#ff008a,#c80070)!important;border:0!important;color:white!important}

.replayRadial{background:rgba(10,8,26,.93)!important}
.radialGuides::before,.radialGuides::after{
  content:"";position:absolute;left:50%;top:50%;width:160vmax;height:2px;
  background:rgba(255,255,255,.30);transform-origin:center;z-index:3;pointer-events:none;
  box-shadow:0 0 10px rgba(255,255,255,.16)
}
.radialGuides::before{transform:translate(-50%,-50%) rotate(45deg)}
.radialGuides::after{transform:translate(-50%,-50%) rotate(-45deg)}
.radialWedge{background:rgba(92,68,160,.16)!important;border:0!important}
.radialWedge.active{background:rgba(255,0,138,.82)!important}
.radialWedge span{filter:drop-shadow(0 2px 6px rgba(0,0,0,.65));font-size:42px!important}
.radialCenter{z-index:5!important}

.adminPage th.idColumn,.adminPage td.idColumn{display:none}
.adminPage tr[data-room-id]{cursor:help}
.adminPage tr[data-room-id]:hover{outline:1px solid rgba(255,0,138,.45);outline-offset:-1px}

.summarySheet{width:min(720px,calc(100vw - 20px));max-height:88dvh!important}
.summaryBlock{border:1px solid #39394c;border-radius:16px;padding:14px;margin:12px 0;background:#15151f}
.summaryBlock h3{margin:0 0 12px;color:#fff;font-size:20px}
.firstHalfSummary{border-color:rgba(0,184,201,.42)}
.secondHalfSummary{border-color:rgba(140,108,255,.5)}
.matchTotalSummary{border-color:rgba(255,0,138,.58);background:linear-gradient(145deg,rgba(255,0,138,.12),#15151f)}
.summaryStoppage{margin-top:10px;padding:10px;border-radius:10px;background:#242033;color:#d9c8ff}
@media(max-width:430px){.durationOptions{grid-template-columns:repeat(3,1fr)!important}}


/* ---------------- v1.11 ---------------- */

/* I tasti durata devono essere grigi, anche dentro il form rosa. */
.auth form .durationOption,
.auth form .durationOption:not(.active) {
  background: #20202b !important;
  border: 1px solid #4a4a5d !important;
  color: #c2c2ce !important;
  box-shadow: none !important;
  opacity: .86 !important;
}
.auth form .durationOption.active {
  background: linear-gradient(135deg,#ff008a,#c80070) !important;
  border-color: #ff83c7 !important;
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(255,0,138,.22) !important;
  opacity: 1 !important;
}

/* Solid color degli spicchi: un solo layer con clip-path identico alle linee. */
.replayRadial {
  --replay-active-color: rgba(255,0,138,.88);
}
.replayRadial::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: transparent;
}
.replayRadial[data-active="tiro_in_porta"]::before {
  background: var(--replay-active-color);
  clip-path: polygon(50% 50%, 0 0, 100% 0);
}
.replayRadial[data-active="punizione"]::before {
  background: var(--replay-active-color);
  clip-path: polygon(50% 50%, 100% 0, 100% 100%);
}
.replayRadial[data-active="fallo"]::before {
  background: var(--replay-active-color);
  clip-path: polygon(50% 50%, 100% 100%, 0 100%);
}
.replayRadial[data-active="calcio_angolo"]::before {
  background: var(--replay-active-color);
  clip-path: polygon(50% 50%, 0 100%, 0 0);
}
.radialWedge {
  z-index: 2 !important;
  background: transparent !important;
}
.radialWedge.active {
  background: transparent !important;
}
.radialGuides {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.radialCenter {
  z-index: 5 !important;
}

/* Recupero compatto 1–15. */
.stoppageCompactChooser {
  width: min(520px, calc(100vw - 26px)) !important;
  max-height: none !important;
}
.stoppageCompactChooser #chooserTitle,
.stoppageCompactChooser h2 {
  text-align: center;
  font-size: 23px;
  margin: 12px 42px 18px !important;
}
.stoppageCompactChooser .chooserGrid,
#chooserSheet.stoppageCompactChooser .chooserGrid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 9px !important;
  overflow: visible !important;
  padding: 4px !important;
}
.stoppageCompactChooser .choiceCard {
  min-height: 62px !important;
  padding: 8px !important;
  justify-content: center !important;
  font-size: 24px !important;
  font-weight: 900 !important;
  border-radius: 13px !important;
}
.stoppageCompactChooser .choiceCard span {
  width: 100%;
  text-align: center;
}

/* Riepilogo finale al posto delle azioni recenti. */
.finishedSummary {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #353548;
  border-radius: 17px;
  padding: 12px;
}
.finishedSummaryHead h2 {
  margin: 4px 4px 12px;
  font-size: 24px;
}
.finishedSummary .summaryBlock {
  margin: 10px 0;
}

/* Segnalazione locale della revisione obbligatoria. */
.reviewRequiredMatch #phase {
  background: rgba(170,25,45,.22) !important;
  border-color: #ff5268 !important;
  color: #ff9aa8 !important;
}

/* Reset completo partita. */
.strongDanger {
  border-color: #e0495c !important;
  background: rgba(165,28,48,.20) !important;
}
.resetMatchSheet {
  width: min(520px, calc(100vw - 24px));
}
.resetWarning {
  background: rgba(170,25,45,.13);
  border: 1px solid rgba(255,76,99,.45);
  border-radius: 14px;
  padding: 14px;
  color: #ffd9de;
}
.resetWarning ul {
  margin: 10px 0 0 20px;
  padding: 0;
}
.resetRosterCheck {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #424257;
  border-radius: 13px;
  background: #181824;
}
.resetRosterCheck input {
  width: 24px;
  height: 24px;
  accent-color: #ff008a;
  flex: 0 0 auto;
}
.timedResetButton:disabled {
  opacity: .48;
  filter: grayscale(.45);
}

/* Admin: partite in revisione e pulsante elimina. */
.adminPage tr.reviewRow {
  background: rgba(177,29,48,.24) !important;
  outline: 1px solid rgba(255,70,91,.72);
  color: #ffd9de;
}
.reviewBadge {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #a91d33;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}
.deleteRoom {
  min-width: 44px;
  background: rgba(155,28,44,.18) !important;
  border: 1px solid #b83b4c !important;
  color: #ff9eaa !important;
  transition: .18s;
}
.deleteRoom.confirmDelete {
  background: #168b4c !important;
  border-color: #44d58a !important;
  color: white !important;
  transform: scale(1.04);
}

@media(max-width:430px){
  .stoppageCompactChooser .chooserGrid,
  #chooserSheet.stoppageCompactChooser .chooserGrid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
  .stoppageCompactChooser .choiceCard {
    min-height: 56px !important;
    font-size: 21px !important;
  }
}


/* v1.12 */
.radialSvg{position:absolute;inset:0;width:100%;height:100%;z-index:1;pointer-events:none}
.radialSlice{fill:rgba(66,49,112,.18);stroke:rgba(255,255,255,.4);stroke-width:.45;vector-effect:non-scaling-stroke;transition:fill .08s ease}
.radialSlice.active{fill:rgba(255,0,138,.88)}
.replayRadial::before,.radialGuides{display:none!important}
.radialWedge,.radialWedge.active{z-index:2!important;background:transparent!important}
.radialCenter{z-index:4!important}
.stoppageCompactChooser{width:min(430px,calc(100vw - 28px))!important}
.stoppageCompactChooser .chooserGrid,#chooserSheet.stoppageCompactChooser .chooserGrid{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:8px!important}
.stoppageCompactChooser .choiceCard{min-height:54px!important;height:54px!important;font-size:20px!important;border-radius:12px!important}
.rosterRow{position:relative}
.rosterRow.rosterDuplicateError{outline:2px solid #ff4f69;background:rgba(180,28,51,.18);border-radius:12px}
.rosterErrorIcon{position:absolute;right:54px;top:-10px;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#c7253f;color:#fff;font-size:15px;box-shadow:0 4px 14px rgba(0,0,0,.35)}
.rosterValidationMessage{margin:8px 0;padding:11px;border-radius:10px;background:rgba(180,28,51,.15);border:1px solid rgba(255,75,102,.48);color:#ffd8de}
.deleteRoom.confirmDelete{background:#168b4c!important;border-color:#49e295!important;color:#fff!important;transform:scale(1.04)}


/* ---------------- v1.13 ---------------- */

/* Lo spicchio selezionato non deve subire scale o trasformazioni. */
.radialSlice,
.radialSlice.active {
  position: static !important;
  display: block !important;
  transform: none !important;
  transform-origin: initial !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
.radialSlice {
  fill: rgba(66,49,112,.18) !important;
  stroke: rgba(255,255,255,.42) !important;
  stroke-width: .42 !important;
  vector-effect: non-scaling-stroke;
}
.radialSlice.active {
  fill: rgba(255,0,138,.9) !important;
}

/* Logo Righello centrato realmente rispetto allo schermo. */
#match > header {
  position: relative;
  grid-template-columns: 48px 1fr auto !important;
}
#match > header .headerLogo {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 82px !important;
  height: 26px !important;
  margin: 0 !important;
  pointer-events: none;
  z-index: 2;
}
#match > header .headerSpacer {
  display: none !important;
}
#match > header .statusIcons {
  grid-column: 3;
}

/* Un solo comando inferiore, a tutta larghezza. */
#matchFooter {
  grid-template-columns: 1fr !important;
}
#matchFooter button:not(.hidden) {
  width: 100%;
  min-height: 58px;
  font-size: 15px;
}
#matchFooter #end {
  background: linear-gradient(135deg,#b51f3d,#7d1429);
}
#matchFooter #export {
  background: linear-gradient(135deg,#1677ff,#0e54b7);
}

.drawerPrimary {
  background: linear-gradient(135deg,#1677ff,#0d56bd) !important;
  border-color: #438ff6 !important;
}
#soundToggle {
  background: #202033 !important;
}

.removePlayer.confirmDelete,
.deleteRoom.confirmDelete {
  background: #168b4c !important;
  border-color: #49e295 !important;
  color: #fff !important;
}


/* ---------------- v1.14: esportazione Story PNG ---------------- */
.storyCanvas {
  position: fixed;
  left: -99999px;
  top: -99999px;
  width: 1px;
  height: 1px;
  pointer-events: none;
  opacity: 0;
}

.finalExportActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  width: 100%;
}

.finalExportActions button {
  min-height: 62px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 14px;
}

.finalExportActions #export {
  background: linear-gradient(135deg,#1677ff,#0e54b7);
  border-color: #3c8cff;
}

.finalExportActions #exportPng {
  background: linear-gradient(135deg,#ff008a,#c80070);
  border-color: #ff62b8;
}

@media(max-width:390px) {
  .finalExportActions {
    gap: 7px;
  }

  .finalExportActions button {
    font-size: 12px;
    padding-inline: 7px;
  }
}


/* =========================================================
   v1.15 — Tutorial interattivo
   ========================================================= */

.tutorialMenuButton {
  background: linear-gradient(135deg, rgba(255,0,138,.18), rgba(140,108,255,.20)) !important;
  border-color: rgba(255,91,183,.62) !important;
}

body.tutorialRunning {
  overflow: hidden !important;
}

body.tutorialRunning .app,
body.tutorialRunning > .overlay:not(#tutorialLayer),
body.tutorialRunning #replayRadial {
  pointer-events: none !important;
}

.tutorialLayer {
  position: fixed;
  inset: 0;
  z-index: 20000;
  pointer-events: auto;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.tutorialShade {
  position: fixed;
  background: rgba(3,3,9,.78);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: all .34s cubic-bezier(.2,.8,.2,1);
  pointer-events: auto;
}

.tutorialFocus {
  position: fixed;
  z-index: 20003;
  border: 3px solid #ff008a;
  border-radius: 18px;
  box-shadow:
    0 0 0 5px rgba(255,0,138,.17),
    0 0 34px rgba(255,0,138,.58);
  transition: all .34s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}

.tutorialFocus.hiddenFocus {
  opacity: 0;
}

.tutorialPulse {
  position: absolute;
  inset: -5px;
  border: 2px solid rgba(255,111,194,.72);
  border-radius: inherit;
  animation: tutorialPulse 1.25s ease-out infinite;
}

@keyframes tutorialPulse {
  0% { transform: scale(.97); opacity: .85; }
  75%,100% { transform: scale(1.07); opacity: 0; }
}

.tutorialCard {
  position: fixed;
  z-index: 20006;
  left: 50%;
  transform: translateX(-50%);
  width: min(430px, calc(100vw - 28px));
  max-height: min(52vh, 480px);
  overflow-y: auto;
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(28,25,44,.98), rgba(13,13,23,.99));
  border: 1px solid rgba(255,255,255,.17);
  box-shadow: 0 24px 85px rgba(0,0,0,.68);
  transition: top .3s ease, bottom .3s ease;
}

.tutorialCardCenterPosition {
  top: 50%;
  transform: translate(-50%, -50%);
}

.tutorialCardBottomPosition {
  transform: translateX(-50%);
}

.tutorialCardTopPosition {
  transform: translateX(-50%);
}

.tutorialCardTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tutorialBadge {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,0,138,.15);
  border: 1px solid rgba(255,0,138,.50);
  color: #ff83c7;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.tutorialSkip {
  width: auto !important;
  min-height: 0 !important;
  padding: 7px 10px !important;
  border: 0 !important;
  background: transparent !important;
  color: rgba(255,255,255,.60) !important;
  font-size: 13px !important;
}

.tutorialCard h2 {
  margin: 4px 0 10px;
  font-size: clamp(24px, 6vw, 31px);
  line-height: 1.08;
}

.tutorialText {
  min-height: 78px;
  color: rgba(255,255,255,.78);
  font-size: 16px;
  line-height: 1.48;
  white-space: pre-wrap;
}

.tutorialText::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -.12em;
  background: #ff008a;
  animation: tutorialCursor .65s steps(1) infinite;
}

@keyframes tutorialCursor {
  50% { opacity: 0; }
}

.tutorialProgress {
  height: 5px;
  margin: 17px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
}

#tutorialProgressBar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff008a, #a991ff);
  transition: width .32s ease;
}

.tutorialFooter {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.tutorialFooter button {
  min-height: 46px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 900;
}

#tutorialBack {
  background: #222235;
  border-color: #42425a;
}

#tutorialNext {
  background: linear-gradient(135deg,#ff008a,#c80070);
  border-color: #ff62b8;
}

#tutorialBack:disabled {
  opacity: .32;
}

#tutorialCounter {
  min-width: 50px;
  text-align: center;
  color: rgba(255,255,255,.55);
  font-weight: 800;
  font-size: 13px;
}

/* Visual: Replay */
.tutorialVisual {
  min-height: 120px;
  margin: 4px 0 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: radial-gradient(circle at center, rgba(255,0,138,.15), transparent 65%);
}

.tutorialReplayVisual {
  position: relative;
  width: 220px;
  height: 145px;
}

.tutorialReplayButton {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  border: 4px solid #ff008a;
  background: #151522;
  color: white;
  font-size: 14px;
  font-weight: 900;
  z-index: 2;
}

.tutorialSwipe {
  position: absolute;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-size: 25px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.35));
}

.tutorialSwipeUp { left: 89px; top: 0; }
.tutorialSwipeRight { right: 8px; top: 52px; }
.tutorialSwipeDown { left: 89px; bottom: 0; }
.tutorialSwipeLeft { left: 8px; top: 52px; }

.tutorialFinger {
  position: absolute;
  left: 98px;
  top: 77px;
  font-size: 28px;
  z-index: 4;
  animation: tutorialFingerSwipe 3.6s ease-in-out infinite;
}

@keyframes tutorialFingerSwipe {
  0%,12% { transform: translate(0,0) scale(.9); }
  24%,36% { transform: translate(0,-60px) scale(1); }
  48%,60% { transform: translate(58px,-2px) scale(1); }
  72%,84% { transform: translate(-58px,-2px) scale(1); }
  100% { transform: translate(0,0) scale(.9); }
}

/* Visual: roster */
.tutorialRosterVisual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
}

.tutorialPaper {
  padding: 12px;
  border-radius: 8px;
  background: #f6f4ed;
  color: #222;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.5;
  transform: rotate(-4deg);
  box-shadow: 0 10px 22px rgba(0,0,0,.35);
}

.tutorialCamera {
  font-size: 31px;
  animation: tutorialCameraFlash 1.6s ease infinite;
}

@keyframes tutorialCameraFlash {
  45% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.13); filter: brightness(2.8); }
  58% { transform: scale(1); filter: brightness(1); }
}

.tutorialArrow {
  color: #ff008a;
  font-size: 28px;
  font-weight: 900;
}

.tutorialPlayers {
  padding: 9px 14px;
  border: 1px solid rgba(169,145,255,.68);
  border-radius: 12px;
  background: rgba(169,145,255,.14);
  color: #d6ccff;
  font-weight: 900;
  line-height: 1.5;
}

/* Visual: export */
.tutorialExportVisual {
  position: relative;
  display: grid;
  place-items: center;
  height: 145px;
}

.tutorialStoryCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 132px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,0,138,.50), transparent 44%),
    linear-gradient(160deg,#0b0b13,#24183a);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 12px 34px rgba(0,0,0,.45);
  animation: tutorialStoryFloat 2.2s ease-in-out infinite;
}

.tutorialStoryCard small {
  color: #ff67b8;
  font-size: 8px;
  font-weight: 900;
}

.tutorialStoryCard b {
  margin: 7px 0;
  font-size: 25px;
}

.tutorialStoryCard span {
  max-width: 72px;
  text-align: center;
  font-size: 8px;
  font-weight: 800;
}

.tutorialStoryCard i {
  margin-top: 8px;
  color: rgba(255,255,255,.45);
  font-size: 7px;
}

.tutorialDownloadArrow {
  position: absolute;
  right: calc(50% - 77px);
  bottom: 13px;
  color: #ff008a;
  font-size: 35px;
  font-weight: 900;
  animation: tutorialDownload 1.3s ease-in-out infinite;
}

@keyframes tutorialStoryFloat {
  50% { transform: translateY(-5px) rotate(1deg); }
}

@keyframes tutorialDownload {
  50% { transform: translateY(8px); opacity: .52; }
}

@media (max-height: 690px) {
  .tutorialCard {
    max-height: 57vh;
    padding: 14px;
  }

  .tutorialVisual {
    min-height: 96px;
  }

  .tutorialText {
    min-height: 58px;
    font-size: 14px;
  }

  .tutorialCard h2 {
    font-size: 23px;
  }
}


/* =========================================================
   v1.16 — Tutorial compatto e popup benvenuto
   ========================================================= */

.tutorialWelcome {
  position: fixed;
  inset: 0;
  z-index: 21000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3,3,9,.82);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.tutorialWelcomeCard {
  width: min(390px, 100%);
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(145deg,#191724,#0e0e17);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 28px 90px rgba(0,0,0,.68);
  text-align: center;
}

.tutorialWelcomeLogo {
  width: 190px;
  max-height: 58px;
  object-fit: contain;
  margin-bottom: 12px;
}

.tutorialWelcomeBadge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,0,138,.14);
  border: 1px solid rgba(255,0,138,.45);
  color: #ff83c7;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
}

.tutorialWelcomeCard h2 {
  margin: 14px 0 8px;
  font-size: 27px;
  line-height: 1.08;
}

.tutorialWelcomeCard p {
  margin: 0;
  color: rgba(255,255,255,.68);
  font-size: 15px;
  line-height: 1.45;
}

.tutorialWelcomeActions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
  margin-top: 20px;
}

.tutorialWelcomeActions button {
  min-height: 48px;
  border-radius: 13px;
  font-weight: 900;
}

#tutorialWelcomeSkip {
  background: #232334;
  border-color: #444459;
}

#tutorialWelcomeStart {
  background: linear-gradient(135deg,#ff008a,#c80070);
  border-color: #ff65ba;
}

/* Card tutorial più piccola, leggibile e sempre contenuta nello schermo. */
.tutorialCard {
  width: min(360px, calc(100vw - 22px)) !important;
  max-height: none !important;
  overflow: hidden !important;
  padding: 13px 14px 12px !important;
  border-radius: 17px !important;
}

.tutorialCardTop {
  margin-bottom: 7px !important;
}

.tutorialBadge {
  padding: 5px 8px !important;
  font-size: 9px !important;
}

.tutorialSkip {
  padding: 4px 6px !important;
  font-size: 11px !important;
}

.tutorialCard h2 {
  margin: 1px 0 6px !important;
  font-size: 20px !important;
  line-height: 1.1 !important;
}

.tutorialText {
  min-height: 50px !important;
  max-height: 78px;
  overflow: hidden;
  font-size: 13px !important;
  line-height: 1.38 !important;
}

.tutorialVisual {
  min-height: 72px !important;
  max-height: 96px;
  margin: 0 0 7px !important;
  border-radius: 12px !important;
}

.tutorialProgress {
  height: 3px !important;
  margin: 9px 0 8px !important;
}

.tutorialFooter {
  grid-template-columns: 40px 1fr 40px !important;
  gap: 6px !important;
}

.tutorialFooter button {
  width: 38px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 0 !important;
  background: transparent !important;
  border: 1px solid rgba(255,255,255,.20) !important;
  color: rgba(255,255,255,.88) !important;
}

#tutorialBack::before {
  content: "‹";
  font-size: 29px;
  font-weight: 300;
  line-height: 1;
}

#tutorialNext::before {
  content: "›";
  font-size: 29px;
  font-weight: 300;
  line-height: 1;
}

#tutorialNext {
  justify-self: end;
  border-color: rgba(255,0,138,.60) !important;
  color: #ff77c3 !important;
}

#tutorialCounter {
  font-size: 11px !important;
}

/* Visual compatti */
.tutorialReplayVisual {
  width: 170px !important;
  height: 90px !important;
  transform: scale(.78);
}

.tutorialRosterVisual {
  transform: scale(.82);
}

.tutorialPlayerVisual {
  position: relative;
  width: 220px;
  height: 72px;
  display: grid;
  place-items: center;
}

.tutorialPlayerCard {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
  padding: 11px 15px;
  border-radius: 13px;
  background: rgba(0,184,201,.15);
  border: 1px solid rgba(0,184,201,.72);
}

.tutorialPlayerCard b {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #00b8c9;
  color: #061114;
}

.tutorialTapDot {
  position: absolute;
  right: 14px;
  bottom: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ff008a;
  animation: tutorialTap 1.2s ease infinite;
}

@keyframes tutorialTap {
  0%,100% { transform: scale(.75); opacity: .35; }
  50% { transform: scale(1.25); opacity: 1; }
}

.tutorialCardVisual {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 15px;
  border-radius: 13px;
}

.tutorialCardVisual .tutorialCardShape {
  display: block;
  width: 27px;
  height: 42px;
  border-radius: 4px;
}

.tutorialCardVisual b,
.tutorialCardVisual small {
  display: block;
}

.tutorialCardVisual small {
  margin-top: 3px;
  color: rgba(255,255,255,.56);
  font-size: 10px;
}

.tutorialRedVisual {
  background: rgba(190,35,55,.18);
  border: 1px solid rgba(255,75,95,.60);
}

.tutorialRedVisual .tutorialCardShape {
  background: #e33248;
}

.tutorialYellowVisual {
  background: rgba(184,133,0,.18);
  border: 1px solid rgba(255,199,44,.58);
}

.tutorialYellowVisual .tutorialCardShape {
  background: #ffc72c;
}

.tutorialSubVisual {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  width: 300px;
  font-size: 10px;
  text-align: center;
}

.tutorialSubOut,
.tutorialSubIn {
  padding: 10px 7px;
  border-radius: 11px;
}

.tutorialSubOut {
  background: rgba(190,35,55,.18);
  border: 1px solid rgba(255,75,95,.50);
}

.tutorialSubIn {
  background: rgba(30,160,85,.17);
  border: 1px solid rgba(70,220,130,.50);
}

.tutorialSubArrow {
  color: #ff008a;
  font-size: 20px;
}

.tutorialRosterEditVisual {
  display: grid;
  gap: 5px;
  width: 290px;
}

.tutorialRosterEditVisual > div {
  display: grid;
  grid-template-columns: 45px 1fr 34px;
  gap: 5px;
}

.tutorialRosterEditVisual input,
.tutorialRosterEditVisual button {
  height: 30px;
  min-height: 30px;
  border-radius: 7px;
  font-size: 10px;
  padding: 4px 7px;
}

.tutorialRosterEditVisual button {
  background: #9d273a;
}

.tutorialRosterEditVisual > span {
  color: #ff76c1;
  font-size: 10px;
  font-weight: 800;
}

/* Posizionamento più prudente su schermi bassi. */
@media (max-height: 760px) {
  .tutorialCard {
    width: min(340px, calc(100vw - 18px)) !important;
  }

  .tutorialVisual {
    min-height: 60px !important;
    max-height: 76px;
  }

  .tutorialText {
    min-height: 43px !important;
    max-height: 66px;
    font-size: 12px !important;
  }
}


/* =========================================================
   v1.17 — stabilità tutorial
   ========================================================= */

.tutorialCardCenterPosition {
  top: 50% !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
}

.tutorialRecoveryVisual {
  display: grid;
  place-items: center;
  gap: 7px;
  width: 280px;
}

.tutorialRecoveryButton {
  padding: 9px 20px;
  border-radius: 13px;
  background: linear-gradient(135deg,#ff008a,#c80070);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
}

.tutorialRecoveryGrid {
  display: grid;
  grid-template-columns: repeat(5, 36px);
  gap: 5px;
}

.tutorialRecoveryGrid span {
  display: grid;
  place-items: center;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18);
  background: #222235;
  color: rgba(255,255,255,.68);
  font-size: 12px;
  font-weight: 900;
}

.tutorialRecoveryGrid span.active {
  background: #ff008a;
  border-color: #ff77c3;
  color: #fff;
}

.tutorialRecoveryVisual small {
  color: rgba(255,255,255,.48);
  font-size: 9px;
  font-weight: 700;
}

body.tutorialRunning #clockGateButton {
  opacity: 1 !important;
  visibility: visible !important;
}

body.tutorialRunning #finishedSummaryContent .summaryEvents {
  max-height: 230px;
  overflow: hidden;
}


/* Buffr QR unobtrusive restore */
.buffrConnectButton{background:linear-gradient(135deg,#0c6f68,#07344a 72%,#06182b)!important;border-color:rgba(86,242,212,.46)!important}.buffrQrSheet{max-width:430px;text-align:center}.buffrBadge{display:inline-flex;margin-bottom:8px;padding:7px 11px;border:1px solid rgba(86,242,212,.42);border-radius:999px;color:#9fffee;background:rgba(27,180,160,.12);font-size:11px;font-weight:900;letter-spacing:.08em}.buffrQrSubtitle{margin:0 0 14px;color:#d8e8ff;font-weight:800}.buffrQrCanvas{display:grid;place-items:center;width:min(72vw,300px);min-height:min(72vw,300px);margin:0 auto 14px;padding:14px;border-radius:24px;background:#fff;box-shadow:0 18px 44px rgba(0,0,0,.35)}.buffrQrCanvas svg{width:100%;height:auto;display:block}.buffrQrFallback{color:#0b1220;font-weight:900}.buffrRoomCode{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0;padding:12px 14px;border:1px solid rgba(112,159,220,.28);border-radius:16px;background:rgba(8,17,31,.72)}.buffrRoomCode span{color:#9fb6d8;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}.buffrRoomCode b{color:#fff;font-size:22px;letter-spacing:.08em}#buffrQrPayload{width:100%;min-height:76px;margin:4px 0 10px;border-radius:14px;font-size:11px;line-height:1.25}.buffrQrHelp{margin:12px 0 0;color:#aebfda;font-size:12px;line-height:1.35}

.adMarkerReminder {
  position: fixed;
  right: 14px;
  bottom: calc(env(safe-area-inset-bottom) + 86px);
  z-index: 18;
  display: grid;
  grid-template-columns: 24px auto;
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  min-width: 220px;
  padding: 12px 14px;
  border: 1px solid rgba(255,188,76,.58);
  border-radius: 18px;
  background: linear-gradient(135deg,rgba(43,24,7,.97),rgba(88,48,8,.94));
  box-shadow: 0 18px 42px rgba(0,0,0,.42), 0 0 28px rgba(255,149,0,.16);
  color: #fffaf2;
  text-align: left;
  transform-origin: 100% 100%;
  animation: cameraSyncReminderIn .22s ease-out;
}

.adMarkerReminder span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255,188,76,.16);
  color: #ffc14d;
  border: 1px solid rgba(255,188,76,.46);
  font-size: 13px;
  font-weight: 950;
}

.adMarkerReminder b {
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .02em;
}

.adMarkerReminder small {
  color: rgba(255,244,220,.74);
  font-size: 10px;
  font-weight: 750;
}

.adMarkerReminder.saving {
  opacity: .7;
  filter: saturate(.7);
}

@keyframes cameraSyncReminderIn {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
  .adMarkerReminder {
    right: 10px;
    left: 10px;
    bottom: calc(env(safe-area-inset-bottom) + 78px);
    min-width: 0;
  }
}

/* v1.39 undo/redo history controls */
.historyActions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.recentHead .historyActions button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  font-size: 25px;
  font-weight: 950;
  line-height: 1;
  transition: opacity .18s ease, transform .18s ease, border-color .18s ease, color .18s ease;
}
#undo {
  border-color: rgba(255,75,145,.58);
  color: #ff7fb8;
  box-shadow: inset 0 0 0 1px rgba(255,75,145,.08), 0 10px 26px rgba(255,0,138,.08);
}
#redo {
  border-color: rgba(80,220,150,.58);
  color: #70e0a3;
  box-shadow: inset 0 0 0 1px rgba(80,220,150,.08), 0 10px 26px rgba(80,220,150,.08);
}
#undo:active,
#redo:active {
  transform: scale(.94);
}
#undo:disabled,
#redo:disabled {
  opacity: .36;
  filter: grayscale(.4);
}
#redo.redoReady {
  background: rgba(35,145,85,.14);
}
@media(max-width:390px){
  .recentHead .historyActions button{width:43px;height:43px;font-size:23px}
  .historyActions{gap:8px}
}

/* ===== v1.40 roster review editor ===== */
.rosterSheet h2{margin-bottom:12px}.matchSheetSummary{display:block;padding:14px;border-radius:18px;background:linear-gradient(135deg,rgba(12,37,67,.92),rgba(20,23,49,.92));border:1px solid rgba(80,170,255,.48)}.matchSheetEditorHead{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-bottom:10px}.matchSheetEditorHead h3{margin:0;color:#fff;font-size:17px;font-weight:950}.matchSheetEditorHead small{color:#9dc8ef;font-size:11px;font-weight:800;text-align:right}.matchSheetEditorGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.matchSheetEditorGrid label{display:grid;gap:5px;color:#8bc9ff;font-size:10px;font-weight:950;text-transform:uppercase;letter-spacing:.04em}.matchSheetEditorGrid label.wide{grid-column:1/-1}.matchSheetEditorGrid input,.matchSheetEditorGrid textarea{width:100%;margin:0;padding:10px 11px;border-radius:11px;border:1px solid rgba(106,157,210,.52);background:#071625;color:#fff;font-size:13px;font-weight:800;resize:vertical;text-transform:none;letter-spacing:0}.matchSheetEditorGrid textarea{line-height:1.32}.rosterRow{grid-template-columns:minmax(76px,94px) minmax(0,1fr) 50px;align-items:center;padding:5px;border:1px solid rgba(255,255,255,.05);background:rgba(255,255,255,.025);border-radius:15px}.rosterRow.isStarter{background:rgba(31,151,82,.22);border-color:#3ddc84}.rosterNumberCell{grid-template-columns:34px minmax(40px,1fr)}.starterToggle{font-size:12px}.playerNameCell{gap:5px}.sourceClubInput{min-height:28px!important;padding:6px 9px!important;border-radius:9px!important;border-color:rgba(87,154,220,.42)!important;background:rgba(12,37,67,.72)!important;color:#9ed7ff!important;font-size:10px!important;font-weight:850!important}.removePlayer{border-radius:13px;background:linear-gradient(135deg,#a32638,#d04257);box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}.removePlayer.confirmDelete{background:linear-gradient(135deg,#21a85a,#47d783)}.rosterRow.pendingDelete{transform:translateX(-8px);box-shadow:10px 0 0 rgba(208,66,87,.82)}.starterChip{right:58px;top:5px}.rosterReviewHint{font-size:15px;font-weight:900;color:#ffd875}.saveRosterReady{min-height:64px;font-size:23px;border-radius:15px}@media(max-width:560px){.rosterSheet{width:calc(100vw - 22px);padding:16px 14px}.matchSheetEditorGrid{grid-template-columns:1fr}.matchSheetEditorHead{align-items:flex-start}.matchSheetEditorHead small{max-width:145px}.rosterTeamBlock{padding:10px}.rosterRow{grid-template-columns:86px minmax(0,1fr) 46px;gap:6px}.rosterNumberCell{grid-template-columns:32px 1fr;gap:5px}.rosterRow input{font-size:16px}.removePlayer{font-size:24px}.starterChip{right:52px}}

/* ===== v1.40 roster review editor ===== */
.rosterSheet h2{margin-bottom:12px}.matchSheetSummary{display:block;padding:14px;border-radius:18px;background:linear-gradient(135deg,rgba(12,37,67,.92),rgba(20,23,49,.92));border:1px solid rgba(80,170,255,.48)}.matchSheetEditorHead{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-bottom:10px}.matchSheetEditorHead h3{margin:0;color:#fff;font-size:17px;font-weight:950}.matchSheetEditorHead small{color:#9dc8ef;font-size:11px;font-weight:800;text-align:right}.matchSheetEditorGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.matchSheetEditorGrid label{display:grid;gap:5px;color:#8bc9ff;font-size:10px;font-weight:950;text-transform:uppercase;letter-spacing:.04em}.matchSheetEditorGrid label.wide{grid-column:1/-1}.matchSheetEditorGrid input,.matchSheetEditorGrid textarea{width:100%;margin:0;padding:10px 11px;border-radius:11px;border:1px solid rgba(106,157,210,.52);background:#071625;color:#fff;font-size:13px;font-weight:800;resize:vertical;text-transform:none;letter-spacing:0}.matchSheetEditorGrid textarea{line-height:1.32}.rosterRow{grid-template-columns:minmax(76px,94px) minmax(0,1fr) 50px;align-items:center;padding:5px;border:1px solid rgba(255,255,255,.05);background:rgba(255,255,255,.025);border-radius:15px}.rosterRow.isStarter{background:rgba(31,151,82,.22);border-color:#3ddc84}.rosterNumberCell{grid-template-columns:34px minmax(40px,1fr)}.starterToggle{font-size:12px}.playerNameCell{gap:5px}.sourceClubInput{min-height:28px!important;padding:6px 9px!important;border-radius:9px!important;border-color:rgba(87,154,220,.42)!important;background:rgba(12,37,67,.72)!important;color:#9ed7ff!important;font-size:10px!important;font-weight:850!important}.removePlayer{border-radius:13px;background:linear-gradient(135deg,#a32638,#d04257);box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}.removePlayer.confirmDelete{background:linear-gradient(135deg,#21a85a,#47d783)}.rosterRow.pendingDelete{transform:translateX(-8px);box-shadow:10px 0 0 rgba(208,66,87,.82)}.starterChip{right:58px;top:5px}.rosterReviewHint{font-size:15px;font-weight:900;color:#ffd875}.saveRosterReady{min-height:64px;font-size:23px;border-radius:15px}@media(max-width:560px){.rosterSheet{width:calc(100vw - 22px);padding:16px 14px}.matchSheetEditorGrid{grid-template-columns:1fr}.matchSheetEditorHead{align-items:flex-start}.matchSheetEditorHead small{max-width:145px}.rosterTeamBlock{padding:10px}.rosterRow{grid-template-columns:86px minmax(0,1fr) 46px;gap:6px}.rosterNumberCell{grid-template-columns:32px 1fr;gap:5px}.rosterRow input{font-size:16px}.removePlayer{font-size:24px}.starterChip{right:52px}}

/* ===== v1.41 crest logos + cronista AI copy ===== */
.crest.hasLogo{background:rgba(255,255,255,.96)!important;border-color:rgba(255,255,255,.72)!important;padding:5px;overflow:hidden}.crest.hasLogo img{display:block;width:100%;height:100%;object-fit:contain;border-radius:12px}.teamAiCard p,.teamAiMeta{word-break:normal}.teamAiType_warning p{color:#ffd8df}
.teamDataImportSheet{width:min(560px,calc(100vw - 24px));max-height:88dvh!important;text-align:left}.teamDataImportSheet h2{margin-right:40px!important}.teamDataImportIntro{margin:0 0 14px;color:#d8d8e8;line-height:1.35;font-size:13px;padding:12px;border:1px solid rgba(255,216,117,.35);border-radius:14px;background:rgba(255,216,117,.09)}.teamDataImportSheet label{display:grid;gap:5px;margin:10px 0;color:#9ed7ff;font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.04em}.teamDataImportSheet input,.teamDataImportSheet textarea{width:100%;margin:0!important;padding:11px 12px!important;border-radius:12px!important;border:1px solid rgba(106,157,210,.52)!important;background:#071625!important;color:#fff!important;font-size:13px!important;font-weight:800!important;text-transform:none!important;letter-spacing:0!important;resize:vertical}.teamDataImportActions{display:grid;grid-template-columns:1fr 1.3fr;gap:10px;margin-top:14px}.teamDataImportActions button{border:1px solid #45455e;border-radius:13px;background:#202033;color:#fff;padding:13px 10px;font-weight:950}.teamDataImportActions button:last-child{border-color:transparent;background:linear-gradient(135deg,var(--righello),var(--righello2))}.teamDataImportActions button:disabled{opacity:.65}@media(max-width:520px){.teamDataImportActions{grid-template-columns:1fr}.teamDataImportSheet textarea{min-height:76px}}

/* =========================================================
   fix19 - menu hamburger Paolo + Suoni identico agli altri
   ========================================================= */
#drawer.overlay {
  align-items: center !important;
  justify-content: center !important;
}

.menuSheetModern {
  width: min(92vw, 430px) !important;
  max-height: min(84dvh, 650px) !important;
  padding: 22px 20px 24px !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 50% -10%, rgba(80,126,190,.20), transparent 36%),
    radial-gradient(circle at 8% 10%, rgba(255,0,138,.12), transparent 30%),
    linear-gradient(180deg, rgba(12,25,43,.98), rgba(8,15,26,.98)) !important;
  border: 1px solid rgba(90,140,200,.30) !important;
  box-shadow: 0 28px 90px rgba(0,0,0,.62) !important;
  overflow-y: auto !important;
  scrollbar-width: none !important;
}

.menuSheetModern::-webkit-scrollbar { display: none !important; }

.menuGrab {
  width: 44px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.25);
  margin: 0 auto 18px;
}

.menuSheetModern h2 {
  margin: 0 56px 24px 4px !important;
  font-size: 24px !important;
  letter-spacing: -.02em !important;
  line-height: 1 !important;
}

.menuSheetModern .menuClose {
  top: 38px !important;
  right: 24px !important;
  width: 46px !important;
  min-width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  font-size: 30px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
}

.menuQuickGrid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: start !important;
  justify-items: center !important;
  width: 100% !important;
  margin: 8px 0 22px !important;
}

.menuQuickGrid > .menuTopAction,
#drawer .menuSheetModern .menuQuickGrid > .menuTopAction,
#drawer .menuSheetModern .menuQuickGrid > #soundToggle.menuTopAction {
  all: unset !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 128px !important;
  min-height: 128px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  text-align: center !important;
  cursor: pointer !important;
  color: rgba(255,255,255,.92) !important;
  -webkit-tap-highlight-color: transparent !important;
}

.menuQuickGrid > .menuTopAction > .menuTopIcon,
#drawer .menuSheetModern .menuQuickGrid > .menuTopAction > .menuTopIcon,
#soundToggleIcon {
  box-sizing: border-box !important;
  width: 76px !important;
  min-width: 76px !important;
  max-width: 76px !important;
  height: 76px !important;
  min-height: 76px !important;
  max-height: 76px !important;
  flex: 0 0 76px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
  font-size: 34px !important;
  line-height: 1 !important;
  text-align: center !important;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.10), transparent 42%),
    rgba(255,255,255,.065) !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  box-shadow: inset 0 0 26px rgba(255,255,255,.035) !important;
}

#tutorialFullButton > .menuTopIcon {
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.12), transparent 42%),
    rgba(255,0,138,.13) !important;
  border-color: rgba(255,0,138,.28) !important;
}

#soundToggle > .menuTopIcon {
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.12), transparent 42%),
    rgba(45,110,200,.14) !important;
  border-color: rgba(90,160,255,.25) !important;
}

.menuQuickGrid > .menuTopAction > b,
#drawer .menuSheetModern .menuQuickGrid > .menuTopAction > b,
#soundToggleLabel {
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  text-align: center !important;
  font-size: 13px !important;
  line-height: 1.18 !important;
  font-weight: 760 !important;
  color: rgba(255,255,255,.92) !important;
  white-space: normal !important;
}

#soundToggle::before,
#soundToggle::after {
  content: none !important;
  display: none !important;
}

.menuDivider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.13), transparent);
  margin: 18px 0;
}

.menuMiniGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.menuMiniAction {
  min-height: 62px !important;
  height: 62px !important;
  padding: 0 13px !important;
  border-radius: 18px !important;
  display: grid !important;
  grid-template-columns: 36px 1fr 14px !important;
  align-items: center !important;
  gap: 8px !important;
  text-align: left !important;
  background: rgba(255,255,255,.055) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  color: rgba(255,255,255,.88) !important;
  margin: 0 !important;
}

.menuMiniAction span {
  color: #ff7fac;
  font-size: 25px;
}

.menuMiniAction b {
  font-size: 13px;
  line-height: 1.12;
  font-weight: 760;
}

.menuMiniAction i,
.menuListAction i {
  font-style: normal;
  color: rgba(255,255,255,.55);
  font-size: 24px;
  line-height: 1;
}

.menuListAction {
  min-height: 58px !important;
  height: 58px !important;
  width: 100% !important;
  margin: 10px 0 0 !important;
  padding: 0 15px !important;
  border-radius: 16px !important;
  display: grid !important;
  grid-template-columns: 40px 1fr 20px !important;
  align-items: center !important;
  gap: 9px !important;
  text-align: left !important;
  background: rgba(255,255,255,.052) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  color: rgba(255,255,255,.90) !important;
}

.menuListAction span {
  font-size: 25px;
  opacity: .9;
}

.menuListAction b {
  font-size: 15px;
  font-weight: 760;
}

.menuExit {
  color: #ff9ab2 !important;
  border-color: rgba(255,83,100,.20) !important;
  background: rgba(255,83,100,.055) !important;
}

.menuSheetModern .buffrConnectButton {
  background: linear-gradient(135deg, rgba(12,111,104,.72), rgba(7,52,74,.86)) !important;
  border-color: rgba(86,242,212,.34) !important;
}

.menuSheetModern .cameraSyncButton {
  background: linear-gradient(135deg, rgba(23,43,25,.82), rgba(15,69,40,.90)) !important;
  border-color: rgba(42,168,97,.45) !important;
  color: #ddffe8 !important;
}

.menuQuickGrid > .menuTopAction.hidden {
  visibility: hidden !important;
  pointer-events: none !important;
}

@media(max-width: 390px), (max-height: 760px) {
  .menuQuickGrid > .menuTopAction,
  #drawer .menuSheetModern .menuQuickGrid > .menuTopAction,
  #drawer .menuSheetModern .menuQuickGrid > #soundToggle.menuTopAction {
    height: 112px !important;
    min-height: 112px !important;
    gap: 8px !important;
  }

  .menuQuickGrid > .menuTopAction > .menuTopIcon,
  #drawer .menuSheetModern .menuQuickGrid > .menuTopAction > .menuTopIcon,
  #soundToggleIcon {
    width: 66px !important;
    min-width: 66px !important;
    max-width: 66px !important;
    height: 66px !important;
    min-height: 66px !important;
    max-height: 66px !important;
    flex-basis: 66px !important;
    font-size: 30px !important;
  }

  .menuQuickGrid > .menuTopAction > b,
  #drawer .menuSheetModern .menuQuickGrid > .menuTopAction > b,
  #soundToggleLabel {
    font-size: 12px !important;
  }
}

/* fix20 - Sound top action hard reset: never render as plain text */
#drawer .menuSheetModern .menuQuickGrid > #soundToggle.menuTopAction {
  all: unset !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 128px !important;
  min-height: 128px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  text-align: center !important;
  cursor: pointer !important;
  color: rgba(255,255,255,.92) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  -webkit-tap-highlight-color: transparent !important;
}

#drawer .menuSheetModern .menuQuickGrid > #soundToggle.menuTopAction > #soundToggleIcon,
#drawer .menuSheetModern .menuQuickGrid > #soundToggle.menuTopAction > .menuTopIcon {
  box-sizing: border-box !important;
  width: 76px !important;
  min-width: 76px !important;
  max-width: 76px !important;
  height: 76px !important;
  min-height: 76px !important;
  max-height: 76px !important;
  flex: 0 0 76px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
  font-size: 34px !important;
  line-height: 1 !important;
  text-align: center !important;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.12), transparent 42%),
    rgba(45,110,200,.14) !important;
  border: 1px solid rgba(90,160,255,.25) !important;
  box-shadow: inset 0 0 26px rgba(255,255,255,.035) !important;
}

#drawer .menuSheetModern .menuQuickGrid > #soundToggle.menuTopAction > #soundToggleLabel,
#drawer .menuSheetModern .menuQuickGrid > #soundToggle.menuTopAction > b {
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  text-align: center !important;
  font-size: 13px !important;
  line-height: 1.18 !important;
  font-weight: 760 !important;
  color: rgba(255,255,255,.92) !important;
  white-space: normal !important;
}

@media(max-width: 390px), (max-height: 760px) {
  #drawer .menuSheetModern .menuQuickGrid > #soundToggle.menuTopAction {
    height: 112px !important;
    min-height: 112px !important;
    gap: 8px !important;
  }
  #drawer .menuSheetModern .menuQuickGrid > #soundToggle.menuTopAction > #soundToggleIcon,
  #drawer .menuSheetModern .menuQuickGrid > #soundToggle.menuTopAction > .menuTopIcon {
    width: 66px !important;
    min-width: 66px !important;
    max-width: 66px !important;
    height: 66px !important;
    min-height: 66px !important;
    max-height: 66px !important;
    flex-basis: 66px !important;
    font-size: 30px !important;
  }
  #drawer .menuSheetModern .menuQuickGrid > #soundToggle.menuTopAction > #soundToggleLabel,
  #drawer .menuSheetModern .menuQuickGrid > #soundToggle.menuTopAction > b {
    font-size: 12px !important;
  }
}

/* fix21 - menu list labels never overflow horizontally */
.menuSheetModern .menuListAction {
  min-width: 0 !important;
  overflow: hidden !important;
}

.menuSheetModern .menuListAction b {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.menuSheetModern #cameraSyncButton b {
  letter-spacing: -.01em !important;
}

/* fix22 - menu order: core actions first, technical sync/buffr last */
.menuSheetModern #cameraSyncButton,
.menuSheetModern #buffrConnect.menuSecondaryLast {
  min-height: 50px !important;
  height: 50px !important;
  opacity: .88 !important;
}

.menuSheetModern #cameraSyncButton b,
.menuSheetModern #buffrConnect.menuSecondaryLast b {
  font-size: 13px !important;
  font-weight: 720 !important;
}

.menuSheetModern #cameraSyncButton span,
.menuSheetModern #buffrConnect.menuSecondaryLast span {
  font-size: 20px !important;
}

.menuSheetModern #buffrConnect.menuSecondaryLast {
  margin-top: 8px !important;
}

/* I numeri grezzi sotto la frase: servono al cronista per accorgersi al volo
   se il modello ha arrotondato o inventato, prima di leggerla in diretta. */
.teamAiDati{display:block;margin-top:4px;opacity:.62;font-size:11.5px;letter-spacing:.2px}

/* fix23 - swipe-to-delete roster: trailing action mobile reale */
.rosterRow {
  position: relative !important;
  display: block !important;
  min-height: 66px;
  padding: 0 !important;
  overflow: hidden;
  touch-action: pan-y;
  border-radius: 15px;
  background: linear-gradient(135deg,#a32638,#d04257) !important;
}

.rosterRowContent {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(76px,94px) minmax(0,1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 66px;
  padding: 5px;
  border-radius: 14px;
  background: #102d3e;
  transition: transform .22s cubic-bezier(.22,.75,.25,1), background .2s;
  will-change: transform;
}

.awayRosterRow .rosterRowContent {
  background: #282742;
}

.rosterRow.isStarter .rosterRowContent {
  background: #184d42;
}

.rosterRow.pendingDelete {
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

.rosterRow.pendingDelete .rosterRowContent {
  transform: translateX(-64px);
}

.rosterRow .removePlayer {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  width: 64px;
  min-width: 64px;
  height: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0 14px 14px 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
  font-size: 34px;
  line-height: 1;
}

.rosterRow.deleting {
  transform: translateX(40px);
}

@media(max-width:560px) {
  .rosterRowContent {
    grid-template-columns: 96px minmax(0,1fr);
    gap: 6px;
  }

  .rosterNumberCell {
    grid-template-columns: 44px minmax(40px,1fr);
  }

  .starterToggle {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  #addHome,
  #addAway {
    min-height: 44px;
    padding-block: 9px;
  }
}

@media (hover:hover) and (pointer:fine) {
  .rosterRowContent {
    width: calc(100% - 54px);
    border-radius: 14px 0 0 14px;
  }
  .rosterRow .removePlayer {
    width: 54px;
    min-width: 54px;
  }
  .rosterRow.pendingDelete .rosterRowContent {
    transform: none;
  }
}

/* fix24 - duplicate roster errors stay current and readable */
.rosterRow.rosterDuplicateError {
  outline: 2px solid #ff4f69 !important;
}

.rosterRow.rosterDuplicateError .rosterRowContent {
  box-shadow: inset 0 0 0 2px #ff4f69;
}

.rosterErrorIcon {
  z-index: 4;
  top: 50%;
  right: 70px;
  transform: translateY(-50%);
  pointer-events: none;
}

@media(max-width:560px) {
  .rosterErrorIcon {
    display: none !important;
  }
}

/* fix25 - espulsi visibili nella rosa, esclusi solo dalle azioni di gioco */
.rosterRow.isSentOff {
  outline: 2px solid #ef435d !important;
}

.rosterRow.isSentOff .rosterRowContent {
  background: linear-gradient(135deg,rgba(114,25,42,.94),rgba(46,29,53,.96));
}

.rosterRow.isSentOff .starterChip {
  display: none !important;
}

.playerMatchStatus {
  justify-self: start;
  padding: 3px 8px;
  border: 1px solid rgba(255,105,126,.72);
  border-radius: 999px;
  background: rgba(171,27,50,.72);
  color: #ffe4e8;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .03em;
}

/* fix26 - guida visiva per fotografare la distinta senza prospettiva */
.wizardSheet {
  width: min(440px,100%);
}

.rosterDocumentGuide {
  display: grid;
  gap: 10px;
  margin: 14px 0 12px;
}

.rosterGuideFrame {
  position: relative;
  width: min(56vw,190px);
  min-height: 0;
  aspect-ratio: 210 / 297;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(100,180,255,.38);
  border-radius: 20px;
  background:
    linear-gradient(rgba(255,255,255,.045) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.045) 1px,transparent 1px),
    radial-gradient(circle at 50% 42%,rgba(32,107,166,.28),transparent 56%),
    #07131f;
  background-size: 33.333% 33.333%,33.333% 33.333%,auto,auto;
  box-shadow: inset 0 0 55px rgba(0,0,0,.52);
}

.rosterGuidePaper {
  position: absolute;
  inset: 15% 12%;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255,255,255,.22);
  border-radius: 8px;
  background: linear-gradient(135deg,rgba(255,255,255,.07),rgba(255,255,255,.025));
}

.rosterGuidePaper span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(4,13,22,.78);
  color: rgba(255,255,255,.72);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .09em;
}

.rosterGuideCorner {
  position: absolute;
  z-index: 2;
  width: 46px;
  height: 46px;
  border-color: #27e6b1;
  filter: drop-shadow(0 0 8px rgba(39,230,177,.46));
}

.cornerTopLeft { top: 10%; left: 8%; border-top: 5px solid #27e6b1; border-left: 5px solid #27e6b1; border-radius: 10px 0 0; }
.cornerTopRight { top: 10%; right: 8%; border-top: 5px solid #27e6b1; border-right: 5px solid #27e6b1; border-radius: 0 10px 0 0; }
.cornerBottomLeft { bottom: 10%; left: 8%; border-bottom: 5px solid #27e6b1; border-left: 5px solid #27e6b1; border-radius: 0 0 0 10px; }
.cornerBottomRight { right: 8%; bottom: 10%; border-right: 5px solid #27e6b1; border-bottom: 5px solid #27e6b1; border-radius: 0 0 10px; }

.rosterGuideTips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.rosterGuideTips span {
  padding: 6px 9px;
  border: 1px solid rgba(117,182,232,.28);
  border-radius: 999px;
  background: rgba(20,45,68,.72);
  color: #c8e8ff;
  font-size: 11px;
  font-weight: 850;
}

.wizardSheet .rosterCameraButton {
  min-height: 54px;
  margin: 10px 0 7px;
  border: 1px solid rgba(39,230,177,.72);
  background: linear-gradient(135deg,#116b59,#159176);
  color: #fff;
}

.wizardSheet .rosterGalleryButton {
  min-height: 46px;
  margin: 0 0 8px;
  padding: 13px;
  border-style: solid;
  background: rgba(16,38,64,.82);
  color: #c7d9eb;
  font-size: 13px;
}

@media(max-height:700px) {
  .rosterGuideFrame {
    min-height: 170px;
  }
  .rosterGuideTips {
    display: none;
  }
}

/* fix27 - fotocamera browser con mirino realmente sovrapposto al video */
.documentCamera {
  position: fixed;
  inset: 0;
  z-index: 22000;
  overflow: hidden;
  background: #000;
  color: #fff;
  touch-action: none;
}

.documentCamera > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050505;
}

.documentCameraTop {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 92px;
  padding: calc(13px + env(safe-area-inset-top)) 18px 14px;
  background: linear-gradient(rgba(0,0,0,.78),rgba(0,0,0,.36) 62%,transparent);
}

.documentCameraTop button {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  padding: 0 0 3px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 50%;
  background: rgba(15,20,25,.58);
  box-shadow: inset 0 1px rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
  font-size: 29px;
  line-height: 1;
}

.documentCameraTop div {
  display: grid;
  gap: 2px;
  text-shadow: 0 2px 8px #000;
}

.documentCameraTop b { font-size: 17px; letter-spacing: -.01em; }
.documentCameraTop small { color: rgba(255,255,255,.76); font-size: 11px; }

.documentCameraGuide {
  position: absolute;
  z-index: 3;
  top: 46%;
  left: 50%;
  width: min(74vw,420px);
  max-height: 61dvh;
  aspect-ratio: 210 / 297;
  transform: translate(-50%,-50%);
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,.9);
  border-radius: 20px;
  box-shadow: 0 0 0 200vmax rgba(0,0,0,.34),0 0 0 1px rgba(0,0,0,.16),0 10px 34px rgba(0,0,0,.22);
  transition: border-color .22s,box-shadow .22s;
}

.documentCameraGuide[data-quality="ready"] {
  border-color: rgba(74,225,173,.96);
  box-shadow: 0 0 0 200vmax rgba(0,0,0,.30),0 0 0 1px rgba(74,225,173,.18),0 0 22px rgba(74,225,173,.16);
}

.documentCameraGuide[data-quality="warning"] {
  border-color: rgba(255,197,89,.96);
}

.documentCameraCorner {
  position: absolute;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-color: #4ae1ad;
  filter: drop-shadow(0 0 5px rgba(74,225,173,.46));
  transition: border-color .22s,filter .22s;
}

.cameraTopLeft { top: -2px; left: -2px; border-top: 4px solid #4ae1ad; border-left: 4px solid #4ae1ad; border-radius: 19px 0 0; }
.cameraTopRight { top: -2px; right: -2px; border-top: 4px solid #4ae1ad; border-right: 4px solid #4ae1ad; border-radius: 0 19px 0 0; }
.cameraBottomLeft { bottom: -2px; left: -2px; border-bottom: 4px solid #4ae1ad; border-left: 4px solid #4ae1ad; border-radius: 0 0 0 19px; }
.cameraBottomRight { right: -2px; bottom: -2px; border-right: 4px solid #4ae1ad; border-bottom: 4px solid #4ae1ad; border-radius: 0 0 19px; }

.documentCameraGuide[data-quality="warning"] .documentCameraCorner {
  border-color: #ffc559;
  filter: drop-shadow(0 0 4px rgba(255,197,89,.38));
}

.documentCameraScanLine {
  position: absolute;
  z-index: 1;
  left: 11%;
  right: 11%;
  top: 18%;
  height: 2px;
  border-radius: 999px;
  background: rgba(96,172,255,.88);
  box-shadow: 0 0 7px rgba(35,140,255,.58);
  animation: documentScan 2.8s ease-in-out infinite alternate;
}

@keyframes documentScan {
  to { top: 82%; }
}

.documentCameraGuideLabel {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(7,13,18,.66);
  color: rgba(255,255,255,.86);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .08em;
  white-space: nowrap;
}

.documentCameraBottom {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 14px;
  padding: 28px 20px calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent,rgba(0,0,0,.48) 26%,rgba(0,0,0,.9) 58%);
  text-align: center;
}

.documentCameraBottom > span {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(7,12,18,.6);
  box-shadow: 0 5px 18px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 5px #000;
}

.documentCameraBottom > span::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8fa1b2;
  box-shadow: 0 0 0 4px rgba(143,161,178,.13);
  content: "";
}

.documentCameraBottom > span[data-quality="ready"]::before {
  background: #4ae1ad;
  box-shadow: 0 0 0 4px rgba(74,225,173,.14),0 0 10px rgba(74,225,173,.45);
}

.documentCameraBottom > span[data-quality="warning"]::before {
  background: #ffc559;
  box-shadow: 0 0 0 4px rgba(255,197,89,.14);
}

.documentCameraActions {
  display: grid;
  grid-template-columns: minmax(88px,1fr) 84px minmax(88px,1fr);
  align-items: center;
  gap: 18px;
}

#documentCameraCancel,
#documentCameraTorch {
  min-height: 48px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  background: rgba(16,21,27,.58);
  color: #fff;
  box-shadow: inset 0 1px rgba(255,255,255,.1);
  backdrop-filter: blur(14px);
  font-weight: 850;
}

#documentCameraTorch {
  justify-self: end;
  width: 48px;
  padding: 0;
  font-size: 21px;
}

#documentCameraTorch[aria-pressed="true"] {
  border-color: rgba(255,230,107,.76);
  background: rgba(255,230,107,.92);
  color: #151515;
  box-shadow: 0 0 24px rgba(255,230,107,.32);
}

#documentCameraCapture {
  justify-self: center;
  width: 82px;
  height: 82px;
  padding: 6px;
  border: 3px solid rgba(255,255,255,.96);
  border-radius: 50%;
  background: rgba(8,12,16,.44);
  box-shadow: 0 6px 24px rgba(0,0,0,.28);
}

#documentCameraCapture i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  transition: transform .12s,background .12s;
}

#documentCameraCapture:active i { transform: scale(.88); }
#documentCameraCapture:disabled i { background: #80a5b5; }

@media (orientation: landscape) and (max-height:560px) {
  .documentCameraGuide {
    width: min(62vw,620px);
    max-height: 76dvh;
    aspect-ratio: 297 / 210;
    top: 49%;
  }
  .documentCameraBottom { left: auto; width: 250px; background: linear-gradient(90deg,transparent,rgba(0,0,0,.84) 32%); }
  .documentCameraActions { grid-template-columns: 1fr 70px; }
  #documentCameraTorch { display: none!important; }
  #documentCameraCapture { width: 68px; height: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  .documentCameraScanLine { animation: none; top: 50%; }
}
