    .game-mode{
      position:fixed;
      inset:0;
      z-index:99999;
      background:#0a0a0a;
      color:#f2f2f2;
      display:none;
      overflow:hidden;
      opacity:0;
      transition:opacity .18s ease;
      touch-action:none;
    }

     .game-mode.show{
      display:block;
      opacity:1;
    }

    .game-ui{
      position:absolute;
      top:22px;
      left:22px;
      right:22px;
      display:flex;
      justify-content:space-between;
      font-size:12px;
      letter-spacing:2px;
      text-transform:uppercase;
      }

    .game-ground{
      position:absolute;
      left:0;
      right:0;
      bottom:28%;
      height:120px;
      border-bottom:1px solid rgba(255,255,255,.35);
    }

    #gameDancer{
      position:absolute;
      left:14%;
      bottom:0;
      width:58px;
      height:auto;
      /* dancer drop shadow */
      filter:
        drop-shadow(2px 0 0 #000)  drop-shadow(-2px 0 0 #000)
        drop-shadow(0 2px 0 #000)  drop-shadow(0 -2px 0 #000)
        drop-shadow(2px 2px 0 #000) drop-shadow(-2px 2px 0 #000)
        drop-shadow(2px -2px 0 #000) drop-shadow(-2px -2px 0 #000);
    }

    #gameDancer.jump{
      animation:jump .55s ease-out;
    }
   
#boss{
  display:none;
  position:absolute;
  right:8%;
  bottom:45%;
  width:180px;
  height:auto;
  z-index:5;
  animation:bossFloat 1.6s ease-in-out infinite alternate;
}

@keyframes bossFloat{
  from{ transform:translateY(-10px); }
  to{ transform:translateY(10px); }
}

#bossHealthWrap{
  display:none;
  width:180px;
  text-align:center;
}

#bossHealthText{
  font-size:10px;
  letter-spacing:2px;
  color:rgba(255,255,255,.6);
  margin-bottom:5px;
}

#bossHealthBar{
  height:6px;
  border:1px solid rgba(255,255,255,.35);
  background:rgba(255,255,255,.08);
}

#bossHealthFill{
  height:100%;
  width:100%;
  background:#fff;
  transition:width .15s ease;
}

.laser{
  position:absolute;
  width:34px;
  height:2px;
  background:#fff;
  z-index:20;
  transform-origin:left center;
  pointer-events:none;
}
    
    @keyframes jump{
      0%{ bottom:0; }
      45%{ bottom:95px; }
      100%{ bottom:0; }
    }
    
     #obstacle{
      position:absolute;
      left:0;
      bottom:0;
      width:28px;
      height:48px;
      border:1px solid rgba(255,255,255,.9);
      background:#f2f2f2;
      opacity:0;
      will-change:transform;
  }

    .game-help{
      position:absolute;
      bottom:18%;
      left:0;
      right:0;
      text-align:center;
      font-size:11px;
      letter-spacing:1.4px;
      color:#a0a0a0;
      text-transform:uppercase;
    }
    

    .game-mode.running #obstacle{
      animation-play-state:running;
      opacity:1;
    }

 @media (max-width: 700px){
  .game-ground{
    bottom:32%;
    height:90px;
  }

  #gameDancer{
    width:38px;
    left:10%;
  }

  #obstacle{
    width:18px;
    height:34px;
  }

  @keyframes jump{
    0%{ bottom:0; }
    45%{ bottom:75px; }
    100%{ bottom:0; }
  }

  .game-help{
    bottom:20%;
    font-size:10px;
  }

  .game-ui{
    display:block;
    position:absolute;
    top:22px;
    left:22px;
    right:22px;
  }

  .game-ui > div:first-child{
    position:absolute;
    left:0;
    top:0;
  }

  #gameScore{
    position:absolute;
    right:0;
    top:0;
  }

  #bossHealthWrap{
    position:fixed;
    left:50%;
    top:55px;
    transform:translateX(-50%);
    width:140px;
  }
}

.boss-win-screen{
  position:absolute;
  inset:0;
  display:none;
  place-items:center;
  background:#0a0a0a;
  z-index:12;
  text-align:center;
  text-transform:uppercase;
  letter-spacing:2px;
}

.boss-win-screen.show{
  display:grid;
}

.boss-win-title{
  font-size:clamp(24px, 6vw, 56px);
  font-weight:800;
  margin-bottom:32px;
}

.dance-party{
  display:flex;
  gap:22px;
  justify-content:center;
  align-items:flex-end;
  margin-bottom:32px;
}

.dance-party img{
  width:64px;
  image-rendering:pixelated;
  animation:danceFlip .45s steps(1) infinite alternate;
}

.dance-party img:nth-child(2){
  animation-delay:.15s;
}

.dance-party img:nth-child(3){
  animation-delay:.3s;
}

@keyframes danceFlip{
  0%{
    transform:scaleX(1);
  }
  49%{
    transform:scaleX(1);
  }
  50%{
    transform:scaleX(-1);
  }
  100%{
    transform:scaleX(-1);
  }
}

#continueRun{
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.08);
  color:#fff;
  padding:11px 18px;
  text-transform:uppercase;
  letter-spacing:1.4px;
  cursor:pointer;
}

#continueRun:hover{
  background:#fff;
  color:#000;
}
    
 .game-over-screen{
  position:absolute;
  inset:0;
  display:none;
  place-items:center;
  background:#0a0a0a;
  z-index:10;
}

.game-over-screen.show{
  display:grid;
}

.game-corner-logo{
  position:absolute;
  top:22px;
  left:22px;
  z-index:11;
  font-size:12px;
  letter-spacing:2px;
  text-transform:uppercase;
  color:#f2f2f2;
  cursor:pointer;
}

.game-corner-logo:hover{
  opacity:.7;
}

.game-over-card{
  width:min(90vw, 520px);
  text-align:center;
  text-transform:uppercase;
  letter-spacing:2px;
}

.game-over-title{
  font-size:clamp(22px, 5vw, 42px);
  font-weight:800;
  margin-bottom:8px;
}

.final-score{
  font-size:11px;
  color:rgba(255,255,255,.45);
  margin-bottom:22px;
}

.leaderboard{
  margin:20px auto 28px;
  width:min(320px, 90%);
  font-size:14px;
  line-height:2;
  letter-spacing:2px;
  color:rgba(255,255,255,.72);
  text-transform:uppercase;
  text-align:left;
}

.leaderboard div:first-child{
  text-align:center;
  font-size:10px;
  letter-spacing:4px;
  color:rgba(255,255,255,.35);
  margin-bottom:14px;
}

.leaderboard div:not(:first-child){
  display:flex;
  justify-content:space-between;
  border-bottom:1px solid rgba(255,255,255,.08);
  padding:3px 0;
}

.leaderboard div:nth-child(2){
  color:#fff;
}

.score-entry{
  display:flex;
  gap:8px;
  justify-content:center;
  margin-bottom:12px;
}

#playerName{
  width:150px;
  background:transparent;
  border:1px solid rgba(255,255,255,.3);
  color:#fff;
  padding:11px 12px;
  text-align:center;
  text-transform:uppercase;
  letter-spacing:2px;
  font-size:16px;
}

.game-over-card button{
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.08);
  color:#fff;
  padding:11px 16px;
  text-transform:uppercase;
  letter-spacing:1.4px;
  cursor:pointer;
}

.game-over-card button:hover{
  background:#fff;
  color:#000;
}

#playAgain{
  margin-top:6px;
}
    
.character-select{
  position:absolute;
  inset:0;
  display:none;
  place-items:center;
  background:#0a0a0a;
  z-index:40;
  text-align:center;
  text-transform:uppercase;
  letter-spacing:2px;
}

.character-select.show{
  display:grid;
}

.select-title{
  font-size:14px;
  color:rgba(255,255,255,.65);
  margin-bottom:24px;
}

.select-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:28px;
  margin-bottom:26px;
}

#selectedCharacter{
  width:150px;
  image-rendering:pixelated;
  animation:selectFloat 2.4s ease-in-out infinite alternate;
}

@keyframes selectFloat{
  from{ transform:translateY(0); }
  to{ transform:translateY(-8px); }
}

.select-arrow,
#startSelectedRunner{
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.08);
  color:#fff;
  cursor:pointer;
  text-transform:uppercase;
  letter-spacing:1.4px;

  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.select-arrow{
  width:38px;
  height:38px;

  border:none;
  background:transparent;

  font-size:24px;
}

.select-arrow:hover{
  opacity:.7;
  transform:scale(1.1);
}

#startSelectedRunner{
  padding:11px 18px;
}

.level-select{
  position:fixed;
  inset:0;
  display:none;
  background:#0a0a0a;
  z-index:99998;
  text-align:center;
}

.level-select.show{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}

.level-row{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:14px;
  margin-top:18px;
}

.level-card{
  width:160px;
  height:90px;

  border:none;
  background:transparent;

  padding:1px;
  cursor:pointer;
  color:#fff;

  position:relative;
  overflow:visible;
}

.level-card:hover{
  transform:translateY(-4px);
  border-color:rgba(255,255,255,.6);
}

.level-card img{
  width:160px;
  height:90px;
  object-fit:cover;
  display:block;

  border:1px solid rgba(255,255,255,.6);
}

.level-card span{
  display:block;
  margin-top:8px;
  font-size:10px;
  letter-spacing:2px;
  color:rgba(255,255,255,.6);
}

/* mobile: stack worlds vertically, let each card grow to fit its label */
@media (max-width: 700px){
  .level-row{
    flex-direction:column;
  }

  .level-card{
    height:auto;
  }
}

/* ── WORLD SCENE LAYER ─────────────────────────────────────────
   sits behind all gameplay, ignores input, themes can never interfere w gameplay
   */
#sceneCanvas{
  position:absolute;
  inset:0;
  z-index:0;
  display:block;
  background:#000;
  pointer-events:none;
  image-rendering:pixelated;
}

/* ── World themes ──────────────────────────────────────────────
.game-mode.theme-easy,
.game-mode.theme-medium,
.game-mode.theme-hard   { background:#000; }

/* vanity outline of obstacles to prevent clash with theme */
.game-mode #obstacle    { background:#fff; border-color:#fff; box-shadow:0 0 0 3px #000; }