/* Smartphone: colori e componenti della lega, comandi accessibili al tocco. */
.admin-tools{position:relative}
.admin-tools>summary{font-size:14px;cursor:pointer;padding:12px;border:1px solid var(--border,#dce3dd);border-radius:10px;color:#226b40;font-weight:700;min-height:44px;box-sizing:border-box}
.admin-tools-content{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:16px;background:var(--surface,#fff);border:1px solid var(--border,#dce3dd);border-radius:12px}
.admin-tools[open] .admin-tools-content{position:absolute;right:0;top:calc(100% + 8px);width:min(440px,80vw);z-index:30;box-sizing:border-box}
.lineup-competition-tabs{display:flex;flex-wrap:wrap;gap:8px;width:100%}
.lineup-competition-tabs button{min-height:44px;padding:10px 18px;border:1px solid #b7d0bf;border-radius:10px;background:#fff;color:#226b40;font:inherit;font-weight:700;cursor:pointer}
.lineup-competition-tabs button[aria-pressed="true"]{background:#146b3b;color:#fff;border-color:#146b3b}
.lineup-controls [hidden]{display:none!important}
.lineup-submit-bar{padding:16px 0;background:var(--surface,#fff);border-top:1px solid var(--border,#dce3dd)}
.lineup-submit-bar .file-feedback:empty{display:none}
.lineup-submit-bar .file-feedback{margin:8px 0;max-height:140px;overflow:auto;color:#226b40}
#lineupSubmissionSummary{margin:0 0 10px;line-height:1.5}
#lineupEditor :is(button,input,select):focus-visible,.topbar :is(button,a,select,summary):focus-visible{outline:3px solid #087843;outline-offset:3px}
@media(min-width:761px){
 .admin-tools>summary{display:none}
 .admin-tools-content,.admin-tools[open] .admin-tools-content{display:flex;position:static;width:auto;padding:0;border:0;background:transparent}
 .admin-tools:not([open])>.admin-tools-content{display:flex}
}
@media(max-width:760px){
 .main-content{min-width:0}.app-shell{max-width:100%}
 body .topbar,body.league-admin .topbar,body:not(.league-admin) .topbar{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto;gap:12px;padding:12px;position:relative}
 body .topbar>.topbar-maker,body.league-admin .topbar>.topbar-maker,body:not(.league-admin) .topbar>.topbar-maker{grid-column:1;grid-row:1;width:120px;justify-self:start}
 body .topbar>.topbar-right,body.league-admin .topbar>.topbar-right,body:not(.league-admin) .topbar>.topbar-right{grid-column:1;grid-row:2;justify-self:stretch;display:flex;flex-wrap:wrap;gap:8px}
 body .topbar>.nav-list,body.league-admin .topbar>.nav-list,body:not(.league-admin) .topbar>.nav-list{grid-column:1;grid-row:3;justify-self:stretch;display:flex;flex-wrap:wrap;overflow:visible;gap:8px;max-width:100%;padding:0;border:0;background:transparent}
 .topbar .nav-item{min-height:44px;box-sizing:border-box;padding:10px 12px;font-size:13px;flex:1 1 auto;justify-content:center;white-space:nowrap}
 .topbar .nav-icon{font-size:16px}
 .topbar-right #leagueLoginButton{height:auto;min-height:44px;min-width:0;max-width:none;flex:1;padding:10px 12px;margin:0;font-size:14px;white-space:normal;overflow-wrap:anywhere}
 .topbar-right #leagueLogout{height:44px;font-size:13px;padding:0 16px;margin:0}
 .admin-tools{flex:1 0 100%;min-width:0}
 .admin-tools[open] .admin-tools-content{position:static;width:100%;margin-top:8px;display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding:12px}
 .topbar-right .admin-tools :is(button,select){height:auto;min-height:44px;font-size:14px;max-width:100%;margin:0}
 .admin-tools .archive-folder-button{width:auto;min-width:44px;justify-content:flex-start;padding:10px 12px}.admin-tools .archive-folder-button>span{position:static;width:auto;height:auto;clip:auto;overflow:visible}.admin-tools .archive-folder-button::after{right:0;width:min(240px,calc(100vw - 72px))}
 .admin-tools .season-switcher{display:flex;flex-wrap:wrap;gap:8px}.admin-tools #globalStatus{font-size:13px}.admin-tools .status-dot{display:none}
 #lineupEditor{min-width:0;max-width:100%}
 #lineupEditor .compact-heading{flex-wrap:wrap;gap:12px}#closeLineupEditor{width:auto;min-width:44px;padding:10px 14px;font-size:13px;margin:0}
 .lineup-controls{gap:12px;margin:16px 0}
 .lineup-controls .select-control,.lineup-same-formation{min-width:0;width:100%;flex:1 1 100%;box-sizing:border-box}
 .lineup-editor :is(input,select),.auth-modal :is(input,select){min-height:44px;font-size:16px;box-sizing:border-box}
 .lineup-editor button,.auth-modal button{min-height:44px}
 .lineup-competition-tabs button{flex:1;min-width:0;overflow-wrap:anywhere;font-size:14px}
 .lineup-same-formation input[type=checkbox]{min-height:24px;width:24px;height:24px;flex-basis:24px}
 .lineup-same-formation{font-size:15px;line-height:1.5}
 #lineupFixtures li{font-size:14px;gap:8px;align-items:stretch}
 #lineupFixtures button{min-height:44px;flex:1;text-align:left;padding:10px 0}
 #lineupFixtures .lineup-calendar-dash{align-self:center}
 #lineupFixtures .lineup-calendar-card.has-cups{grid-template-columns:minmax(0,1fr)}
 #lineupFixtures .has-cups .lineup-calendar-cups{border-left:0;border-top:1px solid #dce8df}
 #directLineupForm .team-table-wrap{overflow:visible;border:0;background:transparent}
 #directLineupForm .team-table{display:block;width:100%;min-width:0;background:transparent}
 #directLineupForm .team-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 #directLineupForm .team-table tbody{display:grid;gap:12px;width:100%}
 #directLineupForm .team-table tr{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:14px;border:1px solid var(--border,#dce3dd);border-radius:12px;background:#fff}
 #directLineupForm .team-table td{display:block;min-width:0;width:auto;padding:0;border:0;white-space:normal}
 #directLineupForm .lineup-role-cell{grid-column:1/-1;grid-row:1;color:#226b40;font-weight:700;font-size:14px}
 #directLineupForm .lineup-player-cell{grid-column:1/-1;grid-row:2}
 #directLineupForm .lineup-shirt-cell{grid-column:1;grid-row:3}
 #directLineupForm .lineup-penalty-cell{grid-column:2;grid-row:3}
 #directLineupForm td[data-label]::before{content:attr(data-label);display:block;font-size:13px;color:#56735f;margin-bottom:6px}
 #directLineupForm input[type=number]{width:100%}.lineup-role-note{font-size:13px;line-height:1.5}
 .lineup-submit-bar{position:sticky;bottom:0;z-index:5;padding:12px 0 calc(12px + env(safe-area-inset-bottom));border-top:1px solid #b7d0bf}
 #saveDirectLineup{width:100%;min-height:48px;justify-content:center;font-size:15px}
 #lineupSubmissionSummary{font-size:13px}
 .auth-modal .season-modal{box-sizing:border-box;width:100%;max-width:100%;max-height:90dvh;padding:20px}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}.topbar *,#lineupEditor *{animation:none!important;transition:none!important}}

.previous-lineup-note p{padding:12px 0;border-bottom:1px solid #dce8df;overflow-wrap:anywhere}.previous-lineup-note button,#loadPreviousFormationsButton{width:auto;min-width:0;min-height:44px;padding:0 14px;margin:8px 8px 0 0;white-space:normal;max-width:100%;line-height:1.3;font-size:12px}.previous-lineup-note button{display:inline-flex;align-items:center;justify-content:center}

.home-recent-results{margin-top:24px;padding:24px}.home-recent-results>.small-note{margin:0 0 16px}.home-recent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.home-recent-match{padding:16px;border:1px solid #dce8df;border-radius:16px;background:#fff;min-width:0}.home-recent-match>small{display:block;color:#526d5d;overflow-wrap:anywhere}.home-recent-match>p{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:12px;align-items:center;margin:12px 0 0}.home-recent-match span{font-weight:600;overflow-wrap:anywhere}.home-recent-match span:last-child{text-align:right}.home-recent-match strong{padding:6px 12px;border-radius:999px;background:#087f46;color:#fff;white-space:nowrap}@media(max-width:1000px){.home-recent-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.home-recent-results{padding:16px}.home-recent-grid{grid-template-columns:minmax(0,1fr)}}

/* Home: played and upcoming fixtures, with standings on the right. */
.home-results-board{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:24px;margin-top:24px;align-items:start}.home-results-board>.home-full-standings{min-width:0;margin-top:0}.home-results-board .home-recent-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0}.home-result-column{display:grid;grid-template-rows:auto minmax(0,1fr) minmax(0,1fr);min-width:0;padding:0 14px}.home-result-column+ .home-result-column{border-left:1px solid #dce8df}.home-result-column>h3{margin:0 0 12px;font-size:18px;color:#16462d}.home-result-half{padding:12px 0;min-width:0}.home-result-half h4{font-size:13px;line-height:1.5;margin:0 0 10px;color:#526d5d}.home-result-column>.home-result-half:last-child,.home-cup-half:last-child{border-top:1px solid #dce8df}.home-result-line{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:8px;margin:0;padding:9px 0;border-bottom:1px solid #e5eee8;font-size:13px;line-height:1.4}.home-result-line span{overflow-wrap:anywhere}.home-result-line span:last-child{text-align:right}.home-result-line strong{background:#087f46;color:#fff;border-radius:8px;padding:3px 7px;white-space:nowrap}.home-result-line i{font-style:normal;color:#526d5d}.home-result-half .home-empty{font-size:14px;padding:12px 0}.home-results-board .home-full-standings-heading{flex-wrap:wrap;gap:12px}.home-intro:has(>.home-intro-copy:only-child){display:block}.home-intro:has(>.home-intro-copy:only-child)>.home-intro-copy{width:100%}
@media(max-width:1100px){.home-results-board{grid-template-columns:minmax(0,1fr)}}@media(max-width:600px){.home-results-board .home-recent-grid{grid-template-columns:minmax(0,1fr)}.home-result-column{padding:0}.home-result-column+ .home-result-column{border-left:0;border-top:1px solid #dce8df;padding-top:20px;margin-top:12px}.home-result-column{grid-template-rows:auto auto auto}.home-results-board{gap:16px}.home-result-line{font-size:14px}}

/* Keep phase titles attached to fixtures without stretching either half. */
.home-results-board .home-recent-grid{align-items:start}.home-result-column{grid-template-rows:auto auto auto;align-content:start;align-items:start;min-height:0}.home-cup-half,.home-result-half{min-height:0;align-content:start}.home-result-half h4{margin-bottom:8px}.home-result-list{overflow:visible}

/* Same centered slot for scores and upcoming fixtures. */
.home-result-line{grid-template-columns:minmax(0,1fr) 86px minmax(0,1fr)}.home-result-line>strong,.home-result-line>i{justify-self:center;text-align:center}
@media(max-width:760px){.home-result-line{grid-template-columns:minmax(0,1fr) 58px minmax(0,1fr)}}

/* Reserve played and upcoming sections, including empty cup rounds. */
.home-cup-half{box-sizing:border-box}.home-result-column>h3{min-height:27px}.home-result-spacer{padding:12px 0}.home-result-column>.home-cup-half:last-child{border-top:1px solid #dce8df;padding-top:12px}
@media(max-width:600px){.home-result-spacer{display:none}.home-result-column>h3{min-height:0}}

/* All imported formations, visible without an accordion or item limit. */
.home-imported-formations{margin-top:24px;width:100%;box-sizing:border-box}.home-formations-pitch{position:relative;padding:20px;border:1px solid #2b7854;border-radius:12px;background:repeating-linear-gradient(90deg,#164b35 0%,#164b35 14%,#1c5b40 14%,#1c5b40 28%);color:#fff}.home-imported-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;list-style:none;margin:0;padding:0}.home-imported-grid>li{display:grid;gap:8px;align-content:start;text-align:center;min-width:0}.home-imported-grid>li>b{justify-self:center;padding:4px 10px;border-radius:6px;background:#087f46;color:#fff}.home-imported-grid>li>span{padding:8px;border-radius:8px;background:rgba(0,0,0,.22);color:#fff;overflow-wrap:anywhere}.home-imported-grid>.home-formations-empty{grid-column:1/-1;padding:20px 10px;color:#fff}
@media(max-width:1000px){.home-imported-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.home-imported-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.home-formations-pitch{padding:14px}.home-imported-formations{margin-top:16px}}

/* Original crests beside team names; names remain readable on the pitch. */
.home-imported-grid>li>span{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px}.home-imported-grid>li>span>strong{color:#fff;font-size:14px;font-weight:600;line-height:1.3;min-width:0;overflow-wrap:anywhere}.home-formation-crest{display:block;width:32px;height:38px;flex:none;object-fit:contain;filter:drop-shadow(0 1px 2px rgba(0,26,18,.6))}

/* Season-specific team branding controls. */
.registry-logo-tools{display:flex;align-items:center;gap:8px;min-width:0;flex-wrap:wrap;margin-top:8px}.registry-logo-preview{display:grid;place-items:center;width:44px;height:44px;flex:none;overflow:hidden;border:1px solid #dce8df;border-radius:8px;background:#fff;color:#087f46;font-size:24px}.registry-logo-preview img{display:block;width:100%;height:100%;object-fit:contain;padding:3px;box-sizing:border-box}.registry-logo-button,.registry-logo-reset{min-height:44px;padding:8px 12px;border:1px solid #dce8df;border-radius:8px;background:#fff;color:#16462d;font-family:inherit;font-size:13px;font-weight:600;cursor:pointer}.registry-logo-button:focus-visible,.registry-logo-reset:focus-visible{outline:2px solid #087f46;outline-offset:2px}.registry-logo-reset{color:#526d5d}.registry-name{min-width:0}

/* Season branding beside displayed team names. */
.team-name-with-crest{display:inline-flex;align-items:center;gap:.34em;vertical-align:baseline;max-width:100%;white-space:normal;overflow-wrap:anywhere}.team-name-with-crest>img{display:inline-block;width:1.18em;height:1.18em;flex:none;object-fit:contain;vertical-align:-.2em}

.team-name-with-crest[data-side=right]{flex-direction:row-reverse}

/* Formation previews use a dedicated crest, separate from name decoration. */
.home-imported-grid .home-formation-crest{width:27px;height:33px;min-width:27px;max-width:27px;min-height:33px;max-height:33px;object-fit:contain;flex:none;padding:0;background:none;border:0}.home-imported-grid .home-formation-name{color:#fff;min-width:0}

/* Explicit team crests in results and calendar. */
.match-card h3>span{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis}.match-card h3>span:last-of-type{text-align:right}.match-card h3 .team-name-with-crest{max-width:100%;vertical-align:middle}.calendar-fixture-teams{display:flex;align-items:center;gap:.32em;min-width:0;white-space:nowrap}.calendar-fixture-teams>span:first-child,.calendar-fixture-teams>span:last-child{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis}.calendar-fixture-teams>span:last-child{text-align:right}.calendar-fixture-teams .team-name-with-crest{max-width:100%;vertical-align:middle}.calendar-fixture-teams .team-name-with-crest>span{overflow:hidden;text-overflow:ellipsis}.fixture-dash{flex:none}.fixture-team-pair{display:flex;align-items:center;gap:.25em;min-width:0}.fixture-team-pair>.team-name-with-crest{min-width:0;overflow:hidden;text-overflow:ellipsis}.fixture-team-pair>.team-name-with-crest:last-child{justify-content:flex-end}

/* Calendar fixtures keep home, score and away in independent columns. */
.calendar-fixture{display:grid;grid-template-columns:minmax(0,1fr) 48px minmax(0,1fr);gap:8px;align-items:center}.calendar-fixture>.calendar-fixture-home{text-align:left;min-width:0}.calendar-fixture>.calendar-fixture-away{text-align:right;min-width:0}.calendar-fixture>.calendar-fixture-score{justify-self:center;text-align:center;white-space:nowrap}.calendar-fixture .team-name-with-crest{max-width:100%;white-space:normal;align-items:center;overflow:visible}.calendar-fixture .team-name-with-crest>span{min-width:0;white-space:normal;overflow-wrap:anywhere;overflow:visible;text-overflow:clip}.calendar-fixture .team-name-with-crest>img{flex:none}
@media(max-width:600px){.calendar-fixture{grid-template-columns:minmax(0,1fr) 40px minmax(0,1fr);gap:6px}}

/* Factor evidence, match scorers and cumulative Fair Play. */
.factor-evidence{grid-column:1/-1;min-width:0;padding:5px 8px;background:var(--neutral-100);border-radius:7px;color:var(--ink,#173d29);font:400 11px/1.35 var(--sans,Arial,sans-serif)}
.factor-evidence>summary{cursor:pointer;color:var(--primary,#087f46);font-weight:700}
.factor-evidence ul{display:grid;gap:2px;margin:5px 0 0;padding:0;list-style:none}
.factor-evidence li{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:3px 0;border-top:1px solid var(--line)}
.factor-evidence li span{min-width:0;overflow-wrap:anywhere}
.factor-evidence li b{flex:none;font:700 10px var(--mono);font-variant-numeric:tabular-nums}
.factor-evidence .factor-evidence-note{color:var(--muted)}
.match-scorers{margin:0 0 16px;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--module-soft,#edf7ef)}
.match-scorers h4{margin:0 0 8px;color:var(--primary,#087f46);font:700 12px var(--heading);text-transform:uppercase;letter-spacing:.05em}
.match-scorers>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.scorer-side{display:grid;gap:4px;min-width:0}
.scorer-side>b{overflow:hidden;text-overflow:ellipsis}
.scorer-side>span{overflow-wrap:anywhere;color:var(--ink,#173d29)}
.match-scorers.compact{margin:0;padding:1.2mm 2mm;border:0;border-bottom:1px solid var(--line);border-radius:0;background:var(--module-soft,#edf7ef);font-size:6px}
.match-scorers.compact h4{margin:0 0 .5mm;font-size:6px}
.match-scorers.compact>div{grid-template-columns:repeat(2,minmax(0,1fr));gap:2mm}
.match-scorers.compact .scorer-side{display:flex;gap:1mm;min-width:0;white-space:nowrap}
.match-scorers.compact .scorer-side>b{flex:none;max-width:38%;font-size:5.5px}
.match-scorers.compact .scorer-side>span{min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:5px}
@media(max-width:650px){.match-scorers>div{grid-template-columns:1fr}.factor-evidence{font-size:10px}}
.fair-play-block{margin-top:18px}.fair-play-block .table-wrap{max-height:none}.fair-play-block table{min-width:650px}.fair-play-block tbody tr:first-child{background:var(--module-soft,#edf7ef)}
