:root {
  --game-bg: linear-gradient(180deg, #29b6f6 0%, #81d4fa 38%, #e1f5fe 68%, #c8e6c9 100%);
}

.top-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px 16px;
  box-sizing: border-box;
  gap: 12px;
  z-index: 30;
}

.top-controls .instruction-banner {
  flex: 1;
  margin: 0;
}

.switch-hero-btn {
  background: linear-gradient(135deg, #ab47bc 0%, #7b1fa2 100%);
  color: #ffffff;
  border: 2px solid #ce93d8;
  font-size: 15px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(123, 31, 162, 0.35);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  outline: none;
}

.switch-hero-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 18px rgba(123, 31, 162, 0.45);
}

.switch-hero-btn:active {
  transform: scale(0.95);
}

.switch-hero-btn:focus-visible {
  outline: 3px solid #ffb300;
  outline-offset: 2px;
}

.tramp-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

.tramp-field:focus-visible {
  outline: 4px solid #ffb300;
  outline-offset: -4px;
}

/* Sky Landmarks */
.sky-scenery {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.sky-landmark {
  position: absolute;
  width: 100%;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.stars-landmark {
  top: 35px;
  font-size: 34px;
  color: #ffd54f;
  animation: stars-twinkle 2s infinite alternate ease-in-out;
}

@keyframes stars-twinkle {
  0% { opacity: 0.6; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.05); }
}

.rainbow-landmark {
  top: 105px;
  font-size: 82px;
  line-height: 1;
  filter: drop-shadow(0 6px 16px rgba(255, 255, 255, 0.6));
  animation: rainbow-pulse 3s infinite alternate ease-in-out;
}

@keyframes rainbow-pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.05); opacity: 1; }
}

.clouds-landmark {
  top: 190px;
  display: flex;
  justify-content: space-around;
  padding: 0 20px;
}

.cloud {
  font-size: 44px;
  line-height: 1;
  opacity: 0.85;
  filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.6));
  animation: cloud-float 18s linear infinite;
}

.c2 { animation-duration: 24s; font-size: 52px; }
.c3 { animation-duration: 20s; }

@keyframes cloud-float {
  0% { transform: translateX(-30px); }
  50% { transform: translateX(30px); }
  100% { transform: translateX(-30px); }
}

/* Altitude Milestone Badge */
.altitude-badge {
  position: absolute;
  top: 18px;
  background: rgba(255, 255, 255, 0.95);
  color: #e65100;
  border: 2px solid #ffb74d;
  font-size: 16px;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: 20px;
  box-shadow: 0 6px 16px rgba(230, 81, 0, 0.25);
  z-index: 25;
  pointer-events: none;
}

.badge-pop-anim {
  animation: badge-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badge-pop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Sky Zone & Bouncer Hero */
.sky-zone {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 96px;
  pointer-events: none;
  z-index: 10;
}

.bouncer-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: pointer;
  pointer-events: auto;
  transform: translateY(0);
}

.bouncer-inner {
  display: inline-block;
  font-size: min(32vw, 130px);
  line-height: 1;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.2));
  transform-origin: center center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.bouncer-inner.squish {
  transform: scaleX(1.35) scaleY(0.68) translateY(12px);
}

.bouncer-inner.launch {
  transform: scaleX(0.88) scaleY(1.18);
}

/* Stardust & Sparks */
.jump-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 8;
}

.jump-spark {
  position: absolute;
  font-size: 26px;
  line-height: 1;
  pointer-events: none;
  animation: spark-burst 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes spark-burst {
  0% { transform: translate(0, 0) scale(0.3); opacity: 1; }
  100% { transform: translate(var(--tx, 0), var(--ty, -50px)) scale(1.2) rotate(var(--rot, 30deg)); opacity: 0; }
}

/* 3D Trampoline */
.tramp-btn {
  position: relative;
  width: min(88vw, 400px);
  height: 96px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 15;
  outline: none;
}

.tramp-btn:focus-visible {
  outline: 4px solid #ffb300;
  border-radius: 20px;
}

.tramp-mat {
  position: relative;
  width: 90%;
  height: 24px;
  background: radial-gradient(ellipse at 50% 30%, #29b6f6 0%, #0288d1 65%, #01579b 100%);
  border-radius: 12px;
  border: 3px solid #e1f5fe;
  box-shadow: inset 0 4px 6px rgba(255, 255, 255, 0.5), inset 0 -4px 6px rgba(0, 0, 0, 0.3), 0 6px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease;
  z-index: 5;
}

.tramp-mat-press {
  transform: scaleY(0.3) scaleX(0.96) translateY(20px);
}

.tramp-mat-recoil {
  transform: scaleY(1.3) scaleX(1.02) translateY(-6px);
}

.tramp-springs {
  position: absolute;
  top: 10px;
  width: 92%;
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  box-sizing: border-box;
  z-index: 3;
}

.spring {
  width: 4px;
  height: 12px;
  background: repeating-linear-gradient(180deg, #90a4ae 0%, #cfd8dc 50%, #90a4ae 100%);
  border-radius: 2px;
}

.tramp-frame {
  position: relative;
  width: 100%;
  height: 52px;
  border: 7px solid #37474f;
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  margin-top: -14px;
  z-index: 2;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.15);
}

.tramp-leg {
  position: absolute;
  bottom: -18px;
  width: 12px;
  height: 22px;
  background: #37474f;
  border-radius: 4px 4px 0 0;
}

.leg-left { left: 16px; transform: rotate(-8deg); }
.leg-center { left: calc(50% - 6px); }
.leg-right { right: 16px; transform: rotate(8deg); }

@media (max-height: 600px) {
  .stars-landmark { top: 12px; font-size: 26px; }
  .rainbow-landmark { top: 52px; font-size: 58px; }
  .clouds-landmark { top: 115px; }
  .cloud { font-size: 32px; }
  .c2 { font-size: 40px; }
  .bouncer-inner { font-size: min(26vw, 105px); }
  .tramp-btn { height: 75px; }
  .sky-zone { padding-bottom: 75px; }
  .switch-hero-btn { font-size: 13px; padding: 4px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .stars-landmark,
  .rainbow-landmark,
  .cloud,
  .bouncer-hero,
  .bouncer-inner,
  .jump-spark,
  .tramp-mat {
    animation: none !important;
    transition: none !important;
  }
}
