/* Side-gutter visitors: CSS only, painted below the HUD and never a tap target.
 * Synchronized 28s phase keeps their four visits separate without an idle JS timer. */
.ice-wildlife{position:absolute;inset:0;overflow:hidden;pointer-events:none;user-select:none}
.iw-visit{
  --dur:28s;--delay:0s;--in:7%;--out:-10%;
  position:absolute;width:clamp(38px,8.6vw,128px);aspect-ratio:1 / 1.15;
  opacity:0;transform-origin:50% 80%;isolation:isolate;
  animation:iw-arrive var(--dur) linear var(--delay) infinite;
}
.iw-fish{left:clamp(2px,5%,94px);top:66%;--art:url("visitor-char.svg");--delay:-.32s}
.iw-seal{right:clamp(2px,6%,110px);top:72%;--art:url("visitor-seal.svg");--delay:-21s;--in:-7%;--out:10%}
.iw-stoat{left:clamp(2px,11%,175px);top:76%;--art:url("visitor-stoat.svg");--delay:-14s}
.iw-lemming{right:clamp(2px,9%,145px);top:65%;--art:url("visitor-lemming.svg");--delay:-7s;--in:-7%;--out:10%}
.iw-visit::before,.iw-visit::after,.iw-window,.iw-window i,.iw-spray{position:absolute;display:block;pointer-events:none}
.iw-visit::before,.iw-visit::after{content:""}
.iw-visit::before{
  inset:auto 0 8%;height:22%;background:center / 100% 100% no-repeat url("visitor-ice.svg");
}
.iw-visit::after{
  /* The bright lip is in front of the cutout, masking the lower end of the body. */
  inset:auto 14% 13.8%;height:9%;border-bottom:clamp(1px,.2vw,2px) solid #cde8e1be;
  border-radius:50%;transform:rotate(-2deg);
}
/* The two shore visitors peek over a broad compression of snow, not out
   of the fish and seal's blue water. The existing lip masks the cutout. */
:is(.iw-stoat,.iw-lemming)::before{
  height:29%;background-image:url("visitor-snowbank.svg");
}
.iw-lemming::before{transform:scaleX(-1)}
:is(.iw-stoat,.iw-lemming)::after{
  inset:auto 12% 11%;height:7%;border:0;
  background:radial-gradient(ellipse 52% 46% at 52% 63%,#e0e8dfba,transparent 100%);
}
.iw-window{inset:0 2% 16%;overflow:hidden;border-radius:0 0 48% 48% / 0 0 8% 8%}
.iw-window i{
  width:79%;height:77%;left:10.5%;bottom:-1%;background:bottom center / contain no-repeat var(--art);
  transform-origin:50% 90%;animation:iw-peek var(--dur) linear var(--delay) infinite;
}
.iw-stoat .iw-window i{width:83%;left:9%;height:91%}
.iw-lemming .iw-window{transform:scaleX(-1)}
.iw-lemming .iw-window i{width:82%;left:9%;height:72%}
.iw-fish .iw-window i{
  width:67%;left:16%;height:57%;transform-origin:center;animation-name:iw-breach;
}
.iw-spray{
  bottom:14%;left:12%;width:76%;height:43%;opacity:0;transform-origin:50% 100%;
  background:
    radial-gradient(ellipse 3% 8% at 6% 26%,#dffbff 82%,transparent 95%),
    radial-gradient(ellipse 4% 10% at 15% 58%,#a3e9f1 78%,transparent 96%),
    radial-gradient(ellipse 3% 7% at 85% 38%,#fff 75%,transparent 96%),
    radial-gradient(ellipse 4% 9% at 94% 13%,#b2e9ed 76%,transparent 96%);
  animation:iw-splash var(--dur) linear var(--delay) infinite;
}
@keyframes iw-arrive{
  0%{opacity:0;transform:translate(var(--in),-10%) scale(.87)}
  2.5%,17.7%{opacity:1}
  20.3%{opacity:0;transform:translate(var(--out),15%) scale(1.04)}
  20.4%,100%{opacity:0;transform:translate(0,0)}
}
@keyframes iw-peek{
  0%,2%{transform:translateY(108%) rotate(-4deg)}
  4%{transform:translateY(14%) rotate(-4deg)}
  5.4%,8.6%{transform:translateY(2%) rotate(-3deg)}
  10.2%,13.8%{transform:translateY(0) rotate(4deg)}
  15.6%{transform:translateY(9%) rotate(1deg)}
  17.7%,100%{transform:translateY(108%) rotate(0deg)}
}
@keyframes iw-breach{
  0%,3.5%{transform:translate(-18%,125%) rotate(-35deg)}
  4.3%{transform:translate(-14%,32%) rotate(-28deg)}
  5.2%{transform:translate(-10%,-18%) rotate(-14deg)}
  6.2%{transform:translate(-3%,-43%) rotate(5deg)}
  6.9%{transform:translate(1%,-47%) rotate(17deg)}
  7.6%{transform:translate(5%,-42%) rotate(34deg)}
  8.5%{transform:translate(9%,-23%) rotate(62deg)}
  9.2%{transform:translate(13%,6%) rotate(85deg)}
  10.4%,100%{transform:translate(21%,129%) rotate(104deg)}
}
@keyframes iw-splash{
  0%,3.5%,5.9%,9%,13%,100%{opacity:0;transform:scale(.46,.32)}
  4.4%{opacity:.95;transform:scale(.86,.59)}
  5.7%{opacity:0;transform:scale(1,.92)}
  10.3%{opacity:1;transform:scale(.87,.66)}
  12.3%{opacity:0;transform:scale(1.1,1.05)}
}
/* The centered panel occupies most of the screen in portrait even on the title
 * page. Keep a recognizable whole silhouette inside its outside border. */
@media (max-width:580px) and (orientation:portrait){
 .iw-visit{width:clamp(9px,3vw,12px);--in:0%;--out:0%}
 .iw-fish,.iw-stoat{left:1px}.iw-seal,.iw-lemming{right:1px}
 .iw-fish{top:48%}.iw-seal{top:51%}.iw-stoat{top:54%}.iw-lemming{top:46%}
}
/* In tall portraits there is room beneath the original, wider square board. */
@media (max-width:580px) and (orientation:portrait) and (min-height:810px){
 .iw-visit{top:auto;bottom:1.9vh;width:clamp(34px,11vw,51px)}
 .iw-fish{left:3px}.iw-seal{right:3px}
 .iw-stoat{left:12px}.iw-lemming{right:12px}
}
/* The restored short-landscape board occupies the left column. The right
   column leaves an ice strip between the controls and footer. */
@media (orientation:landscape) and (max-height:560px){
 .iw-visit{top:auto;bottom:41px;right:10px;left:auto;width:24px;--in:0%;--out:0%}
 .iw-fish{right:12px}.iw-stoat{right:5px}.iw-seal{right:14px}.iw-lemming{right:8px}
}
@media (orientation:landscape) and (max-height:380px){.iw-visit{width:16px;bottom:35px}}
html[data-ice-paused] :is(.iw-visit,.iw-window i,.iw-spray){animation-play-state:paused}
@media(prefers-reduced-motion:reduce){
 .ice-wildlife{display:none}
 .iw-visit,.iw-window i,.iw-spray{animation:none}
}
