html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #050818;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: default;
}
/* Everything is laid out on a fixed 1920x1080 stage, scaled to fit the screen. */
#stage {
  position: absolute; left: 0; top: 0;
  width: 1920px; height: 1080px;
  transform-origin: 0 0;
  background: radial-gradient(ellipse at 20% 50%, #1a1f4a 0%, #0b0f2e 45%, #050818 100%);
  overflow: hidden;
  color: #fff;
}
#sky { position: absolute; left: 0; top: 0; }
#screen { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
.abs { position: absolute; }

.twinkle {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; opacity: .2;
  animation: twinkle 3s ease-in-out infinite alternate;
  will-change: opacity;
}
@keyframes twinkle { to { opacity: 1; } }

#shooting {
  position: absolute; left: 300px; top: 80px;
  width: 220px; height: 3px; border-radius: 3px;
  background: linear-gradient(to left, #fff, rgba(255,255,255,0));
  opacity: 0;
  animation: shoot 17s linear 5s infinite;
  will-change: transform, opacity;
}
@keyframes shoot {
  0%   { transform: translate(0, 0) rotate(18deg); opacity: 0; }
  1%   { opacity: 1; }
  6%   { transform: translate(900px, 290px) rotate(18deg); opacity: 0; }
  100% { transform: translate(900px, 290px) rotate(18deg); opacity: 0; }
}

/* ---------- Focus (TV remote / joystick) ---------- */
[data-nav] { cursor: pointer; }
.focused { box-shadow: 0 0 0 7px #fff, 0 0 0 13px rgba(255, 213, 74, .55); }
.round { border-radius: 50%; }

/* ---------- Planets ---------- */
.pl { position: absolute; }
.pl .float { width: 100%; height: 100%; }
.pl.bob .float {
  animation: float var(--dur, 6s) ease-in-out var(--delay, 0s) infinite alternate;
  will-change: transform;
}
@keyframes float {
  from { transform: translateY(-7px); }
  to   { transform: translateY(7px); }
}
.pop { width: 100%; height: 100%; position: relative; }
.pop svg { width: 100%; height: 100%; display: block; overflow: visible; }
.go { animation: pop .9s ease-out; }
@keyframes pop {
  0%   { transform: scale(1) rotate(0); }
  25%  { transform: scale(1.3) rotate(-8deg); }
  50%  { transform: scale(.92) rotate(6deg); }
  75%  { transform: scale(1.08) rotate(-3deg); }
  100% { transform: scale(1) rotate(0); }
}
.no { animation: no .5s ease-in-out; }
@keyframes no {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-22px); }
  40% { transform: translateX(18px); }
  60% { transform: translateX(-12px); }
  80% { transform: translateX(6px); }
}
.face { display: none; }
.faces .face { display: inline; }

.label {
  position: absolute; left: 50%; top: 100%;
  width: 300px; margin-left: -150px; margin-top: 8px;
  text-align: center; line-height: 1.05;
  pointer-events: none;
  text-shadow: 0 2px 4px #000;
  font-weight: bold; font-size: 28px;
}
.label .ru, .ru { color: #ffd54a; }
.label.small { font-size: 22px; }

/* ---------- Top bar ---------- */
.iconbtn {
  position: absolute; width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255, 255, 255, .13);
}
.iconbtn svg { width: 100%; height: 100%; display: block; }
.prompt {
  position: absolute; left: 160px; right: 160px; top: 22px;
  text-align: center; font-weight: bold; font-size: 64px; line-height: 1.15;
  text-shadow: 0 3px 6px #000;
  transition: opacity .3s;
}
.prompt .sub { font-size: 32px; color: #cfd6ff; font-weight: normal; margin-top: 4px; }
.prompt .dot { color: #7f8bd8; padding: 0 18px; }
.prompt .pic { display: inline-block; width: 80px; height: 80px; vertical-align: middle; margin-right: 18px; position: relative; }
.hide { opacity: 0; }

/* ---------- Menu ---------- */
.title { position: absolute; left: 0; right: 0; top: 30px; text-align: center; font-size: 84px; font-weight: bold; text-shadow: 0 4px 8px #000; }
.tile {
  position: absolute; width: 400px; height: 360px; border-radius: 40px;
  background: rgba(255, 255, 255, .08);
  text-align: center;
}
.tile .art { position: absolute; left: 80px; top: 26px; width: 240px; height: 200px; }
.tile .art svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tile .name { position: absolute; left: 0; right: 0; top: 240px; font-size: 40px; font-weight: bold; line-height: 1.1; }

/* ---------- Cards (pairs) ---------- */
.card {
  position: absolute; border-radius: 30px;
  background: #23307a;
  border: 5px solid #3d4fb0;
  box-sizing: border-box;
}
.card .in { position: absolute; left: 12%; top: 12%; width: 76%; height: 76%; }
.card.open { background: #121a44; }
.card.done { background: #1c3a2c; border-color: #4caf50; }
.flip { animation: flip .36s ease-in-out; }
@keyframes flip { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0); } }

.slot { position: absolute; border-radius: 50%; border: 5px dashed rgba(255, 255, 255, .35); box-sizing: border-box; }
.slot.next { border-color: #ffd54a; animation: breathe 1s ease-in-out infinite alternate; }
@keyframes breathe { to { transform: scale(1.12); } }

.num {
  position: absolute; width: 170px; height: 170px; border-radius: 50%;
  background: #2b3990; text-align: center; font-size: 92px; font-weight: bold; line-height: 150px;
}
.num .dots { position: absolute; left: 0; right: 0; bottom: 18px; font-size: 22px; line-height: 22px; color: #ffd54a; letter-spacing: 2px; }
.badge {
  position: absolute; right: -10px; top: -10px; width: 64px; height: 64px; border-radius: 50%;
  background: #ffd54a; color: #3a2000; font-size: 44px; font-weight: bold; line-height: 64px; text-align: center;
}

.cloud { position: absolute; transition: opacity .5s, transform .5s; }
.cloud svg { width: 100%; height: 100%; display: block; overflow: visible; }
.cloud.gone { opacity: 0; transform: translateY(-120px) scale(1.2); pointer-events: none; }

.lane { position: absolute; top: 0; height: 1080px; width: 400px; }
.faller, .rocket { position: absolute; left: 0; top: 0; will-change: transform; }
.rocket { transition: transform .25s ease-out; }
.rocket svg, .faller svg { width: 100%; height: 100%; display: block; overflow: visible; }
.rocket .flame { transform-origin: 50% 0; animation: flame .15s linear infinite alternate; }
@keyframes flame { to { transform: scaleY(.6); } }
.starbar { position: absolute; left: 0; right: 0; top: 140px; text-align: center; }
.starbar svg { width: 64px; height: 64px; margin: 0 6px; }

.confetti { position: absolute; width: 22px; height: 22px; border-radius: 4px; transition: transform 1.4s ease-out, opacity 1.4s ease-in; }

#start {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  background: rgba(5, 8, 24, .6);
  text-align: center; cursor: pointer;
}
#start .big { position: absolute; left: 0; right: 0; top: 260px; font-size: 120px; font-weight: bold; text-shadow: 0 4px 8px #000; }
#start .play {
  position: absolute; left: 860px; top: 520px; width: 200px; height: 200px; border-radius: 50%;
  background: #ffb300;
  animation: breathe 1.6s ease-in-out infinite alternate;
}
#start .play svg { width: 100%; height: 100%; }

#paddebug { position: absolute; left: 10px; bottom: 10px; font: 22px monospace; color: #8f8; background: rgba(0,0,0,.7); padding: 8px; white-space: pre; }

@media (prefers-reduced-motion: reduce) {
  .pl.bob .float, .twinkle, #shooting, .slot.next, #start .play { animation: none; }
}
