#home:has(.dk-hip.night)::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 58% 4.5%, #fff8d6 0 2.2%, #fff8d640 2.6%, transparent 9%), linear-gradient(#2a2f7a66, #3a2f7a33 55%, #1d2a6b22);
}
#dock { position: relative; z-index: 2; flex: none; display: flex; align-items: flex-end; justify-content: center; gap: var(--dg); }

.dk-hip { position: relative; flex: none; height: var(--hh); aspect-ratio: 611 / 640; touch-action: none; }
.dk-hip::before {
  content: ''; position: absolute; left: 12%; right: 12%; bottom: -2%; height: 12%; border-radius: 50%;
  background: radial-gradient(#00000038, transparent 70%);
}
.dk-bob { position: relative; width: 100%; height: 100%; transform-origin: 50% 100%; animation: dkBreathe 2.8s ease-in-out infinite; }
.dk-body { position: relative; width: 100%; height: 100%; transform-origin: 50% 95%; }
.dk-body img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0;
  filter: drop-shadow(0 .5dvmin .5dvmin #0000004d); transition: opacity .08s;
}
.dk-hip[data-face=open] .dk-open, .dk-hip[data-face=chew] .dk-chew, .dk-hip[data-face=sleep] .dk-sleep { opacity: 1; }
.dk-hip.night .dk-bob { animation: dkSway 4.6s ease-in-out infinite; }
.dk-body.dk-jelly { animation: jelly .5s ease-in-out; }
.dk-body.dk-wig { animation: wiggle .7s ease-in-out; }
.dk-body.dk-hop { animation: bounce .7s ease-out; }
.dk-body.dk-chomp { animation: dkChomp .6s ease-in-out; }

.dk-zzz { position: absolute; left: -2%; top: -8%; width: 40%; height: 50%; pointer-events: none; display: none; --zx: -60%; }
.dk-hip.night[data-face=sleep] .dk-zzz { display: block; }
.dk-zzz i {
  position: absolute; left: 0; bottom: 0; display: flex; align-items: center; justify-content: center;
  width: calc(var(--hh) * .25); height: calc(var(--hh) * .25); border-radius: 50%;
  background: #ffffffe8; box-shadow: 0 2px 6px #0002; color: #7b6fd6;
  font-style: normal; font-weight: 900; font-size: calc(var(--hh) * .16); opacity: 0;
  animation: dkZ 3.6s ease-out infinite;
}
.dk-zzz i:nth-child(2) { animation-delay: 1.2s; }
.dk-zzz i:nth-child(3) { animation-delay: 2.4s; font-size: calc(var(--hh) * .19); }

.dk-bub {
  position: absolute; z-index: 3; left: 84%; top: 2%; width: max-content;
  max-width: calc(var(--bs) * 3 + var(--dg) * 2); padding: .45em .75em; border-radius: 1.1em;
  background: #fff; color: #4a3a8a; font-weight: 900; font-size: clamp(14px, calc(var(--hh) * .12), 26px); line-height: 1.15;
  box-shadow: 0 4px 0 #00000014, 0 6px 14px #00000026; pointer-events: none;
  opacity: 0; transform: scale(.3); transform-origin: 0 80%;
  transition: opacity .2s, transform .35s cubic-bezier(.3,1.6,.5,1);
}
.dk-bub::before {
  content: ''; position: absolute; left: -9px; top: 60%; border: 9px solid transparent; border-left: 0; border-right-color: #fff;
}
.dk-bub.on { opacity: 1; transform: none; }

.dk-btns { display: flex; gap: var(--dg); }
.dk-btn {
  position: relative; flex: none; width: var(--bs); height: var(--bs); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 32% 26%, #ffffffd0, transparent 55%), var(--c);
  border: calc(var(--bs) * .05) solid #fff;
  box-shadow: 0 calc(var(--bs) * .07) 0 color-mix(in srgb, var(--c) 62%, #445), 0 calc(var(--bs) * .12) calc(var(--bs) * .16) #00000030;
  animation: tileIn .45s cubic-bezier(.3,1.6,.5,1) both; transition: transform .12s;
}
.dk-btn:nth-child(2) { animation-delay: 80ms; }
.dk-btn:nth-child(3) { animation-delay: 160ms; }
.dk-btn:active { transform: scale(.9) translateY(3px); }
.dk-ic { width: 80%; height: 80%; object-fit: contain; filter: drop-shadow(0 2px 2px #00000040); }
.dk-badge {
  position: absolute; top: -9%; right: -11%; min-width: 44%; height: 44%; padding: 0 .28em; border-radius: 999px;
  display: none; align-items: center; justify-content: center;
  background: #ff4d6d; color: #fff; font-weight: 900; font-size: calc(var(--bs) * .25); line-height: 1;
  border: max(2px, calc(var(--bs) * .04)) solid #fff; box-shadow: 0 3px 6px #00000040;
}
.dk-badge.on { display: flex; }
.dk-btn[data-x=garden] .dk-badge { background: #fff3a8; padding: 5%; }
.dk-badge svg { width: 100%; height: 100%; }

@media (orientation: landscape) {
  #dock { flex-direction: column; align-items: center; width: var(--dw); }
  .dk-btns { flex-wrap: wrap; justify-content: center; width: calc(var(--bs) * 2 + var(--dg)); }
  .dk-bub { left: auto; right: 80%; top: -12%; transform-origin: 100% 80%; max-width: max(130px, calc(var(--hh) * 1.05)); text-align: center; }
  .dk-bub::before { left: auto; right: -9px; border: 9px solid transparent; border-right: 0; border-left-color: #fff; }
  .dk-zzz { left: 70%; --zx: 60%; }
}

.sn-food { position: absolute; left: 0; top: 0; will-change: transform; }
.sn-food img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 4px #0000004d); }

.die {
  --o: max(2px, .5dvmin);
  object-fit: contain;
  filter: drop-shadow(var(--o) 0 0 #fff) drop-shadow(calc(var(--o) * -1) 0 0 #fff) drop-shadow(0 var(--o) 0 #fff) drop-shadow(0 calc(var(--o) * -1) 0 #fff) drop-shadow(0 calc(var(--o) * 1.2) calc(var(--o) * 1.2) #00000052);
}

.aw {
  position: fixed; z-index: 45; left: 50%; top: calc(env(safe-area-inset-top) + 7dvh);
  width: min(38dvmin, 210px); aspect-ratio: 1; translate: -50% 0; pointer-events: none;
}
.aw-rays {
  position: absolute; inset: -38%; border-radius: 50%;
  background: radial-gradient(closest-side, #fffbe0 0 30%, #ffe06688 48%, transparent 72%), repeating-conic-gradient(#ffffff70 0 9deg, transparent 9deg 22deg);
  -webkit-mask: radial-gradient(closest-side, #000 55%, transparent); mask: radial-gradient(closest-side, #000 55%, transparent);
  animation: spin 9s linear infinite, awIn .5s ease-out both;
}
.aw-st { position: absolute; inset: 0; }
.aw-st img { width: 100%; height: 100%; --o: max(3px, .9dvmin); }

.hn { position: relative; display: flex; align-items: center; justify-content: center; gap: 2dvmin; }
.hn-hip { flex: none; width: min(28dvmin, 170px); aspect-ratio: 611 / 640; object-fit: contain; filter: drop-shadow(0 1dvmin .8dvmin #0000004d); animation: floaty 2.6s ease-in-out infinite; }
.hn-bub {
  position: relative; max-width: min(56vw, 360px); padding: .55em .85em; border-radius: 1em;
  background: #fff; color: #4a3a8a; font-weight: 900; font-size: clamp(17px, 4.2dvmin, 32px); line-height: 1.2;
  box-shadow: 0 5px 0 #00000014, 0 8px 18px #00000026; animation: popIn .45s .2s cubic-bezier(.3,1.5,.5,1) both;
}
.hn-bub::before { content: ''; position: absolute; left: -11px; top: 50%; margin-top: -11px; border: 11px solid transparent; border-left: 0; border-right-color: #fff; }

.ins-scrim {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: #1d2a4a66; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: insFade .3s ease-out both;
}
.ins-card {
  width: min(92vw, 400px); max-height: 92dvh; overflow: hidden; padding: 22px 22px 18px; border-radius: 28px; background: #fff; color: #33334d;
  box-shadow: 0 10px 0 #0000001a, 0 22px 50px #00000059; animation: popIn .45s cubic-bezier(.3,1.5,.5,1) both;
}
.ins-head { display: flex; align-items: center; gap: 14px; }
.ins-icon { flex: none; width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 3px 8px #0000004d; }
.ins-title { font-size: 21px; font-weight: 900; line-height: 1.15; }
.ins-text { margin: 12px 0 6px; font-size: 16px; line-height: 1.35; color: #556; }
.ins-for { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #9aa0b4; }
.ins-row { display: flex; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.ins-row button { min-height: 48px; padding: 0 22px; border-radius: 999px; font-size: 17px; font-weight: 800; }
.ins-no { background: #eef0f6; color: #556; }
.ins-yes { background: #2d9cff; color: #fff; box-shadow: 0 4px 0 #1a6fc4; }
.ins-yes:active, .ins-no:active { transform: translateY(2px); }
.ins-steps { list-style: none; margin: 16px 0 4px; display: grid; gap: 12px; counter-reset: s; }
.ins-steps li { display: flex; align-items: center; gap: 12px; font-size: 16px; line-height: 1.3; counter-increment: s; }
.ins-ic { flex: none; width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #eaf4ff; color: #2d7fe0; }
.ins-ic svg { width: 28px; height: 28px; }
.ins-tp img { width: 40px; height: 40px; border-radius: 10px; }
.ins-arrow { position: fixed; z-index: 301; font-size: 52px; font-weight: 900; color: #fff; text-shadow: 0 3px 8px #0006; pointer-events: none; }
.ins-arrow.down { left: 50%; bottom: calc(env(safe-area-inset-bottom) + 6px); rotate: 90deg; animation: insNudgeY 1s ease-in-out infinite; }
.ins-arrow.up { right: 96px; top: calc(env(safe-area-inset-top) + 4px); rotate: -60deg; animation: insNudgeY 1s ease-in-out infinite reverse; }
.ins-toast {
  position: fixed; z-index: 310; left: 50%; top: calc(env(safe-area-inset-top) + 18px); max-width: 90vw;
  padding: 11px 20px; border-radius: 999px; background: #2b2f45e6; color: #fff; font-size: 15px; font-weight: 800; pointer-events: none;
}

@keyframes dkBreathe { 50% { transform: scale(1.025, .975); } }
@keyframes dkSway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) scale(1.01, .985); } }
@keyframes dkChomp { 0%, 100% { transform: none; } 25% { transform: scale(1.1, .88); } 55% { transform: scale(.95, 1.05); } 80% { transform: scale(1.04, .96); } }
@keyframes dkZ {
  0% { transform: translate(0, 0) scale(.4); opacity: 0; }
  15% { opacity: 1; }
  80% { opacity: .9; }
  100% { transform: translate(var(--zx), -150%) scale(1.05); opacity: 0; }
}
@keyframes awIn { from { opacity: 0; scale: .3; } }
@keyframes insFade { from { opacity: 0; } }
@keyframes insNudgeY { 50% { translate: 0 10px; } }
