@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');
:root{--navy:#101d58;--deep:#0b143e;--blue:#2344a1;--ink:#161e37;--muted:#515c73;--gold:#f6cd5b;--gold-ink:#775100;--paper:#f4f5fa;--line:#d9deed;--white:#fff;--display:"Barlow Condensed","Arial Narrow",Impact,sans-serif;color:var(--ink);background:var(--paper);font:16px Inter,system-ui,sans-serif}
*{box-sizing:border-box}
body,h1,h2,h3,p{margin:0}
[hidden]{display:none!important}
button,input,select,textarea{font:inherit}
button,a.primary{min-height:44px;cursor:pointer;border-radius:999px;font-size:.85rem;font-weight:700;text-decoration:none}
button:disabled{cursor:default;opacity:.55}
:focus-visible{outline:3px solid #335ed6;outline-offset:2px}
.wrap,.bar{width:min(680px,calc(100% - 32px));margin-inline:auto}
.top{background:var(--navy);color:white;position:sticky;top:0;z-index:2;border-bottom:3px solid var(--gold)}
.bar{min-height:62px;display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center}
.brand{grid-column:2;grid-row:1;display:flex;align-items:center;justify-content:center;gap:9px;text-align:center;font-weight:700;overflow-wrap:anywhere}
.brand img{width:30px;height:34px;object-fit:contain}
.icon{color:var(--white);background:transparent;border:0;font-size:1.8rem;padding:0;grid-row:1}
.icon:hover{background:#ffffff20}
#back{grid-column:1}#top-add{grid-column:3}
.wrap{padding-block:18px 24px}
.section-title,.selection,.result-actions,.dialog-actions,.share,.team-title{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
h2{font-size:1.15rem;letter-spacing:-.02em}
h3{font-size:1.05rem}
.quiet{border:1px solid var(--line);color:var(--navy);background:var(--white);padding:6px 13px}
.quiet:hover,.text-button:hover{background:#e7ecfa}
.primary{border:1px solid transparent;background:var(--blue);color:white;padding:8px 18px;display:inline-flex;align-items:center;justify-content:center}
.primary:hover{background:var(--navy)}
.roster,.teams ol{list-style:none;padding:0;margin:12px 0 0}
.player,.team{width:100%;border:1px solid var(--line);background:white;border-radius:13px;box-shadow:0 2px 3px #1829570d}
.identity{display:grid;min-width:0;gap:4px;overflow-wrap:anywhere}
.identity small{color:var(--muted);font-weight:500;font-size:.75rem}
.role{display:inline-grid;place-items:center;width:34px;height:34px;flex:none;background:var(--blue);color:white;border-radius:50%;font-weight:800;font-size:.8rem}
.role[data-role=G]{background:#f9df84;color:#402e02}
.role[data-role=M]{background:#008077}
.role[data-role=P]{background:#6a408c}
.selection{background:#e8edf9;border-radius:12px;padding:8px 12px;margin-top:12px;color:var(--navy);font-size:.82rem}
.selection .quiet{background:white}
.roster{display:grid;gap:8px}
.empty{padding:18px 0;color:var(--muted);font-size:.91rem}
.player{display:flex;align-items:center;padding:5px 6px 5px 10px;gap:2px}
.player-label{display:flex;align-items:center;gap:8px;flex:1;min-width:0;min-height:44px;cursor:pointer}
/* Presence remains a native checkbox with a switch appearance. */
.attendance-switch {
  appearance:none;
  display:grid;
  align-items:center;
  flex:none;
  width:46px;
  height:26px;
  padding:3px;
  margin:0 4px 0 auto;
  border:0;
  border-radius:999px;
  background:#697386;
  cursor:pointer;
}
.attendance-switch::before {
  content:"";
  width:20px;
  height:20px;
  border-radius:50%;
  background:#fff;
}
.attendance-switch:checked {background:var(--blue)}
.attendance-switch:checked::before {justify-self:end}
@media(forced-colors:active) {
  .attendance-switch {forced-color-adjust:none;background:Canvas;border:1px solid CanvasText;padding:2px}
  .attendance-switch::before {background:CanvasText}
  .attendance-switch:checked {background:Highlight;border-color:Highlight}
  .attendance-switch:checked::before {background:HighlightText}
}
.text-button{background:transparent;border:0;font-size:.72rem;color:var(--navy);padding:0 7px}
.remove{font-size:1.15rem;min-width:44px}
.stars{color:var(--gold-ink);font-size:.73rem;display:inline-block;position:relative;white-space:nowrap}
.stars-fill{overflow:hidden;position:absolute;inset:0 auto 0 0;color:#906100;white-space:nowrap}
.sticky-action{position:sticky;bottom:0;background:var(--paper);padding:12px 0 max(10px,env(safe-area-inset-bottom));display:flex;justify-content:center}
.sticky-action button{min-width:min(230px,100%)}
dialog{width:min(390px,calc(100% - 32px));max-height:calc(100% - 30px);padding:22px;border:0;border-radius:22px;color:var(--ink);background:var(--paper);box-shadow:0 18px 65px #090f2d50}
dialog::backdrop{background:#080e2a99}
dialog form{display:grid;gap:13px}
label{font-size:.83rem;font-weight:700}
dialog label{display:grid;gap:6px}
dialog label small{font-size:.74rem;color:var(--muted);font-weight:500}
input:not([type=checkbox],[type=range]),select,textarea{width:100%;min-height:46px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;color:var(--ink);background:white}
input[type=range]{accent-color:var(--blue);width:100%}
.dialog-actions{justify-content:flex-end;margin-top:5px}
.star-picker{display:flex;gap:4px;justify-content:center}
.star-button{background:transparent;color:var(--gold-ink);border:0;font-size:1.7rem;width:44px;padding:0}
.switch-row{display:flex;justify-content:space-between;align-items:center;min-height:44px;padding-block:6px;border-top:1px solid var(--line)}
.switch-row input{width:20px;height:20px;accent-color:var(--blue);flex:none}
.selected-note,#attendance,.feedback,.result-banner p{font-size:.83rem;line-height:1.5;color:var(--muted)}
.feedback{color:#922a2c}
.feedback:empty,#result-info:empty{display:none}
.result-banner{background:#e8edf9;border:1px solid #cbd5f0;border-radius:12px;text-align:center;padding:14px;color:var(--navy)}
.result-banner h2{margin-bottom:5px}
.result-actions{margin-top:12px}
.teams{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,253px),1fr));gap:12px;margin-top:12px}
.team{overflow:hidden}
.team-title{padding:12px 12px 5px}
.average{font-size:.74rem;color:#543905;background:#f9e6aa;border-radius:999px;padding:5px 9px}
.teams ol{margin:0;padding:8px 12px 12px}
.spot{display:flex;align-items:center;gap:7px;min-height:33px;min-width:0;font-size:.8rem}
.spot strong{min-width:0;overflow-wrap:anywhere}
.spot .role{width:24px;height:24px;font-size:.69rem}
.team-players .spot .stars{margin-left:auto}
.team-players .spot small{color:var(--muted)}
.teams .pitch{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;background:repeating-linear-gradient(#164961 0 25%,#1a5370 25% 50%);color:white;padding-block:14px;position:relative}
.pitch:before{content:"";position:absolute;inset:6px;border:1px solid #ffffff65;pointer-events:none}
.pitch .spot{display:grid;z-index:1;justify-items:center;text-align:center}
.pitch .spot[data-role=G],.pitch .spot[data-role=M]{grid-column:1/-1}
.share{justify-content:flex-start;margin-top:14px}
textarea{min-height:140px;margin-top:10px}
@media(max-width:365px){.wrap,.bar{width:calc(100% - 20px)}.player{padding-left:6px}.player-label{gap:5px}.player-label .role{width:28px;height:28px}.remove{min-width:40px}}
.teams .fixed-pitch{grid-template-columns:repeat(2,minmax(0,1fr))}
#sync-status{margin-bottom:12px}.sticky-action{gap:8px;flex-wrap:wrap}
.section-buttons{display:flex;flex-wrap:wrap;gap:8px}
.stat-card{background:white;border:1px solid var(--line);border-radius:13px;padding:14px;margin-bottom:12px}
.stat-card p{margin:10px 0;color:var(--muted);font-size:.83rem}
#match-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
#match-form button{grid-column:1/-1}
.scoreboard {
  position:relative;
  isolation:isolate;
  overflow:hidden;
  color:#fff;
  padding:clamp(18px,4vw,27px);
  border:1px solid #5c65a3;
  border-radius:22px;
  margin-bottom:14px;
  background:
    linear-gradient(180deg,#ffffff22,transparent 44%,#080a2b77),
    linear-gradient(105deg,#123280 0%,#1d48ab 31%,#522f76 52%,#a93452 72%,#941b38 100%);
  box-shadow:0 5px 0 #20284a,0 11px 22px #1b224137,inset 0 1px 0 #ffffff55;
}
.scoreboard::before {
  content:"";
  position:absolute;
  z-index:-1;
  inset:9px;
  border:1px solid #ffffff29;
  border-radius:15px;
  background:repeating-linear-gradient(90deg,transparent 0 12.5%,#ffffff09 12.5% 25%);
  pointer-events:none;
}
.scoreboard h2{font:700 clamp(22px,5vw,30px)/1 var(--display);text-align:center}
.scoreboard-sides{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:14px;position:relative}
.scoreboard-sides::before {
  content:"";
  position:absolute;
  width:54px;
  aspect-ratio:1;
  border:1px solid #ffffff40;
  border-radius:50%;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
}
.scoreboard-sides::after {
  content:"";
  position:absolute;
  inset:0 auto 0 50%;
  border-left:1px solid #ffffff43;
}
.score-side {
  position:relative;
  z-index:1;
  display:grid;
  justify-items:center;
  gap:8px;
  min-width:0;
  padding:10px 3px 2px;
  text-align:center;
}
.score-side h3 {
  border:1px solid #ffffff54;
  border-radius:999px;
  background:#092b87b3;
  padding:5px 9px;
  font-size:clamp(.73rem,3vw,.95rem);
}
.score-side[data-color=red] h3{background:#7c1739bf}
.score-value {
  font:800 clamp(68px,20vw,112px)/.9 var(--display);
  font-variant-numeric:tabular-nums;
  text-shadow:0 1px 0 #c9d2ec,0 3px 0 #7b87b0,0 6px 0 #101943,0 10px 18px #080e2bbe;
}
#last-goal {
  width:fit-content;
  max-width:100%;
  margin:12px auto 0;
  border-radius:10px;
  background:#0c143dc7;
  padding:7px 10px;
  font-size:.82rem;
  text-align:center;
}
#last-goal[data-color=blue]{border-left:3px solid #81b7ff}
#last-goal[data-color=red]{border-left:3px solid #ff9ab1}
.match-controls{margin-top:16px}
.match-controls #match-hint:first-child{margin:0}
#match-form select{display:block;margin-top:4px}
.bib-dot{display:inline-block;width:10px;height:10px;border-radius:50%}
.bib-dot.blue{background:#2352bb}
.bib-dot.red{background:#b0304a}
#log-goal{width:100%;margin-bottom:10px}
.goal-team-picker{border:0;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.goal-team-picker legend{margin-bottom:8px;font-size:.83rem;font-weight:700}
.goal-team-picker .goal-team {
  display:flex;
  align-items:center;
  gap:5px;
  min-height:46px;
  border-radius:9px;
  padding:6px 7px;
  cursor:pointer;
  color:#153a90;
  background:#e2eaff;
  border:2px solid transparent;
}
.goal-team-picker .red{color:#95203f;background:#ffe6eb}
.goal-team input{margin:0;accent-color:currentColor}
.goal-team:has(input:checked){border-color:currentColor}
.goals-table{width:100%;border-collapse:collapse;font-size:.86rem;text-align:left}
.goals-table th,.goals-table td{padding:8px 5px;border-bottom:1px solid var(--line)}
.goals-table tbody th{font-weight:500}
.goals-table th:last-child,.goals-table td:last-child{text-align:right}
#match-history{padding:0;list-style:none;color:var(--muted);font-size:.83rem}
#match-history:empty{display:none}
#match-history li{padding-block:5px}
#install-dialog p{font-size:.87rem;line-height:1.55;margin:12px 0;color:var(--muted)}
#draw-options,.goal-manual{background:#e8edf9;border-radius:8px;padding:10px;color:var(--navy)}
#draw-options summary,.goal-manual summary{cursor:pointer;font-size:.86rem;font-weight:700;padding:5px 0}
#draw-options .switch-row{margin-top:8px}
#attendance{padding:8px 10px;border-left:3px solid var(--blue);background:white;border-radius:4px;font-weight:650}

.ranking-board {
  position:relative;
  isolation:isolate;
  overflow:hidden;
  background:linear-gradient(152deg,#2145b0 0%,#142662 46%,#0a1438 100%);
  color:white;
  border:1px solid #233e8d;
  border-radius:20px;
  padding:clamp(14px,4vw,24px) clamp(14px,4vw,24px) 0;
  margin-bottom:12px;
}
.ranking-board::before {
  content:"";
  position:absolute;
  z-index:-1;
  inset:30% -20% -64%;
  border-radius:50%;
  border:1px solid #ccd9ff22;
  box-shadow:0 0 0 23px #b2caff0d,0 0 0 48px #a3baff0a;
  background:radial-gradient(ellipse at 50% 16%,#233d99aa,transparent 55%);
}
.ranking-board h1{font:800 clamp(30px,6vw,44px)/1 var(--display);letter-spacing:.01em}
.ranking-board label{display:flex;align-items:center;gap:6px;font-size:.76rem}
.ranking-board input[type=month]{width:auto;min-height:40px;padding:4px 6px;font-size:.8rem}
.ranking-board p{margin:10px 0 0;color:#e2e8ff;font-size:.83rem}
.podium {
  --depth:clamp(10px,3vw,18px);
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.1fr) minmax(0,1fr);
  grid-template-areas:"second first third";
  align-items:end;
  list-style:none;
  margin:clamp(18px,5vw,29px) auto 0;
  padding:0;
  max-width:520px;
}
.podium-entry{position:relative;display:grid;min-width:0;text-align:center}
.podium-entry[data-rank="1"] {
  z-index:2;
  grid-area:first;
  --height:clamp(103px,29vw,166px);
  --light:#83a2ff;
  --top:#4b71ed;
  --front:#294ac7;
  --base:#1b2d83;
  --edge:#1a2e88;
  --medal:#f6cd5b;
}
.podium-entry[data-rank="2"] {
  z-index:1;
  grid-area:second;
  --height:clamp(76px,22vw,130px);
  --light:#9db9ff;
  --top:#577ad9;
  --front:#385cbf;
  --base:#223d92;
  --edge:#20367a;
  --medal:#dae6ff;
}
.podium-entry[data-rank="3"] {
  grid-area:third;
  --height:clamp(54px,17vw,102px);
  --light:#789cf3;
  --top:#4067d2;
  --front:#27479f;
  --base:#192d70;
  --edge:#16275d;
  --medal:#f1b582;
}
.podium-names {
  display:grid;
  justify-items:center;
  gap:5px;
  padding:0 5px calc(var(--depth) + 8px);
  overflow-wrap:anywhere;
  font-size:clamp(.72rem,2.6vw,.93rem);
}
.podium-players{display:grid;gap:3px;width:100%}
.podium-badge {
  width:clamp(34px,9vw,50px);
  aspect-ratio:1;
  display:grid;
  place-items:center;
  margin-bottom:2px;
  border-radius:50%;
  border:2px solid var(--medal);
  background:#101f55;
  color:white;
  font-weight:800;
  letter-spacing:.03em;
}
.podium-goals,.podium-empty{color:#e2e8ff}
.podium-goals{border-radius:999px;background:#c0d0ff26;padding:4px 9px;font-weight:700}
.podium-step {
  position:relative;
  display:grid;
  justify-items:center;
  align-items:start;
  padding-top:clamp(7px,2vw,14px);
  min-height:var(--height);
  border-top:1px solid #f4f7ff48;
  background:linear-gradient(90deg,transparent 87%,var(--edge) 100%),linear-gradient(165deg,var(--front),var(--base));
  color:white;
  font:800 clamp(36px,9vw,66px)/1 var(--display);
  text-shadow:0 2px 3px #07124074;
}
.podium-step::before {
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:100%;
  height:var(--depth);
  background:linear-gradient(168deg,var(--light),var(--top));
  clip-path:polygon(11% 0,89% 0,100% 100%,0 100%);
}
.podium-entry[data-rank="1"] .podium-step{color:#ffe29a}
.ranking-list h2{margin-bottom:10px}
.goal-manual{margin:12px 0}
#manual-goal-form{display:grid;gap:7px;margin-top:8px;grid-template-columns:repeat(2,minmax(0,1fr))}
#manual-goal-form label:first-child,#manual-goal-form button{grid-column:1/-1}
#manual-goal-form input,#manual-goal-form select{display:block;margin-top:4px}
#manual-saved:empty,#manual-goals:empty{display:none}
#manual-goals{padding:0;list-style:none;margin:9px 0 0}
#manual-goals li{display:flex;justify-content:space-between;align-items:center;gap:7px;font-size:.8rem;margin-top:5px}
body:has(.mobile-nav:not([hidden])) .wrap{padding-bottom:calc(90px + env(safe-area-inset-bottom,0px))}
body:has(.mobile-nav:not([hidden])) .sticky-action{bottom:calc(76px + env(safe-area-inset-bottom,0px))}
.mobile-nav{position:fixed;z-index:3;left:50%;bottom:calc(12px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:min(400px,calc(100% - 24px));display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;background:var(--deep);border-radius:999px;padding:6px;box-shadow:0 5px 20px #101d5850}
.mobile-nav button{display:grid;gap:2px;place-content:center;justify-items:center;min-height:48px;padding:3px 4px;color:#f1f3ff;background:transparent;border:0;font-size:.66rem;font-weight:700}
.mobile-nav button:hover{background:#ffffff14}
.mobile-nav button[aria-current=page]{background:#284aa6;color:white}
.mobile-nav button[aria-current=page] svg{color:var(--gold)}
.mobile-nav svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.mobile-nav button:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}
.team[data-team-color]{border-top:3px solid var(--team-color)}
.team[data-team-color=blue]{--team-color:#2452b5}
.team[data-team-color=red]{--team-color:#ad284c}
.team[data-team-color=green]{--team-color:#13764d}
.team[data-team-color=yellow]{--team-color:#816000}
.team[data-team-color=purple]{--team-color:#693bb2}
.team[data-team-color=orange]{--team-color:#9a430e}
.draw-team-name{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.team-bib{display:inline-flex;align-items:center;gap:5px;border-radius:999px;padding:4px 7px;color:var(--team-color);background:#f1f3fa;font-size:.72rem}
.team-bib::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor}
.connection-status{margin:0 0 12px;padding:9px 12px;background:#fff1c9;color:#493300;border-radius:8px;font-size:.86rem;font-weight:700}
#sync-conflict-list{padding-left:20px}
#sync-conflict-list li{margin:8px 0;font-size:.85rem}
#sync-conflict-list span{display:block;color:var(--muted);margin-top:3px}

/* Keep the club artwork in the page background, behind the working panels. */
body{min-height:100dvh;isolation:isolate}
body::before{
  content:"";
  position:fixed;
  z-index:-1;
  inset:0;
  background:#101d58 linear-gradient(#0a143929,#0a143968);
  background-image:linear-gradient(#0a14393b,#080f2b91),url("./papel-de-parede.jpg");
  background-position:center;
  background-repeat:no-repeat;
  background-size:cover;
  pointer-events:none;
}
#setup>.section-title h2{color:white}
#setup .empty{color:#e8edff}
#sync-status:not(:empty){background:#fff0ec;border-radius:8px;padding:8px 12px}
.ranking-board{
  background-image:linear-gradient(155deg,#2346a9b8 0%,#142563b8 46%,#080f2ee0 100%),url("./papel-de-parede.jpg");
  background-size:cover;
  background-position:center 51%;
}
@media(min-width:750px){
  body::before{background-size:cover, min(100vw,1050px) auto}
}

.goal-corrections{margin:12px 0;background:#eef1fa;padding:10px;border-radius:8px;font-size:.83rem}
.goal-corrections summary{cursor:pointer;font-weight:700;padding:5px 0}
#goal-corrections{list-style:none;padding:0}
#goal-corrections li{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:7px 0;border-bottom:1px solid var(--line)}
#goal-corrections button{flex:none;font-size:.73rem}
#goal-correction-status:empty{display:none}
