.dots-game-page-wrapper {
    width: 100%;
    background: #151C2E;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 4rem 1rem;
    box-sizing: border-box;
    min-height: 850px;
    font-family: system-ui, sans-serif;
  }

  .dots-game-back-bar {
    width: 100%;
    max-width: 1024px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: flex-start;
  }

  .dots-game-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    transition: color 0.2s;
  }

  .dots-game-back-link:hover {
    color: #ffffff;
  }


  #topBar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    z-index: 10;
    width: 1024px;
    box-sizing: border-box;
    border-radius: 8px 8px 0 0;
    margin-top: 20px;
  }

  #controls {
    display: flex;
    gap: 10px;
    align-items: center;
  }

  #controls button {
    padding: 8px 18px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
  }

  #controls button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
  }

  #scoreBoard {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 36px;
    font-weight: bold;
    color: white;
    z-index: 10;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin: 0;
    padding: 0;
    line-height: 1;
  }

  #levelDisplay {
    position: absolute;
    top: 65px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    z-index: 10;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin: 0;
    padding: 0;
    line-height: 1;
  }

  #keyBox {
    display: flex;
    gap: 16px;
    align-items: center;
  }

  .keyRow {
    display: flex;
    align-items: center;
    font-size: 12px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
  }

  .keyDot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
  }

  #gameContainer {
    position: relative;
    width: 1024px;
    height: 768px;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  }



  #levelUpOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.5s ease-out;
  }

  #levelUpOverlay.show {
    display: flex;
  }

  #levelUpOverlay.visible {
    opacity: 1;
  }

  #levelUpOverlay.fadeOut {
    opacity: 0;
  }

  #levelUpText {
    font-size: 64px;
    font-weight: bold;
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0, 255, 150, 0.8);
  }

  #levelUpCountdown {
    font-size: 120px;
    font-weight: bold;
    font-family: monospace;
    color: #0BA31D;
    text-shadow: 0 4px 30px rgba(11, 163, 29, 0.8);
  }

  #gameOverOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 20;
    animation: fadeIn 0.5s ease-in;
  }

  #gameOverOverlay.show {
    display: flex;
  }

  #gameOverText {
    font-size: 72px;
    font-weight: bold;
    color: #E5007E;
    margin-bottom: 30px;
    text-shadow: 0 4px 30px rgba(229, 0, 126, 0.8);
  }

  #finalScore {
    font-size: 96px;
    font-weight: bold;
    font-family: monospace;
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(255, 255, 255, 0.5);
  }

  #finalLevel {
    font-size: 32px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
  }

  #playAgainBtn {
    padding: 15px 40px;
    font-size: 24px;
    background: rgba(11, 163, 29, 0.3);
    border: 2px solid #0BA31D;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
  }

  #playAgainBtn:hover {
    background: rgba(11, 163, 29, 0.5);
    transform: scale(1.05);
  }

  #nameInput {
    padding: 10px 20px;
    font-size: 20px;
    border: 2px solid #1388EF;
    background: rgba(19, 136, 239, 0.1);
    color: white;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 10px;
    width: 300px;
  }

  #nameInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
  }

  #saveScoreBtn {
    padding: 12px 40px;
    font-size: 20px;
    background: rgba(19, 136, 239, 0.3);
    border: 2px solid #1388EF;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    margin-bottom: 10px;
  }

  #saveScoreBtn:hover {
    background: rgba(19, 136, 239, 0.5);
    transform: scale(1.05);
  }

  #leaderboardBtn {
    padding: 10px 30px;
    font-size: 18px;
    background: rgba(19, 136, 239, 0.3);
    border: 2px solid #1388EF;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 10px;
  }

  #leaderboardBtn:hover {
    background: rgba(19, 136, 239, 0.5);
  }

  #leaderboardOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 25;
  }

  #leaderboardOverlay.show {
    display: flex;
  }

  #leaderboardContent {
    background: rgba(21, 28, 46, 0.95);
    padding: 40px;
    border-radius: 12px;
    border: 2px solid #1388EF;
    max-width: 500px;
    width: 90%;
  }

  #leaderboardTitle {
    font-size: 36px;
    font-weight: bold;
    color: #1388EF;
    text-align: center;
    margin-bottom: 30px;
  }

  .leaderboardEntry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 14px;
  }

  .leaderboardEntry.highlight {
    background: rgba(19, 136, 239, 0.3);
    border: 1px solid #1388EF;
  }

  .entryRank {
    color: #1388EF;
    font-weight: bold;
    min-width: 30px;
  }

  .entryName {
    flex: 1;
    text-align: left;
    margin: 0 10px;
    color: white;
  }

  .entryLevel {
    color: #670BC2;
    font-size: 12px;
    min-width: 50px;
    text-align: center;
  }

  .entryScore {
    color: #0BA31D;
    font-weight: bold;
    min-width: 70px;
    text-align: right;
  }

  #closeLeaderboard {
    margin-top: 30px;
    padding: 12px 40px;
    font-size: 18px;
    background: rgba(19, 136, 239, 0.3);
    border: 2px solid #1388EF;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
  }

  #closeLeaderboard:hover {
    background: rgba(19, 136, 239, 0.5);
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  canvas {
    display: block;
    width: 1024px;
    height: 768px;
    position: relative;
    z-index: 5;
  }

  /* Instructions Overlay */
  #instructionsOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 29, 0.94);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 30;
    animation: fadeIn 0.3s ease-in;
  }

  #instructionsOverlay.show {
    display: flex;
  }

  #instructionsContent {
    background: rgba(21, 28, 46, 0.98);
    padding: 36px 40px;
    border-radius: 12px;
    border: 2px solid #1388EF;
    max-width: 580px;
    width: 90%;
    text-align: center;
    color: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  }

  #instructionsTitle {
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin-bottom: 22px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .instructions-body {
    font-size: 16px;
    line-height: 1.6;
    color: #e2e8f0;
    text-align: left;
    margin-bottom: 28px;
  }

  .instructions-body p {
    margin: 0 0 14px 0;
  }

  .instructions-body .instruction-penalty {
    color: #ff70b8;
  }

  .instructions-body .instruction-start {
    font-weight: 700;
    color: white;
    margin-top: 18px;
  }

  .instructions-body .instruction-luck {
    font-weight: 800;
    color: #0BA31D;
    font-size: 18px;
    margin-bottom: 0;
  }

  #instructionsStartBtn {
    padding: 12px 42px;
    font-size: 16px;
    font-weight: 700;
    background: #0BA31D;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(11, 163, 29, 0.4);
  }

  #instructionsStartBtn:hover {
    background: #0dbe22;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11, 163, 29, 0.6);
  }