/* Backdrop only: nothing here participates in game layout, input or the 30s round. */
.ice-scene{
  --cycle:18s;
  --night-moon:radial-gradient(circle at 20% 16%,#f1f8ef 0 6px,#b2d0ed60 6.6px,transparent 21px);
  position:fixed;inset:0;z-index:0;overflow:hidden;contain:strict;isolation:isolate;
  /* Prevent native gestures beginning on the scenery, including with a finger on each surface. */
  touch-action:none;
  background:
    radial-gradient(circle at 77% 15%,#fffcec 0 .9%,#fff5db86 1.25%,transparent 7.5%),
    radial-gradient(ellipse at 9% 18%,#edf2ed63 0%,#e3eeeb36 31%,transparent 72%) -3vw 2vh/28vw 3.9vh no-repeat,
    radial-gradient(ellipse at 82% 55%,#feeee053 0%,#efeeec29 36%,transparent 74%) right 2vw top 23vh/25vw 3.6vh no-repeat,
    linear-gradient(180deg,#6eafd3 0%,#a4d3e5 27%,#deded9 48%,#f0dfd4 62%,#a5d3df 100%);
}
/* Transparent gaps in the layout belong to the backdrop. Controls stay native. */
.game{pointer-events:none}
.game :is(.brand,.scoreboard,.card,.controls,.foot > span){pointer-events:auto}
.ice-scene > *{pointer-events:none}
.ice-scene > .snow-layer{position:absolute}
/* During touch play, use one snow sheet instead of animating three oversized transparent
 * surfaces above the terrain. The sky, ice, wildlife and day-night timeline still run. */
html[data-round-active][data-touch-device] .ice-scene > :is(.snow-back,.snow-front){display:none}
.ice-scene > span,.ice-terrain > span{position:absolute;inset:0;display:block}
/* The camera follows a broad, banked turn. The shore and lake share the same heading;
   individual objects slide past faster as they approach the bottom of the frame. */
.ice-scene > .ice-terrain{inset:-3%;transform-origin:50% 59%;animation:ice-course 36s ease-in-out infinite}
@keyframes ice-course{
  0%,100%{transform:translate3d(0,0,0) rotate(0deg)}
  25%{transform:translate3d(-2.65%,.6%,0) rotate(-.72deg)}
  75%{transform:translate3d(2.65%,-.4%,0) rotate(.72deg)}
}
.ice-mountains,.ice-lake,.ice-floes,.ice-aurora{background-repeat:no-repeat;background-position:center;background-size:cover}
.ice-sky-night{opacity:0;animation:ice-night var(--cycle) ease-in-out infinite;background:
  radial-gradient(ellipse at 43% 25%,#463b774a,transparent 64%),
  linear-gradient(#080e2b 0%,#142849 35%,#326a79 63%,#274779 86%)}
/* The moon shares the aurora's opacity, not the darkening sky's. By the
   time either is drawn, the daytime disc is fully occluded by the sky. */
.ice-aurora{
  opacity:0;background-image:var(--night-moon),url("aurora-wide.webp");
  animation:ice-aurora var(--cycle) ease-in-out infinite
}
.ice-mountains{background-image:url("mountains.svg");animation:ice-ridge var(--cycle) ease-in-out infinite}
.ice-lake{background-image:url("lake.svg")}
.ice-floes{
  --carve:.95%;
  background-image:url("floes.svg");opacity:0;transform-origin:50% 63%;
  /* Two motions on each existing sheet: linear approach, plus the same
     lateral carve as the camera. The far sheet never scales. */
  animation:ice-glide-far 18s linear infinite, ice-floe-carve 36s ease-in-out infinite;
}
.ice-floes.second{
  --carve:3.55%;
  background-image:url("floes-near.svg");
  animation:ice-glide-near 9s linear -4.5s infinite, ice-floe-carve 36s ease-in-out infinite;
}
.ice-tint{
  opacity:0;animation:ice-ground-shadow var(--cycle) ease-in-out infinite;
  background:linear-gradient(180deg,transparent 12%,#21274b47 30%,#172c567d 48%,#142c579c 65%,#112952bb 100%);
}
/* Light belongs to the banked terrain. Keep the lamp and glints aligned
   to their underlying ice and windows, not adrift with the sky animation. */
.ice-reflection{
  opacity:0;animation:ice-reflection var(--cycle) ease-in-out infinite;
  background:
    url("reflection.svg") center/cover no-repeat,
    radial-gradient(ellipse at 11% 76%,#7dd5bb25,transparent 14%),
    radial-gradient(ellipse at 79% 76%,#67d5c427,transparent 18%),
    radial-gradient(ellipse at 45% 95%,#86d0c333,transparent 14%),
    radial-gradient(ellipse at 90% 88%,#9684e32a,transparent 17%);
}
/* At compact widths/heights the moon would show through the scorecard glass. */
@media(max-width:600px),(max-height:450px){
  .ice-scene{--night-moon:radial-gradient(transparent,transparent)}
}
/* Recompose the portrait inlet rather than stretching or magnifying the
   desktop valley. Interchange the wide lake and sky within the same layers. */
@media(max-aspect-ratio:4/5){
  .ice-aurora{background-image:var(--night-moon),url("aurora-portrait.webp")}
  .ice-floes{--carve:.28%}
  .ice-floes.second{--carve:1.05%}
  .ice-mountains{background-image:none;animation:none}
  .ice-lake{background-image:url("terrain-portrait.svg")}
  .ice-reflection{
    background:
      url("reflection-portrait.svg") center/cover no-repeat,
      radial-gradient(ellipse at 33% 94%,#71d0bd36,transparent 26%),
      radial-gradient(ellipse at 92% 99%,#998bd72c,transparent 27%);
  }
}
.ice-twilight{
  --dusk-light:
    radial-gradient(ellipse at 15% 33%,#c4a0bb3b,transparent 48%),
    radial-gradient(ellipse at 76% 55%,#f1b3974f,transparent 48%),
    linear-gradient(156deg,#705c9c38 0%,#c693a150 58%,#536e9440 100%);
  --dawn-light:
    radial-gradient(ellipse at 78% 45%,#ffdfa36f,transparent 50%),
    radial-gradient(ellipse 42% 15% at 68% 85%,#ffe0a356,#f4c08116 62%,transparent 100%),
    linear-gradient(156deg,#9bc8de22 0%,#eaca8e40 52%,#69b0d335 100%);
  opacity:0;background-image:var(--dusk-light);
  animation:ice-twilight var(--cycle) ease-in-out infinite;
}
.ice-twilight[data-dawn]{background-image:var(--dawn-light)}
/* Twilight peaks before night and after it, below the stationary HUD. The
   recurrence has no opacity cut at frame 0, 18 seconds or 36 seconds. */
@keyframes ice-night{0%,30%,100%{opacity:0} 46%,80%{opacity:1} 96%{opacity:0}}
@keyframes ice-ground-shadow{0%,30%,100%{opacity:0} 49%,78%{opacity:1} 96%{opacity:0}}
@keyframes ice-aurora{
  0%,48%{opacity:0;transform:translate3d(-1.2%,0,0) scale(1.04)}
  56%,73%{opacity:1}
  80%,100%{opacity:0;transform:translate3d(1.8%,.35%,0) scale(1.056)}
}
@keyframes ice-reflection{0%,36%,90%,100%{opacity:0} 54%,76%{opacity:1}}
@keyframes ice-twilight{0%,23%,54%,75%,100%{opacity:0} 38%{opacity:1} 88%{opacity:.92}}
@keyframes ice-ridge{0%,100%{transform:translate3d(-.8%,0,0) scale(1.025)}50%{transform:translate3d(.8%,0,0) scale(1.025)}}
@keyframes ice-floe-carve{
  0%,100%{translate:0 0}
  25%{translate:calc(-1 * var(--carve)) 0}
  75%{translate:var(--carve) 0}
}
@keyframes ice-glide-far{
  0%{opacity:0;transform:translate3d(0,-.6%,0)}
  17%,81%{opacity:.84}
  100%{opacity:0;transform:translate3d(0,3.2%,0)}
}
@keyframes ice-glide-near{
  0%{opacity:0;transform:translate3d(0,-3%,0) scale(.99)}
  23%,71%{opacity:.90}
  100%{opacity:0;transform:translate3d(0,8.5%,0) scale(1.025)}
}
/* Give the smallest footer fixed contrast, without changing the size of its box. */
.game .foot{color:#172d3d;opacity:1}
.game .foot > span{background:#f4fbffed;border-radius:.45em;box-shadow:0 0 0 .14em #f4fbffed}
.game .foot .credits{color:#385671}
html[data-ice-paused] :is(.ice-scene *,.snow-layer){animation-play-state:paused}
@media(prefers-reduced-motion:reduce){
  .ice-scene *{animation:none!important;transform:none}
  .ice-scene > .ice-terrain{inset:0}
  .ice-floes{opacity:1}
  .ice-floes.second{display:none}
}
