:root{--purple:#8041ba;--green:#00c5be;--blue:#324a6d;--yellow:#e9b408;--ink:#111213;--paper:#f3f5f8;--line:#c5cbd6;--radius:22px;font-family:Arial,Helvetica,sans-serif;color:var(--ink);background:var(--paper);font-size:16px;line-height:1.5;color-scheme:light}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0}button,select{font:inherit}button{cursor:pointer;touch-action:manipulation;min-height:48px;border:2px solid transparent;border-radius:13px;padding:10px 16px;font-weight:700;background:#fff;color:var(--blue)}button:hover{filter:brightness(.97)}button:disabled{cursor:not-allowed;opacity:.55}button:focus-visible,a:focus-visible,select:focus-visible{outline:4px solid #b775ef;outline-offset:3px}a{color:#60318c}.skip{position:absolute;left:16px;top:-100px;z-index:10;background:white;padding:12px}.skip:focus{top:8px}.site-header{max-width:1160px;margin:auto;padding:20px;display:flex;align-items:center;justify-content:space-between;gap:12px}.brand{font-size:25px;font-weight:900;color:var(--purple);text-decoration:none;line-height:1.15}.brand span{display:block;font-size:11px;letter-spacing:2px;color:var(--blue);margin-top:5px}main{width:min(1120px,calc(100% - 24px));margin:0 auto}.welcome{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:28px 24px 22px}.welcome h1{font-size:clamp(36px,6vw,62px);line-height:1.08;margin:10px 0 18px;color:var(--blue);letter-spacing:-1.7px}.welcome p{font-size:19px}.eyebrow{font-size:12px!important;letter-spacing:1.4px;font-weight:800;color:var(--purple);margin:0 0 8px}.welcome-robot{object-fit:contain;max-width:28vw}.game-choices{display:grid;grid-template-columns:1fr 1fr;gap:20px}.game-choice{display:flex;align-items:center;gap:18px;text-align:left;padding:26px;box-shadow:0 6px 0 #dce0e9;border:2px solid #e4e7ef;border-top:7px solid var(--purple);border-radius:var(--radius);min-height:180px}.game-choice strong{display:block;font-size:25px;line-height:1.2;color:var(--blue)}.game-choice small{display:block;font-size:16px;font-weight:400;margin-top:9px}.game-choice>span:last-child{margin-left:auto;font-size:26px}.robot-choice{border-top-color:var(--green)}.choice-icon{font-size:60px;color:var(--purple);line-height:1}.small-note{font-size:14px;color:#47546b;margin:24px}.primary{background:var(--purple);color:white}.secondary{background:var(--blue);color:white}.quiet{border-color:var(--line);background:white}.text-button{background:none;text-decoration:underline;font-weight:400;color:#47546b;min-height:44px}.game-panel{background:white;border:1px solid #e0e4ec;border-radius:var(--radius);overflow:hidden;margin-top:16px}.panel-heading{padding:24px;display:flex;justify-content:space-between;align-items:center;gap:16px;border-bottom:1px solid #e2e6ee}.panel-heading h1{font-size:32px;line-height:1.2;color:var(--blue);margin:0}.level-picker{display:flex;align-items:center;gap:10px;font-weight:700}.level-picker select{max-width:230px;border:2px solid var(--line);border-radius:12px;padding:10px;min-height:48px;background:white}.pixel-layout{display:grid;grid-template-columns:250px 1fr;gap:24px;padding:24px}.model-card{align-self:start;background:var(--paper);padding:18px;border-radius:18px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px}.model-card h2{font-size:22px;margin:0;color:var(--blue)}.model-card p{margin:8px 0 0}.model-grid{width:160px;display:grid;grid-template-columns:repeat(8,1fr);border:2px solid var(--blue);aspect-ratio:1}.model-cell{border:1px solid #73839a;aspect-ratio:1;display:block}.workspace{min-width:0}.instruction{margin:0 0 16px;color:#39485c}.palette{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}.swatch{padding:6px 10px;border:2px solid #acb5c5;display:flex;gap:8px;align-items:center;min-height:48px;font-size:14px}.swatch[aria-pressed=true]{outline:3px solid var(--purple);outline-offset:1px;border-color:white}.swatch-chip{width:23px;height:23px;display:block;border:1px solid #4d5c72;border-radius:5px}.board-shell{width:fit-content;max-width:100%;margin:0 auto 14px;border:2px solid var(--blue);border-radius:6px;overflow:hidden;background:white}.pixel-grid,.robot-grid{width:min(352px,calc(100vw - 32px));display:grid;grid-template-columns:repeat(8,1fr);aspect-ratio:1}.pixel-cell{border:1px solid #8390a3;border-radius:0;padding:0;min-height:0;aspect-ratio:1;display:block;width:100%}.pixel-cell:focus-visible{outline:3px solid #ffb800;outline-offset:-4px;z-index:1}.action-row{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}.feedback{min-height:30px;margin:12px 0;font-weight:700;color:var(--blue)}.feedback.success{background:#daf4ed;border-left:5px solid #237d64;padding:12px;border-radius:8px}.feedback.warning{background:#fff3cf;border-left:5px solid #ad7800;padding:12px;border-radius:8px}.narrow-note{display:none;color:#47546b;font-size:13px}.robot-layout{display:grid;grid-template-columns:1fr 1fr;gap:28px;padding:24px}.robot-board-area{min-width:0}.robot-cell{position:relative;aspect-ratio:1;border:1px solid #cad1db;display:flex;align-items:center;justify-content:center;background:#fff;font-size:25px}.robot-cell.wall{background:repeating-linear-gradient(45deg,#d9e0e7 0 6px,#b2becb 6px 8px);border-color:#8998a9}.robot-cell.goal{color:#896200;background:#fff6cf}.robot-cell.trail:after{content:'•';position:absolute;font-size:28px;color:#9c6ac9;line-height:1}.robot-cell.current{background:#def6f3}.robot-cell img{width:90%;height:90%;z-index:1}.robot-cell.current:after{display:none}.grid-legend{display:flex;flex-wrap:wrap;justify-content:center;gap:16px;font-size:14px;color:#47546b}.robot-program h2{margin:0;color:var(--blue)}.robot-program>p{margin:8px 0 16px}.direction-pad{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;max-width:350px}.direction-pad button{font-size:30px;background:var(--paper);border:2px solid var(--line);padding:4px;min-height:58px}.command-count{font-size:14px;color:#47546b}.commands{display:flex;flex-wrap:wrap;gap:7px;padding:10px;list-style:none;min-height:80px;max-height:270px;overflow:auto;background:var(--paper);border:2px dashed var(--line);border-radius:12px;margin:10px 0}.commands:empty:before{content:'Ton programme apparaîtra ici.';color:#617087;align-self:center}.commands li{display:block}.command{position:relative;min-width:44px;min-height:49px;padding:10px 6px 0;font-size:25px;line-height:1;border-color:var(--line)}.command small{position:absolute;top:4px;left:5px;font-size:10px;font-weight:400}.command.active{outline:3px solid #b5812a;background:#fff2ce}.connection-card{display:flex;align-items:center;justify-content:space-between;gap:24px;background:#e9edf5;border-radius:var(--radius);padding:24px;margin:28px 0 20px}.connection-card h2{font-size:21px;margin:0;color:var(--blue)}.connection-card p{margin:8px 0;font-size:14px}.connection-card>button{flex-shrink:0}#storage-status{font-size:13px;color:#47546b}footer{padding:0 6px 28px;display:flex;align-items:center;flex-wrap:wrap;gap:10px 22px;font-size:14px}footer p{flex-basis:100%;font-size:12px;color:#617087;margin:0}dialog{width:min(410px,calc(100vw - 20px));padding:16px;border:2px solid var(--blue);border-radius:20px;color:var(--ink)}dialog::backdrop{background:#15273eb3}.dialog-heading{display:flex;gap:8px;justify-content:space-between;align-items:center;margin-bottom:16px}.dialog-heading h2{font-size:20px;margin:0}.zoom-grid{display:grid;grid-template-columns:repeat(8,1fr);width:100%;border:2px solid var(--blue);aspect-ratio:1}@media(min-width:800px){.pixel-layout{grid-template-columns:250px minmax(360px,1fr)}.board-shell{margin-left:0}}@media(max-width:760px){.game-choices{grid-template-columns:1fr}.welcome{padding:20px 8px}.welcome p{font-size:17px}.welcome-robot{width:110px;height:130px}.game-choice{padding:20px;min-height:135px}.game-choice strong{font-size:22px}.game-choice img{width:52px}.pixel-layout,.robot-layout{display:flex;flex-direction:column;padding:18px 0;gap:20px}.model-card{align-self:stretch;margin:0 14px;padding:14px;display:grid;grid-template-columns:1fr 128px;gap:10px;text-align:left}.model-grid{width:128px;grid-column:2;grid-row:1/3}.model-card h2{font-size:20px}.model-card p{font-size:14px}.model-card button{font-size:13px;justify-self:start;padding:7px}.workspace>.instruction,.workspace>.palette,.workspace>.feedback,.workspace>.action-row{margin-left:14px;margin-right:14px}.board-shell{max-width:none}.palette{gap:7px}.swatch{font-size:13px;padding:6px 8px}.swatch-chip{width:20px;height:20px}.panel-heading{padding:18px 14px;align-items:start;flex-direction:column;gap:14px}.panel-heading h1{font-size:28px}.level-picker{width:100%}.level-picker select{max-width:none;flex:1;min-width:0}.robot-board-area>.instruction{margin:0 14px 16px}.robot-program{padding:0 14px}.connection-card{padding:20px 16px;align-items:stretch;flex-direction:column;gap:10px}.site-header{padding:18px 14px}.brand{font-size:23px}.site-header>.quiet{font-size:13px;padding:8px 10px}.action-row>button{flex-grow:1}.grid-legend{gap:12px}.small-note{margin:22px 8px}}@media(max-width:383px){.narrow-note{display:block;text-align:center;padding:0 14px}.model-card{grid-template-columns:1fr 112px}.model-grid{width:112px}.welcome-robot{width:80px}.welcome h1{font-size:36px}.game-choice{gap:12px;padding:16px}.game-choice small{font-size:14px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

.robot-cell.decor-leaf:before{content:"";position:absolute;right:5px;bottom:6px;width:15px;height:9px;border:2px solid #c6ddcf;border-radius:100% 0;transform:rotate(-25deg);pointer-events:none}.robot-cell.decor-stone:before{content:"";position:absolute;right:8px;bottom:8px;width:5px;height:4px;border:1px solid #c6d4e5;background:#e9eef5;border-radius:50%;box-shadow:7px 1px 0 -1px #c6d4e5,3px -6px 0 -1px #c6d4e5;pointer-events:none}@media(max-width:760px){.model-card{position:sticky;top:8px;z-index:3;box-shadow:0 3px 10px #324a6d20}}

/* Deux colonnes seulement lorsque la grille et les commandes tiennent entièrement. */
@media(min-width:761px) and (max-width:899px){.robot-layout{display:flex;flex-direction:column}.robot-board-area .board-shell{margin-left:auto;margin-right:auto}}
.robot-cell img{position:absolute;left:10%;top:10%;width:80%;height:80%;object-fit:contain}.goal-marker{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;line-height:1;pointer-events:none}.robot-cell.goal.current .goal-marker{inset:auto;top:1px;right:1px;font-size:12px;z-index:2}

/* Présentation Garage404 : visuels fournis, arrière-plan original en CSS. */
@font-face{font-family:'Poppins';src:url('./assets/poppins-black.ttf') format('truetype');font-weight:900;font-style:normal;font-display:swap}
:root{--blue:#324d70;--paper:#f3f5f8;background:#324d70}
body{position:relative;isolation:isolate;min-height:100vh;background:linear-gradient(145deg,#263e5b 0%,#324d70 46%,#493665 100%);background-attachment:fixed}
body:before{content:'';position:fixed;inset:0;pointer-events:none;z-index:-1;background-image:radial-gradient(circle at 7px 7px,#cdd9ed26 0 2px,transparent 2.5px),linear-gradient(90deg,transparent 0 77px,#bfa2e91c 77px 79px,transparent 79px),linear-gradient(0deg,transparent 0 77px,#bfa2e91c 77px 79px,transparent 79px);background-size:40px 40px,160px 160px,160px 160px;mask-image:linear-gradient(90deg,#000,transparent 42%,transparent 58%,#000)}
body:after{content:'{ }   </>    404';position:fixed;left:-30px;right:0;top:40vh;z-index:-1;pointer-events:none;font:900 clamp(60px,13vw,185px)/1 Poppins,Arial,sans-serif;letter-spacing:12px;white-space:nowrap;color:#ffffff07;transform:rotate(-12deg)}
h1,h2,.brand,button,select,.eyebrow,.game-choice strong{font-family:Poppins,Arial,Helvetica,sans-serif;font-weight:900}
.site-header{padding-top:22px;padding-bottom:22px}
.brand{display:flex;flex-direction:column;align-items:center;gap:7px;padding:12px 16px;background:#fff;border-radius:16px;box-shadow:0 4px 0 #15273e66}
.brand-logo{display:block;width:230px;max-width:100%;height:auto;aspect-ratio:1763/298;overflow:hidden}
.brand span{font-size:10px;letter-spacing:2.5px;margin:0;color:#324d70}
.site-header>.quiet{border-color:#d8c2ef;background:#fff;color:#533076;box-shadow:0 3px 0 #17263d55}
.welcome{margin:8px 0 24px;background:linear-gradient(120deg,#fff 0%,#f3f5f8 70%,#ece3f5 100%);border:1px solid #ffffffb3;border-radius:28px;box-shadow:0 8px 0 #142a454d;padding:34px 30px}
.welcome h1{font-size:clamp(36px,5.5vw,60px);letter-spacing:-1.8px;line-height:1.1}
.welcome-robot{width:230px;height:225px;max-width:31%;filter:drop-shadow(0 12px 8px #30436025)}
.game-choice{box-shadow:0 7px 0 #152d4966;border-color:#ded7e8;border-top-color:#8041ba;min-height:190px}
.game-choice strong{font-size:24px;line-height:1.25;letter-spacing:-.4px}
.robot-choice{border-top-color:#00c5be}.robot-choice img{width:76px;height:76px;object-fit:contain;flex-shrink:0}
.small-note{color:#f0eafa;font-size:15px;text-align:center}
.game-panel{box-shadow:0 8px 0 #142a454d;border-color:#dce1eb}
.panel-heading{background:linear-gradient(110deg,#fff,#f4edf9);border-bottom:2px solid #e6daf0}
.panel-heading h1{letter-spacing:-.7px;font-size:31px;line-height:1.2}
.level-picker{font-size:14px}.level-picker select{font-size:14px}
button{font-weight:900;letter-spacing:-.15px}.swatch{font-size:12px;letter-spacing:-.2px}.swatch-chip{flex-shrink:0}
.direction-pad button{font-family:Arial,Helvetica,sans-serif;font-weight:900}
.command{font-family:Arial,Helvetica,sans-serif;font-weight:900}.command small{font-family:Arial,Helvetica,sans-serif}
.connection-card{background:linear-gradient(120deg,#f5f0fa,#edf1f8);border:1px solid #ffffffc7;box-shadow:0 6px 0 #142a454d}
.connection-card h2{line-height:1.3}
footer,footer a,footer .text-button{color:#f1edf8}footer p{color:#dce3ee}
.parent-notice{background:white;border-radius:24px;margin-top:28px;margin-bottom:28px;padding:28px;color:#111213;box-shadow:0 7px 0 #142a454d}.parent-notice h1,.parent-notice h2{color:#324d70;line-height:1.3}.parent-notice a{color:#60318c}.parent-notice li{margin-bottom:10px}
@media(max-width:760px){.site-header{padding:16px 14px}.brand{padding:10px 12px;gap:5px}.brand-logo{width:188px;max-width:47vw}.brand span{font-size:8px;letter-spacing:1.8px}.site-header>.quiet{font-size:12px;padding:8px 10px;max-width:116px}.welcome{padding:25px 18px;gap:10px}.welcome h1{font-size:37px;line-height:1.12;letter-spacing:-1.5px}.welcome-robot{width:120px;height:145px;max-width:31%}.welcome p{font-size:16px}.welcome .eyebrow{font-size:9px!important;letter-spacing:.8px}.game-choice{padding:19px;gap:14px;min-height:144px}.game-choice strong{font-size:20px}.game-choice small{font-size:14px}.robot-choice img{width:58px;height:70px}.choice-icon{font-size:48px}.panel-heading h1{font-size:27px}.level-picker{font-size:13px}.level-picker select{font-size:12px}.model-card h2{font-size:18px;line-height:1.3}.model-card button{font-size:11px}.swatch{font-size:12px;padding:6px 8px}.connection-card h2{font-size:19px}.connection-card>button{font-size:14px}.action-row>button{font-size:13px;padding-left:12px;padding-right:12px}.parent-notice{padding:22px}}
@media(max-width:383px){.brand-logo{width:155px}.site-header>.quiet{font-size:11px;max-width:100px}.brand span{letter-spacing:1px}.welcome{padding:22px 14px}.welcome h1{font-size:32px}.welcome-robot{max-width:26%}.game-choice{padding:15px;gap:10px}.game-choice strong{font-size:18px}.robot-choice img{width:48px}}

.command,.direction-pad button{font-family:Poppins,Arial,Helvetica,sans-serif;font-weight:900}.command small{font-family:Poppins,Arial,Helvetica,sans-serif;font-weight:900}
/* Logo et slogan fournis : images intactes, cadrées seulement dans leur viewport. */
.site-header{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:16px}
.brand{grid-column:2;justify-self:center;gap:8px;padding:14px 18px}
.brand-slogan{display:block;width:196px;max-width:100%;height:auto;aspect-ratio:215/64;overflow:hidden}
.header-actions{grid-column:3;justify-self:end;display:flex;align-items:center;justify-content:center;gap:10px}
.header-actions .quiet{font-size:12px;white-space:nowrap;border-color:#d8c2ef;background:#fff;color:#533076;box-shadow:0 3px 0 #17263d55}
.header-back{display:inline-flex;align-items:center;justify-content:center;padding:10px 14px;min-height:48px;border:2px solid var(--line);border-radius:13px;text-decoration:none;font:900 12px/1.5 Poppins,Arial,sans-serif}
.theme-status{grid-column:1/-1;text-align:center;color:#f1edf8;font-size:13px;margin:0}.theme-status:empty{display:none}
html[data-theme=dark]{color-scheme:dark;--ink:#eef3fb;--paper:#19263b;--line:#586c87;background:#111a29}
html[data-theme=dark] body{background:linear-gradient(145deg,#111a29,#192b43 50%,#251e37);color:#eef3fb}
html[data-theme=dark] body:before{opacity:.65}
html[data-theme=dark] .welcome{background:linear-gradient(120deg,#1b2a40,#232a42 70%,#342747);border-color:#465677}
html[data-theme=dark] .welcome h1,html[data-theme=dark] .panel-heading h1,html[data-theme=dark] h2{color:#f0f4fb}
html[data-theme=dark] .eyebrow{color:#d0a4fb}
html[data-theme=dark] .game-choice{background:#1c2c43;border-color:#4b5d78;border-top-color:#b27ae5;box-shadow:0 7px 0 #090f1a66;color:#e6ecf7}
html[data-theme=dark] .robot-choice{border-top-color:#00c5be}
html[data-theme=dark] .game-choice strong{color:#f0f4fb}
html[data-theme=dark] .choice-icon{color:#c997f6}
html[data-theme=dark] .game-panel{background:#17243a;border-color:#4a5c79}
html[data-theme=dark] .panel-heading{background:linear-gradient(110deg,#1c2a41,#2c2540);border-bottom-color:#49516f}
html[data-theme=dark] .model-card{background:#23314a;color:#eef3fb}
html[data-theme=dark] .model-card h2,html[data-theme=dark] .robot-program h2{color:#f0f4fb}
html[data-theme=dark] .instruction,html[data-theme=dark] .grid-legend,html[data-theme=dark] .command-count,html[data-theme=dark] .narrow-note{color:#d4dfef}
html[data-theme=dark] .quiet,html[data-theme=dark] .swatch,html[data-theme=dark] select{background:#26354e;color:#f0f4fb;border-color:#6c80a0}
html[data-theme=dark] .swatch[aria-pressed=true]{outline-color:#d5a5ff;border-color:#fff}
html[data-theme=dark] .swatch-chip{border-color:#dde6f3}
html[data-theme=dark] .primary{background:#8951c5;color:white;border-color:#b27de5}
html[data-theme=dark] .secondary{background:#334f74;color:#fff;border-color:#6582a8}
html[data-theme=dark] .direction-pad button,html[data-theme=dark] .command{background:#253650;color:#fff;border-color:#7285a2}
html[data-theme=dark] .commands{background:#101d30;border-color:#6b7e9d}
html[data-theme=dark] .commands:empty:before{color:#d2ddee}
html[data-theme=dark] .command.active{background:#69521e;outline-color:#f4cf70}
html[data-theme=dark] .feedback{color:#e2ecfb}
html[data-theme=dark] .feedback.success{background:#123e36;color:#c5f5e9;border-left-color:#63c7ab}
html[data-theme=dark] .feedback.warning{background:#493d1c;color:#ffeab6;border-left-color:#e5bb4e}
html[data-theme=dark] .connection-card{background:linear-gradient(120deg,#242b43,#1c2d46);border-color:#506381}
html[data-theme=dark] #storage-status{color:#cbd9ed}
html[data-theme=dark] dialog{background:#1d2d45;color:#f0f4fb;border-color:#95aac9}
html[data-theme=dark] dialog::backdrop{background:#050a13d9}
html[data-theme=dark] .parent-notice{background:#1a2940;color:#e7edf7;border:1px solid #506381}
html[data-theme=dark] .parent-notice h1,html[data-theme=dark] .parent-notice h2{color:#f0f4fb}
html[data-theme=dark] .parent-notice a,html[data-theme=dark] a{color:#ddbdff}
/* La plaque de marque reste claire ; la grille garde les couleurs du jeu. */
html[data-theme=dark] .brand{background:white}
html[data-theme=dark] .pixel-cell{border-color:#8390a3}
html[data-theme=dark] .robot-cell{color:#324d70}
html[data-theme=dark] .robot-cell.goal{color:#896200}
html[data-theme=dark] .robot-cell.wall{background:repeating-linear-gradient(45deg,#d9e0e7 0 6px,#b2becb 6px 8px)}
@media(max-width:950px){.site-header{display:flex;flex-direction:column;align-items:center;gap:14px}.brand{gap:6px;padding:12px 16px}.brand-logo{width:210px;max-width:100%}.brand-slogan{width:180px}.header-actions{justify-self:center;flex-wrap:wrap}.header-actions .quiet{font-size:12px;max-width:none}.theme-status{max-width:360px}}
@media(max-width:383px){.brand-logo{width:190px}.brand-slogan{width:165px}.header-actions{gap:8px}.header-actions .quiet{font-size:11px;padding:8px 11px}}

.promotion-link{display:flex;align-items:center;justify-content:center;max-width:330px;text-align:center;text-decoration:none;line-height:1.45}
@media(max-width:950px){.header-actions .promotion-link{max-width:290px}.header-actions{align-items:center;justify-content:center}.promotion-link{flex:1 1 230px}}
.header-actions .promotion-link{box-sizing:border-box;min-height:48px;padding:12px 18px;border:2px solid #c5cddd;border-radius:14px;background:#fff;color:#324d70;font-family:'Poppins',Arial,sans-serif;font-weight:900;font-size:14px;white-space:normal;box-shadow:0 3px 0 #1a2c4530}
html[data-theme=dark] .header-actions .promotion-link{background:#26354e;color:#f0f4fb;border-color:#6c80a0}
@media(max-width:950px){.header-actions .promotion-link{width:min(290px,100%);flex:0 1 290px}}
