* {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }

      body {
        background: #ffffff;
        color: #ccc;
        font-family: monospace;
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
      }

      #bar {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 5px 8px;
        background: #0c0c0c;
        border-bottom: 1px solid #181818;
        flex-wrap: wrap;
        flex-shrink: 0;
      }

      #bar .tag {
        font-size: 10px;
        color: #ff3366;
        font-weight: bold;
        margin-right: 2px;
      }

      .main {
        display: flex;
        flex: 1;
        overflow: hidden;
      }

      #stage {
        flex: 1;
        position: relative;
        overflow: hidden;
        background: #ffffff;
        cursor: crosshair;
      }

      #glitch-canvas,
      #overlay-canvas {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: block;
      }

      #glitch-canvas {
        z-index: 0;
        opacity: 0;
        transition: opacity 1.5s ease-in-out;
      }

      #overlay-canvas {
        z-index: 1;
      }

      #panel {
        width: 248px;
        background: #0c0c0c;
        border-left: 1px solid #181818;
        padding: 8px;
        overflow-y: auto;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
        font-size: 11px;
      }

      .sec {
        border-bottom: 1px solid #161616;
        padding-bottom: 6px;
      }

      .stit {
        font-size: 9px;
        color: #303030;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 5px;
      }

      .ctrl {
        display: flex;
        flex-direction: column;
        gap: 1px;
        margin-bottom: 2px;
      }

      label {
        font-size: 11px;
        color: #555;
        display: block;
      }

      .val {
        color: #ff3366;
        float: right;
      }

      input[type="range"] {
        width: 100%;
        accent-color: #ff3366;
        cursor: pointer;
      }

      input[type="color"] {
        width: 28px;
        height: 18px;
        border: none;
        background: none;
        cursor: pointer;
        padding: 0;
      }

      input[type="file"] {
        display: none;
      }

      input[type="checkbox"] {
        accent-color: #ff3366;
        cursor: pointer;
      }

      .row {
        display: flex;
        align-items: center;
        gap: 6px;
      }

      button {
        padding: 3px 8px;
        background: #111;
        border: 1px solid #222;
        color: #888;
        cursor: pointer;
        font-family: monospace;
        font-size: 11px;
        border-radius: 2px;
        white-space: nowrap;
      }

      button:hover {
        border-color: #ff3366;
        color: #fff;
        background: #1a1a1a;
      }

      button.active {
        background: #ff3366;
        border-color: #ff3366;
        color: #fff;
      }

      button.gold {
        border-color: #ffcc00;
        color: #ffcc00;
      }

      button.gold:hover {
        background: #ffcc00;
        color: #000;
      }

      button.wide {
        width: 100%;
        margin-top: 2px;
      }

      .sep {
        width: 1px;
        height: 14px;
        background: #1c1c1c;
      }

      .img-row {
        display: flex;
        align-items: center;
        gap: 5px;
        margin-top: 3px;
      }

      .img-thumb {
        width: 36px;
        height: 36px;
        object-fit: contain;
        border: 1px solid #222;
        background: #111;
        flex-shrink: 0;
      }

      .img-name {
        font-size: 9px;
        color: #444;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1;
        min-width: 0;
      }

      #hud {
        position: absolute;
        bottom: 6px;
        left: 8px;
        font-size: 10px;
        color: #1e1e1e;
        z-index: 5;
        pointer-events: none;
        line-height: 1.8;
      }

      #chaos-bar {
        height: 2px;
        background: #ff3366;
        width: 0%;
        margin-top: 3px;
        transition: width 0.08s;
      }

      #xfade-bar {
        height: 2px;
        background: #33ccff;
        width: 0%;
        margin-top: 2px;
        transition: none;
      }

      /* Hide HUD and panel per user request */
      #hud,
      #panel {
        display: none !important;
      }



 #chaos-form-container {
              position: absolute;
              top: 50%;
              left: 50%;
              transform: translate(-50%, -50%);
              z-index: 10;
              max-width: 440px;
              width: 90%;
              background: #fff3e3;
              border: 4px solid #ff0000;
              border-radius: 12px;
              box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
              cursor: default;
              display: flex;
              flex-direction: column;
              overflow: hidden;
            }

            #chaos-form-container * {
              font-family: "fantabular-mvb", mono, monospace;
              color: #ff0000;
              box-sizing: border-box;
            }

            .cf-header {
              background: #ff0000;
              color: #fff3e3;
              padding: 4px 10px;
              display: flex;
              justify-content: flex-end;
            }

            .cf-header div {
              font-weight: 700;
              font-size: 16px;
              cursor: pointer;
              color: #fff3e3;
              font-family: sans-serif;
            }

            .cf-body {
              padding: 15px 30px 30px;
            }

            .cf-title {
              font-weight: 700;
              font-style: italic;
              font-size: 26px;
              line-height: 100%;
              text-transform: uppercase;
              text-align: center;
              margin-bottom: 10px;
              letter-spacing: 0;
            }

            .cf-divider {
              height: 3px;
              background: #ff0000;
              margin-bottom: 15px;
            }

            .cf-hero {
              font-weight: 500;
              font-size: 9px;
              line-height: 140%;
              text-transform: uppercase;
              margin-bottom: 25px;
              text-align: center;
            }

            .cf-row {
              display: flex;
              align-items: center;
              margin-bottom: 12px;
              gap: 10px;
            }

            .cf-label {
              width: 70px;
              text-align: left;
              font-weight: 500;
              font-style: italic;
              font-size: 9px;
              line-height: 140%;
              text-transform: none;
              text-align: right;
            }

            .cf-input {
              flex: 1;
              border: 2px solid #ff0000;
              border-radius: 8px;
              background: transparent;
              padding: 6px 10px;
              font-weight: 500;
              font-size: 9px;
              line-height: 140%;
              outline: none;
              text-transform: none;
            }

            .cf-input::placeholder {
              color: #ff0000;
              opacity: 0.8;
            }

            .cf-select {
              cursor: pointer;
              appearance: none;
              background: url('data:image/svg+xml;utf8,<svg fill="%23FF0000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>')
                no-repeat right 5px center;
            }

            .cf-check-row {
              display: flex;
              align-items: center;
              gap: 10px;
              margin-top: 15px;
              margin-bottom: 25px;
              padding-left: 10px;
            }

            .cf-check-text {
              font-weight: 500;
              font-size: 9px;
              line-height: 140%;
            }

            .cf-checkbox {
              appearance: none;
              width: 18px;
              height: 18px;
              border: 2px solid #ff0000;
              border-radius: 4px;
              outline: none;
              cursor: pointer;
              position: relative;
              flex-shrink: 0;
            }

            .cf-checkbox:checked::after {
              content: "✔";
              position: absolute;
              top: -3px;
              left: 2px;
              font-size: 14px;
              color: #ff0000;
              font-family: sans-serif;
            }

            .cf-submit-container {
              text-align: right;
              margin-right: 15px;
            }

            .cf-submit {
              background: #fff3e3;
              border: 2px solid #ff0000;
              border-radius: 8px;
              padding: 6px 20px;
              font-weight: 500;
              font-style: italic;
              font-size: 14px;
              line-height: 140%;
              box-shadow: 4px 4px 0 #ff0000;
              cursor: pointer;
              transition: all 0.1s;
              text-transform: uppercase;
              margin-bottom: 4px;
            }

            .cf-submit:active {
              box-shadow: 0px 0px 0 #ff0000;
              transform: translate(4px, 4px);
            }