@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;600&family=Playfair+Display:wght@500&family=Quicksand:wght@700&display=swap');
:root { color:#183d47; font:14px/1.5 "DM Sans",sans-serif; --gold:#b37b31; --red:#df4b35; --green:#25564e }
* { box-sizing:border-box }
.test-panel { position:relative; color:#183d47 }
footer>.test-panel { background:#fffffff2; border:1px solid #d4deda; padding:0; box-shadow:0 2px 12px #23425e17 }
.test-panel summary { cursor:pointer; padding:7px 12px; border-radius:inherit }
.test-panel summary:focus-visible { outline:3px solid #ffbd44 }
.test-settings { position:absolute; bottom:calc(100% + 8px); left:0; width:min(560px,95vw); padding:14px; border:1px solid #d4deda; border-radius:12px; background:white; box-shadow:0 4px 24px #183d4726; max-height:70dvh; overflow:auto }
.test-panel form { display:flex; align-items:end; flex-wrap:wrap; gap:10px; margin:0 0 10px }
.test-panel label { display:grid; gap:3px }
.test-panel input,.test-panel select,.test-panel button { font:inherit; padding:6px 10px }
.test-panel p { margin:0 0 6px }
html,body { overflow:clip }
body { margin:0; height:100vh; height:100dvh; display:flex; flex-direction:column; background:#eff4f4 }
body>header,.test-panel { flex:none }
html:has(dialog[open]) { overflow:hidden }
button { font:700 14px/1.5 Quicksand,sans-serif; color:inherit; cursor:pointer }
:where(.primary,#rules,.test-settings button) { max-width:100%; min-width:0; white-space:normal; overflow-wrap:anywhere; text-align:center }
button:focus-visible { outline:3px solid #ffbd44; outline-offset:2px }
header { min-height:64px; padding:0 28px; background:white; display:flex; align-items:center; gap:22px }
header form { flex:0 1 165px; min-width:0 }
header .primary { width:100%; min-height:32px; padding:4px 12px }
#account { margin-left:auto; display:flex; gap:22px; align-items:center; font:700 14px Quicksand,sans-serif }
#account .balance:first-child { color:var(--gold) }
.intro { pointer-events:none }
#help,#sound,#village-info { display:grid; flex:none; place-items:center; width:33px; height:33px; border:1px solid #d4deda; background:white; border-radius:50%; padding:0 }
#sound[aria-pressed="false"] img { opacity:.55 }
.primary { border:none; color:white; background:var(--red); border-radius:7px; padding:15px 23px }
.primary:hover { background:#c53d2a }
.account-notice { display:grid; place-items:center; overflow:auto; padding:16px; background:#e7eff5 }
.account-notice main { container-type:normal; min-height:auto; width:min(100%,34rem); padding:2rem; text-align:center; border:0; border-radius:16px; background:white }
.account-notice h1 { margin:0; font-family:"Playfair Display",serif }
.account-notice .primary { display:inline-block; margin-top:.5rem; text-decoration:none }
.primary:disabled { cursor:wait }
main { position:relative; flex:1; min-height:0; isolation:isolate; container-type:size; border-top:13px solid #23425e }
.pan { position:absolute; inset:0; overflow:clip; container-type:size; display:grid; place-items:center; background:#23425e }
/* Seuls les pixels du bord prolongent le ciel et la neige autour de la scène 16:9. */
.pan::before { content:''; position:absolute; inset:0; pointer-events:none; border-image-source:url('../img/montagnes.png'); border-image-slice:1 fill; border-image-width:max(1px,calc((100cqh - 56.25cqw)/2)) max(1px,calc((100cqw - 177.7778cqh)/2)) }
.scene { position:relative; aspect-ratio:1440/810; width:min(100%,177.7778cqh); background:#23425e url('../img/montagnes.png') center/contain no-repeat }
.houses { position:absolute; top:29.48%; width:100%; aspect-ratio:1440/537; background:url('../img/maisons.png') center/100% 100% no-repeat }
.houses.lively { background-image:none }
.village-art { display:none; position:absolute; inset:0; overflow:clip; pointer-events:none }
.lively .village-art { display:block }
.snowfall { position:absolute; inset:0; pointer-events:none; overflow:clip }
.snowfall i { position:absolute; top:-6px; aspect-ratio:1; border-radius:50%; background:#fff; opacity:.8; animation:snowfall linear infinite }
.snowfall.paused i { animation-play-state:paused }
@keyframes snowfall { to { transform:translate(60px,calc(100cqh + 12px)) } }
.village-track,.village-art>canvas { position:absolute; inset:0; width:100%; height:100% }
.village-track { right:auto; left:var(--art-left,0px); width:var(--art-width,100%) }
.village-track canvas { position:absolute }
.scene-sound { position:absolute; padding:0; border:0; border-radius:50%; background:transparent; pointer-events:auto }
.moon { left:calc(var(--sky-width,100%) * .0583); top:3.7%; width:calc(var(--sky-width,100%) * .055); aspect-ratio:1 }
.skater-track { pointer-events:none }
.skater-track canvas { inset:0; width:100%; height:100%; pointer-events:none }
.snow-tree { position:absolute; transform-origin:50% 100% }
.snow-tree canvas { inset:0; width:100%; height:100% }
.house { position:absolute; width:calc(var(--house-width) * var(--art-width,100%) + 8px); height:calc(var(--house-height) + 8px); padding:0; transform:translate(-50%,-50%); border:0; border-radius:3px; background:transparent }
.house:is(:hover,:active,.today) { background:rgb(95 95 95 / 9%) }
.house:focus-visible { background:rgb(95 95 95 / 22%); outline:none }
@media (forced-colors:active) { .house:focus-visible { outline:2px solid Highlight } }
.intro { position:absolute; top:3.3%; left:50%; transform:translateX(-50%); width:min(435px,90vw); padding:18px 22px; color:white; text-align:center; border-radius:18px; background:#102b40f0 }
small { display:block; color:var(--gold); font-size:12px; font-weight:600; letter-spacing:.1em; text-transform:uppercase }
.intro small { color:white; font-weight:400; letter-spacing:.18em; font-size:10px }
h1,h2,.prize { font:500 31px/1.5 'Playfair Display',Georgia,serif; margin:0 }
h1 { font-size:clamp(24px,2.5vw,36px); display:flex; align-items:center; justify-content:center; gap:12px; margin:5px 0 }
h1 img { width:10px }
.intro p { font-size:13px; margin:0 0 16px }
.intro strong { font-size:15px }
.intro strong>span { display:block }
footer { position:absolute; bottom:2%; left:2%; right:2%; display:flex; align-items:center; justify-content:space-between; pointer-events:none }
footer>* { pointer-events:auto; background:#fff; border:none; border-radius:22px; padding:8px 16px; font-size:12px }
footer>.test-panel+span { margin-left:8px; margin-right:auto }
dialog { position:fixed; width:min(470px,calc(100vw - 32px)); max-height:94dvh; border:0; border-radius:20px; padding:28px 38px 26px; color:inherit; text-align:center; box-shadow:0 20px 80px #102b4033 }
dialog::backdrop { background:transparent }
dialog[open]:not(:modal) { inset:64px 0 0; z-index:2; margin:auto; max-height:calc(100dvh - 72px) }
@media (max-width:750px) {
 dialog[open]:not(:modal) { inset-block-start:68px; max-height:calc(100dvh - 76px) }
}
@media (prefers-reduced-motion:no-preference) {
 dialog[open],.test-panel[open] .test-settings { animation:popup-enter 200ms cubic-bezier(.2,.75,.25,1) }
 dialog[open]::backdrop { animation:backdrop-enter 180ms ease-out }
}
@keyframes popup-enter { from { opacity:0; transform:translateY(7px) } to { opacity:1; transform:translateY(0) } }
@keyframes backdrop-enter { from { opacity:0 } to { opacity:1 } }
dialog.gift { width:min(957px,calc(100vw - 32px)); padding:22px 30px 28px }
dialog.gift>*:not(.close) { max-width:660px; margin-inline:auto }
dialog .close { position:absolute; top:7px; right:16px; border:0; background:none; color:#77837c; font:30px/1.5 Georgia }
.ornament { display:block; width:108px; height:20px; margin:0 auto 10px }
.ornament use { fill:none; stroke:var(--gold) }
.ornament use:nth-of-type(2) { fill:var(--gold) }
dialog .close { width:34px; height:34px; top:15px; right:16px; display:grid; place-content:center; font-size:0 }
dialog .close::before,dialog .close::after { content:''; grid-area:1/1; width:15px; height:1px; background:currentColor; transform:rotate(45deg) }
dialog .close::after { transform:rotate(-45deg) }
dialog #title:focus { outline:none }
dialog.welcome-game { width:min(560px,calc(100vw - 32px)) }
.welcome-game #result { color:#67766f; font:inherit }
.welcome-game #activity { margin-top:22px }
dialog small { margin-bottom:12px }
dialog p { color:#67766f; margin:12px 0 }
#copy { white-space:pre-line }
#activity:empty,#copy:empty,#result:empty { display:none }
#activity { margin:12px 0 }
.gift #activity { margin-inline:auto }
.gift:not(.jackpot-game) #activity { width:min(660px,100%) }
#action { width:100%; display:block; flex-shrink:0 }
.wheel { position:relative; width:min(246px,100%,clamp(118px,calc(94dvh - 340px),246px)); aspect-ratio:1; margin:20px auto 0 }
.wheel svg { display:block; width:100%; height:100%; overflow:hidden; contain:strict }
.wheel text { text-anchor:middle; font:700 13px Quicksand,sans-serif }
.rotor { transform-origin:123px 123px; transform:rotate(var(--turn,0deg)) }
.rotor,.wheel text { transition:transform 3.6s cubic-bezier(.15,.8,.15,1) }
.wheel::before,.wheel::after { position:absolute; z-index:1; left:50%; transform:translateX(-50%); color:var(--gold) }
.wheel::before { content:''; top:-7px; width:25px; height:22px; background:var(--gold); clip-path:polygon(0 0,100% 0,50% 100%) }
.wheel::after { content:'✦'; top:50%; transform:translate(-50%,-50%); display:grid; place-items:center; border-radius:50%; width:20%; aspect-ratio:1; background:white; font-size:26px; box-shadow:0 2px 10px #0002 }
.reels { display:flex; gap:8px; padding:24px 18px; background:#26564d; border:6px solid #d7b879; border-radius:17px }
.jackpot-game #activity,.gift.jackpot-game #action { width:min(394px,100%); margin-inline:auto }
.jackpot-game #result { font-size:clamp(23px,5vw,31px) }
.reel-window { flex:1; min-width:0; position:relative; aspect-ratio:1; overflow:hidden; border-radius:8px; background:#faf0d9; perspective:650px; container-type:inline-size }
.reel-axis,.reel-drum { position:absolute; inset:0; transform-style:preserve-3d }
.reel-axis { --face-height:100cqw; --radius:186.60cqw; transform:translateZ(calc(0px - var(--radius))) }
.reel-face { position:absolute; top:50%; left:0; right:0; display:grid; place-items:center; height:var(--face-height); margin-top:calc(var(--face-height) / -2); backface-visibility:hidden; background:#faf0d9; color:#ae761d; font:700 clamp(14px,18cqw,20px) Quicksand,sans-serif }
.reel-face.money { grid-template-columns:minmax(0,1fr); background:#a9424b; color:#fff6dd }
.reel-amount { width:calc(100% - 10px); text-align:center; line-height:1.12 }
.reel-amount>span,.ticket-prize[data-prize-label]>span { display:block; width:max-content; margin-inline:auto; white-space:nowrap }
.ticket { position:relative; display:grid; grid-template-columns:minmax(0,1fr); place-items:center; aspect-ratio:394/174; overflow:hidden; border-radius:12px; color:var(--green); background:#faf3e4; box-shadow:inset 0 0 0 1px #d2b682; user-select:none }
.ticket::before,.ticket::after { content:'✧   ✦   ✧'; position:absolute; left:0; right:0; color:#aa803f; font:16px Georgia,serif }
.ticket::before { top:12% }
.ticket::after { bottom:12% }
.ticket-prize { width:calc(100% - clamp(28px,12%,56px)); text-align:center }
.ticket canvas { position:absolute; z-index:1; inset:0; width:100%; height:100%; touch-action:none; cursor:crosshair }
.ticket-game:not(.ticket-active) canvas { cursor:default }
.ticket-game:not(.ticket-active) .ticket { aspect-ratio:394/191 }
.ticket-game .ticket { background:#fbf0d9; box-shadow:none }
.ticket-game .ticket::before,.ticket-game .ticket::after { content:none }
.ticket-game:has(canvas) #action { min-height:44px }
.room { position:relative; aspect-ratio:16/9; background:url('../img/salon.png') center/cover; border-radius:14px }
.present { border:0; background:transparent; position:absolute; width:19%; aspect-ratio:1; left:40.5%; top:56.3%; padding:0 }
.present img,.reveal img { width:100%; height:auto }
.reveal { display:grid; place-content:center; min-height:190px; position:relative; overflow:hidden; background:#fff1d4 url('../img/confettis.png') center/100% 100% no-repeat; border:1px solid #eacb8c; border-radius:16px; color:var(--green); padding:22px 30px 26px; gap:10px; justify-items:center }
.reveal img { width:125px; margin:auto }
.reveal .prize { font-size:36px }
.reveal p { margin:0; white-space:pre-line }
.reveal:has(.confetti) { background-image:none }
.confetti { position:absolute; inset:0; pointer-events:none; background:url('../img/confettis.png') center/100% 100% no-repeat }
.reveal :is(img,.prize,p) { position:relative }
#result,.ticket-prize { font:500 clamp(23px,5vw,31px)/1.5 'Playfair Display',Georgia,serif; color:var(--green) }
.village-progress time { margin-inline-end:6px; font-weight:600 }
.village-progress>span,.village-progress b { font-weight:400; color:#61716c }
footer #rules { color:#687875; font-weight:400; text-decoration:underline }
.finale { width:min(957px,calc(100vw - 32px)) }
.finale ul { list-style:none; max-height:min(240px,32dvh); overflow:auto; width:min(610px,100%); margin:0 auto; padding:0 20px; scrollbar-color:var(--red) #eee; scrollbar-width:thin }
.finale li { margin:.5em 0; overflow-wrap:anywhere }
.finale #action { display:none }
@media (min-width:751px) {
 .jackpot-game #activity,.ticket-game #activity { margin-top:14px }
 dialog.gift.jackpot-game { padding-block:28px 26px }
 dialog.gift:not(.jackpot-game) #activity { margin-block:8px 10px }
 dialog.gift:not(.jackpot-game) #copy { margin-block:10px }
 .gift:has(.reveal) { padding-bottom:36px }
}
@media (min-width:751px) {
 @container (min-aspect-ratio:16/9) {
  .intro { top:2%; width:min(435px,80%); padding:clamp(8px,1.7cqh,18px) 18px }
  .intro h1 { font-size:clamp(24px,4.8cqh,36px) }
  .scene { --sky-width:max(177.7778cqh,55cqw); width:100%; height:100%; aspect-ratio:auto; background-position:left top; background-size:var(--sky-width) auto }
  .moon { top:calc(var(--sky-width) * .0208) }
  /* Le léger chevauchement couvre les arrondis de pixels entre les deux pans du décor. */
  .scene::before { content:''; position:absolute; inset:0 0 0 calc(var(--sky-width) - 2px); transform:scaleX(-1); background:url('../img/montagnes.png') right top/var(--sky-width) auto no-repeat }
  .houses { top:auto; bottom:4.2%; height:min(37.29167cqw,74.58333cqh); aspect-ratio:auto }
 }
}
@media(max-width:750px) {
 header { gap:5px; padding:8px; flex-wrap:nowrap }
 header .name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0 }
 .balance { padding:5px 8px; white-space:nowrap }
 header { min-height:68px; justify-content:space-evenly; gap:6px }
 header form { flex-basis:clamp(120px,42vw,165px) }
 header .primary { padding:4px 8px }
 main { border-top:0; background:#e3eaf1 }
 .pan { bottom:48px; overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; scrollbar-width:none }
 .pan::-webkit-scrollbar { display:none }
 .snowfall { grid-area:1/1; position:sticky; left:0; width:100%; height:100% }
 .scene { grid-area:1/1 }
 @container (max-aspect-ratio:16/9) {
   .scene { position:absolute; inset:0 auto auto 0; width:177.7778cqh }
 }
 .intro { width:min(305px,92%); top:4%; padding:12px 16px }
 .intro small { font-size:8px }
 .intro h1 { font-size:25px; margin:4px 0 }
 .intro p { font-size:10px; margin:0 0 8px }
 .intro strong { font-size:12px }
 footer { left:50%; right:auto; bottom:2%; transform:translateX(-50%); width:max-content; max-width:96%; padding:7px 44px; border-radius:32px; background:#fffffff2; flex-direction:column }
 footer>* { background:none; padding:0 }
 footer:has(.test-panel) { bottom:4px; gap:2px }
 footer>.test-panel { position:static }
 footer>.test-panel+span { margin:0 }
 footer .demo-context { display:none }
 .test-settings { width:min(94vw,385px); left:50%; transform:translateX(-50%); text-align:left }
 .test-panel summary { padding:4px 12px }
 main:has(.test-panel) .pan { bottom:80px }
 .village-step { position:absolute; top:50%; transform:translateY(-50%); width:38px; height:38px; background:#fff; border:1px solid #d4deda; color:var(--green); font:26px/1 Georgia,serif }
 .village-step.previous { left:3px }
 .village-step.next { right:3px }
 .village-step:disabled { opacity:.4 }
 footer #account { margin:0; gap:14px; max-width:100% }
 footer .name { order:-1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
 header #rules { background:white; border:1px solid #d4deda; border-radius:20px; padding:7px 13px; font-size:12px; text-decoration:underline }
 header #rules { font-weight:400; color:#687875 }
 .gift:not(.jackpot-game) #activity { margin-block:8px 10px }
 .gift:not(.jackpot-game) h2 { font-size:20px }
 .gift:not(.jackpot-game) #copy { margin-block:10px }
 .room .present { inset:0; width:100%; height:100%; aspect-ratio:auto }
 .room .present img { display:none }
 .gift:has(.room) #action { padding-block:10px; font-size:12px }
 dialog,dialog.gift { padding:22px min(7.7vw,30px); width:min(470px,calc(100vw - 48px)) }
 h2 { font-size:clamp(20px,5.6vw,26px) }
 .reveal { padding:15px; gap:6px }
 .reveal img { width:90px }
 .reveal,.confetti { background-size:cover }
 .reveal p { font-size:11px }
 .gift .reveal { min-height:208px }
 .reveal .prize { font-size:25px }
}
@media(prefers-reduced-motion:reduce) {
 .rotor,.wheel text { transition:none }
 .village-track { display:none }
 .skater-track { display:block; transform:none !important }
 .skater-track canvas { visibility:hidden }
 .snowfall { display:none }
 .snowfall i { animation:none }
}
@media (max-height:600px) {
 dialog.wheel-game { padding-block:12px }
 .wheel-game .ornament { display:none }
 .wheel-game small,.wheel-game p { margin-block:5px }
 .wheel-game h2 { font-size:24px }
 .wheel-game #action { padding-block:9px }
}
@media (max-height:480px) {
 .pan { bottom:48px }
 main { background:#23425e }
 .room { width:min(100%,64dvh); margin-inline:auto }
 dialog.gift { padding-block:10px }
 .gift .reveal { padding-block:8px; min-height:0; gap:2px }
 .gift .reveal img { width:64px }
 .intro h1 { margin:0; font-size:20px }
 .intro { padding:6px 12px }
 .intro p { font-size:11px; line-height:1.3; margin:3px 0 5px }
 .intro strong { font-size:12px; line-height:1.35 }
 .test-settings form { gap:6px; margin:5px 0 }
 .test-settings input,.test-settings select,.test-settings button { padding:3px 6px }
 dialog { padding-block:12px }
 dialog .ornament { display:none }
 dialog p,dialog small,#activity { margin-block:5px }
 .jackpot-game #activity { width:min(310px,100%) }
 .reels { padding-block:8px }
}
@media (min-height:481px), (max-width:539px) {
 main:has(.intro:not([hidden])) { background-image:linear-gradient(#23425e 50%,transparent 50%) }
 main:has(.intro:not([hidden])) .pan { translate:0 var(--roof-clearance,0px) }
 .intro { top:6px; width:min(580px,94%); padding:8px 16px }
 .intro h1 { margin:2px 0; line-height:1.15 }
 .intro p { margin:4px 0 6px }
 .intro strong { line-height:1.35 }
}
@media (min-width:751px) and (min-height:481px) and (max-height:820px) {
 .intro { width:min(840px,96%); padding:6px 14px; column-gap:18px; align-items:center }
 .intro:not([hidden]) { display:grid; grid-template-columns:1.25fr 1fr }
 .intro strong { grid-column:2; grid-row:1 / 4; font-size:13px }
 .intro h1 { font-size:25px }
 .intro p { margin:2px 0; line-height:1.25 }
}
@media (min-width:751px) and (min-height:481px) and (max-height:550px) {
 .intro:not([hidden]) { grid-template-columns:1fr 1.25fr 1fr; width:min(980px,97%) }
 .intro h1 { grid-column:1; font-size:21px }
 .intro p,.intro strong { grid-row:1 / 3 }
 .intro p { grid-column:2 }
 .intro strong { grid-column:3; font-size:12px }
}
@media (max-width:750px) and (max-height:670px) {
 .intro { top:3px; width:96%; padding:4px 8px }
 .intro h1 { font-size:20px; margin:0 }
 .intro p { margin:2px 0; line-height:1.2 }
 .intro strong { font-size:11px; line-height:1.2 }
}
@media (max-height:480px) and (min-width:540px) {
 main:has(.intro:not([hidden])) { --info-width:clamp(190px,30vw,300px) }
 main:has(.intro:not([hidden])) .pan { left:var(--info-width) }
 .intro { left:0; top:0; width:var(--info-width); transform:none; padding:10px }
 dialog:is(.wheel-game,.ticket-game,.jackpot-game,.gift)[open] { display:grid; grid-template-columns:minmax(145px,1fr) minmax(200px,1.25fr); align-content:center; align-items:center; column-gap:20px; width:min(660px,96vw); padding:20px 28px }
 dialog #activity { grid-column:1; grid-row:1 / 6; margin:0 }
 dialog :is(#date,#title,#copy,#result,#action) { grid-column:2 }
 .wheel-game .wheel { width:min(100%,48dvh); margin:12px auto }
}

dialog.information { width:min(957px,calc(100vw - 32px)); overflow-y:auto; overscroll-behavior:contain }
.information #title:focus { outline:none }
.information #activity { margin:0 auto; width:min(750px,100%) }
.help-sections h3 { font-size:1em; margin:1em 0 0 }
.help-sections p { margin:.15em 0 .9em }
.information #action { width:min(272px,100%); margin:12px auto 0 }
.information-footer { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; border-top:1px solid #dde3e0; padding-top:12px; margin-top:14px; text-align:start }
.information-footer .primary { display:inline-block; text-decoration:none }
.rules-document { display:block; width:100%; height:clamp(160px,48dvh,600px); border:0 }
.information .rules-controls { border:0; margin:0 0 12px; padding:0 }
.information-footer select { font:inherit; color:inherit; padding:5px; max-width:100% }
.information:has(.help-sections) { display:none }
.information[open]:has(.help-sections) { display:flex; flex-direction:column; align-items:center }
.information:has(.help-sections) #activity { display:contents }
.information .help-sections,.information .information-footer { width:min(750px,100%) }
.information:has(.help-sections) .information-footer { order:1 }
