:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#14233b;background:#eef3f9;font-synthesis:none;font-smooth:always;--navy:#0c1830;--blue:#1858ad;--sky:#eef5ff;--ink:#14233b;--muted:#65748b;--line:#dbe4ef;--white:#fff;--orange:#ef9652;--green:#107c55}
*{box-sizing:border-box}html{min-height:100%;-webkit-text-size-adjust:100%}body{margin:0;min-height:100vh}button,input,select{font:inherit}button{cursor:pointer;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.4;cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #70a7ff;outline-offset:2px} .shell{max-width:720px;margin:0 auto;padding:0 16px 100px;min-height:100vh}
.apphead{margin:0 -16px 18px;padding:calc(env(safe-area-inset-top) + 18px) 20px 20px;background:var(--navy);color:white;border-radius:0 0 24px 24px}.eyebrow{font-size:11px;text-transform:uppercase;letter-spacing:1.25px;font-weight:800;color:#9fc7fb}.brand{display:flex;align-items:center;gap:13px}.ball{width:46px;height:46px;border-radius:14px;background:#dc8341;display:grid;place-items:center;font-size:25px;flex-shrink:0}.brand h1{margin:0;font-size:24px;letter-spacing:-.7px}.brand small{color:#c5d4ec;display:block;margin-top:2px}.saved{display:flex;align-items:center;gap:6px;color:#b6f2ce;margin-top:15px;font-size:12px;font-weight:650}.saved.warn{color:#ffd2a9}.dot{background:#75e4aa;border-radius:50%;width:8px;height:8px;display:inline-block}.saved.warn .dot{background:#ffb470}
.nav{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0 0 20px}.nav button{border:1px solid var(--line);background:#fff;border-radius:13px;padding:11px;color:#526680;font-weight:800}.nav .active{color:#fff;border-color:var(--blue);background:var(--blue)}
.panel{background:var(--white);border:1px solid var(--line);border-radius:19px;padding:17px;margin-bottom:15px;box-shadow:0 5px 15px rgba(28,51,89,.035)}.panel h2,.panel h3{margin:0 0 12px;line-height:1.2}.panel h2{font-size:20px}.panel h3{font-size:16px}.sub{font-size:13px;color:var(--muted);line-height:1.5}.sectionlabel{font-size:12px;color:#647991;text-transform:uppercase;letter-spacing:.7px;font-weight:800;margin:19px 0 10px}.toprow,.row{display:flex;align-items:center;justify-content:space-between;gap:10px}.toprow{margin-bottom:12px}.toprow h2{margin:0}.subtitle{color:var(--muted);font-size:13px;margin-top:4px}.pill{font-size:11px;font-weight:800;padding:5px 9px;border-radius:99px;background:#e8f2ff;color:#2054a1;white-space:nowrap}.pill.orange{background:#fff0e5;color:#b4551b}.pill.green{background:#e8f8ef;color:#187750}.pill.gray{background:#eff2f6;color:#647185}
.btn{width:100%;border:0;border-radius:13px;min-height:49px;padding:12px 16px;background:var(--blue);color:white;font-weight:850;font-size:15px;line-height:1.25}.btn.secondary{background:#eef3fa;color:var(--blue)}.btn.outline{background:transparent;color:var(--blue);border:1px solid #b9cbe4}.btn.danger{background:#fff0ee;color:#a83b2a}.btn.small{width:auto;min-height:35px;font-size:12px;padding:7px 12px;border-radius:10px}.actions{display:flex;gap:8px}.actions>*{flex:1}.actions.two .btn{min-width:0}
.periods{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px;margin-bottom:15px}.periods button{border:1px solid var(--line);background:#fff;border-radius:10px;min-width:0;height:39px;color:#64748b;font-weight:850;font-size:12px}.periods button.done{background:#eaf6ef;border-color:#b6dec7;color:#208057}.periods button.current{background:#174e9e;border-color:#174e9e;color:#fff}.periods button.selected:not(.current){box-shadow:0 0 0 2px #ffb15f inset}.periodbig{display:flex;justify-content:space-between;align-items:center;gap:15px;border-radius:16px;background:#edf4ff;padding:17px;margin-bottom:13px}.periodbig strong{display:block;font-size:28px;letter-spacing:-.9px;color:#103d84}.periodbig span{color:#5c7394;font-size:12px;font-weight:750}.mins{font-weight:900;color:#2560ad;font-size:17px;text-align:right}
.court{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.player{background:#f0f5fb;border:1px solid #e0eaf7;border-radius:13px;padding:12px 10px;min-width:0}.player strong{display:block;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.player small{display:block;font-size:11px;color:var(--muted);margin-top:5px}.jersey{display:inline-flex;align-items:center;justify-content:center;background:#dce8f9;color:#174f9c;padding:2px 5px;border-radius:6px;font-size:12px;margin-right:6px;min-width:25px;font-weight:900}.chips{display:flex;gap:8px;flex-wrap:wrap}.chip{background:#f0f4fa;border-radius:10px;padding:8px 10px;color:#34465c;font-size:13px;font-weight:700}.chip.ref{background:#fff0e1;color:#914e17}.empty{color:var(--muted);font-size:13px}
.playerlist{display:flex;flex-direction:column;gap:9px}.checkrow{display:flex;align-items:center;gap:11px;border-radius:12px;background:#f6f9fd;padding:11px}.checkrow input{height:22px;width:22px;flex:none;accent-color:var(--blue)}.checkrow .name{font-size:14px;font-weight:800}.checkrow .mini{font-size:11px;color:var(--muted);display:block;margin-top:3px}.checkrow .count{margin-left:auto;font-size:11px;color:#5f7190}.rosterrow{display:grid;grid-template-columns:minmax(0,1fr) 68px 103px 65px;gap:7px;align-items:center;padding:11px 0;border-top:1px solid var(--line)}.rosterrow:first-child{border-top:0}.rosterrow .name{font-size:13px;font-weight:850}.rosterrow label{display:block;font-size:10px;color:var(--muted);margin:0 0 4px}.rosterrow select,.rosterrow input{min-width:0;width:100%;height:37px;border-radius:9px;background:#f7f9fd;border:1px solid #d5dfe8;padding:0 6px;color:#1d3350;font-size:12px}.selectline{display:grid;grid-template-columns:1fr 1fr;gap:10px}.selectline label{font-size:12px;font-weight:800;color:#566b81;display:block;margin:0 0 6px}.selectline select{border:1px solid #ccd9ea;background:#fff;padding:12px 8px;border-radius:11px;width:100%;color:#223750;font-size:14px}.note{background:#f8faff;border-left:3px solid #78a0dc;border-radius:7px;padding:12px;color:#596c84;font-size:12px;line-height:1.5;margin:12px 0}.summarygrid{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.summarygrid .stat{border-radius:12px;background:#f0f5fb;text-align:center;padding:12px 3px}.stat strong{display:block;font-size:24px;color:#1b4d9e}.stat span{font-size:10px;font-weight:750;color:#61738c}
.statrow{display:grid;grid-template-columns:minmax(0,1fr) 58px 58px;gap:7px;align-items:center;border-bottom:1px solid #eaf0f7;padding:9px 0;font-size:13px}.statrow.head{font-weight:800;color:#728096;font-size:11px}.statrow:last-child{border-bottom:0}.statrow span:nth-child(2),.statrow span:nth-child(3){text-align:center}.muted{color:var(--muted)}.minor{font-size:11px;color:var(--muted)}.divider{border-top:1px solid var(--line);margin:15px 0}.toast{position:fixed;bottom:calc(env(safe-area-inset-bottom) + 16px);left:50%;transform:translateX(-50%);background:#192943;color:#fff;font-size:13px;padding:11px 18px;border-radius:12px;box-shadow:0 8px 25px #0002;max-width:calc(100vw - 30px);z-index:30}.foot{color:#8794a7;text-align:center;font-size:11px;line-height:1.5;margin:18px 0}
.overlay{position:fixed;inset:0;display:flex;align-items:flex-end;justify-content:center;background:rgba(9,23,42,.62);z-index:20}.sheet{width:100%;max-width:720px;max-height:92vh;overflow:auto;border-radius:24px 24px 0 0;background:white;padding:22px 17px calc(22px + env(safe-area-inset-bottom));box-shadow:0 -10px 30px #0002}.sheet h2{font-size:21px;margin:0 0 7px}.editrow{display:grid;grid-template-columns:minmax(0,1fr) 135px;gap:7px;align-items:center;border-bottom:1px solid #edf0f6;padding:8px 0;font-size:13px;font-weight:800}.editrow select{border:1px solid #cbd5e5;background:#f8fafc;border-radius:9px;height:42px;width:100%;padding:7px;font-size:13px}.sheet .sticky{position:sticky;bottom:-22px;background:white;padding-top:14px}.warntext{color:#af3b2a;font-size:13px;font-weight:800;min-height:16px}.intro{font-size:14px;color:#667991;line-height:1.5;margin:0 0 16px}.switch{display:flex;gap:8px;margin-bottom:12px}.switch button{border:1px solid #d5e2ef;background:white;border-radius:10px;padding:8px 12px;color:#456481;font-size:13px;font-weight:700}.switch .on{background:#eaf2ff;border-color:#7ca7da;color:#2054a1}
@media(max-width:380px){.rosterrow{grid-template-columns:minmax(0,1fr) 58px 96px 56px;gap:4px}.rosterrow .name{font-size:12px}.rosterrow select{font-size:11px}.panel{padding:14px}.court{gap:7px}.player{padding:10px 7px}.player strong{font-size:13px}.selectline{gap:7px}}
/* Gestion multi-equipes et formulaires */
.nav.nav4{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.nav.nav4 button{font-size:12px;padding:12px 2px}
.field{display:flex;flex-direction:column;gap:6px;color:#4b617d;font-size:12px;font-weight:800;margin-bottom:13px}
.field input,.field select{height:43px;background:#f9fbff;border:1px solid #ccd8e8;border-radius:10px;padding:9px 11px;font-size:15px;color:#20334f;width:100%;min-width:0}
.field input:focus,.field select:focus{border-color:var(--blue)}
.panel.compact{padding:12px}.form2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 9px}.form3{display:grid;grid-template-columns:75px minmax(0,1fr) 90px;gap:0 9px}
.teamrow{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:13px 0;border-bottom:1px solid var(--line)}.teamrow strong{display:block;font-size:14px}.teamrow .mini{display:block;color:var(--muted);font-size:11px;margin-top:4px}
.rosterrow.rosterrow2{grid-template-columns:minmax(0,1fr) 55px 99px 64px;gap:6px}.rosterrow2 .name{position:relative}.rosterrow2 .nameinput{padding-right:20px;font-weight:800;font-size:13px}
.rosterrow2 .minidel{position:absolute;top:7px;right:3px;border:0;background:transparent;color:#a84545;font-size:21px;padding:0 3px;line-height:1}
.periods.flexible{display:flex;flex-wrap:wrap;gap:6px}.periods.flexible button{flex:1 1 9%;min-width:32px;max-width:65px}
.statusbox{padding:14px;background:#edf4ff;border-radius:12px;color:#215096;font-size:13px;font-weight:750;margin-bottom:15px}
@media(max-width:390px){.nav.nav4 button{font-size:11px}.rosterrow.rosterrow2{grid-template-columns:minmax(0,1fr) 49px 83px 52px;gap:4px}.rosterrow2 .nameinput{font-size:11px}.form3{grid-template-columns:65px minmax(0,1fr) 77px;gap:6px}}

/* Bilan final de match, mobile et impression */
.report-hero .report-opponent{font-size:19px;margin:12px 0 6px;color:var(--navy)}
.report-grid{margin:12px 0}.report-grid .stat strong{font-size:19px}
.report-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.report-table{width:100%;border-collapse:collapse;font-size:12px;table-layout:fixed}
.report-table th,.report-table td{padding:10px 5px;border-bottom:1px solid #e3eaf3;vertical-align:middle;text-align:center}
.report-table th:first-child{width:39%;text-align:left}
.report-table th[scope=row]{font-weight:700;overflow-wrap:anywhere}
.report-name{display:block;font-size:13px}
.report-table small{display:block;font-size:10px;font-weight:500;color:var(--muted);margin-top:4px}
.minibar{display:block;margin-top:6px;background:#e6edf5;width:100%;height:6px;border-radius:8px;overflow:hidden}
.minibar span{display:block;background:#2268b5;height:100%;border-radius:8px}
.report-player-detail,.report-period{border-bottom:1px solid var(--line);padding:11px 0;font-size:12px;line-height:1.5}
.report-player-detail:first-of-type,.report-period:first-of-type{padding-top:0}
.report-player-detail:last-child,.report-period:last-child{border-bottom:0;padding-bottom:0}
.report-player-detail strong,.report-period strong{display:block;font-size:14px;margin-bottom:4px}
.report-player-detail div,.report-period div{margin-top:3px;color:#56677c}
.report-period b{color:#3a4e65}
.report-period small{font-size:11px;color:var(--muted);font-weight:400}
.history-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-top:1px solid var(--line)}
.history-row strong{font-size:13px;display:block}
.history-row small{font-size:11px;color:var(--muted);display:block;margin-top:4px}
.field textarea{border:1px solid #ccd8e8;background:#f9fbff;border-radius:10px;padding:9px 11px;font-size:14px;color:#20334f;min-height:80px;resize:vertical;width:100%}
@media print{
  @page{size:A4;margin:13mm}
  html,body{background:#fff!important;color:#111!important}
  .shell{max-width:none;padding:0;min-height:0}
  .apphead,.nav,.panel.compact,.no-print,.foot{display:none!important}
  .shell>.panel{display:none!important}
  #report .panel{display:block!important;box-shadow:none;border:0;border-radius:0;padding:0;margin:0 0 15px}
  #report .report-grid .stat{background:#f5f5f5!important}
  #report .report-table tr,#report .report-player-detail,#report .report-period{break-inside:avoid}
  #report .report-period{font-size:11px}
  #report .report-name{font-size:11px}
  #report .minibar{background:#eee}
  #report .minibar span{background:#777!important}
  #report .field input,#report .field textarea{border:none;background:transparent;padding:0;height:auto;min-height:0;resize:none}
  #report .report-grid strong{font-size:17px}
}

.final-score{display:flex;align-items:center;gap:14px;margin:8px 0 13px}.final-score strong{color:#164e97;font-size:26px}.final-score span{color:#56708b;font-weight:700;font-size:13px}


/* V4 - points optionnels / saisie tactile */
.points-panel{border-left:4px solid #2e6fb4}
.score-editor{display:flex;flex-direction:column;gap:9px;margin:10px 0}
.score-entry{display:grid;grid-template-columns:minmax(95px,1fr) 64px auto;gap:7px;align-items:center;padding:8px 0;border-bottom:1px solid var(--line)}
.score-entry:last-child{border-bottom:0}
.score-player{min-width:0}.score-player strong{display:block;font-size:13px;overflow-wrap:anywhere}.score-player small{display:block;font-size:10px;color:var(--muted)}
.score-input input,.points-report-table input{width:100%;height:43px;border:1px solid #c6d6eb;border-radius:9px;font-size:17px;text-align:center;background:#f9fbff;color:#172e4f;padding:4px 2px}
.score-actions{display:flex;gap:4px}.score-actions button{border:1px solid #cad7e8;background:#eff5fc;border-radius:9px;min-width:29px;height:38px;padding:0 6px;font-size:12px;font-weight:800;color:#174d84;touch-action:manipulation}
.score-actions button:active{background:#c7def8}.score-actions .score-clear{background:#fff4f3;color:#a83c32}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.points-report-table th:first-child{width:34%}.points-report-table th:nth-child(2){width:28%}.points-report-table th:nth-child(3){width:38%}
.points-report-table input{font-size:15px;max-width:86px;display:block;margin:0 auto}
.points-total{margin:14px 0;padding:12px;border-radius:11px;background:#edf5ff;display:flex;align-items:center;gap:12px}
.points-total strong{font-size:23px;color:#15569b}.points-total span{font-size:12px;color:#47627d}
.score-period-details{margin-top:12px;border-radius:10px;background:#f5f8fc;padding:10px}
.score-period-details summary{cursor:pointer;color:#174c86;font-size:13px;font-weight:800;list-style-position:inside}
.score-period-details .score-entry{grid-template-columns:minmax(90px,1fr) 60px auto}
.score-print{margin-top:8px}
@media(max-width:380px){.score-entry{grid-template-columns:minmax(75px,1fr) 54px auto;gap:4px}.score-actions{gap:2px}.score-actions button{min-width:27px;padding:0 4px}}
@media print{.score-period-details,.points-panel{display:none!important}.points-report-table input{border:0!important}.points-total{background:#f4f4f4!important}}

/* V5 - maintien optionnel de l'ecran pendant le match */
.wake-panel{padding:13px 15px;border-left:4px solid #eab34c}
.wake-row{display:flex;gap:10px;align-items:center;justify-content:space-between}
.wake-row>div{flex:1;min-width:0}.wake-row h3{font-size:14px;margin:0 0 4px}.wake-row .minor{margin:0;line-height:1.4}
.wake-row .btn{flex:0 0 auto;width:auto;min-width:114px;max-width:142px;padding:9px 11px;white-space:normal;font-size:12px}
.wake-row .btn.wake-active{background:#d9f4e5;border-color:#4b9b72;color:#185c37}
.wake-row .btn:disabled{opacity:.45}.wake-note{margin:10px 0 0;line-height:1.45}
