:root {
  --sky-top: #070b1e;
  --sky-mid: #121d45;
  --sky-low: #2b417b;
  --ice: #d8ecff;
  --mint: #7ff5c9;
  --aqua: #5fd8ff;
  --violet: #a98bff;
  --ink: #0b1026;
  --scene-h: clamp(240px, 44vh, 480px);
  --paw-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg fill='white' stroke='%230b1026' stroke-width='1.6'%3E%3Cellipse cx='16' cy='21' rx='7' ry='6'/%3E%3Ccircle cx='7.5' cy='13' r='3'/%3E%3Ccircle cx='12.5' cy='8.5' r='3'/%3E%3Ccircle cx='19.5' cy='8.5' r='3'/%3E%3Ccircle cx='24.5' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E") 16 16, auto;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }

html, body { min-height: 100%; }

body {
  font-family: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  color: #fff;
  background: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  cursor: var(--paw-cursor);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Sky ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% 100%, rgba(90, 130, 210, .45) 0%, transparent 60%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 48%, var(--sky-low) 100%);
}

.stars { position: absolute; inset: 0; }
.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  opacity: var(--o);
  animation: twinkle var(--d) ease-in-out var(--dl) infinite;
}
@keyframes twinkle { 50% { opacity: .12; } }

.moon {
  position: absolute;
  top: 7vh;
  right: 9vw;
  font-size: clamp(40px, 5.5vw, 72px);
  width: 1em;
  height: 1em;
  border-radius: 50%;
  box-shadow: .26em -.1em 0 0 #fff3c9;
  filter: drop-shadow(0 0 18px rgba(255, 238, 190, .55));
  transform: rotate(-12deg);
}

.aurora {
  position: absolute;
  inset: -12% -25% 35% -25%;
  filter: blur(46px);
  opacity: .8;
  mix-blend-mode: screen;
}
.band { position: absolute; left: 0; right: 0; height: 36%; border-radius: 50%; }
.b1 {
  top: 10%;
  background: linear-gradient(90deg, transparent 5%, rgba(80, 255, 190, .55) 30%, rgba(70, 220, 255, .5) 55%, transparent 85%);
  animation: drift1 17s ease-in-out infinite alternate;
}
.b2 {
  top: 26%;
  background: linear-gradient(90deg, transparent 15%, rgba(160, 120, 255, .45) 45%, rgba(80, 255, 190, .35) 70%, transparent 95%);
  animation: drift2 23s ease-in-out infinite alternate;
}
.b3 {
  top: 0;
  height: 28%;
  background: linear-gradient(90deg, transparent 0%, rgba(60, 200, 255, .35) 22%, rgba(120, 255, 200, .4) 42%, transparent 68%);
  animation: drift3 29s ease-in-out infinite alternate;
}
@keyframes drift1 {
  from { transform: translateX(-9%) rotate(-9deg) scaleY(.75); }
  to   { transform: translateX(9%)  rotate(-3deg) scaleY(1.25); }
}
@keyframes drift2 {
  from { transform: translateX(10%)  rotate(7deg) scaleY(1.1); }
  to   { transform: translateX(-8%)  rotate(2deg) scaleY(.8); }
}
@keyframes drift3 {
  from { transform: translateX(-4%) rotate(4deg); opacity: .6; }
  to   { transform: translateX(14%) rotate(-5deg); opacity: 1; }
}

.shooting {
  position: absolute;
  width: 150px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff);
  filter: drop-shadow(0 0 6px #fff);
  animation: shoot 1.1s ease-out forwards;
}
@keyframes shoot {
  from { transform: rotate(16deg) translateX(0); opacity: 0; }
  15%  { opacity: 1; }
  to   { transform: rotate(16deg) translateX(460px); opacity: 0; }
}

/* ---------- Snow canvas ---------- */
.snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* ---------- Layout ---------- */
.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
}

.hero {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.2vh, 20px);
  padding: clamp(32px, 8vh, 90px) 16px 8px;
  text-align: center;
}

.eyebrow {
  font-size: clamp(.74rem, 1.5vw, .92rem);
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--mint);
  text-shadow: 0 0 18px rgba(127, 245, 201, .45);
}

/* ---------- Title ---------- */
.title {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: .26em;
  font-weight: 700;
  font-size: clamp(3rem, min(12.5vw, 16vh), 8.5rem);
  line-height: 1;
  letter-spacing: -.01em;
  filter:
    drop-shadow(0 .06em 0 rgba(6, 12, 38, .6))
    drop-shadow(0 0 .4em rgba(110, 210, 255, .3));
}
.word { display: inline-flex; white-space: nowrap; }

.l {
  display: inline-block;
  animation: bob 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * .11s - 3.2s);
}
.l > span {
  display: inline-block;
  padding: 0 .015em;
  background: linear-gradient(180deg, #ffffff 30%, #d2ebff 70%, #a6d4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: transform .4s cubic-bezier(.3, 1.7, .5, 1);
}
.w2 .l > span {
  background-image: linear-gradient(180deg, #b6ffe6 15%, #7ff5c9 55%, #5fd8ff 100%);
}
.l:hover > span { transform: translateY(-.14em) rotate(-9deg) scale(1.1); }
.l:nth-child(even):hover > span { transform: translateY(-.14em) rotate(9deg) scale(1.1); }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-.07em); }
}

.soon {
  display: flex;
  align-items: center;
  gap: .45em;
  font-size: clamp(1.3rem, 3.4vw, 2.15rem);
  font-weight: 500;
  color: #e8f4ff;
  letter-spacing: .02em;
}
.claw-ico {
  width: 1.05em;
  height: 1.05em;
  fill: none;
  stroke: var(--mint);
  stroke-width: 3.4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(127, 245, 201, .6));
}
.claw-ico.flip { transform: scaleX(-1); }

/* ---------- Status chip ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: .65em;
  margin-top: 4px;
  padding: .6em 1.05em;
  border-radius: 999px;
  font-size: clamp(.84rem, 1.6vw, .98rem);
  color: #d9ebff;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.flake-spin {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: var(--aqua);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: spin 7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-msg {
  display: inline-block;
  min-width: 12.5em;
  text-align: left;
  transition: opacity .28s ease, transform .28s ease;
}
.status-msg.out { opacity: 0; transform: translateY(-6px); }

.bar {
  width: 76px;
  height: 8px;
  flex: none;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}
.fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--aqua), var(--mint));
  box-shadow: 0 0 10px rgba(127, 245, 201, .7);
  transition: width .9s cubic-bezier(.3, 1.3, .5, 1);
}
.pct {
  min-width: 2.6em;
  text-align: right;
  font-weight: 600;
  color: var(--mint);
  font-variant-numeric: tabular-nums;
}

.hint {
  font-size: .86rem;
  color: rgba(216, 236, 255, .58);
  transition: opacity .8s ease;
}
.hint.gone { opacity: 0; }

/* ---------- Scene ---------- */
.scene {
  position: relative;
  z-index: 1;
  height: var(--scene-h);
  overflow: hidden;
}
.scene-art {
  position: absolute;
  bottom: 0;
  left: 50%;
  height: 100%;
  width: auto;
  aspect-ratio: 20 / 3;
  transform: translateX(-50%);
}

.foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(12px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: .8rem;
  letter-spacing: .03em;
  color: #6c80ab;
}

/* Bear */
.poke { cursor: pointer; outline: none; }
.poke:focus-visible { filter: drop-shadow(0 0 10px var(--mint)) drop-shadow(0 0 4px var(--mint)); }

.bear-rise { animation: rise 1.2s cubic-bezier(.2, .8, .25, 1.12) .45s both; }
@keyframes rise {
  from { transform: translateY(340px); }
  to   { transform: translateY(0); }
}
.bear-bob { animation: breathe 4.6s ease-in-out 1.8s infinite; }
@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(7px); }
}

.bear-react, .penguin-react, .penguin, .ear, .eye, .paw-pop, .paw-move, .sparkle {
  transform-box: fill-box;
}
.bear-react { transform-origin: 50% 100%; }
.bear-react.boop { animation: boop .65s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes boop {
  0%   { transform: none; }
  25%  { transform: translateY(26px) scale(1.05, .93); }
  60%  { transform: translateY(-12px) scale(.97, 1.04); }
  100% { transform: none; }
}

.ear { transform-origin: 50% 90%; }
.boop .ear-l { animation: earL .6s ease; }
.boop .ear-r { animation: earR .6s ease; }
@keyframes earL { 30% { transform: rotate(-20deg); } 65% { transform: rotate(8deg); } }
@keyframes earR { 30% { transform: rotate(20deg); }  65% { transform: rotate(-8deg); } }

.eye { transform-origin: center; animation: blink 5.5s infinite; }
@keyframes blink {
  0%, 93%, 100% { transform: scaleY(1); }
  95%           { transform: scaleY(.1); }
}
.boop .eye { animation: squint .65s ease; }
@keyframes squint { 20%, 65% { transform: scaleY(.15); } }

.mouth-open { opacity: 0; transition: opacity .12s; }
.boop .mouth-open { opacity: 1; }

.paw-pop { transform-origin: 50% 100%; animation: pawPop .6s cubic-bezier(.3, 1.6, .5, 1) both; }
.paw-pop-l { animation-delay: 1.35s; }
.paw-pop-r { animation-delay: 1.52s; }
@keyframes pawPop {
  from { transform: translateY(30px) scale(.2); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.paw-move { transform-origin: 50% 100%; }
.paw-move.swipe { animation: swipe .7s cubic-bezier(.3, 1.3, .5, 1); }
@keyframes swipe {
  0%   { transform: none; }
  35%  { transform: translateY(-90px) rotate(-24deg); }
  65%  { transform: translateY(6px) rotate(3deg) scaleY(.94); }
  100% { transform: none; }
}

/* Penguin */
.penguin-react { transform-origin: 50% 100%; }
.penguin { transform-origin: 50% 100%; animation: waddle 1.8s ease-in-out infinite; }
@keyframes waddle {
  0%, 100% { transform: rotate(-5deg); }
  50%      { transform: rotate(5deg); }
}
.penguin-react.hop { animation: hop .6s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes hop {
  40%  { transform: translateY(-46px) rotate(-8deg); }
  100% { transform: none; }
}

/* Snow sparkle + igloo glow */
.sparkle { transform-origin: center; opacity: 0; animation: sparkle 3.2s ease-in-out infinite; }
@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(.3) rotate(0); }
  50%      { opacity: 1; transform: scale(1) rotate(45deg); }
}
.door-glow { opacity: .45; animation: flicker 4s ease-in-out infinite; }
@keyframes flicker {
  0%, 100% { opacity: .45; }
  40%      { opacity: .3; }
  45%      { opacity: .55; }
  70%      { opacity: .38; }
}

/* ---------- Claw marks ---------- */
.claws-layer {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}
.claw {
  position: absolute;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  transform: rotate(var(--r));
  filter: drop-shadow(0 0 8px rgba(95, 216, 255, .85));
  animation: clawFade 2.4s ease forwards;
}
.claw svg { width: 100%; height: 100%; overflow: visible; }
.claw path {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1;
  animation: draw .22s cubic-bezier(.5, 0, .2, 1) forwards;
}
.claw .glow { stroke: rgba(127, 245, 201, .45); stroke-width: 11; }
.claw .core { stroke: #f2fbff; stroke-width: 4.5; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes clawFade {
  0%, 55% { opacity: 1; }
  100%    { opacity: 0; }
}

/* ---------- Speech bubble ---------- */
.bubble {
  position: fixed;
  z-index: 6;
  left: 0;
  top: 0;
  padding: .55em 1em;
  border-radius: 16px;
  background: #fff;
  color: #1b2340;
  font-weight: 600;
  font-size: clamp(.9rem, 1.7vw, 1.05rem);
  white-space: nowrap;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .5);
  pointer-events: none;
  opacity: 0;
  transform-origin: var(--tail, 50%) 100%;
  transform: translate(-50%, calc(-100% - 14px)) scale(.6);
  transition: opacity .18s ease, transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.bubble.show { opacity: 1; transform: translate(-50%, calc(-100% - 14px)) scale(1); }
.bubble::after {
  content: "";
  position: absolute;
  left: var(--tail, 50%);
  bottom: -7px;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
}

::selection { background: var(--mint); color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .bar { display: none; }
  .status-msg { min-width: 0; }
  .status { gap: .55em; }
}

@media (max-height: 560px) and (orientation: landscape) {
  :root { --scene-h: clamp(170px, 40vh, 260px); }
  .hero { padding-top: 20px; gap: 8px; }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
  }
  .claw, .claw path { animation: none !important; }
  .claw path { stroke-dashoffset: 0; }
}
