    :root {
      --bg: #36a6b3;
      --coral: #ff7f50;
      --gold: #ffd700;
      --panel-bg: rgba(255, 255, 255, 0.1);
      --text-primary: #fff;
      --text-secondary: #ddd;
      --input-border: #806f2e;
      --game-scale: 1;
      --footer-bg: rgba(0, 0, 0, 0.2);
    }

    .custom-option.locked {
      filter: grayscale(100%);
      opacity: 0.7;
    }


    @keyframes spectrum {
      0% {
        filter: hue-rotate(0deg);
      }

      100% {
        filter: hue-rotate(360deg);
      }
    }

    .spectrum-anim {
      animation: spectrum 2s linear infinite;
    }


    /* Hide scrollbar for Chrome, Safari and Opera */
    *::-webkit-scrollbar {
      display: none;
    }

    /* Hide scrollbar for IE, Edge and Firefox */
    * {
      -ms-overflow-style: none;
      /* IE and Edge */
      scrollbar-width: none;
      /* Firefox */
    }

    #mf-global-tooltip {
      z-index: 1000000 !important;
      /* Ensures it is always above every modal and panel */
    }

    html,
    body {
      height: 100%;
      margin: 0
    }

    body {
      font-family: 'Montserrat', Arial, Helvetica, sans-serif;
      background: var(--bg);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      padding: 18px;
      box-sizing: border-box;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }

    #startScreen {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      width: 100%;
      max-width: min(90vw, 700px);
      margin-top: 20px;
    }

    #optionsPanel {
      display: none;
      position: relative;
      flex-direction: column;
      align-items: center;
      gap: calc(12px * var(--game-scale));
      margin-top: calc(20px * var(--game-scale));
      background: rgba(255, 255, 255, 0.1);
      padding: calc(40px * var(--game-scale));
      border-radius: calc(15px * var(--game-scale));
    }

    #optionsPanel label {
      font-family: montserrat;
      font-weight: 600;
      color: #fff;
      display: flex;
      align-items: center;
      gap: calc(10px * var(--game-scale));
      font-size: calc(14px * var(--game-scale));
    }

    #optionsPanel input[type="range"] {
      width: calc(150px * var(--game-scale));
      cursor: pointer;
    }

    #optionsTitle {
      font-size: calc(24px * var(--game-scale));
      font-weight: bold;
      font-family: montserrat;
      text-shadow: 3px 3px 6px rgba(0, 0, 0, .25);
      color: White;
    }

    /* Difficulty buttons */
    #difficultyRow {
      display: flex;
      gap: calc(10px * var(--game-scale));
      margin-top: calc(8px * var(--game-scale));
      flex-wrap: wrap;
      justify-content: center;
    }

    .diffBtn {
      appearance: none;
      border: none;
      background: #806f2e;
      padding: calc(8px * var(--game-scale)) calc(14px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      box-shadow: 0 calc(4px * var(--game-scale)) #614e03;
      font-size: calc(14px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      color: white;
    }

    .diffBtn:active {
      transform: translateY(4px);
      box-shadow: none;
    }

    .diffBtn.active {
      background: #ffd000;
      box-shadow: 0 4px #b89a20;
      color: #333;
    }

    /* Challenge Buttons */
    #challengeBox {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: calc(10px * var(--game-scale));
      margin: calc(10px * var(--game-scale)) 0;
      padding: calc(10px * var(--game-scale));
      border: 2px solid rgba(255, 255, 255, 0.3);
      border-radius: 10px;
    }

    .challengeBtn {
      font-family: montserrat;
      font-size: calc(12px * var(--game-scale));
      padding: calc(6px * var(--game-scale));
      border-radius: calc(5px * var(--game-scale));
      border: none;
      background: #806f2e;
      color: white;
      cursor: pointer;
      box-shadow: 0 3px #614e03;
    }

    .challengeBtn.active {
      background: #ff7f50;
      box-shadow: 0 3px #c45a35;
    }

    #multiplierTag {
      font-family: montserrat;
      font-weight: 800;
      color: var(--gold);
      font-size: calc(18px * var(--game-scale));
      margin-bottom: calc(5px * var(--game-scale));
    }

    #titleBig {
      font-size: calc(64px * var(--game-scale));
      font-family: montserrat;
      color: var(--coral);
      font-weight: 800;
      text-shadow: 3px 3px 6px rgba(0, 0, 0, .25);
      text-align: center;
      /* -webkit-animation: glow 1s ease-in-out infinite alternate;
      -moz-animation: glow 1s ease-in-out infinite alternate;
      animation: glow 1s ease-in-out infinite alternate;
      }
      @-webkit-keyframes glow {
        from {
          text-shadow: 0 0 10px #eeeeee, 0 0 20px #000000, 0 0 30px #000000, 0 0 40px #000000, 
                       0 0 50px #9554b3, 0 0 60px #ff9900, 0 0 70px #ff9900;
        }
        to {
          text-shadow: 0 0 20px #eeeeee, 0 0 30px #ff9900, 0 0 40px #ff9900, 0 0 50px #ff9900,
                       0 0 60px #ff9900, 0 0 70px #ff9900, 0 0 80px #ff9900;
        }*/
    }

    #authorText {
      font-size: calc(8px * var(--game-scale));
      font-family: montserrat;
      position: relative;
      color: blue;
      font-weight: 800;
      text-shadow: 3px 3px 6px rgba(0, 0, 0, .25);
      margin-top: -1px;
    }

    #editorText {
      font-size: calc(8px * var(--game-scale));
      font-family: montserrat;
      position: relative;
      color: #39ff14;
      font-weight: 800;
      text-shadow: 3px 3px 6px rgba(0, 0, 0, .25);
      margin-top: -7px;
    }

    #gameVersion {
      font-size: calc(10px * var(--game-scale));
      font-family: montserrat;
      position: relative;
      color: black;
      font-weight: 800;
      margin-top: -17px;
      padding: 10px;
      z-index: 100;
      cursor: pointer;
    }

    #smalleditorText {
      font-size: calc(8px * var(--game-scale));
      font-family: montserrat;
      position: absolute;
      bottom: calc(-13px * var(--game-scale));
      color: #39ff14;
      font-weight: 800;
      text-shadow: 3px 3px 6px rgba(0, 0, 0, .25);
    }

    #smallauthorText {
      font-size: calc(8px * var(--game-scale));
      font-family: montserrat;
      position: absolute;
      color: blue;
      bottom: calc(-23px * var(--game-scale));
      font-weight: 800;
      text-shadow: 3px 3px 6px rgba(0, 0, 0, .25);
    }

    #preBestScore {
      color: var(--gold);
      font-family: montserrat;
      font-weight: 700;
      font-size: calc(20px * var(--game-scale));
      text-shadow: 2px 2px 4px rgba(0, 0, 0, .4);
    }

    #loggedInUserText {
      font-family: montserrat;
      font-size: calc(12px * var(--game-scale));
      color: #e0e0e0;
      text-shadow: 1px 1px 3px rgba(0, 0, 0, .5);
      margin-top: calc(-5px * var(--game-scale));
      margin-bottom: calc(5px * var(--game-scale));
      font-weight: 600;
      text-align: center;
    }

    #startBtn,
    #optionsBtn,
    #optionsBackBtn,
    #restartBtn,
    #backBtn {
      appearance: none;
      border: none;
      background: #ffdd57;
      padding: calc(10px * var(--game-scale)) calc(20px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      box-shadow: 0 calc(4px * var(--game-scale)) #c9a92b;
      font-size: calc(18px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      font-weight: bold;
    }

    #startBtn:active,
    #optionsBtn:active,
    #optionsBackBtn:active {
      transform: translateY(4px);
      box-shadow: none
    }

    #inGameUI {
      width: min(90vw, 68vh, 700px);
      display: none;
      box-sizing: border-box;
      margin-bottom: 8px;
    }

    .scoresRow {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      padding: 4px 6px;
    }

    #bestScore,
    #score,
    #multiDisplay {
      color: white;
      text-shadow: 2px 2px 4px rgba(0, 0, 0, .6);
      font-family: montserrat;
      font-weight: 700;
      font-size: calc(14px * var(--game-scale));
    }

    #bestScore {
      color: var(--gold)
    }

    #multiDisplay {
      color: #ff7f50;
    }

    #score {
      display: block
    }

    #newHighScore {
      font-size: calc(16px * var(--game-scale));
      font-family: montserrat;
      color: #FFD700;
      font-weight: 800;
      text-shadow: 2px 2px 4px rgba(0, 0, 0, .6);
      display: none;
    }

    #gameWrap {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      flex-shrink: 0;
    }

    canvas {
      width: min(90vw, 68vh, 700px);
      height: auto !important;
      border: 5px solid #000;
      background: #70c5ce;
      display: none;
      aspect-ratio: 500 / 550 !important;
    }

    #titleSmall {
      margin-top: calc(12px * var(--game-scale));
      font-size: calc(28px * var(--game-scale));
      font-family: montserrat;
      color: var(--coral);
      font-weight: 800;
      text-shadow: 2px 2px 4px rgba(0, 0, 0, .25);
      display: none;
    }

    /* Restart button inside canvas */
    #restartBtn {
      position: absolute;
      font-family: montserrat;
      left: 50%;
      bottom: calc(50px * var(--game-scale));
      right: auto;
      top: auto;
      transform: translateX(-50%);
      padding: calc(10px * var(--game-scale)) calc(24px * var(--game-scale));
      font-size: calc(18px * var(--game-scale));
      border: none;
      background-color: #ffdd57;
      box-shadow: 0 calc(5px * var(--game-scale)) #c9a92b;
      cursor: pointer;
      user-select: none;
      display: none;
      z-index: 10;
    }

    #restartBtn:active {
      transform: translateX(-50%) translateY(4px);
      box-shadow: none;
    }

    #backBtn {
      position: absolute;
      top: calc(10px * var(--game-scale));
      left: calc(10px * var(--game-scale));
      right: auto;
      bottom: auto;
      transform: none;
      background: #ffdd57;
      border: none;
      border-radius: calc(8px * var(--game-scale));
      padding: calc(8px * var(--game-scale)) calc(12px * var(--game-scale));
      font-size: calc(20px * var(--game-scale));
      cursor: pointer;
      box-shadow: 0 calc(4px * var(--game-scale)) #c9a92b;
      z-index: 200;
      display: none;
      transition: right 0.2s, left 0.2s;
    }

    #backBtn.paused {
      left: auto;
      right: calc(10px * var(--game-scale));
    }

    #backBtn:active {
      transform: translateY(2px);
      box-shadow: none;
    }

    #pauseBtn {
      position: absolute;
      top: calc(10px * var(--game-scale));
      left: calc(10px * var(--game-scale));
      right: auto;
      bottom: auto;
      transform: none;
      background: #ffdd57;
      border: none;
      border-radius: calc(8px * var(--game-scale));
      padding: calc(8px * var(--game-scale)) calc(12px * var(--game-scale));
      font-size: calc(20px * var(--game-scale));
      cursor: pointer;
      box-shadow: 0 calc(4px * var(--game-scale)) #c9a92b;
      z-index: 50;
      display: none;
    }

    #pauseBtn:active {
      transform: translateY(2px);
      box-shadow: none;
    }

    /* Modifiers Panel */
    #modifiersPanel {
      display: none;
      flex-direction: column;
      align-items: center;
      gap: calc(12px * var(--game-scale));
      margin-top: calc(20px * var(--game-scale));
      background: rgba(255, 255, 255, 0.1);
      padding: calc(20px * var(--game-scale));
      border-radius: calc(15px * var(--game-scale));
      max-width: min(90vw, 700px);
      width: 100%;
    }

    #modifiersTitle {
      font-size: calc(24px * var(--game-scale));
      font-weight: bold;
      font-family: montserrat;
      text-shadow: 3px 3px 6px rgba(0, 0, 0, .25);
      color: White;
    }

    #modifiersBackBtn {
      appearance: none;
      border: none;
      background: #ffdd57;
      padding: calc(10px * var(--game-scale)) calc(20px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      box-shadow: 0 calc(4px * var(--game-scale)) #c9a92b;
      font-size: calc(18px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      font-weight: bold;
      margin-top: calc(10px * var(--game-scale));
    }

    #modifiersBackBtn:active {
      transform: translateY(4px);
      box-shadow: none;
    }

    /* Custom Presets Panel */
    #customPresetsPanel {
      display: none;
      flex-direction: column;
      align-items: center;
      gap: calc(12px * var(--game-scale));
      margin-top: calc(20px * var(--game-scale));
      background: rgba(255, 255, 255, 0.1);
      padding: calc(50px * var(--game-scale));
      border-radius: calc(15px * var(--game-scale));
      max-width: min(90vw, 700px);
      width: 100%;
    }

    #customPresetsTitle {
      font-size: calc(24px * var(--game-scale));
      font-weight: bold;
      font-family: montserrat;
      text-shadow: 3px 3px 6px rgba(0, 0, 0, .25);
      color: White;
    }

    #presetsList {
      display: flex;
      flex-direction: column;
      gap: calc(8px * var(--game-scale));
      width: 100%;
      max-height: calc(300px * var(--game-scale));
      overflow-y: auto;
      padding: calc(10px * var(--game-scale));
      background: rgba(0, 0, 0, 0.2);
      border-radius: calc(8px * var(--game-scale));
    }

    .presetItem {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #806f2e;
      padding: calc(10px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      color: white;
      font-family: montserrat;
      font-size: calc(14px * var(--game-scale));
    }

    .presetItem:hover {
      background: #9a8540;
    }

    .presetName {
      font-weight: 600;
      flex: 1;
    }

    .presetDetails {
      font-size: calc(11px * var(--game-scale));
      color: #ddd;
      margin-left: calc(10px * var(--game-scale));
      flex: 2;
    }

    .presetButtons {
      display: flex;
      gap: 5px;
    }

    .presetLoadBtn,
    .presetDeleteBtn {
      padding: calc(5px * var(--game-scale)) calc(10px * var(--game-scale));
      border: none;
      border-radius: calc(5px * var(--game-scale));
      cursor: pointer;
      font-family: montserrat;
      font-size: calc(12px * var(--game-scale));
      font-weight: bold;
    }

    .presetLoadBtn {
      background: #4CAF50;
      color: white;
    }

    .presetLoadBtn:hover {
      background: #45a049;
    }

    .presetDeleteBtn {
      background: #f44336;
      color: white;
    }

    .presetDeleteBtn:hover {
      background: #da190b;
    }

    .presetItem.active {
      background: #ffd000;
      color: #333;
      border: 3px solid #b89a20;
    }

    .presetItem.active .presetName {
      color: #333;
    }

    .presetItem.active .presetDetails {
      color: #555;
    }

    #savePresetSection {
      display: flex;
      flex-direction: column;
      gap: calc(10px * var(--game-scale));
      width: 100%;
      padding: calc(15px * var(--game-scale));
      background: rgba(0, 0, 0, 0.2);
      border-radius: calc(8px * var(--game-scale));
      margin-top: calc(10px * var(--game-scale));
    }

    #savePresetSection h3 {
      color: white;
      font-family: montserrat;
      font-size: calc(16px * var(--game-scale));
      margin: 0;
    }

    #presetNameInput {
      padding: calc(8px * var(--game-scale));
      border-radius: calc(5px * var(--game-scale));
      border: 2px solid #806f2e;
      font-family: montserrat;
      font-size: calc(14px * var(--game-scale));
    }

    #savePresetBtn {
      appearance: none;
      border: none;
      background: #4CAF50;
      padding: calc(10px * var(--game-scale)) calc(20px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      box-shadow: 0 calc(4px * var(--game-scale)) #2d6b2f;
      font-size: calc(14px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      font-weight: bold;
      color: white;
    }

    #savePresetBtn:active {
      transform: translateY(4px);
      box-shadow: none;
    }

    #customPresetsBtn {
      appearance: none;
      border: none;
      background: #4CAF50;
      padding: calc(2px * var(--game-scale)) calc(3.5px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      box-shadow: 0 calc(4px * var(--game-scale)) #2d6b2f;
      font-size: calc(18px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      color: white;
      font-weight: bold;
      transition: background 0.3s, box-shadow 0.3s;
    }

    #customPresetsBtn.active {
      background: #9C27B0;
      box-shadow: 0 4px #6a1b9a;
    }

    #customPresetsBtn:active {
      transform: translateY(4px);
      box-shadow: none;
    }

    #presetsBackBtn {
      appearance: none;
      border: none;
      background: #ffdd57;
      padding: calc(10px * var(--game-scale)) calc(20px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      box-shadow: 0 calc(4px * var(--game-scale)) #c9a92b;
      font-size: calc(18px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      font-weight: bold;
    }

    #presetsBackBtn:active {
      transform: translateY(4px);
      box-shadow: none;
    }

    #presetError {
      color: #ff4444;
      font-family: montserrat;
      font-size: 12px;
      display: none;
    }

    #optionsPanel input[type="range"]:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    .diffBtn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    #statsBtn {
      appearance: none;
      border: none;
      background: #ffdd57;
      padding: calc(8px * var(--game-scale)) calc(10px * var(--game-scale));
      border-radius: 50%;
      box-shadow: 0 calc(4px * var(--game-scale)) #c9a92b;
      font-size: calc(18px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      color: white;
      font-weight: bold;
      width: calc(40px * var(--game-scale));
      height: calc(40px * var(--game-scale));
      display: flex;
      align-items: center;
      justify-content: center;
    }

    #statsBtn:active {
      transform: translateY(4px);
      box-shadow: none;
    }

    #statsPanel {
      display: none;
      flex-direction: column;
      align-items: center;
      gap: calc(15px * var(--game-scale));
      margin-top: calc(20px * var(--game-scale));
      background: rgba(255, 255, 255, 0.1);
      padding: calc(40px * var(--game-scale));
      border-radius: calc(15px * var(--game-scale));
      max-width: min(90vw, 700px);
      width: 100%;
    }

    #statsTitle {
      font-size: calc(28px * var(--game-scale));
      font-weight: bold;
      font-family: montserrat;
      text-shadow: 3px 3px 6px rgba(0, 0, 0, .25);
      color: White;
      margin-bottom: calc(10px * var(--game-scale));
    }

    .statItem {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
      padding: calc(12px * var(--game-scale)) calc(20px * var(--game-scale));
      background: rgba(0, 0, 0, 0.2);
      border-radius: calc(8px * var(--game-scale));
      font-family: montserrat;
    }

    .statLabel {
      font-size: calc(16px * var(--game-scale));
      font-weight: 600;
      color: #fff;
    }

    .statValue {
      font-size: calc(18px * var(--game-scale));
      font-weight: 800;
      color: var(--gold);
    }

    #statsBackBtn {
      appearance: none;
      border: none;
      background: #ffdd57;
      padding: calc(10px * var(--game-scale)) calc(20px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      box-shadow: 0 calc(4px * var(--game-scale)) #c9a92b;
      font-size: calc(18px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      font-weight: bold;
      margin-top: 1px;
    }

    #statsBackBtn:active {
      transform: translateY(4px);
      box-shadow: none;
    }

    #resetStatsBtn {
      appearance: none;
      border: none;
      background: #f44336;
      padding: calc(8px * var(--game-scale)) calc(16px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      box-shadow: 0 calc(4px * var(--game-scale)) #c62828;
      font-size: calc(14px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      font-weight: bold;
      color: white;
      margin-top: 5px;
    }

    #resetStatsBtn:active {
      transform: translateY(4px);
      box-shadow: none;
    }

    #leaderboardBtn {
      appearance: none;
      border: none;
      background: #ffdd57;
      padding: calc(8px * var(--game-scale)) calc(10px * var(--game-scale));
      border-radius: 50%;
      box-shadow: 0 calc(4px * var(--game-scale)) #c9a92b;
      font-size: calc(18px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      color: white;
      font-weight: bold;
      width: calc(40px * var(--game-scale));
      height: calc(40px * var(--game-scale));
      display: flex;
      align-items: center;
      justify-content: center;
    }

    #leaderboardBtn:active {
      transform: translateY(4px);
      box-shadow: none;
    }

    #leaderboardPanel {
      display: none;
      flex-direction: column;
      align-items: center;
      gap: calc(15px * var(--game-scale));
      margin-top: calc(20px * var(--game-scale));
      background: rgba(255, 255, 255, 0.1);
      padding: calc(30px * var(--game-scale));
      border-radius: calc(15px * var(--game-scale));
      max-width: 620px;
      width: 100%;
    }

    #leaderboardTitle {
      font-size: calc(28px * var(--game-scale));
      font-weight: bold;
      font-family: montserrat;
      text-shadow: 3px 3px 6px rgba(0, 0, 0, .25);
      color: White;
      margin-bottom: 5px;
    }

    .leaderboardControls {
      display: flex;
      gap: calc(10px * var(--game-scale));
      flex-wrap: wrap;
      justify-content: center;
      margin-bottom: 10px;
    }

    .leaderboardTab {
      appearance: none;
      border: none;
      background: transparent;
      padding: calc(12px * var(--game-scale)) calc(24px * var(--game-scale));
      border-radius: 0;
      box-shadow: none;
      font-size: calc(18px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      color: rgba(255, 255, 255, 0.6);
      font-weight: bold;
      border-bottom: 3px solid transparent;
      transition: all 0.3s;
    }

    .leaderboardTab:active {
      transform: none;
      box-shadow: none;
    }

    .leaderboardTab.active {
      background: transparent;
      box-shadow: none;
      color: #fff;
      border-bottom: 3px solid #ffdd57;
    }

    .filterTab {
      appearance: none;
      border: none;
      background: rgba(255, 255, 255, 0.15);
      padding: calc(8px * var(--game-scale)) calc(16px * var(--game-scale));
      border-radius: calc(20px * var(--game-scale));
      box-shadow: none;
      font-size: calc(14px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      color: rgba(255, 255, 255, 0.7);
      font-weight: bold;
      transition: all 0.3s;
    }

    .filterTab:active {
      transform: translateY(1px);
    }

    .filterTab.active {
      background: #c9a92b;
      color: white;
    }

    #leaderboardList {
      width: 100%;
      max-height: calc(400px * var(--game-scale));
      overflow-y: auto;
      padding: calc(10px * var(--game-scale));
      background: rgba(0, 0, 0, 0.2);
      border-radius: calc(8px * var(--game-scale));
    }

    .leaderboardEntry {
      display: flex;
      flex-direction: column;
      background: rgba(255, 255, 255, 0.1);
      padding: calc(12px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      margin-bottom: calc(8px * var(--game-scale));
      font-family: montserrat;
      color: white;
    }

    .leaderboardEntry.rank1 {
      background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.1));
      border: 2px solid #FFD700;
    }

    .leaderboardEntry.rank2 {
      background: linear-gradient(135deg, rgba(192, 192, 192, 0.3), rgba(192, 192, 192, 0.1));
      border: 2px solid #C0C0C0;
    }

    .leaderboardEntry.rank3 {
      background: linear-gradient(135deg, rgba(205, 127, 50, 0.3), rgba(205, 127, 50, 0.1));
      border: 2px solid #CD7F32;
    }

    .entryHeader {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 6px;
    }

    .entryRank {
      font-size: calc(18px * var(--game-scale));
      font-weight: 800;
      color: var(--gold);
      min-width: 30px;
    }

    .entryName {
      font-size: calc(16px * var(--game-scale));
      font-weight: 700;
      flex: 1;
      margin: 0 10px;
    }

    .entryScore {
      font-size: calc(20px * var(--game-scale));
      font-weight: 800;
      color: #66e16a;
    }

    .entryDetails {
      display: flex;
      justify-content: space-between;
      font-size: calc(12px * var(--game-scale));
      color: #ddd;
      margin-top: 4px;
    }

    .entryPreset {
      font-weight: 600;
    }

    .entryMods {
      color: var(--coral);
      font-weight: 600;
    }

    .entryMultiplier {
      color: var(--gold);
      font-weight: 700;
    }

    #playerNameInput {
      padding: 8px;
      border-radius: 5px;
      border: 2px solid #806f2e;
      font-family: montserrat;
      font-size: 14px;
    }

    #leaderboardBackBtn {
      appearance: none;
      border: none;
      background: #ffdd57;
      padding: calc(10px * var(--game-scale)) calc(20px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      box-shadow: 0 calc(4px * var(--game-scale)) #c9a92b;
      font-size: calc(18px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      font-weight: bold;
      margin-top: 1px;
    }

    #leaderboardBackBtn:active {
      transform: translateY(4px);
      box-shadow: none;
    }

    .alphaTag {
      background: #d28383;
      color: white;
      padding: calc(2px * var(--game-scale)) calc(8px * var(--game-scale));
      border-radius: calc(4px * var(--game-scale));
      font-size: calc(12px * var(--game-scale));
      font-weight: bold;
      margin-left: calc(8px * var(--game-scale));
    }

    .emptyLeaderboard {
      text-align: center;
      padding: calc(40px * var(--game-scale)) calc(20px * var(--game-scale));
      color: #ccc;
      font-family: montserrat;
      font-size: calc(16px * var(--game-scale));
    }

    .authButton {
      appearance: none;
      border: none;
      background: #4CAF50;
      padding: calc(12px * var(--game-scale)) calc(24px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      box-shadow: 0 calc(4px * var(--game-scale)) #2d6b2f;
      font-size: calc(16px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      font-weight: bold;
      color: white;
      width: 100%;
      transition: transform 0.1s;
    }

    .authButton:active {
      transform: translateY(4px);
      box-shadow: none;
    }

    .authButton:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    #disclaimerSignupBtn {
      width: auto;
      padding: calc(8px * var(--game-scale)) calc(16px * var(--game-scale));
      font-size: calc(14px * var(--game-scale));
    }

    #accountBtn {
      appearance: none;
      border: none;
      background: #ffdd57;
      padding: calc(8px * var(--game-scale)) calc(10px * var(--game-scale));
      border-radius: 50%;
      box-shadow: 0 calc(4px * var(--game-scale)) #c9a92b;
      font-size: calc(18px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      color: white;
      font-weight: bold;
      width: calc(40px * var(--game-scale));
      height: calc(40px * var(--game-scale));
      display: flex;
      align-items: center;
      justify-content: center;
    }

    #accountBtn:active {
      transform: translateY(4px);
      box-shadow: none;
    }

    .entryName {
      font-size: calc(16px * var(--game-scale));
      font-weight: 700;
      flex: 1;
      margin: 0 10px;
      cursor: pointer;
      transition: color 0.2s;
    }

    .entryName:hover {
      color: #4CAF50;
      text-decoration: none;
    }

    .statItemProfile {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 90%;
      max-width: calc(400px * var(--game-scale));
      padding: calc(12px * var(--game-scale)) calc(20px * var(--game-scale));
      background: rgba(255, 255, 255, 0.15);
      border-radius: calc(8px * var(--game-scale));
      font-family: montserrat;
    }

    .statLabelProfile {
      font-size: calc(14px * var(--game-scale));
      font-weight: 600;
      color: #fff;
    }

    .statValueProfile {
      font-size: calc(18px * var(--game-scale));
      font-weight: 800;
      color: var(--gold);
    }

    .passwordToggle {
      display: flex;
      align-items: center;
      gap: calc(8px * var(--game-scale));
      color: #ddd;
      font-family: montserrat;
      font-size: calc(12px * var(--game-scale));
      margin-top: calc(-10px * var(--game-scale));
      cursor: pointer;
    }

    .passwordToggle input[type="checkbox"] {
      cursor: pointer;
    }

    #signupBackBtn,
    #loginBackBtn,
    #accountBackBtn,
    #settingsBackBtn,
    #forgotPasswordBackBtn,
    #updateLogBackBtn {
      transition: transform 0.1s ease, box-shadow 0.1s ease;
      color: black;
    }

    #signupBackBtn:active,
    #loginBackBtn:active,
    #disclaimerSignupBtn:active,
    #forgotPasswordBackBtn:active,
    #updateLogBackBtn:active,
    #accountBackBtn:active,
    #settingsBackBtn:active,
    #deleteAccountBtn:active,
    #resetStatsBtn:active,
    #settingsBtn:active,
    #logoutBtn:active {
      transform: translateY(4px);
      box-shadow: none !important;
    }

    .adminBadge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, #6b6b6b, #4a4a4a);
      width: calc(22px * var(--game-scale));
      height: calc(22px * var(--game-scale));
      border-radius: 50%;
      margin-left: calc(6px * var(--game-scale));
      font-family: montserrat;
      font-weight: 800;
      font-size: calc(12px * var(--game-scale));
      color: white;
      border: 2px solid #888;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
      position: relative;
      vertical-align: middle;
    }

    .adminBadge::before {
      content: '⚙';
      position: absolute;
      font-size: calc(14px * var(--game-scale));
      opacity: 0.3;
    }

    .creatorName {
      color: #00d4ff !important;
      text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
      font-weight: 800;
    }

    @media (max-width:420px) {
      body {
        padding: 12px
      }

      #startScreen {
        margin-top: 8px
      }
    }

    #siteFooter {
      margin-top: 1px;
      margin-bottom: -15px;
      padding: calc(20px * var(--game-scale));
      text-align: center;
      font-family: montserrat;
      font-size: calc(12px * var(--game-scale));
      color: rgba(255, 255, 255, 0.6);
      width: 100%;
      max-width: min(90vw, 700px);
      display: none;
      /* Hidden by default */
      flex-direction: column;
      gap: 10px;
      align-items: center;
    }

    .footerLinks {
      display: flex;
      gap: calc(15px * var(--game-scale));
      justify-content: center;
      flex-wrap: wrap;
    }

    .footerLink {
      color: rgba(255, 255, 255, 0.6);
      text-decoration: none;
      transition: color 0.2s;
    }

    .footerLink:hover {
      color: white;
      text-decoration: underline;
    }

    .copyright {
      margin-top: 5px;
    }

    /* Container to hold gameWrap and side ads */
    #gameContainer {
      display: flex;
      justify-content: center;
      align-items: flex-start;
      gap: 20px;
      max-width: 1200px;
      margin: 0 auto;
    }

    /* Side banner ads for game screen */
    .side-ad {
      width: 300px;
      height: 250px;
      background: rgba(255, 255, 255, 0.1);
      border: 2px solid rgba(255, 255, 255, 0.3);
      border-radius: 8px;
      display: none;
      /* Hidden by default */
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    /* Show game ads only when game is active */
    .side-ad.game-active {
      display: flex;
    }

    /* Start screen ads container */
    #startScreenContainer {
      display: flex;
      justify-content: center;
      align-items: flex-start;
      gap: 20px;
      max-width: 1200px;
      margin: 0 auto;
      width: 100%;
    }



    /* Horizontal ad below game version */
    .horizontal-ad {
      width: 100%;
      max-width: 728px;
      height: 90px;
      background: rgba(255, 255, 255, 0.1);
      border: 2px solid rgba(255, 255, 255, 0.3);
      border-radius: 8px;
      display: none;
      /* Hidden by default */
      align-items: center;
      justify-content: center;
      margin-top: 10px;
    }

    /* Show start screen ads only when start screen is active */
    .horizontal-ad.start-active {
      display: flex;
    }

    /* Hide ads on smaller screens */
    @media (max-width: 1024px) {

      .side-ad {
        display: none !important;
      }
    }

    @media (max-width: 768px) {
      .horizontal-ad {
        height: 50px;
        max-width: 320px;
      }
    }

    /* CUSTOM DROPDOWN STYLES */
    .custom-select-container {
      position: relative;
      width: calc(220px * var(--game-scale));
      /* Adjust as needed */
      font-family: montserrat;
      user-select: none;
    }

    .custom-select-trigger {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: white;
      color: #333;
      padding: calc(8px * var(--game-scale)) calc(12px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      border: 2px solid #ccc;
      cursor: pointer;
      font-weight: 600;
      transition: all 0.2s;
    }

    .custom-select-trigger:hover {
      border-color: #888;
    }

    .custom-select-trigger:after {
      content: '▼';
      font-size: calc(10px * var(--game-scale));
      color: #555;
      margin-left: calc(8px * var(--game-scale));
    }

    .custom-options {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: white;
      border-radius: 8px;
      border: 2px solid #ccc;
      /* Match trigger border */
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
      margin-top: calc(6px * var(--game-scale));
      z-index: 100;
      display: none;
      max-height: calc(300px * var(--game-scale));
      overflow-y: auto;
    }

    .custom-options.open {
      display: block;
    }

    .custom-option {
      display: flex;
      align-items: center;
      justify-content: space-between;
      /* Icon on right */
      padding: calc(8px * var(--game-scale)) calc(12px * var(--game-scale));
      cursor: pointer;
      border-bottom: 1px solid #eee;
      color: #333;
      font-weight: 600;
      transition: background 0.2s;
    }

    .custom-option:last-child {
      border-bottom: none;
    }

    .custom-option:hover {
      background: #f0f0f0;
    }

    .custom-option.selected {
      background: #e0e0e0;
      color: #000;
    }

    .custom-option.locked {
      color: #999;
      background: #f9f9f9;
    }

    .custom-option.locked:hover {
      background: #f0f0f0;
    }

    .preview-icon {
      width: 30px;
      height: 30px;
      object-fit: contain;
      margin-left: 10px;
      display: block;
    }

    .custom-option.locked .preview-icon {
      filter: grayscale(100%) opacity(0.6);
    }

    .skin-preview-img {
      width: 40px;
      height: 30px;
      object-fit: contain;
      margin-right: 10px;
    }

    .killbrick-preview-img {
      width: 24px;
      height: 24px;
      object-fit: contain;
    }

    .origin-id-tag {
      font-size: 10px;
      color: rgba(255, 255, 255, 0.5);
      text-align: right;
    }

    .rank-tag {
      font-size: 12px;
      color: var(--gold);
      font-weight: bold;
      margin-right: 10px;
    }

    /* Color Picker */
    #skinColorPicker {
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
      width: 32px;
      height: 32px;
      padding: 0;
      border: none;
      background: none;
      vertical-align: middle;
      cursor: pointer;
      margin-left: 8px;
    }

    #skinColorPicker::-webkit-color-swatch-wrapper {
      padding: 0;
    }

    #skinColorPicker::-webkit-color-swatch {
      border: 3px solid #fff;
      border-radius: 50%;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
      box-sizing: border-box;
    }

    #skinColorPicker::-moz-color-swatch {
      border: 3px solid #fff;
      border-radius: 50%;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
      box-sizing: border-box;
    }

    .score-tag {
      font-size: 12px;
      color: #66e16a;
      font-weight: bold;
    }

    .killbrick-preview-box {
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      color: #ff4444;
      font-weight: bold;
    }

    #modifiersBtn {
      background: #ef5350;
      box-shadow: 0px calc(4px * var(--game-scale)) #802726;
      width: auto;
      padding: calc(10px * var(--game-scale)) calc(20px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      font-size: calc(18px * var(--game-scale));
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      font-weight: bold;
      color: white;
      margin-top: calc(10px * var(--game-scale));
      margin-bottom: calc(10px * var(--game-scale));
      display: block;
      margin-left: auto;
      margin-right: auto;
      transition: background 0.3s, box-shadow 0.3s;
    }

    #modifiersBtn:active {
      transform: translateY(calc(4px * var(--game-scale)));
      box-shadow: none !important;
    }

    /* Admin Buttons */
    .adminBtn {
      appearance: none;
      border: none;
      padding: 8px 8px;
      border-radius: 8px;
      font-size: 14px;
      font-family: montserrat;
      cursor: pointer;
      user-select: none;
      font-weight: bold;
      color: white;
      box-shadow: 0 4px rgba(0, 0, 0, 0.3);
    }

    .adminBtn:active {
      transform: translateY(4px);
      box-shadow: none !important;
    }

    #adminResetBtn {
      background: #f44336;
      box-shadow: 0 4px #c62828;
      margin-right: 10px;
    }

    #adminResetWeeklyBtn {
      background: #ff9800;
      box-shadow: 0 4px #e65100;
    }

    /* Modal Close Button */
    .closeModalBtn {
      background: rgba(255, 255, 255, 0.2);
      border: none;
      color: white;
      border-radius: 50%;
      cursor: pointer;
      font-weight: bold;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.2s;
    }

    .closeModalBtn:hover {
      background: rgba(255, 255, 255, 0.3);
    }

    .closeModalBtn:active {
      transform: scale(0.9);
    }

    /* User Search Trigger */
    .userSearchTriggerBtn {
      position: absolute;
      right: calc(-60px * var(--game-scale));
      top: calc(-5px * var(--game-scale));
      background: transparent;
      border: none;
      color: white;
      font-size: calc(42px * var(--game-scale));
      cursor: pointer;
      text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
      padding: 0;
      transition: transform 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .userSearchTriggerBtn:hover {
      transform: scale(1.1);
    }

    .userSearchTriggerBtn:active {
      transform: scale(0.9) !important;
      text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    }

    /* Mobile Responsiveness & Search Button */
    @media (max-width: 600px) {
      .userSearchTriggerBtn {
        position: absolute;
        top: 15px;
        right: 15px;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        color: white;
        cursor: pointer;
        transition: background 0.2s;
        z-index: 10;
      }

      .userSearchTriggerBtn:hover {
        background: rgba(255, 255, 255, 0.4);
      }

      .userSearchTriggerBtn:active {
        transform: scale(0.95);
      }
    }

    @media (max-width: 600px) {
      .userSearchTriggerBtn {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 14px;
      }

      #userSearchModal>div,
      #userProfileModal>div {
        width: 95% !important;
        max-width: 95% !important;
        padding: 20px !important;
        max-height: 90vh;
        overflow-y: auto;
      }

      #userSearchResults {
        max-height: 40vh !important;
      }

      #accountPanel>div {
        padding: 20px !important;
      }


      #titleBig {
        font-size: 42px;
      }

      .accountInfoBox {
        padding: 12px 15px !important;
      }
    }

    .accountInfoBox {
      width: 100%;
      padding: calc(20px * var(--game-scale));
      background: rgba(0, 0, 0, 0.2);
      border-radius: calc(8px * var(--game-scale));
    }

    .settingsPanelContainer {
      max-width: calc(500px * var(--game-scale));
      width: 100%;
      background: rgba(255, 255, 255, 0.1);
      padding: calc(40px * var(--game-scale));
      border-radius: calc(15px * var(--game-scale));
      display: flex;
      flex-direction: column;
      gap: calc(20px * var(--game-scale));
      align-items: center;
    }

    .modalPanelContainer {
      max-width: calc(500px * var(--game-scale));
      width: 90%;
      background: linear-gradient(135deg, #36a6b3, #2d8a94);
      padding: calc(40px * var(--game-scale));
      border-radius: calc(15px * var(--game-scale));
      position: relative;
      box-shadow: 0 calc(10px * var(--game-scale)) calc(40px * var(--game-scale)) rgba(0, 0, 0, 0.5);
    }

    .accountInfoTitle {
      color: white;
      font-family: montserrat;
      font-size: calc(18px * var(--game-scale));
      font-weight: bold;
      margin-bottom: calc(10px * var(--game-scale));
    }

    .authPanelContainer {
      max-width: calc(400px * var(--game-scale));
      width: 100%;
      background: rgba(255, 255, 255, 0.1);
      padding: calc(40px * var(--game-scale));
      border-radius: calc(15px * var(--game-scale));
      display: flex;
      flex-direction: column;
      gap: calc(20px * var(--game-scale));
      align-items: center;
    }

    .authTitle {
      font-size: calc(32px * var(--game-scale));
      font-weight: bold;
      font-family: montserrat;
      color: white;
      text-shadow: 3px 3px 6px rgba(0, 0, 0, .25);
    }

    .authInput {
      width: 100%;
      padding: calc(12px * var(--game-scale));
      border-radius: calc(8px * var(--game-scale));
      border: 2px solid #806f2e;
      font-family: montserrat;
      font-size: calc(14px * var(--game-scale));
    }

    .authFeedback {
      width: 100%;
      font-family: montserrat;
      font-size: calc(12px * var(--game-scale));
      margin-top: calc(-15px * var(--game-scale));
      margin-bottom: calc(-10px * var(--game-scale));
      min-height: calc(15px * var(--game-scale));
      text-align: left;
    }

    .authText {
      color: #ddd;
      font-family: montserrat;
      font-size: calc(14px * var(--game-scale));
    }

    .authLink {
      color: #4CAF50;
      font-family: montserrat;
      font-size: calc(12px * var(--game-scale));
      text-decoration: none;
      font-weight: bold;
    }

    @keyframes spectrum {
      0% {
        filter: hue-rotate(0deg);
      }

      100% {
        filter: hue-rotate(360deg);
      }
    }

    .spectrum-anim {
      animation: spectrum 2s linear infinite;
    }