    html, body { margin: 0; background: #000; color: #fff; font-family: sans-serif; }
    canvas { display: block; margin: auto; image-rendering: pixelated; border: 1px solid #444; }

    /* all brushes default */
    #tileBrushes canvas {
      width: 64px;
      height: 64px;
      box-sizing: border-box;
      border: 2px solid #fff;
      margin: 2px;
      cursor: pointer;
      transition: transform 0.1s;
    }

    /* the selected one */
    #tileBrushes canvas.selected {
      border-color: #ff0;  /* yellow */
    }
    
    /* Sidebar sliding */
    #tileProps {
      position: fixed;
      top: 0; left: -220px;
      width: 220px; height: 100vh;
      background: #222; color: #fff;
      padding: 10px; overflow: hidden;
      box-shadow: 2px 0 8px rgba(0,0,0,0.5);
      transition: left .25s ease-in-out;
      z-index: 20;
    }
    #tileProps.open {
      left: 0;
    }
    /* Shift canvas area when sidebar opens */
    #canvasContainer {
      position: relative; left: 0;
      transition: left .25s ease-in-out;
    }
    #canvasContainer.shifted {
      left: 220px;
    }

    /* Palette grid */
    #tileBrushes {
      display: grid;
      grid-template-columns: repeat(11, 68px);
      grid-auto-rows: 68px;
      gap: 4px;
      overflow-y: auto;
      padding: 10px;
      box-sizing: border-box;
    }

    /* Ensure the backdrop covers the screen and centers the modal */
    #sharedModalBackdrop {
      display: none;              /* hidden by default */
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(0,0,0,0.6);
      z-index: 999;
      display: none;
      align-items: center;
      justify-content: center;
    }

    /* Modal window styling (no change needed here if you like it) */
    #sharedModal {
      background: #1e1e1e;
      color: #eee;
      border-radius: 8px;
      width: 90%;
      max-width: 500px;
      max-height: 80vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      box-shadow: 0 8px 24px rgba(0,0,0,0.7);
      box-sizing: border-box;    /* include padding in width calculations */
    }

    #sharedList {
      list-style: none;
      margin: 0;
      padding: 0.5rem;
      overflow-y: auto;
      flex: 1;
    }

    #sharedList li {
      display: flex;
      align-items: center;
      justify-content: flex-start;   /* force left alignment */
      gap: 0.75rem;                  /* consistent spacing between canvas and text */
      text-align: left;
      padding: 0.75rem 1rem;
      border-bottom: 1px solid #333;
      cursor: pointer;
      transition: background 0.2s;
    }

    #sharedList li:hover {
      background: rgba(255,255,255,0.05);
    }

    #sharedList canvas {
      width: 64px;
      height: 48px;
      flex-shrink: 0;
      border: 1px solid #444;
      border-radius: 4px;
    }

    #sharedList span {
      font-size: 1rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      flex-grow: 1; /* make it take up the rest of the row */
    }

    /* Header/Footer buttons (no change) */
    #sharedModal header,
    #sharedModal footer {
      padding: 1rem;
      background: #272727;
      border-bottom: 1px solid #444;
    }
    #sharedModal footer {
      border-top: 1px solid #444;
      text-align: right;
    }
    #sharedModal footer button {
      background: #444;
      color: #eee;
      border: none;
      padding: 0.5rem 1rem;
      border-radius: 4px;
      cursor: pointer;
      transition: background 0.2s;
    }
    #sharedModal footer button:hover {
      background: #555;
    }

    .modal-backdrop {
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(0,0,0,0.8);
      z-index: 1000;
    }

    .modal {
      max-width: 1000px;
      width: 90%;
      max-height: 90%;
      overflow: auto;
      background: #1e1e1e;
      color: #ddd;
      padding: 1.5rem;
      border-radius: 10px;
      font-family: sans-serif;
    }
    
    .modal pre {
      background: #2e2e2e;
      padding: 1rem;
      margin: 1em 0;
      border-radius: 4px;

      /* Fix font and spacing */
      font-family: Consolas, Menlo, "Courier New", monospace;
      font-size: 14px;
      line-height: 1.5;
      white-space: pre-wrap;
      word-break: break-word;
      overflow-x: auto;
    }

    .modal pre code {
      display: block;
      background: none;
      padding: 0;
      border-radius: 0;
      font-size: inherit;
      font-family: inherit;
      line-height: inherit;
    }

    .modal code {
      font-family: Consolas, Menlo, "Courier New", monospace;
      font-size: 14px;
      background: rgba(255,255,255,0.05);
      padding: 0.2rem 0.4rem;
      border-radius: 4px;
      white-space: pre-wrap;
      word-break: break-word;
      line-height: 1.4;
    }

    .modal h1, .modal h2, .modal h3 {
      border-bottom: 1px solid #444;
      padding-bottom: 0.25em;
    }

    .modal img {
      max-width: 100%;
    }

    .modal a {
      color: #6cf;
    }
