.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%}}

/* 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%}
