  /* Pixel-art editor modal */
  #pixelOverlay {
    position: fixed; inset: 0; z-index: 66; display: flex; align-items: center;
    justify-content: center; background: rgba(6,10,20,0.72);
  }
  .pixel-card {
    width: min(900px, 94vw); max-height: 90vh; background: #0e1726; border: 1px solid #2a3a5e;
    border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px;
    box-shadow: 0 18px 60px rgba(0,0,0,.6);
  }
  .pixel-head { display: flex; align-items: center; justify-content: space-between; color: #cfe0ff; gap: 10px; }
  .pixel-head .zoom { display: flex; align-items: center; gap: 6px; }
  .pixel-head .zoom button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid #2a3a5e; background: #11203a; color: #dce7fb; cursor: pointer; font-size: 15px; }
  .pixel-head .zoom span { font-size: 12px; color: #8aa0c8; min-width: 56px; text-align: center; }
  #pixelSwatches { display: flex; gap: 5px; flex-wrap: wrap; }
  #pixelSwatches button { width: 24px; height: 24px; padding: 0; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
  #pixelSwatches button.sel { border-color: #fff; transform: scale(1.12); }
  #pixelSwatches .erase { background: #11203a; color: #dce7fb; font-size: 13px; }
  #pixelScroll {
    overflow: auto; background: #060b14; border: 1px solid #223255; border-radius: 10px;
    /* checkerboard so empty cells read as transparent */
    background-image: linear-gradient(45deg,#0c1322 25%,transparent 25%),linear-gradient(-45deg,#0c1322 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#0c1322 75%),linear-gradient(-45deg,transparent 75%,#0c1322 75%);
    background-size: 16px 16px; background-position: 0 0,0 8px,8px -8px,-8px 0;
    flex: 1; min-height: 200px; text-align: center;
  }
  #pixelCanvas { image-rendering: pixelated; display: inline-block; margin: auto; cursor: crosshair; vertical-align: middle; }
  .pixel-hint { font-size: 12px; color: #6b7aa0; }
  /* Poll modal */
  #pollOverlay { position: fixed; inset: 0; z-index: 66; display: flex; align-items: center; justify-content: center; background: rgba(6,10,20,0.6); }
  .poll-card { width: min(420px, 92vw); background: #0e1726; border: 1px solid #2a3a5e; border-radius: 16px; padding: 18px; box-shadow: 0 18px 60px rgba(0,0,0,.6); }
  #pollOpts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
  .pollopt { position: relative; text-align: left; border: 1px solid #2a3a5e; background: #0b1322; color: #e8eefc; border-radius: 8px; padding: 9px 11px; cursor: pointer; overflow: hidden; font-size: 14px; }
  .pollopt .bar { position: absolute; inset: 0; background: #2c4470; width: 0; transition: width .25s; z-index: 0; }
  .pollopt.mine { border-color: #5aa6ff; }
  .pollopt .lbl, .pollopt .pct { position: relative; z-index: 1; }
  .pollopt .pct { float: right; color: #9bc2ff; }
  /* Tic-tac-toe modal */
  #tttOverlay { position: fixed; inset: 0; z-index: 66; display: flex; align-items: center; justify-content: center; background: rgba(6,10,20,0.6); }
  .ttt-card { background: #0e1726; border: 1px solid #2a3a5e; border-radius: 16px; padding: 18px; box-shadow: 0 18px 60px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: 12px; align-items: center; }
  #tttStatus { color: #cfe0ff; font-weight: 700; min-height: 20px; }
  #tttGrid { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 64px); gap: 6px; }
  #tttGrid button { font-size: 34px; border-radius: 10px; border: 1px solid #2a3a5e; background: #11203a; color: #e8eefc; cursor: pointer; }
  #tttGrid button:hover:not(:disabled) { background: #1a2c4d; }
  /* Help / shortcuts modal */
  #helpOverlay { position: fixed; inset: 0; z-index: 68; display: flex; align-items: center; justify-content: center; background: rgba(6,10,20,0.6); }
  .help-card { width: min(520px, 92vw); max-height: 86vh; overflow-y: auto; background: #0e1726; border: 1px solid #2a3a5e; border-radius: 16px; padding: 18px; box-shadow: 0 18px 60px rgba(0,0,0,.6); }
  .help-head { display: flex; align-items: center; justify-content: space-between; color: #cfe0ff; margin-bottom: 12px; }
  .help-grid { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; align-items: center; }
  .help-grid span { color: #c4d2ee; font-size: 14px; }
  .help-grid kbd, .help-grid span kbd { display: inline-block; background: #11203a; border: 1px solid #33476e; border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; font: 600 12px ui-monospace, monospace; color: #e8eefc; white-space: nowrap; }
  .help-grid span kbd { padding: 1px 5px; }
  .help-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid #223255; color: #8aa0c8; font-size: 12.5px; }
  /* Games guide modal */
  #gamesOverlay { position: fixed; inset: 0; z-index: 68; display: flex; align-items: center; justify-content: center; background: rgba(6,10,20,0.6); }
  .games-card { width: min(560px, 94vw); max-height: 88vh; overflow-y: auto; background: #0e1726; border: 1px solid #2a3a5e; border-radius: 16px; padding: 18px; box-shadow: 0 18px 60px rgba(0,0,0,.6); }
  .games-intro { color: #8aa0c8; font-size: 13px; margin: 4px 0 12px; }
  .games-list { display: flex; flex-direction: column; gap: 10px; }
  .game { display: flex; gap: 12px; align-items: flex-start; background: #0b1322; border: 1px solid #223255; border-radius: 10px; padding: 10px 12px; }
  .game .g-ico { font-size: 26px; line-height: 1; flex: none; }
  .game b { color: #e8eefc; }
  .game .g-set { color: #8aa0c8; font-size: 12.5px; margin-top: 3px; }
  .game .g-play { color: #c4d2ee; font-size: 13px; margin-top: 2px; }

  /* City tile picker modal (Kenney roguelike modern city) */
  #cityOverlay {
    position: fixed; inset: 0; z-index: 67; display: flex; align-items: center;
    justify-content: center; background: rgba(6,10,20,0.72);
  }
  .city-card {
    width: min(960px, 95vw); max-height: 90vh; background: #0e1726; border: 1px solid #2a3a5e;
    border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px;
    box-shadow: 0 18px 60px rgba(0,0,0,.6);
  }
  .city-head { display: flex; align-items: center; gap: 10px; color: #cfe0ff; }
  .city-head b { flex: none; }
  .city-tabs { display: flex; gap: 4px; flex: none; }
  .city-tab {
    padding: 6px 12px; border-radius: 9px; border: 1px solid #2a3a5e; cursor: pointer;
    background: #0a1322; color: #9fb3d6; font-size: 13px; font-weight: 600;
  }
  .city-tab.sel { background: #1d3a6b; color: #fff; border-color: #3a5a9e; }
  .city-head #citySearch {
    flex: 1; min-width: 0; padding: 7px 11px; border-radius: 9px; border: 1px solid #2a3a5e;
    background: #0a1322; color: #e8eefc; font-size: 13px;
  }
  .city-layer { display: flex; gap: 0; flex: none; border: 1px solid #2a3a5e; border-radius: 9px; overflow: hidden; }
  .city-layer button {
    padding: 7px 10px; border: 0; background: #0a1322; color: #9fb3d6; cursor: pointer; font-size: 12.5px;
  }
  .city-layer button.sel { background: #1d3a6b; color: #fff; }
  .city-body { overflow: auto; flex: 1; min-height: 220px; padding-right: 4px; }
  .city-grp-h { color: #8aa0c8; font-size: 12px; font-weight: 600; margin: 10px 2px 6px; text-transform: uppercase; letter-spacing: .04em; }
  .city-grid { display: flex; flex-wrap: wrap; gap: 5px; }
  .city-tile {
    width: 32px; height: 32px; padding: 0; box-sizing: content-box; border: 1px solid #243150;
    border-radius: 5px; cursor: pointer; background-color: #0a1322;
    background-image: url(../citymap.png); background-size: 1184px 896px; background-repeat: no-repeat;
    image-rendering: pixelated; position: relative;
  }
  .city-tile:hover { border-color: #5aa6ff; transform: scale(1.1); z-index: 1; }
  .city-tile.sel { outline: 2px solid #ffd45a; border-color: #ffd45a; }
  .city-hint { color: #7e93b8; font-size: 11.5px; line-height: 1.4; }
  .city-empty { color: #7e93b8; font-size: 13px; padding: 16px 4px; }
