:root{--paper:#f5f2eb;--ink:#24251f;--muted:#77796c;--orange:#ed5c32;--line:#dedfd3}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:'DM Sans',sans-serif}.shell{max-width:550px;margin:auto;padding:28px 26px 18px}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;touch-action:manipulation}button:focus-visible,a:focus-visible{outline:3px solid #377be8;outline-offset:4px}button:disabled{cursor:default}button{border:0}button:hover{filter:brightness(.96)}[hidden]{display:none!important}.brand{display:flex;justify-content:space-between;align-items:center;margin-bottom:52px}.brand a{font:700 34px 'Space Grotesk',sans-serif;color:var(--ink);text-decoration:none;letter-spacing:-2px}.brand a>span:first-child{color:var(--orange)}.dot{color:var(--orange);margin-left:7px}.small{background:transparent;color:var(--ink);font-size:13px;padding:10px 0}.eyebrow{font-size:10px;letter-spacing:1.5px;font-weight:700;display:flex;align-items:center;gap:8px}.eyebrow i{width:7px;height:7px;background:var(--orange);border-radius:50%}h1{font:700 clamp(54px,12vw,76px)/.99 'Space Grotesk',sans-serif;letter-spacing:-4px;margin:22px 0}h1>span:not(.dot){color:var(--orange)}.intro{color:var(--muted);font-size:16px;line-height:1.65;margin-bottom:30px}.demo{background:#e9eade;border:1px solid #d8dacb;border-radius:18px;padding:18px;transform:rotate(-2deg);margin:30px 0}.demo-label{font-size:10px;font-weight:700;letter-spacing:1px;display:flex;justify-content:space-between}.demo-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:16px}.demo-cards>div{position:relative;background:var(--paper);border-radius:10px;font:600 36px 'Space Grotesk';text-align:center;padding:14px 0 10px}.demo-cards span{display:block;font-size:13px;color:#a4ae90;margin-top:6px}.demo-cards .chosen{background:var(--orange);color:white;transform:rotate(7deg) translateY(-6px);box-shadow:0 8px 0 #dbd9ca}.demo-cards .chosen span{color:#ffc7b6}.demo-cards b{position:absolute;right:-10px;bottom:-12px;color:var(--ink);font-size:35px}.demo-note{font-size:11px;text-align:center;color:var(--muted);margin-top:18px}.facts{display:flex;justify-content:space-between;margin:33px 0 25px;gap:10px}.facts div{display:flex;flex-direction:column;gap:4px}.facts b{font:600 25px 'Space Grotesk'}.facts span{font-size:10px;color:var(--muted)}.primary,.secondary{width:100%;border-radius:12px;padding:18px 20px;font-weight:700;display:flex;justify-content:space-between;align-items:center}.primary{background:var(--orange);color:#fff;box-shadow:0 4px 0 #cb4824}.secondary{margin-top:14px;border:1px solid var(--line);background:transparent}.home-footer{display:flex;justify-content:space-between;font-size:9px;color:var(--muted);margin-top:20px;gap:10px}.home-footer>span:first-child{font-weight:700;letter-spacing:1px}.footer{border-top:1px solid var(--line);margin-top:40px;padding-top:17px;font-size:8px;letter-spacing:.7px;color:var(--muted);display:flex;justify-content:space-between;gap:20px}.game-top{display:flex;align-items:center;justify-content:space-between;font-size:10px;letter-spacing:1px}#lives{color:var(--orange);font-size:19px;letter-spacing:3px}.score-line{display:flex;align-items:center;justify-content:space-between;margin:28px 0 20px}.score-line div{display:flex;flex-direction:column;gap:6px}.score-line div:last-child{text-align:right}.score-line span{font-size:10px;color:var(--muted);letter-spacing:1px}.score-line strong{font:700 60px/1 'Space Grotesk';letter-spacing:-3px}.score-line b{font-size:13px}#rule-panel{background:var(--ink);color:white;border-radius:16px;padding:22px;min-height:155px}.rule-top{display:flex;justify-content:space-between;color:#c2c6b1;font-size:9px;letter-spacing:1px}#instruction{font:600 27px/1.1 'Space Grotesk';letter-spacing:-.7px;margin:18px 0 8px}#hint{font-size:12px;color:#c2c6b1;margin:0}#word{display:inline-block;margin-top:14px;background:var(--paper);padding:8px 20px;border-radius:8px;font:700 27px 'Space Grotesk'}.timer{height:5px;background:var(--line);border-radius:5px;margin:18px 0 22px;overflow:hidden}#time{height:100%;width:100%;background:var(--orange);transform-origin:left}.cards{display:grid;grid-template-columns:1fr 1fr;gap:14px}.card{height:132px;background:#fffdf7;border:2px solid var(--line);border-radius:15px;position:relative;color:var(--ink);display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px}.card .num{font:700 46px/1 'Space Grotesk'}.card .shape{font-size:27px;line-height:1}.card .color-name{font-size:9px;font-weight:700;letter-spacing:1px}.card .key{position:absolute;top:10px;left:12px;color:var(--muted);font-size:9px}.card.correct{border-color:#559353;background:#e9efdf}.card.wrong{border-color:var(--orange);background:#fce0d6}#feedback{text-align:center;min-height:36px;font-size:12px;color:var(--muted);line-height:1.5;margin:20px 0 4px}.game-bottom{display:flex;justify-content:space-between;color:var(--muted);font-size:9px}.result-score{display:flex;align-items:baseline;gap:15px;margin:25px 0}.result-score strong{font:700 100px/1 'Space Grotesk';letter-spacing:-6px;color:var(--orange)}.result-score span{font-size:13px;color:var(--muted)}#result-copy{line-height:1.6;color:var(--muted)}.result-stats{padding:20px 0;margin:20px 0;border-block:1px solid var(--line);display:flex;justify-content:space-between;gap:10px}.result-stats div{display:flex;flex-direction:column;gap:10px}.result-stats span{font-size:9px;color:var(--muted)}.result-stats b{font:600 25px 'Space Grotesk'}.back{display:block;margin:20px auto}#share-status{font-size:12px;text-align:center}dialog{border:1px solid var(--line);border-radius:20px;max-width:470px;width:calc(100% - 32px);background:var(--paper);color:var(--ink);padding:26px}dialog::backdrop{background:#24251faa;backdrop-filter:blur(4px)}dialog h2{font-family:'Space Grotesk';letter-spacing:-1px}.dialog-top{display:flex;align-items:center;justify-content:space-between;gap:12px}dialog p,dialog li{font-size:13px;line-height:1.8}dialog ol{padding-left:20px}#rule-panel.changed{animation:switch .45s ease}@keyframes switch{50%{transform:translateY(-4px);background:#ad462b}}@media(max-width:380px){.shell{padding:20px}.brand{margin-bottom:35px}.card{height:116px}.home-footer,.footer{font-size:8px}#instruction{font-size:24px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.account-bar{display:flex;justify-content:space-between;align-items:center;border:1px solid var(--line);border-radius:12px;padding:6px 12px;margin:-26px 0 28px;font-size:12px}.account-bar>div{display:flex;align-items:center;gap:8px}.avatar{background:var(--ink);color:var(--paper);border-radius:50%;width:24px;height:24px;text-align:center;line-height:24px}.card{background:var(--card-color);border-color:var(--card-color);color:white;box-shadow:0 5px 0 color-mix(in srgb,var(--card-color),black 22%)}.card .shape,.card .color-name,.card .key{color:white!important}.card .key{opacity:.65}.card.correct{background:var(--card-color);border-color:#24251f;outline:4px solid #b0c97d;outline-offset:2px}.card.correct:after{content:'✓';position:absolute;top:9px;right:12px;font-size:21px;color:white}.card.wrong{background:var(--card-color);opacity:.45;border-color:var(--ink)}.card.wrong:after{content:'×';position:absolute;top:9px;right:12px;font-size:21px}.badges{display:flex;gap:6px;flex-wrap:wrap;margin-top:20px}.badge{border:1px solid var(--line);border-radius:20px;padding:7px 10px;font-size:10px;color:var(--muted)}.badge.unlocked{color:#485a24;background:#e3ebd3;border-color:#b6c78b}.auth-link{text-decoration:none}.tabs{display:flex;gap:8px;margin:20px 0}.tabs button{padding:10px 16px;border-radius:8px;border:1px solid var(--line);background:transparent}.tabs .selected{background:var(--ink);color:white}.board-note{color:var(--muted);font-size:11px}.board-row{display:flex;align-items:center;gap:12px;padding:13px 0;border-bottom:1px solid var(--line)}.board-row .rank{width:22px;font-size:12px;color:var(--muted)}.board-row .name{flex:1;font-weight:600;font-size:13px;overflow-wrap:anywhere}.board-row .points{font:700 24px 'Space Grotesk';color:var(--orange)}.board-row.me{background:#e9eddf;padding-inline:8px;border-radius:8px}.board-row small{display:block;font-size:9px;color:var(--muted);font-weight:400}#profile-form label{font-size:12px;display:block;margin:18px 0 10px}#nickname{width:100%;background:#fffdf7;border:1px solid var(--line);padding:14px;border-radius:8px;font:inherit}#player-id,#sync-status,#my-best,#earned-badge{font-size:11px;color:var(--muted);line-height:1.6}#earned-badge{color:#486025;text-align:center}#rule-panel{min-height:160px}.brand{margin-bottom:48px}#leaderboard{max-height:85dvh;overflow:auto}

/* Une interface centrée sur le jeu. */
.small{min-height:44px;padding:10px 8px}.account-bar{padding:4px 12px}.home-footer{font-size:12px;margin-top:24px}.home-footer>span{letter-spacing:.5px}.facts span{font-size:12px}.demo-note{font-size:12px}.eyebrow{font-size:10px}.badges:empty{display:none}.rule-details,.player-details{margin:18px 0}.rule-details summary,.player-details summary{cursor:pointer;padding:12px 0;font-size:13px}.player-details{color:var(--muted)}.tabs button{min-height:44px;flex:1}.board-note{font-size:13px}.game-bottom{font-size:11px}#feedback{font-size:13px}#sync-status{font-size:12px;text-align:center}#profile-form label{font-size:14px}#leaderboard .rank{font-size:14px}#leaderboard .name{font-size:15px}.dialog-top h2{font-size:25px}.result-stats span{font-size:10px}#game .game-top{margin-top:6px}.rule-top{font-size:11px;letter-spacing:.5px}.badge{font-size:11px}@media(pointer:coarse){.keyboard-hint,.card .key{display:none}.game-bottom{justify-content:flex-end}}@media(max-width:380px){.tabs button{padding:10px 8px;font-size:12px}}

#home h1{font-size:clamp(48px,12vw,62px);margin:18px 0}#home .intro{font-size:15px;margin-bottom:20px}#home .demo{margin:22px 0;padding:14px}#home .demo-cards>div{padding:10px 0 8px;font-size:32px}#home .facts{margin:24px 0 20px}#home .primary,#home .secondary{padding:16px 20px}
@media(pointer:coarse){
 html,body{height:100%;overflow:hidden}.shell{height:100dvh;max-width:700px;padding:10px 16px;display:flex;flex-direction:column;gap:8px;overflow:hidden}
 .brand{margin:0;flex:none;min-height:36px}.brand a{font-size:28px}.small{min-height:36px;padding:6px}.account-bar{margin:0;padding:0 10px;min-height:36px;flex:none}
 #home:not([hidden]),#result:not([hidden]){flex:1;min-height:0;display:flex;flex-direction:column;justify-content:space-evenly;gap:6px}
 #home h1,#result h1{font-size:clamp(32px,8vw,46px);margin:0;letter-spacing:-2px}#home .intro{font-size:13px;line-height:1.35;margin:0}
 #home .demo{margin:0;padding:9px;transform:none}#home .demo-cards{margin-top:8px;gap:8px}#home .demo-cards>div{padding:6px 0;font-size:24px}#home .demo-note{display:none}
 #home .facts{margin:0}#home .facts b{font-size:20px}#home .primary,#home .secondary,#result .primary,#result .secondary{min-height:44px;padding:10px 16px;margin:0}
 #home .home-footer{margin:0}#badges{display:none}
 .shell:has(#game:not([hidden])) .brand,.shell:has(#game:not([hidden])) .account-bar{display:none}
 #game:not([hidden]){flex:1;min-height:0;display:flex;flex-direction:column;gap:8px}.game-top{min-height:36px;flex:none}.score-line{margin:0;flex:none}.score-line strong{font-size:42px}.score-line div{gap:2px}
 #rule-panel{min-height:0;padding:14px;flex:none}#instruction{font-size:24px;margin:10px 0 6px}#word{font-size:22px;margin-top:8px;padding:5px 14px}
 .timer{margin:0;flex:none}.cards{flex:1;min-height:0;grid-template-rows:1fr 1fr;gap:10px}.card{height:auto;min-height:64px;gap:4px}.card .num{font-size:36px}.card .shape{font-size:22px}
 #feedback{margin:0;min-height:18px;font-size:11px}.game-bottom{flex:none}.result-score{margin:0}.result-score strong{font-size:65px}#result-copy{margin:0;font-size:13px}.result-stats{padding:10px 0;margin:0}.result-stats b{font-size:22px}.result-stats div{gap:4px}.back,#share-status,#sync-status{margin:0}
}
@media(pointer:coarse) and (orientation:landscape){
 .shell{max-width:none;padding:8px 14px;gap:4px}.brand{min-height:30px}.account-bar{min-height:30px}.small{min-height:30px}
 #home:not([hidden]){display:grid;grid-template-columns:1fr 1fr;grid-template-rows:repeat(5,minmax(0,1fr));gap:6px 24px}
 #home .eyebrow{display:none}#home h1{grid-column:1;grid-row:1/3;font-size:32px}#home h1 br{display:none}#home .intro{grid-column:1;grid-row:3;font-size:11px}#home .demo{display:none}#home .facts{grid-column:1;grid-row:4/6;align-self:center}
 #home #play{grid-column:2;grid-row:1/3}#home #daily{grid-column:2;grid-row:3}#home #leaderboard-button{grid-column:2;grid-row:4}#home .home-footer{grid-column:2;grid-row:5}
 #game:not([hidden]){display:grid;grid-template-columns:1fr 1fr;grid-template-rows:36px auto minmax(0,1fr) 5px 22px;gap:6px 16px}.game-top{grid-column:1/-1}.score-line{grid-column:1;grid-row:2}.score-line strong{font-size:32px}
 #rule-panel{grid-column:1;grid-row:3;overflow:auto;padding:10px}#instruction{font-size:21px;margin:6px 0}#hint{font-size:10px}#word{font-size:20px;padding:2px 10px;margin-top:4px}.timer{grid-column:1;grid-row:4}.cards{grid-column:2;grid-row:2/5}.card{min-height:54px}.card .num{font-size:28px}.card .shape{font-size:18px}#feedback{grid-column:1;grid-row:5}.game-bottom{grid-column:2;grid-row:5}
 #result:not([hidden]){display:grid;grid-template-columns:1fr 1fr;gap:6px 20px}#result .eyebrow,#result #share-status,#result #earned-badge{display:none}#result h1{font-size:30px}.result-score strong{font-size:48px}
}
@media(pointer:coarse) and (orientation:landscape){
 #home:not([hidden]){grid-template-rows:repeat(3,minmax(44px,1fr)) 34px}
 #home h1 br{display:initial}#home .facts{grid-row:4}#home #play{grid-row:1}#home #daily{grid-row:2}#home #leaderboard-button{grid-row:3}#home .home-footer{grid-row:4}
}
