  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { overscroll-behavior: none; }
  body {
    background: #008080;
    font-family: "Comic Sans MS", "Comic Sans", sans-serif;   /* (not cursive: phones have no Comic Sans and show a handwriting font) */
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 100vh; min-height: 100dvh; color: #000;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
             max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    overflow-x: hidden;
    touch-action: manipulation;          /* no double-tap zoom */
    -webkit-user-select: none; user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }
  .window { position: relative; background: #c0c0c0; border: 3px outset #fff; padding: 4px; box-shadow: 6px 6px 0 rgba(0,0,0,0.4); }
  /* settings dialog, Win95 style, covering the whole screen (on phones the game window alone is too short for it) */
  .settings-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center; padding: 12px; z-index: 5;
  }
  .settings-backdrop[hidden] { display: none; }
  .settings-backdrop.typing { align-items: flex-start; }   /* pasting a save code: stay above the phone's keyboard */
  .settings {
    width: min(300px, 100%); max-height: 100%; display: flex; flex-direction: column;
    background: #c0c0c0; border: 3px outset #fff; padding: 3px; box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
  }
  /* (scrolls on short screens) */
  .settings-body { padding: 12px 10px 10px; font-family: Tahoma, sans-serif; font-size: 14px; overflow-y: auto; touch-action: pan-y; }
  .settings-body[hidden], .settings .check[hidden], .settings .btn[hidden] { display: none; }
  .settings .slider { display: block; margin-bottom: 12px; }
  .settings .row { display: flex; justify-content: space-between; font-weight: bold; margin-bottom: 4px; }
  .settings input[type=range] { width: 100%; height: 28px; touch-action: pan-x; accent-color: #000080; }
  .settings .check { display: flex; align-items: center; gap: 8px; font-weight: bold; margin: 8px 0; min-height: 28px; }
  .settings .check input { width: 20px; height: 20px; accent-color: #000080; }
  .settings .hint { font-size: 12px; color: #333; margin: 4px 0 12px; }
  .settings .ok {
    display: block; margin: 0 auto; min-width: 90px; min-height: 30px;
    background: #c0c0c0; border: 2px outset #fff; font-family: Tahoma, sans-serif; font-weight: bold; cursor: pointer;
  }
  .settings .ok:active, .settings .btn:active, .titlebar button:active { border-style: inset; }
  /* save code + reset progress */
  .settings .btnrow { display: flex; gap: 8px; margin: 6px 0 12px; }
  .settings .btn {
    flex: 1; min-height: 30px; padding: 2px 6px;
    background: #c0c0c0; border: 2px outset #fff; font-family: Tahoma, sans-serif; font-size: 13px; font-weight: bold; cursor: pointer; color: #000;
  }
  .settings .btn.danger { color: #900; }
  .settings .btn.armed { background: #c62828; color: #fff; }   /* reset/load: tap again to confirm */
  .settings .sub { font-weight: bold; margin-top: 4px; }
  .settings .code {
    display: block; width: 100%; margin-top: 4px; resize: none; padding: 4px;
    font-family: Consolas, "Courier New", monospace; font-size: 11px; line-height: 1.3; word-break: break-all;
    border: 2px inset #fff; background: #fff; color: #000;
    -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
  }
  .settings .msg { min-height: 1.3em; font-size: 13px; font-weight: bold; color: #000080; margin: -4px 0 8px; text-align: center; }
  .settings .msg.bad { color: #b71c1c; }
  .titlebar {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: #fff; padding: 4px 8px; font-weight: bold;
    display: flex; justify-content: space-between; align-items: center;
    font-family: Tahoma, sans-serif; font-size: 14px;
  }
  .titlebar button {
    background: #c0c0c0; border: 2px outset #fff; width: 20px; height: 18px;
    font-family: Tahoma, sans-serif; font-weight: bold; cursor: pointer;
  }
  #pauseBtn { font-size: 8px; letter-spacing: -1px; }
  #pauseBtn:disabled { color: #808080; cursor: default; }
  #muteBtn { font-size: 12px; line-height: 1; }
  #muteBtn.muted { color: #900; text-decoration: line-through; text-decoration-thickness: 2px; }
  canvas { display: block; background: #87ceeb; cursor: default; touch-action: none; }
  canvas.playing { cursor: none; }
  .hud {
    background: #c0c0c0; padding: 6px 8px; display: flex; justify-content: space-between;
    font-family: Tahoma, sans-serif; font-size: 13px; font-weight: bold; border-top: 2px groove #fff;
    gap: 6px;
  }
  /* in the menus: no score or lives (they'd be left over from the last game), just the best score */
  .hud.idle > span:not(#hi) { visibility: hidden; }
  /* (v158) a LAST STAND going on: the hearts glow gold behind a shield (the shield is in the text) */
  #lives.shielded { filter: drop-shadow(0 0 2px #ffd54f) drop-shadow(0 0 4px #ffb300); }
  /* TOILET MEDS of this game, next to the score: capsules (med colour + white) and the multiplier */
  #medsHud { margin-left: 5px; white-space: nowrap; }
  #medsHud[hidden] { display: none; }
  #medsHud .cap {
    display: inline-block; width: 13px; height: 7px; margin-right: 1px; vertical-align: 1px;
    border: 1px solid #000; border-radius: 4px; transform: rotate(-28deg);
    background: linear-gradient(90deg, var(--c) 50%, #fafafa 50%);
  }
  #medsHud .up { color: #b71c1c; }
  #medsHud .down { color: #1b5e20; }
  /* (v173) this game's SPICE level: a drawn chili and the number */
  #medsHud .spice { margin-left: 4px; color: #bf360c; font-weight: bold; white-space: nowrap; }
  #medsHud .spice svg { width: 0.75em; height: 1em; vertical-align: -0.15em; margin-right: 1px; }
  /* narrow phones: a little smaller, and with meds on the "Score:" / "Lives:" labels go,
     so score + meds, hearts and hi still fit on one line */
  @media (max-width: 420px) {
    .hud { font-size: 12px; padding: 6px 5px; gap: 4px; }
    .hud.has-meds .lbl { display: none; }
    #medsHud { margin-left: 3px; }
    #medsHud .cap { width: 11px; height: 6px; margin-right: 0; }
    /* (v173) with a SPICE level shown too: slimmer capsules and chili, so it all stays on one line */
    #medsHud.has-spice { margin-left: 2px; }
    #medsHud.has-spice .cap { width: 8px; height: 5px; }
    #medsHud .spice { margin-left: 1px; }
    #medsHud .spice svg { width: 0.55em; margin-right: 0; }
  }
  .footer { margin-top: 12px; color: #fff; font-size: 12px; text-align: center; text-shadow: 1px 1px 0 #000; max-width: 430px; }
  /* touch screens: the keyboard/mouse help is no use, and the space below the game is the thumb pad */
  .touch .footer { display: none; }   /* (html.touch: set in ui.js) */
  body.ingame { touch-action: none; }   /* while playing, a drag anywhere moves the BUKET (no scrolling or zooming) */
  .thumbpad {
    position: fixed; display: flex; align-items: center; justify-content: center; pointer-events: none;
    border: 2px dashed rgba(255,255,255,0.3); border-radius: 18px; background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.5); font-size: 14px; font-weight: bold; text-align: center; padding: 8px;
    transition: background 0.15s, border-color 0.15s;
  }
  .thumbpad[hidden] { display: none; }
  .thumbpad.active { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.55); }
  /* (v146) FULLSCREEN (html.full, ui.js): the game window fills the whole screen like a maximized window; the game
     itself as big as fits, centred on black between the title bar and the score bar */
  #fullBtn { font-size: 13px; line-height: 1; }
  html.full body {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    align-items: stretch; background: #000;
  }
  html.full .window {
    flex: 1; display: flex; flex-direction: column; min-height: 0;
    border: none; padding: 0; box-shadow: none; background: #000;
  }
  html.full canvas { margin: auto auto 0; flex: none; }
  /* (v147) the score bar right under the game, as wide as it, its text growing with it (fitCanvas sets --game-w and
     the font size), so score and lives are where you look, not tiny in the screen's corners */
  html.full .hud { align-self: center; width: var(--game-w); margin-bottom: auto; padding: 0.35em 0.6em; }
  html.full #medsHud .cap { width: 1em; height: 0.54em; }
  /* (a tall phone: the game + score bar right under the title bar, the space below them for the thumb pad) */
  @media (orientation: portrait) { html.full canvas { margin: 0 auto; } }
  html.full .footer { display: none; }
