
  html, body {
    margin: 0;
    padding: 0;
    background: #08060d;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #stage {
    position: relative;
  }
  canvas {
    /* A canvas is inline by default, so its line box adds a ~4px descender gap and
       #stage ends up 4px TALLER than the canvas. Anything anchored to the bottom of
       the stage (the search band) would then hang below the game frame. Block-level
       makes #stage exactly the canvas box. */
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background: #0d0a14;
    box-shadow: 0 0 0 2px #000;
  }
  #textc {
    position: absolute;
    top: 0;
    left: 0;
    image-rendering: auto;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
  }
  body {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  /* ---- multiplayer lobby -------------------------------------------------- */
  #lobby {
    position: fixed; inset: 0; z-index: 10;
    background: rgba(8,6,13,0.95);
    display: flex; align-items: center; justify-content: center;
    font-family: "Courier New", monospace; text-align: center;
  }
  #lobby[hidden] { display: none; }
  #lobby-title { font-size: 26px; font-weight: bold; color: #ffb14a; margin-bottom: 18px; }
  #lobby-code { font-size: 46px; font-weight: bold; letter-spacing: 14px; color: #ffd24a; }
  #lobby-code-label { font-size: 13px; color: #8b83b8; margin-bottom: 6px; }
  #lobby-status { font-size: 14px; color: #7fe0c3; margin: 12px 0 20px; min-height: 18px; }
  #lobby-status2 { font-size: 14px; color: #ff5a5a; min-height: 20px; margin: 8px 0; }
  #lobby-count { font-size: 16px; font-weight: bold; color: #ffd24a; margin: 4px 0 10px; }
  .lobby-btn {
    display: block; margin: 10px auto; min-width: 230px; min-height: 50px;
    font: bold 16px "Courier New", monospace; color: #fff; cursor: pointer;
    background: #2a2740; border: 2px solid #ffb14a; border-radius: 8px;
  }
  .lobby-btn:active { background: #3a2f5c; }
  #lobby-input {
    font: bold 22px "Courier New", monospace; text-align: center; letter-spacing: 8px;
    text-transform: uppercase; width: 210px; min-height: 50px;
    background: #0d0a14; color: #ffd24a; border: 2px solid #3a2f5c; border-radius: 8px;
    -webkit-user-select: text; user-select: text; touch-action: auto;
  }
  /* ---- mobile touch controls --------------------------------------------- */
  #touch { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
  #joy {
    position: absolute; left: 22px; bottom: 22px; width: 124px; height: 124px;
    border-radius: 62px; background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.28); pointer-events: auto; display: none;
  }
  #joy-thumb {
    position: absolute; left: 50%; top: 50%; width: 50px; height: 50px;
    margin: -25px 0 0 -25px; border-radius: 25px;
    background: rgba(255,177,74,0.55); border: 2px solid rgba(255,255,255,0.7);
  }
  #btn-dash {
    position: absolute; right: 22px; bottom: 42px; width: 88px; height: 88px;
    border-radius: 44px; background: rgba(255,112,67,0.55);
    border: 2px solid rgba(255,255,255,0.7); color: #fff;
    font: bold 14px "Courier New", monospace; pointer-events: auto; display: none;
  }
  #btn-pause {
    position: absolute; right: 12px; top: 12px; width: 48px; height: 48px;
    border-radius: 24px; background: rgba(0,0,0,0.55);
    border: 2px solid rgba(255,255,255,0.45); color: #fff;
    font: bold 16px "Courier New", monospace; pointer-events: auto; display: none;
  }
  #btn-bomb {
    position: absolute; right: 34px; bottom: 144px; width: 64px; height: 64px;
    border-radius: 32px; background: rgba(155,93,229,0.55);
    border: 2px solid rgba(255,255,255,0.7); color: #fff;
    font: bold 12px "Courier New", monospace; pointer-events: auto; display: none;
    opacity: 0.4;
  }
  @media (pointer: coarse) {
    #joy, #btn-dash, #btn-pause, #btn-bomb { display: block; }
  }
  /* ---- leaderboard name capture ------------------------------------------ */
  #lbname {
    position: fixed; inset: 0; z-index: 20;
    background: rgba(8,6,13,0.94);
    display: flex; align-items: center; justify-content: center;
    font-family: "Courier New", monospace; text-align: center;
  }
  #lbname[hidden] { display: none; }
  /* max-width + wrapping: the welcome prompt's sub-line is a full sentence, and without
     a bound it would run off the side of a phone instead of wrapping under the title. */
  #lbname-panel { padding: 0 16px; max-width: 360px; box-sizing: border-box; }
  #lbname-title { font-size: 24px; font-weight: bold; color: #ffd24a; margin-bottom: 8px; }
  #lbname-best { font-size: 15px; color: #7fe0c3; margin-bottom: 16px; line-height: 1.4; }
  #lbname-input {
    font: bold 22px "Courier New", monospace; text-align: center; letter-spacing: 6px;
    text-transform: uppercase; width: 230px; min-height: 50px;
    background: #0d0a14; color: #ffd24a; border: 2px solid #3a2f5c; border-radius: 8px;
    -webkit-user-select: text; user-select: text; touch-action: auto;
  }
  #lbname-hint { font-size: 13px; color: #8b83b8; margin: 14px 0 4px; }
  #lbname-status { font-size: 13px; color: #ff5a5a; min-height: 18px; margin-top: 8px; }
  /* ---- players-online search band ---------------------------------------- */
  /* Anchored INSIDE #stage, so the band lines up with the canvas box whatever
     integer scale fitCanvas() picked. Every dimension is a multiple of --s (the
     scale), which JS sets from fitCanvas(), so the band is always exactly
     ONLINE_BAR logical pixels tall and the list can reserve room for it. */
  #psearch {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: calc(30px * var(--s, 1));
    box-sizing: border-box; display: flex; align-items: center;
    gap: calc(6px * var(--s, 1));
    padding: calc(3px * var(--s, 1)) calc(10px * var(--s, 1));
    background: rgba(8,6,13,0.97);
    border-top: 1px solid #3a2f5c;
    font-family: "Courier New", monospace;
  }
  #psearch[hidden] { display: none; }
  #psearch-input {
    flex: 1; min-width: 0; box-sizing: border-box;
    font: bold calc(11px * var(--s, 1)) "Courier New", monospace;
    padding: calc(2px * var(--s, 1)) calc(5px * var(--s, 1));
    letter-spacing: 1px; text-transform: uppercase;
    background: #0d0a14; color: #7fe0c3; border: 1px solid #3a2f5c; outline: none;
    -webkit-user-select: text; user-select: text; touch-action: auto;
  }
  #psearch-input::placeholder { color: #6b6390; letter-spacing: 0; }
  #btn-psearch-clear {
    display: inline-block;
    font: bold calc(11px * var(--s, 1)) "Courier New", monospace;
    padding: calc(2px * var(--s, 1)) calc(7px * var(--s, 1));
    background: #2a2740; color: #ffb14a; border: 1px solid #ffb14a;
    cursor: pointer; touch-action: auto;
  }
  #btn-psearch-clear[hidden] { display: none; }
  /* ---- moved notice ------------------------------------------------------- */
  /* The game moved to https://emberdust.online. The custom domain is an ALIAS of this
     same Tekt site, so Tekt serves BOTH hostnames the identical bundle -- the old host
     cannot be handed different files. It is turned away in script instead, and this is
     what it shows: a plain white page, opaque and above everything else on the page. */
  #moved {
    position: fixed; inset: 0; z-index: 100;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: "Courier New", monospace; text-align: center;
  }
  #moved[hidden] { display: none; }
  #moved-line { font-size: 20px; color: #111; letter-spacing: 1px; }
  #moved-link {
    display: inline-block; margin-top: 14px;
    font-size: 24px; font-weight: bold; color: #0645ad;
  }
