:root{
  --bg:#04060f;
  --ink:#ffffff;
  --scene: min(94vw, 66vh);
}

*{box-sizing:border-box;margin:0;padding:0}

html,body{
  height:100%;
  background:var(--bg);
  overflow:hidden;
  -webkit-tap-highlight-color:transparent;
  -webkit-user-select:none;
  user-select:none;
  touch-action:manipulation;
  overscroll-behavior:none;
}

body{
  font-family:ui-sans-serif,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--ink);
  cursor:pointer;
  background-image:
    radial-gradient(120% 90% at 22% 46%, rgba(28,60,120,.30) 0%, rgba(4,6,15,0) 62%),
    radial-gradient(100% 100% at 50% 50%, rgba(9,14,32,1) 0%, #02030a 100%);
}

.stars{
  position:fixed;
  inset:-2px;
  background:url("/public/images/stars.png") repeat;
  background-size:512px 512px;
  opacity:.55;
  pointer-events:none;
  animation:drift 240s linear infinite;
}
@keyframes drift{to{background-position:512px 256px}}

/* ---------- counter ---------- */
.top{
  position:fixed;
  top:0;left:0;right:0;
  display:flex;
  justify-content:center;
  padding:calc(env(safe-area-inset-top,0px) + 18px) 16px 0;
  pointer-events:none;
  z-index:3;
}

.count{
  font-size:clamp(34px, 11vw, 72px);
  font-weight:800;
  line-height:1;
  letter-spacing:.02em;
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum" 1;
  color:#fff;
  text-shadow:0 0 22px rgba(120,180,255,.55), 0 0 60px rgba(60,120,255,.30);
  transition:transform .09s ease-out;
  will-change:transform;
}
.count.pop{transform:scale(1.06)}

/* ---------- scene ---------- */
.stage{
  position:relative;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:2;
}

.scene{
  position:relative;
  width:var(--scene);
  aspect-ratio:1/1;
  opacity:0;
  transition:opacity .5s ease;
}
.scene.ready{opacity:1}

.earth{
  position:absolute;
  left:4%;
  top:34%;
  width:46%;
  aspect-ratio:1/1;
  border-radius:50%;
  box-shadow:
    0 0 0 1px rgba(120,180,255,.10),
    0 0 26px 4px rgba(70,140,255,.30),
    0 0 90px 14px rgba(40,90,200,.18);
}

#globe{
  display:block;
  width:100%;
  height:100%;
  border-radius:50%;
}

.cat{
  position:absolute;
  left:48.2%;
  top:19.6%;
  width:50%;
  aspect-ratio:281/252;
  background-image:url("/public/images/cat-lick.webp");
  background-repeat:no-repeat;
  background-size:1300% 100%;
  background-position:0% 0;
  filter:drop-shadow(0 10px 26px rgba(0,0,0,.55));
  will-change:background-position;
}

/* ---------- links ---------- */
.links{
  position:fixed;
  left:0;right:0;
  bottom:calc(env(safe-area-inset-bottom,0px) + 18px);
  display:flex;
  justify-content:center;
  gap:14px;
  z-index:4;
}

.link{
  width:52px;
  height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:16px;
  background:rgba(255,255,255,.055);
  border:1px solid rgba(255,255,255,.13);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  transition:transform .16s ease, background .16s ease, border-color .16s ease;
}
.link img{
  width:26px;
  height:26px;
  object-fit:contain;
  display:block;
  pointer-events:none;
}
.link:hover{
  transform:translateY(-3px);
  background:rgba(255,255,255,.11);
  border-color:rgba(255,255,255,.28);
}
.link:active{transform:translateY(-1px) scale(.96)}

@media (orientation:portrait){
  :root{--scene: min(98vw, 62vh)}
}

@media (max-width:380px){
  .link{width:46px;height:46px;border-radius:14px}
  .link img{width:23px;height:23px}
  .links{gap:11px}
}

@media (orientation:landscape) and (max-height:520px){
  :root{--scene: min(72vw, 76vh)}
  .count{font-size:clamp(24px,5vh,40px)}
}

@media (prefers-reduced-motion:reduce){
  .stars{animation:none}
}
