:root{--rose:#be0049;--rose2:#980033;--pink:#fff1f6;--bg:#fcf8fa;--line:#eadce2;--ink:#2c2130;--grey:#776a75;--white:#fff;--green:#236344;--greenbg:#e7f7ee}*{box-sizing:border-box}body{margin:0;background:var(--bg);font:14px/1.5 Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;color:var(--ink)}button,input,select{font:inherit}button{cursor:pointer}a{color:var(--rose2)}button:disabled{opacity:.48;cursor:not-allowed}.wrap{width:min(1300px,calc(100% - 28px));margin:auto}.top{padding:19px 0 74px;background:linear-gradient(130deg,#980033,#d30a51);color:#fff}.top-line{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:40px}.brand{display:flex;gap:12px;align-items:center;color:#fff;text-decoration:none}.brandlogo{width:50px;height:50px;object-fit:contain;border-radius:10px;background:#fff;flex:none}.brandmark{display:grid;place-items:center;border-radius:11px;background:white;color:var(--rose2);font-weight:900;min-width:51px;height:45px;font-size:16px}.brand b{font-size:16px}.brand small{display:block;font-size:11px;color:#ffe1ec}.top nav{display:flex;gap:18px}.top nav a{color:#fff;font-size:13px}.eyebrow{font-size:11px;font-weight:850;letter-spacing:.12em;opacity:.9}.top h1{font-size:clamp(29px,5vw,48px);letter-spacing:-.04em;line-height:1.15;margin:10px 0 10px}.top h1 span{opacity:.75;font-size:.6em;letter-spacing:0}.top p{margin:0;color:#ffe5ef}.panel{background:#fff;border:1px solid var(--line);border-radius:17px;padding:24px;margin-bottom:17px;box-shadow:0 10px 28px #4c15301c}.wrap>main{margin-top:-47px}main.wrap{margin-top:-48px;position:relative;z-index:1}.stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-bottom:17px}.metric{background:white;border:1px solid var(--line);border-radius:13px;padding:16px;min-width:0}.metric strong{display:block;color:var(--rose2);font-size:25px;font-weight:900}.metric span{font-size:11px;font-weight:750;color:var(--grey)}.pagebar{display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap;margin:22px 0 15px}.tabs{display:flex;gap:7px;flex-wrap:wrap}.tabs button{background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px 18px;color:#65565e;font-weight:800}.tabs button.active{background:var(--rose);border-color:var(--rose);color:#fff}.sectionhead{display:flex;justify-content:space-between;gap:20px;align-items:start;flex-wrap:wrap;margin-bottom:18px}.sectionhead h2{margin:0 0 3px;font-size:24px}.sectionhead p{margin:0;color:var(--grey);font-size:13px}.rightbuttons{display:flex;gap:8px;flex-wrap:wrap}button.primary,button.outline{padding:10px 14px;border-radius:9px;font-weight:800;white-space:nowrap}button.primary{border:1px solid var(--rose);background:var(--rose);color:white}button.primary:hover:not(:disabled){background:var(--rose2)}button.outline{background:white;border:1px solid #d9b3c3;color:var(--rose2)}button.outline:hover{background:var(--pink)}.textbutton{background:none;border:0;padding:0;color:var(--rose2);font-weight:800;margin-bottom:10px}.addForm{background:#fff9fb;border:1px solid #edd9e3;border-radius:12px;padding:15px;margin:16px 0}.addForm label{font-weight:800;display:block;margin-bottom:8px}.addForm small,.smallmeta{font-size:12px;color:var(--grey)}.horizontal{display:flex;gap:8px;margin-bottom:6px}.horizontal input{flex:1;min-width:0}.filterrow{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:15px 0}.filterrow input{min-width:220px;flex:1}.filterrow select{min-width:150px}input,select{background:white;border:1px solid #e0cad4;border-radius:8px;padding:10px 12px;color:var(--ink);min-height:42px}input:focus,select:focus{outline:2px solid #efb3cc;outline-offset:1px}.scroller{overflow-x:auto;max-width:100%}table{width:100%;border-collapse:collapse;text-align:left;min-width:690px}th{font-size:10px;color:#746775;letter-spacing:.06em;text-transform:uppercase;background:#faf6f8;padding:12px;border-bottom:1px solid var(--line)}td{padding:11px 12px;border-bottom:1px solid #eee4e8;vertical-align:middle}tbody tr:hover{background:#fff8fa}td strong{display:block;font-weight:850;font-size:13px}td small{display:block;font-size:11px;color:var(--grey)}.tag{display:inline-flex;padding:5px 8px;border-radius:7px;background:#f2eff1;color:#605661;font-weight:750;font-size:11px;white-space:nowrap}.tag.ok{background:var(--greenbg);color:var(--green)}.tag.warn{background:#fff1dd;color:#8b5700}.tag.bad{background:#ffe7eb;color:#a11a37}.mini{font-size:11px;padding:5px 9px;border:1px solid #e3bccc;border-radius:7px;background:white;color:var(--rose2);font-weight:780;cursor:pointer;white-space:nowrap}.mini:disabled{opacity:.35}.notice{padding:13px 14px;background:#fff5f8;border:1px solid #f3d8e1;border-radius:11px;color:#754c63;margin:14px 0;font-size:12px}.statline{display:flex;gap:12px;flex-wrap:wrap;margin:15px 0}.statline span{background:#f8f4f6;padding:8px 12px;border-radius:7px;font-weight:700}.red{color:#bc003c;font-weight:900}.rowred{background:#fff1f4!important}.score{font-size:16px;color:var(--rose2);font-weight:900}.split{display:grid;grid-template-columns:1fr 1fr;gap:25px}.split h3{margin-top:2px}.checks div{border-bottom:1px solid #eee1e7;padding:11px 0;font-size:13px}.checks b{display:inline-block;min-width:28px}.history{font-size:12px}.history div{padding:10px 0;border-bottom:1px solid var(--line)}.foot{color:#7d707b;font-size:12px;padding:20px 0 35px}.toast{position:fixed;bottom:18px;right:18px;max-width:min(460px,calc(100vw - 36px));z-index:99;color:white;background:#423441;border-radius:12px;padding:13px 19px;box-shadow:0 12px 32px #0003}.toast.error{background:#8f1734}.modal{position:fixed;inset:0;background:#160b13b2;z-index:80;display:grid;place-items:center;padding:15px}.modalbox{background:white;border-radius:17px;max-width:800px;width:100%;max-height:90vh;overflow-y:auto;padding:25px;position:relative}.close{position:absolute;top:14px;right:17px;background:#fff0f5;border:0;border-radius:8px;font-size:24px;color:var(--rose);width:36px;height:36px}@media(max-width:820px){.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.split{grid-template-columns:1fr}.panel{padding:15px}.horizontal{flex-wrap:wrap}.horizontal input{flex-basis:100%}.top-line{margin-bottom:24px}.top nav{gap:8px}.top nav a{font-size:11px}.filterrow input,.filterrow select{width:100%}.sectionhead h2{font-size:21px}}
/* Correct rendering of initially hidden player details and notices. */
[hidden], .modal[hidden], .toast[hidden] { display: none !important; }

.tag.archive{background:#eae9ee;color:#4a4852;margin-top:4px}
.importpanel{background:#fff9fb;border:1px solid var(--line);border-radius:12px;padding:17px;margin-top:20px}
.importpanel h3{margin:0 0 6px}
.importpanel .sectionhead p{font-size:12px;max-width:700px}
#rankingRows tr[data-key],#publicRows tr[data-key]{cursor:pointer}
#rankingPublication{max-width:100%;min-width:230px}
@media(max-width:820px){.brandlogo{width:43px;height:43px}.importpanel{padding:12px}}

/* LFBB Calendrier TJO — regroupement par province et fiches responsives */
.calendar-province{margin-top:24px}
.calendar-province:first-child{margin-top:12px}
.calendar-province h3{font-size:19px;margin:0 0 12px;display:flex;gap:10px;align-items:center;border-bottom:1px solid var(--line);padding-bottom:10px}
.calendar-province h3 span{font-size:12px;font-weight:500;color:var(--grey)}
.calendar-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px}
.calendar-event{border:1px solid var(--line);border-radius:12px;padding:15px;background:#fff;display:flex;flex-direction:column;gap:8px;min-width:0}
.calendar-event:hover{border-color:#dba5ba;background:#fffafb}
.calendar-date{font-size:12px;color:var(--rose2);font-weight:800}
.calendar-event h4{font-size:15px;line-height:1.3;margin:0}
.calendar-event p{margin:0;font-size:12px;color:var(--grey)}
.calendar-levels{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.calendar-levels .tag{padding:4px 9px}
.calendar-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:auto;padding-top:5px}
.calendar-actions a{font-size:12px;font-weight:750}
.calendar-actions .no-ts{font-size:11px;color:var(--grey)}
.calendar-empty{padding:22px;color:var(--grey);text-align:center}
#publicCalResults,#adminCalResults{margin-top:10px}
@media(max-width:650px){.calendar-list{grid-template-columns:1fr}}

.seed-intro{margin:0 0 16px;color:var(--grey);font-size:13px}
.seed-status{font-size:12px;color:var(--grey);padding:9px 0}
.seed-row{display:flex;flex-wrap:wrap;align-items:center;gap:9px;margin:10px 0}
.seed-row input[type=url]{flex:1;min-width:220px}
.seed-level{font-weight:800}
.seed-identity-ok{color:var(--green);font-weight:800}
.seed-identity-warning{color:#8b5700;font-weight:800}
.seed-result-info{color:var(--grey);font-size:12px}
.seed-foot{font-size:12px;color:var(--grey);margin-top:12px}
.seed-login{max-width:480px;border:1px solid var(--line);padding:20px;border-radius:12px;background:white}
.seed-login label{display:block;font-weight:750;margin-top:8px;margin-bottom:6px}
.seed-login input{display:block;width:100%}
.seed-login .seed-row button{flex:1}
.seed-logout{font-size:12px}
.seed-strong{font-size:17px;font-weight:900}
.seed-link{font-size:12px;margin-left:6px}
.seed-warning-row{background:#fff6ea}
.seed-modal{border:1px solid var(--line);background:#fff8fb;border-radius:12px;padding:12px;margin:12px 0}
.seed-modal input{max-width:240px}

.share-checkboxes{display:flex;flex-wrap:wrap;gap:13px;margin:12px 0}
.share-checkboxes label{display:flex;align-items:center;gap:7px;background:white;border:1px solid var(--line);padding:10px;border-radius:9px;font-size:12px;font-weight:750}
.share-checkboxes input[type=checkbox]{min-height:0;width:17px;height:17px;margin:0;accent-color:var(--rose)}
.share-cell input[type=checkbox]{min-height:0;width:19px;height:19px;margin:0;accent-color:var(--rose)}
.share-badge{font-size:12px;color:var(--grey)}
.share-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:13px;margin-top:15px}
.share-tile{border:1px solid var(--line);background:#fff;border-radius:14px;padding:19px}
.share-tile h3{margin:4px 0 9px}
.share-tile p{color:var(--grey);font-size:13px}
.share-tile a{font-weight:850}
#shareRows td strong{font-size:13px}
@media(max-width:820px){.share-checkboxes{flex-direction:column;align-items:stretch}.share-checkboxes label{width:100%}}

/* Têtes de série — tous les simples D, regroupés par tableau */
.seed-overview{margin:15px 0;padding:13px 16px;border:1px solid var(--line);border-radius:10px;background:var(--soft,#f8fafc);font-weight:700;font-size:13px}
.seed-filters{margin:13px 0;align-items:center}
.seed-filters select{max-width:none}
.seed-filters input[type="search"]{flex:1;min-width:175px}
.seed-draw{border:1px solid var(--line);border-radius:12px;padding:14px;margin:15px 0;background:white}
.seed-draw-title{display:flex;align-items:center;justify-content:space-between;margin:0 0 11px}
.seed-draw-title h3{font-size:17px;margin:0 0 5px}
.seed-draw-title p{font-size:12px;color:var(--grey);margin:0}
.seed-table{width:100%;min-width:680px}
.seed-table td{vertical-align:top}
.seed-table td small{display:block;font-size:11px;color:var(--grey)}
.seed-order{width:55px;font-weight:800;color:var(--grey)}
.seed-c-row{background:#ffe2e8!important}
.seed-c-row td,.seed-c-row td strong{color:#94112d!important}
.seed-c-row td small{color:#8b4655!important}
.seed-c-count,.seed-c-marker{font-weight:800;color:#a10f30}
.seed-c-marker{display:inline-block;background:#ffc1cf;padding:2px 7px;border-radius:5px;font-size:11px;margin-top:4px}
.seed-c-maybe-row{background:#fff1e3}
.seed-c-possible{display:inline-block;color:#945a00;font-size:11px;font-weight:750;margin-top:4px}
.seed-warning-label{color:#935300}
@media(max-width:720px){.seed-draw{padding:10px}.seed-draw-title h3{font-size:16px}.seed-filters select,.seed-filters input,.seed-filters button{width:100%}}

/* Unified LFBB C/D public ranking — sortable and readable on mobile */
#publicHead .sort-title,#tournamentHead .sort-title{display:flex;align-items:center;gap:8px;padding:0;border:0;background:transparent;font:inherit;color:inherit;letter-spacing:inherit;text-transform:inherit;font-weight:800;text-align:left;white-space:nowrap;cursor:pointer}
#publicHead .sort-title:hover,#tournamentHead .sort-title:hover{color:var(--rose2)}
#publicHead [aria-sort="ascending"] .sort-title,#publicHead [aria-sort="descending"] .sort-title,
#tournamentHead [aria-sort="ascending"] .sort-title,#tournamentHead [aria-sort="descending"] .sort-title{color:var(--rose2)}
#publicHead .sort-title span,#tournamentHead .sort-title span{font-size:15px;font-weight:800}
#publicRows .player-link,#tournamentRows .player-link{border:0;background:none;padding:0;color:var(--ink);text-align:left;font-weight:850;font-size:15px;cursor:pointer;white-space:normal}
#publicRows .player-link:hover,#tournamentRows .player-link:hover{color:var(--rose2);text-decoration:underline}
#publicRows tr[data-licence],#tournamentRows tr[data-licence]{cursor:pointer}
#publicRows small,#tournamentRows small{display:block;color:var(--grey);font-size:11px;margin-top:2px}
#publicRows td:first-child,#tournamentRows td:first-child{min-width:170px}
#publicRows .statcell,#tournamentRows .statcell{font-variant-numeric:tabular-nums;white-space:nowrap}
.tag.level-c{background:#ffe4eb;color:#9d1640}
.tag.level-d{background:#eaf3f1;color:#276c5c}
.tournament-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(185px,1fr));gap:10px;margin:17px 0}
.tournament-choice{border:1px solid var(--line);background:#fff;border-radius:12px;text-align:left;padding:13px;min-height:82px;display:flex;flex-direction:column;gap:8px;justify-content:space-between}
.tournament-choice strong{font-size:13px;line-height:1.3}
.tournament-choice small{font-size:11px;color:var(--grey)}
.tournament-choice.active{border-color:var(--rose);background:#fff4f8;box-shadow:0 0 0 1px var(--rose)}
.tournament-choice:hover{border-color:var(--rose)}
.tournament-points{font-weight:750;white-space:nowrap;color:var(--rose2)}
.empty-entry{color:#ae9ea6}
#publicTournamentsPanel .scroller{margin-top:14px}
#publicTournamentsPanel .sectionhead a{font-size:12px;font-weight:750}
#playerModal .modalbox{max-width:980px}
#modalResults h3{font-size:17px;margin:25px 0 5px}
#modalResults h3:first-child{margin-top:12px}
#modalResults table{min-width:670px}
#modalMeta{color:var(--grey);font-size:12px;padding-right:26px}
@media(max-width:760px){.tournament-choices{grid-template-columns:repeat(2,minmax(0,1fr))}.tournament-choice{padding:10px}.tournament-choice strong{font-size:12px}#publicRows .player-link,#tournamentRows .player-link{font-size:14px}}

/* Public 52-week tournament list and chronological calendar */
.tournament-list-table{min-width:580px}
.tournament-list-table tr[data-tour]{cursor:pointer}
.tournament-list-table tr[data-tour]:hover,.tournament-list-table tr[data-tour]:focus{background:#fff1f6;outline:none}
.tournament-list-table tr[data-tour]:focus-visible{box-shadow:inset 0 0 0 2px var(--rose)}
.tournament-list-table .tournament-date{white-space:nowrap;font-weight:800;color:var(--rose2);width:120px}
.tournament-list-table td:nth-child(2){min-width:220px}
#publicTournamentDetail .sectionhead h2{font-size:23px}
#publicTournamentDetail .textbutton{font-size:13px;margin-bottom:18px}
#publicTournamentDetail table{min-width:580px}
#publicTournamentDetail td:nth-child(3){min-width:170px}
#publicCalResults .calendar-date-list{display:flex;flex-direction:column;gap:9px;margin-top:15px}
#publicCalResults .calendar-public-row{display:grid;grid-template-columns:125px minmax(0,1fr) auto;align-items:center;gap:16px}
#publicCalResults .calendar-public-row .calendar-date{align-self:start;font-size:14px;white-space:nowrap}
#publicCalResults .calendar-public-row .calendar-row-main{display:flex;flex-direction:column;gap:6px;min-width:0}
#publicCalResults .calendar-public-row .calendar-row-main h4{margin:0}
#publicCalResults .calendar-public-row .calendar-actions{padding:0;margin:0;justify-content:flex-end}
#publicCalResults .calendar-public-row .calendar-actions a{white-space:nowrap}
#adminCalResults .calendar-date-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(285px,1fr));gap:12px}
@media(max-width:760px){
 #publicCalResults .calendar-public-row{grid-template-columns:1fr;align-items:stretch;gap:7px}
 #publicCalResults .calendar-public-row .calendar-date{font-size:13px}
 #publicCalResults .calendar-public-row .calendar-actions{justify-content:flex-start}
}

/* Public unified ranking: position numbering follows active sorts and filters. */
#publicRankPanel.unified-ranking #publicHead th:nth-child(1),
#publicRankPanel.unified-ranking #publicRows td:nth-child(1),
#publicRankPanel.unified-ranking #publicHead th:nth-child(n+4),
#publicRankPanel.unified-ranking #publicRows td:nth-child(n+4){text-align:center}
#publicRankPanel.unified-ranking #publicHead th:nth-child(n+4) .sort-title{
 width:100%;
 justify-content:center;
 text-align:center;
}
#publicRankPanel.unified-ranking #publicHead th:nth-child(2),
#publicRankPanel.unified-ranking #publicHead th:nth-child(3),
#publicRankPanel.unified-ranking #publicRows td:nth-child(2),
#publicRankPanel.unified-ranking #publicRows td:nth-child(3){text-align:left}
#publicRankPanel.unified-ranking #publicHead th:nth-child(2) .sort-title,
#publicRankPanel.unified-ranking #publicHead th:nth-child(3) .sort-title{
 justify-content:flex-start;
 text-align:left;
}
#publicRankPanel.unified-ranking .rank-position{
 width:76px;
 min-width:76px;
 font-weight:800;
 font-variant-numeric:tabular-nums;
 color:var(--rose2);
}
#publicRankPanel.unified-ranking .rank-position-head{width:76px;min-width:76px}


/* Public pages — phone-first presentation. Desktop tables remain unchanged. */
.mobile-sortbar{display:none}
@media (max-width:700px){
 body{font-size:14px;overflow-x:hidden}
 .wrap{width:calc(100% - 20px)}
 .top{padding:12px 0 50px}
 .top-line{gap:9px;margin-bottom:16px;align-items:flex-start}
 .brand{gap:8px;min-width:0;flex:1}
 .brandlogo{width:38px;height:38px}
 .brand b{font-size:12px;line-height:1.25}
 .brand small{font-size:10px;line-height:1.3}
 .top nav{flex:none}
 .top nav a{font-size:11px}
 .eyebrow{font-size:10px}
 .top h1{font-size:27px;margin:6px 0}
 .top p{font-size:11px;line-height:1.4}
 main.wrap{margin-top:-37px}
 .panel{padding:12px;border-radius:13px;margin-bottom:12px;box-shadow:0 5px 14px #4c153011}
 .pagebar{display:flex;flex-direction:column;align-items:stretch;gap:7px;margin:9px 0 12px}
 .tabs{display:flex;flex-wrap:nowrap;gap:6px;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;padding:3px 1px 8px;scrollbar-width:thin}
 .tabs button{font-size:12px;padding:9px 12px;white-space:nowrap;flex:none;scroll-snap-align:start;border-radius:8px}
 .rightbuttons{align-self:stretch;justify-content:flex-end}
 #exportExcel{font-size:12px;padding:7px 12px}
 #publicFilters,#publicCalendar .filterrow{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:8px 0 12px}
 #publicFilters #publicSearch,#publicCalendar .filterrow input{grid-column:1/-1}
 #publicFilters input,#publicFilters select,#publicCalendar .filterrow input,#publicCalendar .filterrow select,
 #tournamentSearch{width:100%;min-width:0;min-height:42px;margin:0;padding:8px;font-size:16px}
 #publicFilters select{padding:8px 6px}
 #rankingHelp{font-size:11px;line-height:1.4;margin:10px 0}
 #publicCount,#tournamentCount,#tournamentDetailCount{font-size:11px;line-height:1.5}
 #mobileSortBar:not([hidden]){display:block;margin:12px 0 10px;border-top:1px solid var(--line);padding-top:12px}
 .mobile-sortbar label{display:block;font-size:12px;font-weight:800;margin-bottom:6px}
 .mobile-sortcontrols{display:flex;gap:7px;align-items:stretch}
 .mobile-sortcontrols select{flex:1;min-width:0;max-width:100%;width:100%;font-size:15px;padding:8px 6px}
 .mobile-sortcontrols button{flex:none;min-width:120px;font-size:12px;padding:7px 9px;white-space:nowrap}

 /* Ranking — every player becomes a compact, fully visible card. */
 #publicRankPanel.unified-ranking .scroller{overflow:visible}
 #publicRankPanel.unified-ranking table{display:block;width:100%;min-width:0}
 #publicRankPanel.unified-ranking #publicHead{display:none}
 #publicRankPanel.unified-ranking #publicRows{display:grid;gap:9px}
 #publicRankPanel.unified-ranking #publicRows tr[data-licence]{
  display:grid;grid-template-columns:48px minmax(0,1fr) minmax(0,1fr) 78px;
  grid-template-areas:"pos name name name" "pos genre category level" "promo promo played played" "ptsD ptsD ptsC ptsC";
  align-items:center;column-gap:7px;row-gap:5px;
  padding:10px;background:#fff;border:1px solid var(--line);border-radius:12px;
  box-shadow:0 2px 6px #4c15300b;
 }
 #publicRankPanel.unified-ranking #publicRows tr[data-licence]:active{background:#fff6f9}
 #publicRankPanel.unified-ranking #publicRows td{display:block;min-width:0!important;width:auto;border:0;padding:2px 0;text-align:left!important;overflow-wrap:anywhere}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(1){grid-area:pos;align-self:start;font-size:19px;color:var(--rose2);padding:1px 0;min-width:0}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(2){grid-area:name}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(3){grid-area:genre;color:var(--grey);font-size:12px}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(4){grid-area:category;font-size:12px;white-space:nowrap}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(5){grid-area:level;text-align:right!important}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(6){grid-area:promo;background:#faf6f8;padding:7px 9px;border-radius:7px;font-size:15px;font-weight:850;text-align:right!important}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(7){grid-area:played;background:#faf6f8;padding:7px 9px;border-radius:7px;font-size:15px;font-weight:850;text-align:right!important}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(8){grid-area:ptsD;background:#f4f3f6;padding:9px 10px;border-radius:8px;text-align:right!important}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(9){grid-area:ptsC;background:#fff0f5;padding:9px 10px;border-radius:8px;text-align:right!important}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(6)::before{content:"Points montée C"}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(7)::before{content:"Tournois joués"}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(8)::before{content:"Points D"}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(9)::before{content:"Points C"}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(n+6)::before{display:block;font-size:10px;letter-spacing:.01em;color:var(--grey);font-weight:650;text-align:left}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(8) b,
 #publicRankPanel.unified-ranking #publicRows td:nth-child(9) b{font-size:19px;line-height:1.2;color:var(--ink)}
 #publicRankPanel.unified-ranking #publicRows .player-link{font-size:16px;line-height:1.2;font-weight:850}
 .mobile-load-more:not([hidden]){display:block;width:100%;margin:14px 0 4px;padding:12px;font-weight:800;font-size:13px;border-radius:9px}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(2) small{font-size:11px;line-height:1.3;margin-top:3px}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(4) small{font-size:10px}

 /* Promotion history — one readable entry per player. */
 #publicRankPanel:not(.unified-ranking) .scroller{overflow:visible}
 #publicRankPanel:not(.unified-ranking) table{display:block;min-width:0}
 #publicRankPanel:not(.unified-ranking) #publicHead{display:none}
 #publicRankPanel:not(.unified-ranking) #publicRows{display:grid;gap:9px}
 #publicRankPanel:not(.unified-ranking) #publicRows tr[data-licence]{
  display:grid;grid-template-columns:1fr 1fr;gap:7px;
  background:#fff;border:1px solid var(--line);border-radius:11px;padding:12px
 }
 #publicRankPanel:not(.unified-ranking) #publicRows td{display:block;border:0;padding:2px 0;min-width:0!important;width:auto;overflow-wrap:anywhere}
 #publicRankPanel:not(.unified-ranking) #publicRows td:nth-child(1){grid-column:1/-1;grid-row:1;color:var(--rose2);font-size:12px;text-align:left}
 #publicRankPanel:not(.unified-ranking) #publicRows td:nth-child(2){grid-column:1/-1;grid-row:2;padding-right:0}
 #publicRankPanel:not(.unified-ranking) #publicRows td:nth-child(3),
 #publicRankPanel:not(.unified-ranking) #publicRows td:nth-child(4),
 #publicRankPanel:not(.unified-ranking) #publicRows td:nth-child(5),
 #publicRankPanel:not(.unified-ranking) #publicRows td:nth-child(6){font-size:12px;color:var(--grey)}
 #publicRankPanel:not(.unified-ranking) #publicRows td:nth-child(7){grid-column:1/-1;background:#fff5f8;border-radius:7px;padding:8px;font-size:12px}
 #publicRankPanel:not(.unified-ranking) #publicRows td:nth-child(7)::before{content:"Motif de montée · ";font-weight:750}

 /* Tournament index — date, tournament and source without horizontal scroll. */
 #publicTournamentList .scroller,#publicTournamentDetail .scroller{overflow:visible}
 #publicTournamentList table,#publicTournamentDetail table{display:block;min-width:0;width:100%}
 #publicTournamentList thead,#tournamentHead{display:none}
 #tournamentListRows,#tournamentRows{display:grid;gap:9px}
 #tournamentListRows tr[data-tour]{display:grid;grid-template-columns:1fr auto;gap:6px;
  border:1px solid var(--line);border-radius:11px;padding:12px;background:#fff}
 #tournamentListRows td{display:block;padding:0;border:0;min-width:0!important;overflow-wrap:anywhere}
 #tournamentListRows td:nth-child(1){grid-column:1;font-size:12px;font-weight:800}
 #tournamentListRows td:nth-child(2){grid-column:1/-1;grid-row:2;font-size:14px}
 #tournamentListRows td:nth-child(3){grid-column:2;grid-row:1;font-size:12px;color:var(--grey)}
 #tournamentListRows td:nth-child(3)::after{content:" joueurs"}
 #tournamentListRows td:nth-child(4){grid-column:1/-1;grid-row:3;font-size:12px}
 #publicTournamentDetail .sectionhead h2{font-size:20px;line-height:1.25}
 #publicTournamentDetail .sectionhead{gap:8px}
 #publicTournamentDetail #tournamentSearch{width:100%}
 #tournamentRows tr[data-licence]{display:grid;grid-template-columns:1fr 1fr;column-gap:12px;row-gap:6px;
  border:1px solid var(--line);border-radius:11px;padding:12px;background:#fff}
 #tournamentRows td{display:block;border:0;padding:0;min-width:0!important;overflow-wrap:anywhere}
 #tournamentRows td:nth-child(1){grid-column:1/-1}
 #tournamentRows td:nth-child(1) .player-link{font-size:15px}
 #tournamentRows td:nth-child(2){font-size:12px;color:var(--grey)}
 #tournamentRows td:nth-child(3){font-size:12px;text-align:right}
 #tournamentRows td:nth-child(4){font-size:12px}
 #tournamentRows td:nth-child(4)::before{content:"Résultat : ";color:var(--grey)}
 #tournamentRows td:nth-child(5){font-size:17px;font-weight:850;text-align:right!important;color:var(--rose2)}
 #tournamentRows td:nth-child(5)::before{content:"Points : ";font-size:11px;color:var(--grey);font-weight:500}
 #tournamentRows small{font-size:10px}

 /* Detailed player profile, full screen and touch-friendly. */
 #playerModal{padding:0;align-items:stretch}
 #playerModal .modalbox{width:100%;max-width:none;max-height:100dvh;min-height:100dvh;border-radius:0;padding:16px 12px 34px;overscroll-behavior:contain}
 #playerModal .close{position:sticky;float:right;top:0;right:0;z-index:4;min-width:40px;min-height:40px}
 #modalName{font-size:21px;padding-right:30px;line-height:1.25}
 #modalMeta{font-size:12px;line-height:1.6;margin-bottom:16px}
 #modalResults h3{font-size:16px}
 #modalResults .scroller{overflow:visible}
 #modalResults table{display:block;min-width:0}
 #modalResults thead{display:none}
 #modalResults tbody{display:grid;gap:8px}
 #modalResults tr{display:grid;grid-template-columns:1fr 1fr;gap:5px;background:#fff;border:1px solid var(--line);border-radius:9px;padding:10px}
 #modalResults td{display:block;border:0;padding:1px 0;min-width:0!important;font-size:12px;overflow-wrap:anywhere}
 #modalResults td:nth-child(2){grid-column:1/-1;font-weight:800;font-size:13px}
 #modalResults td:nth-child(1){grid-column:1;color:var(--grey)}
 #modalResults .scroller:first-of-type td:nth-child(3){grid-column:1/-1}
 #modalResults .scroller:first-of-type td:nth-child(4)::before{content:"Résultat : ";color:var(--grey)}
 #modalResults .scroller:first-of-type td:nth-child(5)::before{content:"Points D : ";color:var(--grey)}
 #modalResults .scroller:first-of-type td:nth-child(6)::before{content:"Points C : ";color:var(--grey)}
 #modalResults .scroller:first-of-type td:nth-child(7)::before{content:"Montée : ";color:var(--grey)}
 #modalResults .scroller:nth-of-type(2) td:nth-child(3)::before{content:"Classement : ";color:var(--grey)}
 #modalResults .scroller:nth-of-type(2) td:nth-child(5)::before{content:"Place : ";color:var(--grey)}
 #modalResults .scroller:nth-of-type(2) td:nth-child(6)::before{content:"Points : ";color:var(--grey)}

 /* Existing chronological calendar: keep date, location and action visible. */
 #publicCalResults .calendar-public-row{padding:12px;gap:7px}
 #publicCalResults .calendar-public-row .calendar-date{font-size:13px}
 #publicCalResults .calendar-public-row .calendar-actions a{display:inline-flex;align-items:center;min-height:35px;font-size:13px}
 #publicCalendar .sectionhead h2,#promotionRules h2{font-size:21px}
 #promotionRules{font-size:13px;line-height:1.6}
 #promotionRules ul{padding-left:20px}
}
@media (max-width:365px){
 #publicRankPanel.unified-ranking #publicRows tr[data-licence]{grid-template-columns:43px minmax(0,1fr) minmax(0,1fr) 65px;column-gap:5px;padding:8px}
 .mobile-sortcontrols button{min-width:102px;padding:7px 6px}
 #publicRankPanel.unified-ranking #publicRows td:nth-child(8) b,
 #publicRankPanel.unified-ranking #publicRows td:nth-child(9) b{font-size:17px}
}

/* Calendrier public : éviter qu'une plage sur deux jours déborde sur le nom. */
#publicCalResults .calendar-public-row{
 grid-template-columns:minmax(160px,180px) minmax(0,1fr) auto;
}
#publicCalResults .calendar-public-row .calendar-date{
 min-width:0;
 white-space:normal;
 overflow-wrap:normal;
 font-variant-numeric:tabular-nums;
}
@media(max-width:760px){
 #publicCalResults .calendar-public-row{grid-template-columns:minmax(0,1fr);}
}
/* Évolution entre deux publications : icône minuscule à côté de la position, sans badge. */
#publicRankPanel.unified-ranking .rank-position-number{font-variant-numeric:tabular-nums;}
#publicRankPanel.unified-ranking .rank-movement{
 display:inline-block;
 margin-left:4px;
 font-size:10px;
 line-height:1;
 font-weight:600;
 vertical-align:1px;
 opacity:.62;
 color:#857c83;
 white-space:nowrap;
}
#publicRankPanel.unified-ranking .rank-movement-up{color:#688371;}
#publicRankPanel.unified-ranking .rank-movement-down{color:#97828c;}
@media(max-width:700px){
 #publicRankPanel.unified-ranking .rank-movement{font-size:9px;margin-left:3px;}
}

/* Exceptions à la règle C/D : montée C après clôture = D maintenu au tournoi. */
.seed-c-allowed{display:inline-block;font-size:11px;font-weight:750;color:#35624e;margin-top:4px}


/* Ranking public: keep numeric column labels visible during page scrolling
   while respecting the table's independent horizontal scroll. */
.public-rank-sticky{
 position:fixed;
 top:0;
 z-index:55;
 overflow:hidden;
 background:#faf6f8;
 border-bottom:1px solid var(--line);
 box-shadow:0 3px 9px #4c153014;
}
.public-rank-sticky[hidden]{display:none!important}
.public-rank-sticky .public-rank-sticky-table{
 min-width:0;
 margin:0;
 border-collapse:collapse;
 table-layout:fixed;
}
.public-rank-sticky th{
 box-sizing:border-box;
 background:#faf6f8;
 vertical-align:middle;
}
.public-rank-sticky .rank-position-head{
 width:76px;
 min-width:76px;
}
.public-rank-sticky .sort-title{
 display:flex;
 align-items:center;
 gap:8px;
 padding:0;
 border:0;
 background:transparent;
 font:inherit;
 color:inherit;
 letter-spacing:inherit;
 text-transform:inherit;
 font-weight:800;
 text-align:left;
 white-space:nowrap;
 cursor:pointer;
}
.public-rank-sticky .sort-title:hover,
.public-rank-sticky [aria-sort="ascending"] .sort-title,
.public-rank-sticky [aria-sort="descending"] .sort-title{color:var(--rose2)}
.public-rank-sticky .sort-title span{font-size:15px;font-weight:800}
.public-rank-sticky th:nth-child(1),
.public-rank-sticky th:nth-child(n+4){text-align:center}
.public-rank-sticky th:nth-child(n+4) .sort-title{
 width:100%;
 text-align:center;
 justify-content:center;
}
.public-rank-sticky th:nth-child(2),
.public-rank-sticky th:nth-child(3){text-align:left}
.public-rank-sticky th:nth-child(2) .sort-title,
.public-rank-sticky th:nth-child(3) .sort-title{
 justify-content:flex-start;
 text-align:left;
}
@media(max-width:700px){
 .public-rank-sticky{display:none!important}
}


/* LFBB public: multi-selection filters, readable untruncated labels. */
#publicFilters{
 display:grid;
 grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));
 gap:9px;
 align-items:start;
}
#publicFilters #publicSearch{min-width:0;width:100%;height:56px}
#publicFilters .public-multi-filter{
 position:relative;
 min-width:0;
 width:100%;
 border:1px solid #e0cad4;
 border-radius:9px;
 background:#fff;
}
#publicFilters .public-multi-filter[hidden]{display:none!important}
#publicFilters .public-multi-filter > summary{
 list-style:none;
 cursor:pointer;
 min-height:56px;
 width:100%;
 padding:7px 27px 7px 9px;
 position:relative;
 line-height:1.25;
 word-break:normal;
 overflow-wrap:anywhere;
 white-space:normal;
}
#publicFilters .public-multi-filter > summary::-webkit-details-marker{display:none}
#publicFilters .public-multi-filter > summary::after{
 content:"⌄";position:absolute;right:8px;top:50%;
 transform:translateY(-50%);font-size:17px;color:#83556b
}
#publicFilters .public-multi-filter[open] > summary::after{content:"⌃"}
#publicFilters .public-multi-filter:focus-within{outline:2px solid #efb3cc;outline-offset:1px}
#publicFilters .filter-title{
 display:block;
 font-size:11px;
 font-weight:800;
 color:#7a596c;
 white-space:normal;
}
#publicFilters .filter-selected{
 display:block;
 font-size:12px;
 font-weight:660;
 color:var(--ink);
 white-space:normal;
 overflow-wrap:anywhere;
 margin-top:3px;
}
#publicFilters .has-selection .filter-selected{color:var(--rose2)}
#publicFilters .filter-choices{
 position:absolute;
 top:calc(100% + 3px);
 left:0;
 z-index:70;
 min-width:100%;
 width:max-content;
 max-width:min(350px,calc(100vw - 34px));
 max-height:300px;
 overflow-y:auto;
 overscroll-behavior:contain;
 border:1px solid #dec3cf;
 border-radius:10px;
 background:#fff;
 box-shadow:0 6px 20px #45152d24;
 padding:9px;
}
#publicFilters .filter-choices-header{
 font-size:11px;
 color:#7b6672;
 padding:3px 6px 8px;
 font-weight:800;
}
#publicFilters .filter-choice{
 display:flex;
 align-items:flex-start;
 gap:9px;
 padding:8px 6px;
 cursor:pointer;
 min-width:0;
 border-radius:6px;
 line-height:1.35;
 font-size:13px;
}
#publicFilters .filter-choice:hover{background:#fff5f9}
#publicFilters .filter-choice input[type="checkbox"]{
 width:17px;
 height:17px;
 margin:1px 0 0;
 padding:0;
 min-height:0;
 flex:none;
 accent-color:var(--rose2);
}
#publicFilters .filter-choice span{white-space:normal;overflow-wrap:anywhere}
#publicFilters .filter-reset{
 display:block;
 width:100%;
 margin-top:8px;
 padding:8px;
 border:1px solid #e3bccc;
 border-radius:7px;
 background:#fff8fa;
 color:var(--rose2);
 font-size:12px;
 font-weight:750;
}
@media(max-width:700px){
 /* Four navigation tabs fit entirely onto a phone without sideways swiping. */
 .pagebar .tabs{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
  width:100%;
  max-width:100%;
  overflow:visible;
  scroll-snap-type:none;
  padding:0;
 }
 .pagebar .tabs button{
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  width:100%;
  max-width:100%;
  min-height:45px;
  padding:7px 5px;
  white-space:normal;
  overflow-wrap:anywhere;
  text-align:center;
  line-height:1.2;
  font-size:11px;
 }
 #publicFilters{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  align-items:start;
 }
 #publicFilters #publicSearch{
  grid-column:1/-1;
  height:44px;
  min-height:44px;
 }
 #publicFilters .public-multi-filter{width:100%;min-width:0}
 #publicFilters .public-multi-filter > summary{
  min-height:62px;
  padding:7px 20px 7px 8px;
 }
 #publicFilters .public-multi-filter > summary::after{right:5px;font-size:14px}
 #publicFilters .filter-title{font-size:10px;line-height:1.2}
 #publicFilters .filter-selected{font-size:11px;line-height:1.25}
 #publicFilters #publicGender .filter-choices,
 #publicFilters #publicProvince .filter-choices{
  left:auto;right:0;
 }
 #publicFilters .filter-choices{
  min-width:100%;
  width:max-content;
  max-width:calc(100vw - 34px);
  max-height:270px;
 }
 .mobile-sortcontrols{display:flex;flex-wrap:wrap;gap:6px}
 .mobile-sortcontrols select{
  flex:1 1 210px;
  min-width:0;
  font-size:14px;
 }
 .mobile-sortcontrols button{
  flex:1 1 110px;
  min-width:0;
 }
}

/* Contrôle à la demande des montées C : résultat séparé TJO / ranking national */
.manual-promotion-panel{
 border:1px solid #c7d9e8;border-radius:11px;padding:14px 16px;
 background:#f6f9fd;margin:13px 0;
}
.manual-promotion-panel h3{margin:0 0 5px;font-size:15px;color:#204b70}
.manual-promotion-panel p{font-size:12px;line-height:1.5;margin:8px 0}
#manualPromotionStatus{font-weight:750;color:#305f82}
.manual-promotion-details{display:grid;gap:9px;margin-top:9px}
.manual-promotion-stage{background:#fff;border:1px solid #dde7ef;border-radius:9px;padding:10px 12px}
.manual-promotion-stage h4{margin:0 0 5px;font-size:13px}
.manual-promotion-stage p{margin:4px 0}
.manual-promotion-stage ul{margin:7px 0 0;padding-left:20px}
.manual-promotion-stage li{font-size:12px;line-height:1.6}
.manual-promotion-warning{color:#9d4a25;font-weight:650}
#manualPromotionScan[disabled]{opacity:.6;cursor:wait}
@media(max-width:700px){
 #montées>.sectionhead>.rightbuttons{display:grid;grid-template-columns:1fr;gap:7px;width:100%}
 #montées>.sectionhead>.rightbuttons button{width:100%;white-space:normal;line-height:1.25;min-height:40px}
 .manual-promotion-panel{padding:11px}
}
