
*{box-sizing:border-box}body{margin:0;background:#e9f7ff;font-family:Arial, sans-serif;color:#163a52}.game{max-width:1400px;margin:auto;padding:24px}h1{font-size:clamp(26px,4vw,44px);margin:0;color:#16456a}.top{display:flex;justify-content:space-between;gap:20px;align-items:center}.subtitle{font-size:18px;line-height:1.5}.toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:16px 0}button,select{font:inherit;min-height:46px;border:2px solid #b4d3e2;border-radius:14px;background:white;color:#163a52;padding:10px 16px;cursor:pointer}button:focus-visible,select:focus-visible{outline:4px solid #ffbd38;outline-offset:3px}button:disabled{cursor:default;opacity:.55}.scene{position:relative;overflow:hidden;border-radius:26px;background:linear-gradient(#aee2ff 0 46%,#b4dc93 46% 67%,#7ea853 67%);height:340px;border:5px solid white;box-shadow:0 8px 28px #2555741a}.scene:before{content:"";position:absolute;inset:0;background:linear-gradient(#ffffff26,#ffffff26),url("village-ispagnac.png") center/100% 100% no-repeat;filter:blur(.6px) saturate(.85);pointer-events:none}.cloud{position:absolute;background:#ffffffb8;border-radius:70px;width:150px;height:40px;top:32px;left:14%}.cloud.second{left:58%;top:55px}.town{position:absolute;left:4%;right:15%;height:90px;bottom:136px;display:flex;align-items:end;justify-content:space-between}.house{height:65px;width:85px;background:#ffe4ab;border-radius:10px 10px 0 0;border-top:16px solid #de7965;box-shadow:inset 20px 0 #fff2d1}.house:nth-child(2){height:85px;background:#c6c7ee;border-color:#8d83bc}.house:nth-child(3){width:115px;background:#f9bfa7}.house:nth-child(4){background:#afd9de}.road{position:absolute;bottom:0;left:0;right:0;height:9%;background:#747985;border-top:1px solid #d7d1c7;border-bottom:0}.road:after{content:'';position:absolute;bottom:4px;left:0;right:0;border-top:2px dashed #d9e4ec}.queue{position:absolute;left:2%;right:11%;bottom:0;display:flex;flex-direction:row-reverse;align-items:center;gap:5px}.slot{position:relative;flex:1;min-width:0;height:72px;border:0;border-radius:12px;background:transparent;padding:0;min-height:0}.slot svg{width:100%;height:100%;display:block}.slot:disabled{opacity:1}.slot.empty{visibility:hidden;pointer-events:none}.slot.model{border:2px solid #ffd35a;background:#ffd35a18}.slot.model:before{content:'★';position:absolute;left:2px;top:-22px;color:#ffdb66;font-size:18px}.signal{position:absolute;right:1.5%;bottom:66px;width:62px;height:146px;padding:8px;background:#23374a;border:4px solid #ffffff;border-radius:18px;display:flex;flex-direction:column;gap:7px;box-shadow:0 7px 12px #18324b38}.signal:after{content:'';position:absolute;top:138px;left:24px;height:60px;width:8px;background:#263a4b}.light{width:36px;height:36px;border-radius:50%;background:#13222e;flex-shrink:0;box-shadow:inset 0 3px 5px #0005}.red .light:first-child{background:#ff4f4f;box-shadow:0 0 20px #ff5858}.green .light:last-child{background:#4fe391;box-shadow:0 0 20px #4fe391}.reserve{background:#fff;border-radius:24px;padding:20px;margin-top:18px;border:2px solid #d4e8f2}.reserve h2{font-size:20px;margin:0 0 14px}.choices{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}.vehicle-choice{width:100%;min-width:0;background:#edf8ff;border:3px solid #b9d9eb;padding:8px}.vehicle-choice svg{width:100%;height:80px}.vehicle-choice span{display:block;font-weight:bold;font-size:16px}.status{min-height:58px;font-size:20px;font-weight:bold;line-height:1.4;margin:18px 0 0}.hint{font-size:15px;color:#4a697d;margin:12px 0 0}.badge{background:#fff;padding:10px 14px;border-radius:16px;white-space:nowrap;font-size:18px}.smoke{color:#20242b;position:absolute;right:1%;bottom:196px;font-size:70px;opacity:0;pointer-events:none}.error .smoke{animation:smoke 1.8s ease-out 2}.error .slot:not(.empty){animation:honk .16s linear 12}.depart .slot{animation:drive 3s ease-in forwards}.depart .slot.empty{visibility:hidden}.leaving .slot:not(.empty){animation:vanish .7s ease-in forwards}@keyframes arrive{from{transform:translateX(-1500px)}to{transform:translateX(0)}}@keyframes vanish{to{opacity:0;transform:translateY(12px)}}@keyframes drive{to{transform:translateX(1500px)}}@keyframes honk{50%{transform:translateY(-5px) rotate(-2deg)}}@keyframes smoke{0%{opacity:0;transform:translateY(20px) scale(.3)}30%{opacity:.9}100%{opacity:0;transform:translate(-25px,-90px) scale(2)}}@media(max-width:650px){.game{padding:12px}.top{align-items:start;gap:5px}.badge{font-size:14px;padding:10px}.subtitle{font-size:16px}.scene{height:280px;border-width:3px}.queue{left:1%;right:13%;gap:2px;bottom:0}.slot{height:52px;border-radius:7px}.signal{right:1%;width:43px;height:108px;padding:5px;gap:5px;border-width:3px;bottom:66px}.light{width:27px;height:27px}.signal:after{top:103px;left:15px;height:55px}.vehicle-choice{padding:5px}.vehicle-choice svg{height:58px}.vehicle-choice span{font-size:13px}.choices{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.reserve{padding:14px 10px}.toolbar{gap:8px}.toolbar button,.toolbar select{font-size:15px;padding:8px}.status{font-size:18px}.house:nth-child(4){display:none}}@media(prefers-reduced-motion:reduce){.depart .slot,.arrive .slot.model,.slot.entering,.leaving .slot:not(.empty){animation-duration:.5s}.error .slot{animation:none}}

/* Panorama élargi et véhicules de la file agrandis. */
@media(min-width:651px){.game{max-width:1900px;padding-left:12px;padding-right:12px}.scene{height:260px}.queue{left:1%;right:7%;gap:1px;align-items:flex-end}.slot{height:auto;aspect-ratio:124/82}.signal{right:.8%}}

/* Illustrations 3D, mêmes images dans la file et dans la réserve. */
.vehicle-sprite{display:block;width:100%;height:100%;object-fit:contain;object-position:center bottom;pointer-events:none;user-select:none}
.vehicle-choice .vehicle-sprite{height:80px;object-position:center bottom}
.signal{bottom:0;right:.4%;width:110px;height:165px;min-height:0;padding:0;border:0;background:transparent;box-shadow:none;display:block;border-radius:12px}
.signal:after{display:none}.signal:disabled{opacity:1}.signal-art{width:100%;height:100%;object-fit:fill;pointer-events:none;display:block}
.signal .light{position:absolute;left:36%;width:28%;height:18.5%;border-radius:50%;background:#03080caa;box-shadow:inset 0 2px 5px #0008;pointer-events:none}
.signal .light:nth-of-type(1){top:7.1%}.signal .light:nth-of-type(2){top:28.3%}.signal .light:nth-of-type(3){top:49.5%}
.signal.red .light:first-of-type{background:radial-gradient(circle at 35% 30%,#fff9d0 0%,#ff6555 24%,#f00b18 65%,#a8000e);box-shadow:0 0 18px #ff392c,inset 0 1px 3px #fff8}
.signal.green .light:last-of-type{background:radial-gradient(circle at 35% 30%,#e6ffbc 0%,#7bff7b 24%,#12d94c 65%,#00862e);box-shadow:0 0 18px #3eff77,inset 0 1px 3px #fff8}
@media(max-width:650px){.signal{right:0;bottom:0;width:66px;height:99px}.vehicle-choice .vehicle-sprite{height:58px}}

/* Espacement devant le feu et panache de particules. */
.scene{--signal-size:78px;--queue-end:calc(var(--signal-size) + 30px)}
.signal{right:8px;width:var(--signal-size);height:calc(var(--signal-size)*1.5)}
.queue{right:var(--queue-end)}
.smoke{right:calc(var(--queue-end) + (100% - var(--queue-end) - 1%)*.068);bottom:12px;width:12px;height:12px;opacity:1;font-size:0;animation:none!important;z-index:3}
.smoke i{position:absolute;left:0;bottom:0;width:25px;height:22px;opacity:0;border-radius:45% 55% 40% 60%;background:radial-gradient(ellipse at 45% 50%,#16191dd9 0%,#292d32b8 32%,#42474d80 55%,#5a616700 75%);filter:blur(1px);pointer-events:none;transform-origin:center}
.error .smoke i{animation:exhaust-puff var(--life) ease-out var(--delay) both}
@keyframes exhaust-puff{0%{opacity:0;transform:translate(0,0) scale(.25) rotate(0deg)}12%{opacity:.82}40%{opacity:.65;transform:translate(calc(var(--drift)*.4),-28px) scale(1.7) rotate(25deg)}75%{opacity:.3}100%{opacity:0;transform:translate(var(--drift),-105px) scale(3.7) rotate(70deg);filter:blur(5px)}}
@media(max-width:650px){.scene{--signal-size:48px;--queue-end:calc(var(--signal-size) + 20px)}.signal{right:4px}.smoke i{width:18px;height:16px}}
@media(prefers-reduced-motion:reduce){.error .smoke i{animation:none}.error .smoke i:first-child{opacity:.45;transform:translate(-8px,-12px) scale(1.5)}}

/* La fumée sort exclusivement du sommet du feu lors d’un échec. */
.signal .smoke{right:calc(50% - 6px);bottom:calc(100% - 12px);width:12px;height:12px;pointer-events:none}

/* Téléphones : route défilante, véhicules lisibles et commandes tactiles. */
.scene-viewport{max-width:100%;min-width:0}.mobile-check,.mobile-help{display:none}
button{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
@media(max-width:650px),(max-width:950px) and (max-height:500px){
 .game{padding:12px 8px;max-width:100%}.top{flex-wrap:wrap;gap:8px}.top h1{font-size:26px;line-height:1.15}.badge{font-size:14px;padding:8px 10px;white-space:normal}.subtitle{font-size:15px;line-height:1.35;margin:12px 0}
 .toolbar{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;margin:12px 0}.toolbar button{min-width:0;min-height:46px;font-size:13px;padding:7px 3px;border-radius:12px}
 .scene-viewport{overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;border-radius:18px;scrollbar-width:thin;scrollbar-color:#679bb8 #d6eaf4}
 .scene-viewport:focus-visible{outline:3px solid #ffbd38;outline-offset:2px}
 .scene{min-width:840px;height:230px;border-width:3px;border-radius:18px;--signal-size:54px;--queue-end:calc(var(--signal-size) + 24px)}
 .queue{left:8px;right:var(--queue-end);gap:3px;align-items:flex-end}.slot{height:52px;aspect-ratio:auto;flex:1}.slot.model{border-radius:7px}.slot.model:before{top:-21px;font-size:17px}.signal{right:5px;bottom:0}
 .mobile-help{display:block;margin:7px 2px;font-size:13px;line-height:1.35;color:#4a697d}
 .mobile-check{display:block;width:100%;min-height:48px;margin-top:8px;background:#e2f8e9;border:2px solid #73bd8c;font-weight:bold;font-size:16px}
 .status{font-size:16px;line-height:1.35;margin-top:12px;min-height:44px}
 .reserve{padding:12px 8px;margin-top:12px;border-radius:18px}.reserve h2{font-size:18px;margin-bottom:10px}
 .choices{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.vehicle-choice{min-height:91px;padding:6px 3px;border-radius:12px}.vehicle-choice .vehicle-sprite{height:59px}.vehicle-choice span{font-size:12px;margin-top:4px;overflow-wrap:anywhere}.hint{font-size:13px;line-height:1.4;margin-top:10px}
}
@media(max-width:350px){.top h1{font-size:24px}.toolbar button{font-size:12px}.vehicle-choice span{font-size:11px}}
@media(max-width:950px) and (max-height:500px){.scene{height:185px}.top{align-items:center}.top h1{font-size:24px}.subtitle{margin:8px 0}.vehicle-choice .vehicle-sprite{height:48px}.vehicle-choice{min-height:78px}.choices{grid-template-columns:repeat(6,minmax(0,1fr))}}
