/* Échiquier : grille 8 × 8 (ces règles n’étaient plus que dans l’ancienne feuille admin-base.css, non chargée côté public). */
.chess-board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));aspect-ratio:1;border:3px solid #25243e}
.chess-square{display:grid;place-items:center;aspect-ratio:1;min-width:0;min-height:0;border:0;padding:0;margin:0;font:400 clamp(1.4rem,5vw,3.4rem)/1 Georgia,serif;cursor:pointer;overflow:hidden}
.chess-square:disabled{cursor:default}
.chess-square.target{box-shadow:inset 0 0 0 5px #3d8154}
.game-page,.games-hub{width:min(1180px,calc(100% - 40px));margin:60px auto 90px}.game-header{max-width:800px;margin-bottom:38px}.game-header h1{margin:0;font:500 clamp(4rem,8vw,7.5rem)/.88 var(--serif)}.game-header>p{color:var(--muted);font:1.1rem/1.6 var(--serif)}.game-layout{display:grid;grid-template-columns:minmax(420px,680px) minmax(250px,1fr);gap:36px;align-items:start}.sudoku-card,.game-sidebar{background:#fff;padding:clamp(20px,4vw,38px);border:1px solid var(--line)}.game-toolbar{display:flex;justify-content:space-between;margin-bottom:18px}.game-toolbar strong{font:500 1.8rem var(--serif)}
.level-tabs{display:flex;flex-wrap:wrap;gap:8px;margin-top:25px}.level-tabs a{padding:9px 14px;border:1px solid var(--ink);border-radius:99px;font-size:.75rem;font-weight:800;text-transform:uppercase}.level-tabs a.active{background:var(--ink);color:#fff}.sudoku-grid{display:grid;grid-template-columns:repeat(9,1fr);aspect-ratio:1;border:3px solid var(--ink)}.sudoku-cell{display:grid;place-items:center;border-right:1px solid #aaa;border-bottom:1px solid #aaa;font:600 clamp(1rem,3vw,1.7rem) var(--serif)}.sudoku-cell:nth-child(3n){border-right:2px solid var(--ink)}.sudoku-cell:nth-child(9n){border-right:0}.sudoku-cell:nth-child(n+19):nth-child(-n+27),.sudoku-cell:nth-child(n+46):nth-child(-n+54){border-bottom:2px solid var(--ink)}.sudoku-cell:nth-child(n+73){border-bottom:0}.sudoku-cell.given{background:#ede8dd}.sudoku-cell input{width:100%;height:100%;border:0;text-align:center;background:transparent;color:#87651f;font:inherit;outline:0}.sudoku-cell:focus-within{background:#f3e7c8}.sudoku-cell.conflict{background:#f6d6d3}.sudoku-cell.revealed{background:#f3e4ce}
.game-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:20px}.game-actions .button{margin:0;border:0;cursor:pointer}.game-actions>button:not(.button){border:0;background:transparent;text-decoration:underline;cursor:pointer}.danger-link{color:#8d2525!important}.game-message{min-height:26px}.game-message.success{color:#276139}.game-message.error{color:#8d2525}.game-sidebar{position:sticky;top:20px}.game-sidebar h2{font:500 2.4rem var(--serif)}.game-stats{display:grid;grid-template-columns:1fr 1fr;margin:25px 0}.game-stats article{padding:18px;border:1px solid var(--line)}.game-stats strong,.game-stats span{display:block}.game-stats strong{font:500 2rem var(--serif);color:#9b762f}.game-stats span{font-size:.72rem;color:var(--muted)}
.games-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}.game-card{position:relative;overflow:hidden;isolation:isolate;min-height:400px;padding:42px;background:#fff;border-top:5px solid var(--gold);display:flex;flex-direction:column;justify-content:flex-end}.game-card>span{position:absolute;top:20px;right:28px;color:#ddd;font:500 6rem var(--serif)}.game-card h2{margin:4px 0;font:500 3rem/1 var(--serif)}.game-card b{margin-top:20px}.game-card>p,.game-card>h2,.game-card>b,.game-card>span{position:relative;z-index:2}.game-card-art{position:absolute;z-index:0;top:7%;right:-5%;width:64%;height:64%;color:var(--ink);fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;opacity:.085;pointer-events:none;transition:transform .35s ease,opacity .35s ease}.game-card.dark .game-card-art{color:var(--gold-light);opacity:.14}.game-card.chess .game-card-art,.game-card.multiplayer .game-card-art{fill:currentColor;stroke:currentColor;stroke-width:1.2}.game-card.chess .game-card-art{top:5%;right:-2%;width:58%;height:58%;opacity:.095}.game-card.multiplayer .game-card-art{top:8%;right:-8%;width:78%;height:52%;opacity:.1}.game-card:hover .game-card-art{transform:translate(-2%,-2%) scale(1.035);opacity:.14}.game-card.dark:hover .game-card-art{opacity:.2}@media(max-width:500px){.game-card-art{width:58%;height:58%;opacity:.075}}.game-card.dark{background:var(--ink);color:#fff}.game-card.dark>p:not(.eyebrow){color:#d2cfdb}.hub-account{text-align:center;margin-top:30px}.hub-account a{text-decoration:underline}.memory-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.memory-card{aspect-ratio:1;border:1px solid var(--gold);background:var(--ink);color:#fff;font:500 clamp(1.8rem,5vw,3.5rem) var(--serif);cursor:pointer}.memory-card.open,.memory-card.matched{background:#f1e5c8;color:var(--ink)}.memory-card.matched{opacity:.68}
@media(max-width:820px){.game-layout,.games-grid{grid-template-columns:1fr}.game-sidebar{position:static}.game-card{min-height:310px;padding:28px}}@media(max-width:500px){.game-page,.games-hub{width:calc(100% - 20px);margin-top:35px}.sudoku-card{padding:10px}.game-actions{align-items:stretch;flex-direction:column}.game-actions button{width:100%}}
.game-card.thread{grid-column:1/-1;min-height:320px;background:#e9e1d1}.leaderboard{margin-top:65px;padding:clamp(25px,5vw,55px);background:#fff;border-top:4px solid var(--ink)}.leaderboard h2{font:500 clamp(2.5rem,5vw,4.5rem)/1 var(--serif)}.leaderboard ol{list-style:none;padding:0}.leaderboard li{display:flex;justify-content:space-between;gap:20px;padding:15px 0;border-top:1px solid var(--line)}.leaderboard strong{color:#8a6827}.thread-card{max-width:760px;background:#fff;padding:clamp(28px,6vw,65px);border-top:5px solid var(--gold)}.thread-card h2{font:500 2.5rem/1 var(--serif)}.thread-clues{display:grid;gap:10px;padding:0;list-style:none}.thread-clues li{padding:17px;background:#eee9df;font:600 1.2rem var(--serif)}#threadForm{display:grid;grid-template-columns:1fr auto;gap:10px;margin-top:25px}#threadForm input{min-width:0;border:1px solid var(--ink);padding:14px}#threadForm .button{margin:0;border:0}.thread-actions{margin-top:12px}.thread-actions button{border:0;background:transparent;text-decoration:underline;cursor:pointer}.member-photo-field{padding:16px;background:#f2efe8;border:1px solid var(--line)}.member-photo-field .member-photo-clear{margin-top:8px;border:0;background:transparent;color:#8d2525;text-decoration:underline;cursor:pointer}

/* Toutes les vignettes du portail partagent désormais le même format. */
.games-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.game-card,.game-card.thread,.game-card.paths,.game-card.chess{grid-column:auto;aspect-ratio:1/1;min-height:0}
.game-card.chess{background:#dce3ea;border-top-color:#334b61}
@media(max-width:820px){.games-grid{grid-template-columns:1fr}.game-card,.game-card.thread,.game-card.paths,.game-card.chess{aspect-ratio:auto;min-height:310px}}

/* Lisibilité et aides communes à tous les jeux. */
.game-header>p{font-size:1.25rem;line-height:1.65;color:#4f4b58}
.game-card>span{color:#625e68;text-shadow:0 1px #fff}.game-card.dark>span{color:#ead7a6;text-shadow:none}.game-card>p:not(.eyebrow){font-size:1rem;line-height:1.65}.game-card b{font-size:.92rem}
.game-sidebar p,.thread-card p,.hub-account,.leaderboard li,.game-rankings li{font-size:1rem}.game-stats span{font-size:.85rem;color:#514d59}.level-tabs a{font-size:.84rem}
.game-tutorial{max-width:900px;margin:-12px 0 34px;background:#fff;border:1px solid var(--line);border-left:5px solid var(--gold)}.game-tutorial summary{padding:17px 20px;cursor:pointer;font-weight:800;font-size:1rem}.game-tutorial>div{padding:0 24px 22px;font-size:1rem;line-height:1.7}.game-tutorial p{margin:8px 0}.game-tutorial ol{margin:14px 0;padding-left:24px}.game-tutorial li{margin:7px 0}
.leaderboard-privacy-note{margin:24px 0 0;color:#514d59;font-size:.95rem}.leaderboard-privacy-note a{text-decoration:underline;text-underline-offset:3px}
.leaderboard-heading{display:flex;align-items:end;justify-content:space-between;gap:30px}.leaderboard li.is-me,.game-rankings li.is-me{margin-inline:-12px;padding-inline:12px;background:#f3e7c8;border-top-color:#c9a45b}.personal-rank{display:grid;min-width:220px;padding:18px;background:var(--ink);color:#fff}.personal-rank span,.personal-rank small{font-size:.88rem}.personal-rank strong{font:600 2.8rem/1 var(--serif);color:var(--gold-light)}.per-game-rankings{margin-top:55px}.per-game-rankings>header{max-width:760px;margin-bottom:24px}.per-game-rankings>header h2{margin:0;font:500 clamp(2.4rem,5vw,4.5rem)/1 var(--serif)}.per-game-rankings>header>p:last-child{color:#514d59}.game-ranking-title{display:flex;align-items:center;justify-content:space-between;gap:18px}.game-ranking-title h3{margin-bottom:12px}.game-ranking-title>span{padding:6px 10px;border-radius:99px;background:var(--ink);color:#fff;font-size:.82rem;font-weight:800}.game-rankings li span{display:flex;gap:10px}.game-rankings li span b{color:#76571b}.my-game-rank{margin:18px 0 0;padding:12px;background:#f3e7c8;color:var(--ink)!important}
.daily-leaderboard{background:#fff8e8;border-top-color:var(--gold)}.daily-leaderboard .leaderboard-heading>div>p:last-child{max-width:650px;color:#514d59}.streak-stat{background:#fff8e8!important}.streak-stat strong{color:#8a4b17!important}
@media(max-width:700px){.leaderboard-heading{align-items:stretch;flex-direction:column}.personal-rank{width:100%}}

/* Invitations internes pour les échecs entre amis. */
.friends-panel{margin:0 0 28px;padding:clamp(22px,4vw,38px);background:var(--ink);color:#fff;border-top:4px solid var(--gold)}
.friends-intro{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,480px);gap:38px;align-items:end}.friends-intro h2{margin:.2rem 0 .7rem;font:500 clamp(2.2rem,4vw,3.8rem)/1 var(--serif)}.friends-intro p{max-width:660px;color:#d8d5df}.friends-intro form,.friends-intro label{display:grid;gap:8px}.friends-intro form>div{display:flex}.friends-intro input{min-width:0;flex:1;padding:14px;border:1px solid #77748e;background:#fff;color:var(--ink);font:inherit}.friends-intro .button{flex:none;margin:0;border:0;cursor:pointer}
.friends-panel .game-message{margin:12px 0 0}.friends-panel .game-message.error{color:#ffc5bd}.friends-panel .game-message.success{color:#cce8d3}
.friend-requests,.friends-list{margin-top:24px}.friend-requests h3,.friends-list h3{margin:0 0 8px;font:500 1.7rem var(--serif)}.friend-requests article,.friends-list article{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:13px 0;border-top:1px solid #ffffff29}.friend-requests article>div{display:flex;gap:8px}.friend-requests button,.friends-list button{margin:0;cursor:pointer}.friend-action.secondary,.friend-action.remove{padding:9px 13px;border:1px solid #aaa6ba;background:transparent;color:#fff;font-weight:800}.friends-list span{display:grid;gap:3px}.friends-list small{color:#c8c4d2}
.chess-invitations{margin:0 0 28px;padding:clamp(22px,4vw,38px);background:#fff8e8;border:1px solid #dcc99d;border-top:4px solid var(--gold)}
.chess-invitations .section-head h2{margin:.2rem 0 1.2rem;font:500 clamp(2rem,4vw,3.4rem)/1 var(--serif)}
.chess-invitations article{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:18px 0;border-top:1px solid #dcc99d}
.chess-invitations article>div:first-child{display:grid;gap:5px}.chess-invitations small{color:#514d59}
.chess-invitations article>div:last-child{display:flex;gap:10px}.chess-invitations form{margin:0}.chess-invitations button{margin:0;cursor:pointer}
.chess-invitations .decline-chess-invite{padding:12px 18px;border:1px solid #8d2525;background:transparent;color:#8d2525;font-weight:800}
.player-picker{display:grid;gap:8px;max-width:520px;margin:22px 0 14px;font-weight:800}.player-picker select{width:100%;padding:14px;border:1px solid var(--ink);background:#fff;color:var(--ink);font:inherit}
.invite-box{margin-top:18px}.invite-box a{display:inline-block;text-decoration:underline;text-underline-offset:4px;font-weight:800}
@media(max-width:720px){.friends-intro{grid-template-columns:1fr}.friends-intro form>div{display:grid;gap:8px}.friend-requests article,.friends-list article{align-items:stretch;flex-direction:column}.friend-requests article>div{display:grid;grid-template-columns:1fr 1fr}.friend-requests button,.friends-list button{width:100%}}
@media(max-width:620px){.chess-invitations article{align-items:stretch;flex-direction:column}.chess-invitations article>div:last-child{display:grid;grid-template-columns:1fr 1fr}.chess-invitations article button{width:100%}}

/* Partie d’échecs complète. */
.chess-game-shell{display:grid;grid-template-columns:minmax(0,760px) minmax(240px,1fr);gap:28px;align-items:start;width:100%;min-width:0}.chess-main-card,.chess-moves-panel{min-width:0;background:#fff;padding:clamp(18px,3vw,32px);border:1px solid var(--line)}.chess-controls{display:flex;align-items:end;justify-content:space-between;gap:18px;margin-bottom:20px}.chess-controls label{display:grid;gap:7px;font-weight:700}.chess-controls select{min-width:250px;border:1px solid var(--ink);background:#fff;padding:11px}.chess-control-buttons{display:flex;align-items:center;gap:12px}.chess-control-buttons .button{margin:0;border:0;cursor:pointer}.chess-control-buttons>button:not(.button){border:0;background:transparent;color:#7a2d2d;text-decoration:underline;cursor:pointer}.chess-control-buttons button:disabled{opacity:.55;cursor:not-allowed}
.chess-player{display:flex;align-items:center;gap:12px;padding:12px 2px}.chess-player>div{display:grid}.chess-player small{font-size:.92rem;color:#514d59}.chess-avatar{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:var(--ink);color:#fff;font-size:1.35rem}.chess-avatar.human{background:var(--gold);color:var(--ink)}.bot-thinking{margin-left:auto;color:#514d59;font-weight:700}
.chess-board.full-board{box-sizing:border-box;width:min(100%,700px);max-width:700px;margin:auto;border:4px solid #25243e;box-shadow:0 15px 35px rgba(23,22,56,.16)}.chess-square{position:relative;min-width:0}.chess-square.light{background:#eee5d2}.chess-square.dark{background:#718398}.chess-square.piece-b{color:#111026;text-shadow:0 1px 0 #ffffff66}.chess-square.piece-w{color:#fffdf5;text-shadow:0 1px 2px #111026}.chess-square.last-move{box-shadow:inset 0 0 0 999px rgba(239,199,80,.28)}.chess-square.selected{box-shadow:inset 0 0 0 5px #f3bd36}.chess-square.legal-target::after{content:'';position:absolute;width:24%;aspect-ratio:1;border-radius:50%;background:#214f36aa}.chess-square.legal-target:not(:empty)::after{width:76%;background:transparent;border:5px solid #214f36aa}.chess-status{min-height:32px;margin:14px 0 0;font-weight:700}.chess-side-panel{display:grid;min-width:0;gap:20px}.chess-rating-card{position:static}.chess-record{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--line)}.chess-record span{display:grid;background:#fff;padding:12px;font-size:.92rem}.chess-record strong{font:600 1.55rem var(--serif);color:#76571b}.chess-moves-panel{max-height:520px;overflow:auto}.chess-moves-panel ol{list-style:none;margin:0;padding:0}.chess-moves-panel li{display:grid;grid-template-columns:34px minmax(0,1fr) minmax(0,1fr);gap:8px;padding:8px 0;border-bottom:1px solid var(--line);font-size:1rem}.chess-moves-panel li>span{color:#514d59}
@media(max-width:1050px){.chess-game-shell{grid-template-columns:1fr}.chess-side-panel{grid-template-columns:1fr 1fr}.chess-moves-panel{max-height:340px}}
@media(max-width:600px){.chess-controls{align-items:stretch;flex-direction:column}.chess-controls label,.chess-controls select{width:100%}.chess-control-buttons{justify-content:space-between}.chess-main-card{padding:12px}.chess-side-panel{grid-template-columns:1fr}.chess-square{font-size:clamp(1.7rem,10vw,3rem)}.game-tutorial{margin-top:-15px}.game-tutorial>div{padding-inline:18px}}

/* Icônes vectorielles sobres pour le jeu des paires. */
.memory-card svg{width:52%;height:52%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.memory-card.open{box-shadow:inset 0 0 0 2px rgba(201,164,91,.45)}

/* Salon d’échecs entre amis. */
.game-card.multiplayer{background:#efe3c7;border-top-color:#8a6827}.multiplayer-login,.multiplayer-dashboard,.match-list{margin:28px 0;padding:clamp(24px,5vw,48px);background:#fff;border-top:5px solid var(--gold)}.multiplayer-login h2,.multiplayer-lobby h2,.match-list h2{font:500 clamp(2rem,4vw,3.4rem)/1 var(--serif)}.multiplayer-dashboard{display:grid;grid-template-columns:1fr 260px;gap:35px}.multiplayer-lobby{display:contents}.multiplayer-rating{display:grid;align-content:center;padding:25px;background:var(--ink);color:#fff}.multiplayer-rating strong{font:500 4rem/1 var(--serif);color:var(--gold-light)}.multiplayer-rating span{font-size:.9rem;line-height:1.5}.invite-box{display:grid;grid-template-columns:1fr auto;gap:10px;margin-top:24px;padding:18px;background:#f3eee4}.invite-box label{grid-column:1/-1;display:grid;gap:7px;font-weight:700}.invite-box input{width:100%;padding:12px;border:1px solid var(--ink);background:#fff}.invite-box button{padding:10px 15px;border:1px solid var(--ink);background:#fff;cursor:pointer}.invite-box a{align-self:center;font-weight:800}.match-list{display:grid;gap:1px;background:var(--line)}.match-list h2{background:#fff;margin:0;padding-bottom:20px}.match-list a{display:grid;grid-template-columns:1fr auto auto;gap:20px;align-items:center;padding:17px;background:#fff}.match-list small{color:#514d59}.multiplayer-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:16px}.multiplayer-actions button{padding:9px 13px;border:1px solid var(--ink);background:#fff;cursor:pointer}.multiplayer-actions button:disabled{opacity:.45}.multiplayer-leaderboard{clear:both}.multiplayer-page>.chess-game-shell{margin-top:28px}
@media(max-width:820px){.personal-game-stats{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.multiplayer-dashboard{grid-template-columns:1fr}.multiplayer-lobby{display:block}.invite-box{grid-template-columns:1fr}.match-list a{grid-template-columns:1fr auto}.match-list a b{grid-column:1/-1}.multiplayer-rating{min-height:190px}.account-game-breakdown{grid-template-columns:1fr 1fr}}
.guest-game-warning{max-width:900px;margin:-12px 0 28px;padding:14px 18px;border-left:5px solid var(--gold);background:#fff8e8}.guest-game-warning a{text-decoration:underline;font-weight:800}

/* Multiplayer page flow: game first, ranking below, regardless of browser defaults. */
.multiplayer-page{display:flex!important;flex-direction:column!important;align-items:stretch!important}
.multiplayer-page>.game-header,.multiplayer-page>.game-tutorial,.multiplayer-page>.multiplayer-login,.multiplayer-page>.multiplayer-dashboard,.multiplayer-page>.match-list,.multiplayer-page>.chess-game-shell,.multiplayer-page>.multiplayer-leaderboard{width:100%;min-width:0;flex:0 0 auto}
.multiplayer-page>.multiplayer-leaderboard{display:block;clear:both;margin-top:65px}
.multiplayer-page .chess-square{display:flex;align-items:center;justify-content:center;overflow:hidden;line-height:1;font-family:"DejaVu Sans","Segoe UI Symbol","Noto Sans Symbols 2",Georgia,serif}
.chess-piece-svg{display:block;width:78%;height:78%;overflow:visible;fill:currentColor;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round;pointer-events:none}
.piece-w .chess-piece-svg{color:#fffdf5;stroke:#292843;filter:drop-shadow(0 1px 0 rgba(255,255,255,.35))}
.piece-b .chess-piece-svg{color:#15142f;stroke:#f1e7d1;stroke-width:.7}
.chess-piece-svg .piece-cut{fill:none;stroke-width:3}.chess-piece-svg .piece-eye{stroke:none}
.multiplayer-page .chess-game-shell>.multiplayer-leaderboard{grid-column:1/-1;width:100%;margin-top:37px}
#multiplayerBoardShell{grid-column:1/-1!important;width:100%!important;max-width:none!important}
.multiplayer-leaderboard{grid-column:1/-1!important;width:100%!important;max-width:none!important;flex:0 0 100%!important;clear:both!important}
.multiplayer-leaderboard h2{max-width:none;font-size:clamp(2.3rem,4vw,4rem);line-height:1}
/* Accessible control sizes for touch and low-vision use. */
.game-actions button,.thread-actions button,.multiplayer-actions button,.chess-control-buttons button,.invite-box button,.level-tabs a{min-height:44px}
@media(max-width:600px){.game-actions button,.thread-actions button,.multiplayer-actions button,.chess-control-buttons button,.invite-box button{padding-block:11px}}

/* Le numéro reste lisible sans entrer en collision avec l’illustration. */
.game-card>span{z-index:3;top:18px;right:22px;font-size:clamp(3.8rem,7vw,5.4rem);line-height:1}
.game-card-art{top:14%;right:3%;width:48%;height:48%;opacity:.075}
.game-card.chess .game-card-art{top:15%;right:5%;width:44%;height:44%}
.game-card.multiplayer .game-card-art{top:17%;right:2%;width:56%;height:38%}
@media(max-width:600px){.game-card>span{font-size:4rem}.game-card-art{top:18%;width:43%;height:43%}}
.game-card>span{position:absolute!important;width:auto}.game-card-art{right:14%}.game-card.chess .game-card-art{right:16%}.game-card.multiplayer .game-card-art{right:14%}
.game-card-art,.game-card.chess .game-card-art,.game-card.multiplayer .game-card-art{right:30%}

/* Cahier jeux — proportions de presse, grille dense et couleurs Agora. */
.game-page,.games-hub{width:min(1240px,calc(100% - 44px));margin:34px auto 64px}
.games-hub>.game-header,.game-page>.game-header{display:grid;grid-template-columns:minmax(230px,.72fr) minmax(340px,1.28fr);gap:clamp(26px,5vw,76px);max-width:none;margin:0 0 26px;padding:18px 0 22px;border-top:4px double var(--ink);border-bottom:1px solid var(--ink);align-items:end}
.games-hub>.game-header .eyebrow,.game-page>.game-header .eyebrow{grid-column:1/-1;margin:0 0 -18px}
.games-hub>.game-header h1,.game-page>.game-header h1{font-size:clamp(3.2rem,5.5vw,5.6rem);line-height:.84;letter-spacing:-.035em}
.games-hub>.game-header>p:not(.eyebrow),.game-page>.game-header>p:not(.eyebrow){margin:0;padding:4px 0 4px 20px;border-left:3px solid var(--gold);color:#504b43;font:1rem/1.55 Montserrat,Arial,sans-serif}
.personal-game-stats{grid-template-columns:1.3fr repeat(6,minmax(0,1fr));margin:0 0 26px;border-block:1px solid var(--ink);background:transparent;gap:0}
.personal-game-stats article{min-width:0;padding:14px 12px;background:#fffaf1;border-right:1px solid var(--line)}
.personal-game-stats article:first-child{background:var(--ink)}
.personal-game-stats strong{font-size:1.7rem}.personal-game-stats span{font-size:.67rem;line-height:1.35}
.games-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:0;border-top:5px solid var(--gold);border-bottom:4px double var(--ink)}
.game-card,.game-card.thread,.game-card.paths,.game-card.chess,.game-card.multiplayer{grid-column:span 4;aspect-ratio:auto;min-height:285px;padding:28px 26px;border-top:0;border-right:1px solid rgba(7,24,45,.25);border-bottom:1px solid rgba(7,24,45,.25);background:#fffaf1}
.game-card:first-child{grid-column:span 7;min-height:330px;background:#efe0cd}
.game-card:nth-child(2){grid-column:span 5;min-height:330px;background:var(--ink)}
.game-card.thread{background:#e7ddc9}.game-card.chess{background:#dccdbd;border-top:0}.game-card.multiplayer{background:#ead7ab;border-top:0}
.game-card>span{top:15px;right:18px;color:rgba(7,24,45,.2);font-size:clamp(3rem,5vw,4.5rem)}
.game-card h2{max-width:12ch;font-size:clamp(2rem,3vw,3.1rem);line-height:.94}
.game-card>p:not(.eyebrow){max-width:38ch;font-size:.9rem;line-height:1.5}
.game-card b{padding-top:12px;border-top:1px solid currentColor;font-size:.72rem;letter-spacing:.08em;text-transform:uppercase}
.game-card-art,.game-card.chess .game-card-art,.game-card.multiplayer .game-card-art{top:12%;right:5%;width:44%;height:44%;opacity:.07}
.leaderboard,.per-game-rankings{margin-top:36px;padding:28px 30px;background:#fffaf1;border-top:4px solid var(--ink);box-shadow:none}
.leaderboard h2,.per-game-rankings h2{font-size:clamp(2.1rem,4vw,3.6rem);line-height:.92}
.leaderboard li{padding:11px 0}.game-rankings{gap:0;border-top:1px solid var(--ink);border-left:1px solid var(--line)}
.game-rankings article{padding:20px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);background:#fffaf1}
.game-rankings h3{font-size:1.55rem}
@media(max-width:960px){.personal-game-stats{grid-template-columns:repeat(3,1fr)}.personal-game-stats article:first-child{grid-column:1/-1}.game-card,.game-card.thread,.game-card.paths,.game-card.chess,.game-card.multiplayer{grid-column:span 6}.game-card:first-child,.game-card:nth-child(2){grid-column:span 6}}
@media(max-width:700px){.game-page,.games-hub{width:calc(100% - 24px);margin-top:22px}.games-hub>.game-header,.game-page>.game-header{grid-template-columns:1fr;gap:12px}.games-hub>.game-header .eyebrow,.game-page>.game-header .eyebrow{grid-column:auto;margin:0}.games-hub>.game-header>p:not(.eyebrow),.game-page>.game-header>p:not(.eyebrow){padding:10px 0 0;border-top:3px solid var(--gold);border-left:0}.games-grid{display:block}.game-card,.game-card.thread,.game-card.paths,.game-card.chess,.game-card.multiplayer,.game-card:first-child,.game-card:nth-child(2){min-height:270px;border-right:0}.personal-game-stats{grid-template-columns:repeat(2,1fr)}.leaderboard,.per-game-rankings{padding:22px 16px}.game-rankings{grid-template-columns:1fr}}

/* Mode nuit : les jeux avaient des fonds clairs en dur (texte clair sur fond blanc). */
:root[data-theme="dark"] .sudoku-card,:root[data-theme="dark"] .game-sidebar,:root[data-theme="dark"] .game-card,:root[data-theme="dark"] .leaderboard,:root[data-theme="dark"] .thread-card,:root[data-theme="dark"] .game-tutorial,:root[data-theme="dark"] .chess-main-card,:root[data-theme="dark"] .chess-moves-panel,:root[data-theme="dark"] .chess-record span,:root[data-theme="dark"] .multiplayer-login,:root[data-theme="dark"] .multiplayer-dashboard,:root[data-theme="dark"] .match-list h2,:root[data-theme="dark"] .match-list a,:root[data-theme="dark"] .personal-game-stats article,:root[data-theme="dark"] .game-rankings article,:root[data-theme="dark"] .per-game-rankings{background:var(--card)!important;color:var(--ink)}
:root[data-theme="dark"] .game-card,:root[data-theme="dark"] .game-card.thread,:root[data-theme="dark"] .game-card.paths,:root[data-theme="dark"] .game-card.chess,:root[data-theme="dark"] .game-card.multiplayer{border-color:var(--line)}
:root[data-theme="dark"] .game-card:first-child,:root[data-theme="dark"] .game-card.thread,:root[data-theme="dark"] .game-card.chess,:root[data-theme="dark"] .game-card.multiplayer,:root[data-theme="dark"] .thread-clues li,:root[data-theme="dark"] .member-photo-field,:root[data-theme="dark"] .invite-box,:root[data-theme="dark"] .daily-leaderboard,:root[data-theme="dark"] .streak-stat,:root[data-theme="dark"] .guest-game-warning,:root[data-theme="dark"] .chess-invitations{background:var(--sand)!important;color:var(--ink)}
:root[data-theme="dark"] .chess-invitations,:root[data-theme="dark"] .chess-invitations article{border-color:#3a3f4f}
:root[data-theme="dark"] .game-card:nth-child(2),:root[data-theme="dark"] .game-card.dark,:root[data-theme="dark"] .personal-game-stats article:first-child,:root[data-theme="dark"] .personal-rank,:root[data-theme="dark"] .game-ranking-title>span,:root[data-theme="dark"] .friends-panel,:root[data-theme="dark"] .multiplayer-rating,:root[data-theme="dark"] .chess-avatar,:root[data-theme="dark"] .memory-card{background:#232738!important;color:#f4efe4}
:root[data-theme="dark"] .game-card:nth-child(2) *,:root[data-theme="dark"] .personal-game-stats article:first-child *{color:inherit}
:root[data-theme="dark"] .level-tabs a.active{background:var(--gold-lt);color:#0f1220}
:root[data-theme="dark"] .chess-avatar.human{background:var(--gold-lt)!important;color:#0f1220}
:root[data-theme="dark"] .game-card>span{color:rgba(236,230,218,.18)!important;text-shadow:none!important}
:root[data-theme="dark"] .game-header>p,:root[data-theme="dark"] .game-stats span,:root[data-theme="dark"] .leaderboard-privacy-note,:root[data-theme="dark"] .per-game-rankings>header>p:last-child,:root[data-theme="dark"] .daily-leaderboard .leaderboard-heading>div>p:last-child,:root[data-theme="dark"] .chess-invitations small,:root[data-theme="dark"] .chess-player small,:root[data-theme="dark"] .bot-thinking,:root[data-theme="dark"] .chess-moves-panel li>span,:root[data-theme="dark"] .match-list small,:root[data-theme="dark"] .games-hub>.game-header>p:not(.eyebrow),:root[data-theme="dark"] .game-page>.game-header>p:not(.eyebrow){color:var(--mut)!important}
:root[data-theme="dark"] .leaderboard strong,:root[data-theme="dark"] .game-stats strong,:root[data-theme="dark"] .game-rankings li span b,:root[data-theme="dark"] .chess-record strong,:root[data-theme="dark"] .sudoku-cell input,:root[data-theme="dark"] .streak-stat strong{color:var(--gold-dk)!important}
:root[data-theme="dark"] .leaderboard li.is-me,:root[data-theme="dark"] .game-rankings li.is-me,:root[data-theme="dark"] .my-game-rank,:root[data-theme="dark"] .sudoku-cell:focus-within,:root[data-theme="dark"] .memory-card.open,:root[data-theme="dark"] .memory-card.matched{background:#3a3220!important;color:var(--ink)!important}
:root[data-theme="dark"] .sudoku-cell{border-color:#4a4e5c}.sudoku-cell.given{background:#232633}.sudoku-cell.conflict{background:#4a2326}.sudoku-cell.revealed{background:#3a2f22}
:root[data-theme="dark"] .friends-intro input,:root[data-theme="dark"] .player-picker select,:root[data-theme="dark"] .chess-controls select,:root[data-theme="dark"] .invite-box input,:root[data-theme="dark"] #threadForm input{background:var(--bg)!important;color:var(--ink)!important;border-color:#4a4e5c}
:root[data-theme="dark"] .invite-box button,:root[data-theme="dark"] .multiplayer-actions button,:root[data-theme="dark"] .chess-control-buttons>button:not(.button){background:var(--bg);color:var(--ink);border-color:#4a4e5c}
:root[data-theme="dark"] .danger-link,:root[data-theme="dark"] .game-message.error,:root[data-theme="dark"] .member-photo-field .member-photo-clear,:root[data-theme="dark"] .chess-invitations .decline-chess-invite{color:#ff9b9b!important;border-color:#ff9b9b}
:root[data-theme="dark"] .game-message.success{color:#8fd3a3}
@media (prefers-color-scheme:dark){
:root:not([data-theme="light"]) .sudoku-card,:root:not([data-theme="light"]) .game-sidebar,:root:not([data-theme="light"]) .game-card,:root:not([data-theme="light"]) .leaderboard,:root:not([data-theme="light"]) .thread-card,:root:not([data-theme="light"]) .game-tutorial,:root:not([data-theme="light"]) .chess-main-card,:root:not([data-theme="light"]) .chess-moves-panel,:root:not([data-theme="light"]) .chess-record span,:root:not([data-theme="light"]) .multiplayer-login,:root:not([data-theme="light"]) .multiplayer-dashboard,:root:not([data-theme="light"]) .match-list h2,:root:not([data-theme="light"]) .match-list a,:root:not([data-theme="light"]) .personal-game-stats article,:root:not([data-theme="light"]) .game-rankings article,:root:not([data-theme="light"]) .per-game-rankings{background:var(--card)!important;color:var(--ink)}
:root:not([data-theme="light"]) .game-card,:root:not([data-theme="light"]) .game-card.thread,:root:not([data-theme="light"]) .game-card.paths,:root:not([data-theme="light"]) .game-card.chess,:root:not([data-theme="light"]) .game-card.multiplayer{border-color:var(--line)}
:root:not([data-theme="light"]) .game-card:first-child,:root:not([data-theme="light"]) .game-card.thread,:root:not([data-theme="light"]) .game-card.chess,:root:not([data-theme="light"]) .game-card.multiplayer,:root:not([data-theme="light"]) .thread-clues li,:root:not([data-theme="light"]) .member-photo-field,:root:not([data-theme="light"]) .invite-box,:root:not([data-theme="light"]) .daily-leaderboard,:root:not([data-theme="light"]) .streak-stat,:root:not([data-theme="light"]) .guest-game-warning,:root:not([data-theme="light"]) .chess-invitations{background:var(--sand)!important;color:var(--ink)}
:root:not([data-theme="light"]) .chess-invitations,:root:not([data-theme="light"]) .chess-invitations article{border-color:#3a3f4f}
:root:not([data-theme="light"]) .game-card:nth-child(2),:root:not([data-theme="light"]) .game-card.dark,:root:not([data-theme="light"]) .personal-game-stats article:first-child,:root:not([data-theme="light"]) .personal-rank,:root:not([data-theme="light"]) .game-ranking-title>span,:root:not([data-theme="light"]) .friends-panel,:root:not([data-theme="light"]) .multiplayer-rating,:root:not([data-theme="light"]) .chess-avatar,:root:not([data-theme="light"]) .memory-card{background:#232738!important;color:#f4efe4}
:root:not([data-theme="light"]) .game-card:nth-child(2) *,:root:not([data-theme="light"]) .personal-game-stats article:first-child *{color:inherit}
:root:not([data-theme="light"]) .level-tabs a.active{background:var(--gold-lt);color:#0f1220}
:root:not([data-theme="light"]) .chess-avatar.human{background:var(--gold-lt)!important;color:#0f1220}
:root:not([data-theme="light"]) .game-card>span{color:rgba(236,230,218,.18)!important;text-shadow:none!important}
:root:not([data-theme="light"]) .game-header>p,:root:not([data-theme="light"]) .game-stats span,:root:not([data-theme="light"]) .leaderboard-privacy-note,:root:not([data-theme="light"]) .per-game-rankings>header>p:last-child,:root:not([data-theme="light"]) .daily-leaderboard .leaderboard-heading>div>p:last-child,:root:not([data-theme="light"]) .chess-invitations small,:root:not([data-theme="light"]) .chess-player small,:root:not([data-theme="light"]) .bot-thinking,:root:not([data-theme="light"]) .chess-moves-panel li>span,:root:not([data-theme="light"]) .match-list small,:root:not([data-theme="light"]) .games-hub>.game-header>p:not(.eyebrow),:root:not([data-theme="light"]) .game-page>.game-header>p:not(.eyebrow){color:var(--mut)!important}
:root:not([data-theme="light"]) .leaderboard strong,:root:not([data-theme="light"]) .game-stats strong,:root:not([data-theme="light"]) .game-rankings li span b,:root:not([data-theme="light"]) .chess-record strong,:root:not([data-theme="light"]) .sudoku-cell input,:root:not([data-theme="light"]) .streak-stat strong{color:var(--gold-dk)!important}
:root:not([data-theme="light"]) .leaderboard li.is-me,:root:not([data-theme="light"]) .game-rankings li.is-me,:root:not([data-theme="light"]) .my-game-rank,:root:not([data-theme="light"]) .sudoku-cell:focus-within,:root:not([data-theme="light"]) .memory-card.open,:root:not([data-theme="light"]) .memory-card.matched{background:#3a3220!important;color:var(--ink)!important}
:root:not([data-theme="light"]) .sudoku-cell{border-color:#4a4e5c}.sudoku-cell.given{background:#232633}.sudoku-cell.conflict{background:#4a2326}.sudoku-cell.revealed{background:#3a2f22}
:root:not([data-theme="light"]) .friends-intro input,:root:not([data-theme="light"]) .player-picker select,:root:not([data-theme="light"]) .chess-controls select,:root:not([data-theme="light"]) .invite-box input,:root:not([data-theme="light"]) #threadForm input{background:var(--bg)!important;color:var(--ink)!important;border-color:#4a4e5c}
:root:not([data-theme="light"]) .invite-box button,:root:not([data-theme="light"]) .multiplayer-actions button,:root:not([data-theme="light"]) .chess-control-buttons>button:not(.button){background:var(--bg);color:var(--ink);border-color:#4a4e5c}
:root:not([data-theme="light"]) .danger-link,:root:not([data-theme="light"]) .game-message.error,:root:not([data-theme="light"]) .member-photo-field .member-photo-clear,:root:not([data-theme="light"]) .chess-invitations .decline-chess-invite{color:#ff9b9b!important;border-color:#ff9b9b}
:root:not([data-theme="light"]) .game-message.success{color:#8fd3a3}
}
:root[data-theme="dark"] .game-page .button{background:var(--gold-lt);color:#0f1220;border-color:var(--gold-lt)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .game-page .button{background:var(--gold-lt);color:#0f1220;border-color:var(--gold-lt)}}
