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

:root {
  color-scheme: dark;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  --app-bg-top: #353953;
  --app-bg-mid: #4f6384;
  --app-bg-bottom: #7dc1d1;
  --panel-fill: rgba(157, 175, 211, 0.2);
  --panel-stroke: rgba(232, 241, 255, 0.2);
  --panel-glow: rgba(214, 246, 255, 0.25);
  --text-main: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.8);
  --beam-fill: rgba(255, 255, 255, 0.14);
  --lane-fill: rgba(255, 255, 255, 0.06);
  --shadow-soft: 0 18px 36px rgba(30, 38, 70, 0.18);
}

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

body {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(180deg, var(--app-bg-top) 0%, var(--app-bg-mid) 54%, var(--app-bg-bottom) 100%);
  color: var(--text-main);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.game-app {
  width: 100vw;
  height: 100dvh;
  margin: 0;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

#game-stage:fullscreen .game-app,
#game-stage:-webkit-full-screen .game-app {
  width: 100vw;
  height: 100dvh;
}

.scene-control,
.overlay__button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(180deg, rgba(201, 216, 244, 0.18), rgba(122, 138, 170, 0.14));
  color: #fff;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: 28px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 10px 28px rgba(35, 44, 80, 0.12);
}

.scene {
  position: relative;
  width: min(100%, 560px);
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 38px;
  background:
    linear-gradient(180deg, rgba(50, 57, 83, 0.96) 0%, rgba(78, 97, 129, 0.94) 56%, rgba(127, 191, 206, 0.94) 100%);
  border: 1px solid rgba(232, 241, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -28px 80px rgba(255, 255, 255, 0.08),
    0 20px 40px rgba(29, 41, 73, 0.12);
}

.scene__ambience,
.scene__frame,
.scene__camera,
.scene__world,
.tower-layer,
.active-layer,
.falling-layer {
  position: absolute;
  inset: 0;
}

.scene__ambience {
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.scene__night-cycle,
.scene__rainbow,
.scene__meteor-shower,
.scene__constellations,
.scene__aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene__frame {
  border-radius: inherit;
  pointer-events: none;
  z-index: 4;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.scene__parallax--far::before,
.scene__parallax--far::after,
.scene__night-cycle,
.scene__aurora-band,
.scene__rainbow,
.scene__constellation,
.scene__orb,
.scene__beam {
  animation: none !important;
}

.scene__constellations,
.scene__orb {
  display: none;
}

.scene__parallax {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene__parallax--far::before,
.scene__parallax--far::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  opacity: 0.9;
  animation: sky-twinkle 9s ease-in-out infinite alternate;
}

.scene__parallax--far::before {
  background-image:
    radial-gradient(circle at 14% 24%, rgba(255, 255, 255, 0.96) 0 1.4px, transparent 1.6px),
    radial-gradient(circle at 36% 16%, rgba(255, 255, 255, 0.9) 0 1.2px, transparent 1.4px),
    radial-gradient(circle at 54% 28%, rgba(255, 255, 255, 0.94) 0 1.3px, transparent 1.5px),
    radial-gradient(circle at 73% 20%, rgba(255, 255, 255, 0.82) 0 1.1px, transparent 1.3px),
    radial-gradient(circle at 86% 12%, rgba(255, 255, 255, 0.92) 0 1.5px, transparent 1.7px),
    radial-gradient(circle at 78% 42%, rgba(255, 255, 255, 0.96) 0 2.1px, transparent 2.3px);
}

.scene__parallax--far::after {
  opacity: 0.28;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.2), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 50%);
  animation-duration: 12s;
}

.scene__night-cycle {
  z-index: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.2), transparent 34%),
    radial-gradient(circle at 50% 22%, rgba(95, 130, 201, 0.18), transparent 50%),
    linear-gradient(180deg, rgba(6, 10, 28, 0.1), rgba(6, 14, 38, 0.34));
  mix-blend-mode: multiply;
  animation: sky-breathing 22s ease-in-out infinite;
}

.scene__aurora {
  z-index: 1;
  opacity: 0.8;
  filter: blur(12px);
}

.scene__aurora--front {
  opacity: 0.58;
  filter: blur(8px);
}

.scene__aurora-band {
  position: absolute;
  top: -8%;
  width: 44%;
  height: 54%;
  border-radius: 50%;
  opacity: 0.52;
  transform-origin: 50% 0;
  mix-blend-mode: screen;
  animation: aurora-drift 18s ease-in-out infinite;
}

.scene__aurora-band--mint {
  left: -2%;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(220, 255, 255, 0.85), rgba(120, 255, 222, 0.3) 42%, transparent 72%);
}

.scene__aurora-band--violet {
  right: 4%;
  width: 52%;
  background:
    radial-gradient(ellipse at 40% 18%, rgba(244, 216, 255, 0.7), rgba(138, 141, 255, 0.24) 38%, transparent 70%);
  animation-delay: -7s;
}

.scene__aurora-band--cyan {
  left: 18%;
  width: 54%;
  height: 48%;
  background:
    radial-gradient(ellipse at 48% 14%, rgba(194, 248, 255, 0.74), rgba(88, 214, 255, 0.2) 40%, transparent 74%);
  animation-duration: 14s;
  animation-delay: -4s;
}

.scene__aurora-band--gold {
  right: 12%;
  top: 2%;
  width: 36%;
  height: 34%;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(255, 241, 170, 0.56), rgba(255, 162, 92, 0.14) 38%, transparent 76%);
  animation-duration: 16s;
  animation-delay: -10s;
}

.scene__rainbow {
  z-index: 1;
  top: -12%;
  left: 50%;
  width: 126%;
  height: 58%;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at 50% 100%,
      transparent 0 47%,
      rgba(255, 93, 93, 0.16) 48% 50%,
      rgba(255, 179, 78, 0.16) 50.4% 52.4%,
      rgba(255, 236, 126, 0.14) 52.8% 54.8%,
      rgba(118, 255, 149, 0.12) 55.2% 57.2%,
      rgba(101, 210, 255, 0.12) 57.6% 59.6%,
      rgba(143, 149, 255, 0.11) 60% 61.8%,
      rgba(228, 141, 255, 0.11) 62.2% 64.2%,
      transparent 65% 100%);
  opacity: 0.62;
  filter: blur(3px);
  mix-blend-mode: screen;
  animation: rainbow-pulse 18s ease-in-out infinite;
}

.scene__constellations {
  z-index: 2;
  overflow: visible;
}

.scene__constellations--far {
  opacity: 0.58;
}

.scene__constellation {
  fill: none;
  stroke: rgba(218, 240, 255, 0.28);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 9px rgba(198, 230, 255, 0.18));
  animation: constellation-glimmer 20s ease-in-out infinite;
  animation-delay: var(--constellation-delay, 0s);
  will-change: transform, opacity;
}

.scene__constellation circle {
  fill: rgba(248, 251, 255, 0.72);
  stroke: rgba(248, 251, 255, 0.24);
  stroke-width: 0.9;
}

.scene__meteor-shower {
  z-index: 3;
}

.scene__meteor {
  position: absolute;
  top: -10%;
  width: 2px;
  height: 112px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.96) 30%, rgba(117, 214, 255, 0.18) 72%, rgba(117, 214, 255, 0));
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.42);
  opacity: 0;
  transform: rotate(24deg);
  animation: meteor-fall 8.5s linear infinite;
}

.scene__meteor::after {
  content: "";
  position: absolute;
  inset: auto -32px 8px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(190, 237, 255, 0.9), rgba(255, 255, 255, 0));
  filter: blur(1px);
}

.scene__meteor--1 {
  left: 12%;
  animation-delay: -1.2s;
}

.scene__meteor--2 {
  left: 28%;
  animation-duration: 10s;
  animation-delay: -5.6s;
}

.scene__meteor--3 {
  left: 54%;
  animation-duration: 7.6s;
  animation-delay: -3.8s;
}

.scene__meteor--4 {
  left: 74%;
  animation-duration: 9.2s;
  animation-delay: -6.4s;
}

.scene__meteor--5 {
  left: 88%;
  animation-duration: 11.4s;
  animation-delay: -8.8s;
}

.scene__ridge,
.scene__city {
  display: none;
}

.scene__lane-glow {
  position: absolute;
  inset: auto 0 0;
  height: 44%;
  opacity: 0.28;
  filter: blur(18px);
}

.scene__lane-glow--left {
  left: -18%;
  width: 58%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.16), transparent 70%);
}

.scene__lane-glow--right {
  right: -14%;
  width: 54%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 70%);
}

.scene__orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(48px);
  opacity: 0.16;
  animation: orb-bob 14s ease-in-out infinite;
}

.scene__orb--green {
  top: 18%;
  left: 10%;
  width: 160px;
  height: 160px;
  background: rgba(218, 249, 255, 0.55);
}

.scene__orb--orange {
  top: 26%;
  right: 11%;
  width: 220px;
  height: 140px;
  background: rgba(255, 235, 207, 0.48);
  animation-delay: -6s;
}

.scene__beam {
  position: absolute;
  left: 50%;
  top: 0;
  width: 54%;
  height: 100%;
  transform: translateX(-50%);
  clip-path: polygon(36% 0, 64% 0, 89% 100%, 11% 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.05));
  opacity: 0.72;
  animation: beam-glow 18s ease-in-out infinite;
}

.scene__camera {
  overflow: hidden;
  z-index: 2;
}

.scene__hud {
  position: absolute;
  inset: 0 0 auto;
  z-index: 7;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  pointer-events: none;
}

.scene__score,
.scene-control {
  pointer-events: auto;
}

.scene__score {
  min-width: 88px;
  min-height: 60px;
  padding: 14px 18px;
  border-radius: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(174, 193, 228, 0.32), rgba(118, 136, 170, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 14px 28px rgba(34, 42, 76, 0.18);
  backdrop-filter: blur(16px);
}

.scene__score-value {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: 0 6px 18px rgba(255, 255, 255, 0.18);
}

.scene__brand {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 5;
  margin: 0;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(0.78rem, 2vw, 0.96rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow:
    0 1px 0 rgba(60, 30, 102, 0.28),
    0 0 12px rgba(255, 79, 216, 0.12),
    0 0 16px rgba(105, 214, 255, 0.1);
  opacity: 0.86;
}

.scene__controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  min-width: 0;
  gap: 10px;
}

.scene-control {
  display: inline-grid;
  place-items: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.96);
  background: linear-gradient(180deg, rgba(174, 193, 228, 0.3), rgba(118, 136, 170, 0.18));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 12px 26px rgba(35, 44, 80, 0.18);
  backdrop-filter: blur(16px);
}

.scene-control[aria-pressed="false"] {
  color: rgba(255, 255, 255, 0.4);
  background: linear-gradient(180deg, rgba(95, 107, 136, 0.18), rgba(70, 81, 110, 0.14));
}

.scene-control__icon {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.scene-control__stroke-icon {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

#fullscreen-button .scene-control__fullscreen-exit {
  display: none;
}

#fullscreen-button[data-fullscreen-active="true"] .scene-control__fullscreen-enter {
  display: none;
}

#fullscreen-button[data-fullscreen-active="true"] .scene-control__fullscreen-exit {
  display: block;
}

#game-stage:fullscreen .tower-shell-stage__actions,
#game-stage:-webkit-full-screen .tower-shell-stage__actions {
  display: none;
}

.scene__world {
  transform-origin: 50% 100%;
  will-change: transform;
}

.scene__lane {
  position: absolute;
  left: 50%;
  bottom: 34px;
  width: min(54%, 300px);
  height: 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 10px 30px rgba(118, 189, 207, 0.18);
}

.tower-layer,
.active-layer,
.falling-layer {
  pointer-events: none;
}

.block {
  position: absolute;
  left: 0;
  bottom: 64px;
  width: var(--block-total-width);
  height: var(--block-total-height);
  transform: translate3d(var(--block-x), calc(var(--block-y) * -1), 0);
  transform-origin: 50% 100%;
  filter: drop-shadow(0 12px 18px rgba(54, 65, 102, 0.16));
  will-change: transform;
}

.block--flat {
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--block-core) 72%, white 28%), var(--block-edge) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 8px 14px rgba(44, 57, 92, 0.14);
  filter: none;
}

.block--flat.block--active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 10px rgba(255, 255, 255, 0.1),
    0 10px 16px rgba(44, 57, 92, 0.16);
}

.block--flat.block--base {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 18px rgba(44, 57, 92, 0.16);
}

.block--flat.is-falling {
  filter: none;
  opacity: 0.9;
}

.block__top,
.block__front,
.block__side {
  position: absolute;
  display: block;
}

.block__top {
  inset: 0;
  clip-path: var(--block-top-path);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--block-core) 72%, white 28%), color-mix(in srgb, var(--block-core) 92%, white 8%));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

.block__front {
  left: 0;
  bottom: 0;
  width: calc(var(--block-front-width) + var(--block-depth-width));
  height: var(--block-total-height);
  clip-path: var(--block-front-path);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 24%),
    linear-gradient(180deg, color-mix(in srgb, var(--block-edge) 82%, white 18%) 0%, var(--block-edge) 70%, color-mix(in srgb, var(--block-edge) 80%, black 20%) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -8px 16px rgba(0, 0, 0, 0.08);
}

.block__front-glow {
  position: absolute;
  inset: 0;
  clip-path: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 34%, rgba(255, 255, 255, 0.14) 66%, transparent 82%);
  opacity: 0.6;
}

.block__trim {
  position: absolute;
  left: 14%;
  right: 12%;
  top: 10px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  opacity: 0.55;
}

.block__side {
  top: 0;
  bottom: 0;
}

.block__side--left {
  inset: 0;
  clip-path: var(--block-side-left-path);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 22%),
    linear-gradient(180deg, color-mix(in srgb, var(--block-core) 56%, black 44%), color-mix(in srgb, var(--block-edge) 52%, black 48%));
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.08),
    inset -1px 0 0 rgba(0, 0, 0, 0.08);
}

.block__side--right {
  inset: 0;
  clip-path: var(--block-side-right-path);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 20%),
    linear-gradient(180deg, color-mix(in srgb, var(--block-core) 62%, black 38%), color-mix(in srgb, var(--block-edge) 60%, black 40%));
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.1),
    inset -1px 0 0 rgba(0, 0, 0, 0.12);
}

.block--base {
  filter: drop-shadow(0 14px 22px rgba(44, 57, 92, 0.2));
}

.block--active {
  filter:
    drop-shadow(0 0 16px rgba(255, 255, 255, 0.18))
    drop-shadow(0 14px 24px rgba(44, 57, 92, 0.22));
}

.block--active .block__top {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--block-core) 62%, white 38%), color-mix(in srgb, var(--block-core) 90%, white 10%));
}

.block.is-perfect .block__top {
  animation: block-shimmer 420ms ease-out;
}

.block.is-snap {
  animation: block-snap 260ms ease-out;
}

.block.is-falling {
  opacity: 0.85;
  filter: drop-shadow(0 18px 24px rgba(42, 52, 86, 0.2));
}

.block--mobile-resting {
  filter: none;
}

.block--mobile-resting .block__top,
.block--mobile-resting .block__side {
  display: none;
}

.block--mobile-resting .block__front-glow,
.block--mobile-resting .block__trim {
  display: none;
}

.block--mobile-resting .block__front {
  left: calc(var(--block-depth-width) * 0.5);
  bottom: 0;
  width: var(--block-front-width);
  height: var(--block-height);
  clip-path: none;
  border-radius: 5px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--block-edge) 78%, white 22%) 0%, color-mix(in srgb, var(--block-edge) 74%, black 26%) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.perfect-banner {
  position: absolute;
  left: 50%;
  top: 102px;
  z-index: 6;
  transform: translateX(-50%);
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 12px 26px rgba(41, 51, 84, 0.18);
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #fff8da;
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
}

.perfect-banner.is-visible {
  animation: perfect-banner-pop 520ms ease-out;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 28px;
  background: linear-gradient(180deg, rgba(39, 47, 72, 0.16), rgba(39, 47, 72, 0.26));
  backdrop-filter: blur(6px);
  transition: opacity 180ms ease;
}

.overlay--hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay__panel {
  position: relative;
  width: min(100%, 440px);
  padding: 34px 30px;
  border-radius: 30px;
  text-align: center;
  background: linear-gradient(180deg, rgba(146, 165, 199, 0.22), rgba(118, 136, 170, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 24px 48px rgba(40, 50, 84, 0.16);
}

.overlay__panel--loading {
  width: min(100%, 380px);
}

.overlay__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(201, 216, 244, 0.16), rgba(122, 138, 170, 0.12));
  color: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 24px rgba(35, 44, 80, 0.14);
  backdrop-filter: blur(12px);
}

.overlay__close span {
  transform: translateY(-1px);
}

.overlay__spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.84);
  animation: overlay-spin 900ms linear infinite;
}

.overlay__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 16px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff8da;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  box-shadow: 0 14px 30px rgba(40, 50, 84, 0.14);
}

.overlay__eyebrow {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.7);
}

.overlay__title {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 0.94;
}

.overlay__copy,
.overlay__hint {
  margin: 0 auto;
  max-width: 28ch;
  color: rgba(255, 255, 255, 0.82);
}

.overlay__copy {
  font-size: 1rem;
  line-height: 1.55;
}

.overlay__hint {
  margin-top: 16px;
  font-size: 0.92rem;
}

.overlay__actions {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin-top: 24px;
}

.overlay__button {
  min-width: 172px;
  min-height: 60px;
  padding: 0 28px;
  font-size: 1rem;
}

.overlay__button--secondary {
  min-width: 172px;
  min-height: 52px;
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  background: linear-gradient(180deg, rgba(174, 193, 228, 0.14), rgba(118, 136, 170, 0.1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 18px rgba(35, 44, 80, 0.1);
}

@keyframes block-snap {
  0% {
    transform: translate3d(var(--block-x), calc(var(--block-y) * -1), 0) scale(1);
  }
  26% {
    transform: translate3d(var(--block-x), calc(var(--block-y) * -1 + 3px), 0) scale(1.02, 0.96);
  }
  60% {
    transform: translate3d(var(--block-x), calc(var(--block-y) * -1 - 2px), 0) scale(0.99, 1.02);
  }
  100% {
    transform: translate3d(var(--block-x), calc(var(--block-y) * -1), 0) scale(1);
  }
}

@keyframes overlay-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes sky-twinkle {
  0% {
    opacity: 0.46;
    transform: scale(1);
  }
  50% {
    opacity: 0.88;
    transform: scale(1.01);
  }
  100% {
    opacity: 0.58;
    transform: scale(1);
  }
}

@keyframes sky-breathing {
  0%,
  100% {
    opacity: 0.28;
    filter: brightness(0.96);
  }
  30% {
    opacity: 0.42;
    filter: brightness(0.84);
  }
  64% {
    opacity: 0.14;
    filter: brightness(1.08);
  }
}

@keyframes aurora-drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-4deg) scale(1);
    opacity: 0.42;
  }
  35% {
    transform: translate3d(14px, 12px, 0) rotate(2deg) scale(1.08);
    opacity: 0.58;
  }
  68% {
    transform: translate3d(-16px, 26px, 0) rotate(-8deg) scale(0.96);
    opacity: 0.34;
  }
}

@keyframes rainbow-pulse {
  0%,
  100% {
    opacity: 0.46;
    transform: translateX(-50%) scale(0.98);
  }
  50% {
    opacity: 0.72;
    transform: translateX(-50%) scale(1.02);
  }
}

@keyframes constellation-glimmer {
  0%,
  100% {
    opacity: 0.38;
    filter: drop-shadow(0 0 8px rgba(198, 230, 255, 0.24));
  }
  45% {
    opacity: 0.82;
    filter: drop-shadow(0 0 18px rgba(216, 243, 255, 0.42));
  }
  70% {
    opacity: 0.52;
    filter: drop-shadow(0 0 12px rgba(198, 230, 255, 0.3));
  }
}

@keyframes meteor-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -12%, 0) rotate(24deg) scaleY(0.8);
  }
  8% {
    opacity: 0.88;
  }
  26% {
    opacity: 0.64;
    transform: translate3d(92px, 240px, 0) rotate(24deg) scaleY(1.04);
  }
  32%,
  100% {
    opacity: 0;
    transform: translate3d(154px, 420px, 0) rotate(24deg) scaleY(1);
  }
}

@keyframes orb-bob {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -12px, 0) scale(1.04);
  }
}

@keyframes beam-glow {
  0%,
  100% {
    opacity: 0.56;
  }
  42% {
    opacity: 0.84;
  }
  76% {
    opacity: 0.48;
  }
}

@keyframes block-shimmer {
  0% {
    filter: brightness(1);
  }
  36% {
    filter: brightness(1.16);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes perfect-banner-pop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.94);
  }
  18% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  82% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px) scale(0.98);
  }
}

@media (max-width: 720px) {
  .game-app {
    width: 100%;
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .scene__hud {
    padding: 14px;
    gap: 12px;
  }

  .scene__score {
    min-width: 72px;
    min-height: 52px;
    padding: 12px 14px;
    border-radius: 20px;
    backdrop-filter: none;
  }

  .scene__score-value {
    font-size: 1.55rem;
  }

  .scene__brand {
    left: 14px;
    bottom: 14px;
    font-size: 0.78rem;
  }

  .scene__controls {
    gap: 6px;
  }

  .scene-control {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    flex: 0 0 auto;
    backdrop-filter: none;
  }

  .scene-control__icon {
    width: 20px;
    height: 20px;
  }

  .scene {
    width: 100%;
    border-radius: 30px;
  }

  .scene__lane {
    bottom: 24px;
    width: min(60%, 260px);
  }

  .scene__rainbow {
    top: -2%;
    width: 158%;
    height: 44%;
    opacity: 0.54;
  }

  .scene__aurora-band {
    width: 68%;
    height: 42%;
  }

  .scene__constellation {
    filter: none;
  }

  .scene__aurora {
    filter: blur(8px);
    opacity: 0.68;
  }

  .scene__aurora--front {
    filter: blur(6px);
  }

  .block {
    filter: drop-shadow(0 8px 12px rgba(54, 65, 102, 0.12));
  }

  .block--flat,
  .block--flat.block--active,
  .block--flat.block--base,
  .block--flat.is-falling {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      0 6px 10px rgba(44, 57, 92, 0.12);
  }

  .block--base {
    filter: drop-shadow(0 10px 16px rgba(44, 57, 92, 0.16));
  }

  .block--active {
    filter:
      drop-shadow(0 0 10px rgba(255, 255, 255, 0.12))
      drop-shadow(0 10px 16px rgba(44, 57, 92, 0.16));
  }

  .block.is-falling {
    filter: drop-shadow(0 12px 18px rgba(42, 52, 86, 0.14));
  }

  .perfect-banner {
    top: 78px;
    backdrop-filter: none;
  }

  #start-fullscreen-button {
    display: none;
  }
}

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

body[data-game-key="tower"] {
  overflow-x: hidden;
  overflow-y: auto;
}

body[data-game-key="tower"] .game-template-app {
  padding: 0;
}

body[data-game-key="tower"] .tower-stage .game-app {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
}

body[data-game-key="tower"] .tower-shell-canvas {
  touch-action: manipulation;
}

body[data-game-key="tower"] .tower-shell-stage__actions {
  display: none;
}

body[data-game-key="tower"] .tower-panel {
  width: 100%;
  margin: 0;
}

body[data-game-key="tower"] .tower-stage__frame {
  width: min(100%, 430px);
}

body[data-game-key="tower"] .tower-hero {
  grid-template-columns: 1fr;
}

body[data-game-key="tower"] .tower-stage .scene {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
}

#game-stage:fullscreen,
#game-stage:-webkit-full-screen {
  width: 100vw !important;
  height: 100dvh !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#game-stage:fullscreen .tower-shell-canvas,
#game-stage:-webkit-full-screen .tower-shell-canvas,
#game-stage:fullscreen .scene,
#game-stage:-webkit-full-screen .scene {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#game-stage:fullscreen .scene__frame,
#game-stage:-webkit-full-screen .scene__frame {
  display: none;
}

.tower-shell-canvas:fullscreen,
.tower-shell-canvas:-webkit-full-screen {
  width: 100vw !important;
  height: 100dvh !important;
  aspect-ratio: auto !important;
  max-width: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.tower-shell-canvas:fullscreen::before,
.tower-shell-canvas:-webkit-full-screen::before {
  display: none !important;
}

.tower-shell-canvas:fullscreen .game-app,
.tower-shell-canvas:-webkit-full-screen .game-app,
.tower-shell-canvas:fullscreen .scene,
.tower-shell-canvas:-webkit-full-screen .scene {
  width: 100% !important;
  height: 100% !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.tower-shell-canvas:fullscreen .scene__frame,
.tower-shell-canvas:-webkit-full-screen .scene__frame {
  display: none !important;
}

@media (min-width: 760px) {
  body[data-game-key="tower"] .tower-stage {
    min-height: 0;
  }

  body[data-game-key="tower"] .tower-hero {
    align-self: stretch;
  }

  body[data-game-key="tower"] .tower-support {
    align-self: stretch;
  }
}

@media (max-width: 759px) {
  body[data-game-key="tower"] {
    overflow: hidden;
  }

  body[data-game-key="tower"] .tower-panel {
    min-height: 100dvh;
    padding: 0;
    gap: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-game-key="tower"] .xiiy-shell__nav,
  body[data-game-key="tower"] .tower-hero,
  body[data-game-key="tower"] .tower-support,
  body[data-game-key="tower"] .seo-copy {
    display: none;
  }

  body[data-game-key="tower"] .tower-stage {
    min-height: 100dvh;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }

  body[data-game-key="tower"] .tower-stage .game-app {
    width: 100vw;
    height: 100dvh;
    padding: 0;
  }

  body[data-game-key="tower"] .tower-shell-stage__actions {
    display: none;
  }

  body[data-game-key="tower"] .tower-stage__frame {
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-game-key="tower"] .tower-shell-canvas {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-game-key="tower"] .tower-stage .scene {
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body[data-game-key="tower"] .tower-stage .scene__frame {
    display: none;
  }
}
