@import url("https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap");
    #wheel-root * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    #wheel-root {
      width: 100%;
      height: auto;
      display: grid;
      align-items: center;
      justify-items: center;
      position: relative;
    }
    #wheel-root.fullscreen {
      position: fixed;
      inset: 0;
      width: 100vw;
      height: 100vh;
      background: #111111;
      display: grid;
      place-items: center;
      z-index: 2000;
    }
    #wheel-root.fullscreen #spin_the_wheel {
      max-width: 95vw;
      max-height: 95vh;
    }
    #wheel-root #spin_the_wheel {
      display: inline-block;
      position: relative;
      overflow: hidden;
    }
    #wheel-root #wheel {
      display: block;
    }
    #wheel-root #spin {
      font:
        1.5em/0 "Lato",
        sans-serif;
      user-select: none;
      cursor: pointer;
      display: flex;
      justify-content: center;
      align-items: center;
      position: absolute;
      top: 50%;
      left: 50%;
      width: 30%;
      height: 30%;
      margin: -15%;
      background: #fff;
      color: #fff;
      box-shadow:
        0 0 0 8px currentColor,
        0 0px 15px 5px rgba(0, 0, 0, 0.6);
      border-radius: 50%;
      transition: 0.8s;
    }
    #wheel-root #spin.pressed {
      transform: scale(0.85);
      box-shadow:
        0 0 0 8px #f7b71e,
        0 0px 16px 8px rgba(0, 0, 0, 0.6);
      background: #f7b71e;
      color: #212121;
      transition: transform 0.08s, background 0.08s, color 0.08s;
    }
    #wheel-root #spin::after {
      content: "";
      position: absolute;
      top: -17px;
      border: 10px solid transparent;
      border-bottom-color: currentColor;
      border-top: none;
    }
    #wheel-root .row {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      width: 100%;
    }
    #wheel-root .column {
      display: flex;
      flex-direction: column;
      flex-basis: 100%;
      flex: 1;
    }
    #wheel-root .modal-overlay {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(0, 0, 0, 0.55);
      z-index: 1000;
    }
    #wheel-root .modal-overlay.open {
      display: flex;
    }
    #wheel-root .modal {
      width: 600px;
      height: 480px;
      max-width: calc(100% - 48px);
      max-height: calc(100% - 48px);
      background: #1c1f23;
      border: 5px solid #aea73b;
      color: #111111;
      padding: 20px 24px;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
      display: flex;
      flex-direction: column;
    }
    #wheel-root .modal-title {
      margin: 0 0 8px;
      font: 700 22px/1.2 "Lato", sans-serif;
      color: white;
    }
    #wheel-root .modal-body {
      margin: 0 0 16px;
      color: #ededed;
      font: 400 16px/1.5 "Lato", sans-serif;
      text-align: center;
      flex: 1;
      display: grid;
      place-items: center;
    }
    #wheel-root .modal-actions {
      margin-top: auto;
      display: flex;
      justify-content: flex-end;
    }
    #wheel-root #win-modal-close {
      background: #f7b71e;
      color: #ffffff;
      border: none;
      padding: 10px 14px;
      font: 900 14px/1 "Lato", sans-serif;
      cursor: pointer;
    }
    #wheel-root #win-modal-label {
      display: block;
      margin-top: 8px;
      font: 700 clamp(32px, 6vw, 72px)/1.1 "Lato", sans-serif;
      text-align: center;
      color: #ffffff;
      max-width: 100%;
      padding: 0 12px;
      white-space: nowrap;
      overflow: hidden;
    }
    #wheel-root #results-modal .modal-title {
      text-align: center;
    }
    #wheel-root #results-modal .modal-body {
      display: block;
      text-align: left;
      font: 400 14px/1.4 "Lato", sans-serif;
      color: #ededed;
      overflow: auto;
    }
    #wheel-root #results-table {
      width: 100%;
      border-collapse: collapse;
    }
    #wheel-root #results-table thead th {
      position: sticky;
      top: 0;
      background: #1c1f23;
      color: #ffffff;
      text-align: left;
      font: 700 14px/1.4 "Lato", sans-serif;
      padding: 8px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }
    #wheel-root #results-table tbody th {
      text-align: right;
      color: #ffffff;
      font: 700 14px/1.4 "Lato", sans-serif;
      padding: 8px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      width: 48px;
    }
    #wheel-root #results-table tbody td {
      color: #ededed;
      font: 400 14px/1.4 "Lato", sans-serif;
      padding: 8px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    #wheel-root #results-modal .modal-actions {
      justify-content: flex-end;
      gap: 12px;
    }
    #wheel-root #results-close,
    #wheel-root #results-clear {
      background: #f7b71e;
      color: #ffffff;
      border: none;
      padding: 10px 14px;
      font: 900 14px/1 "Lato", sans-serif;
      cursor: pointer;
    }
    @media (max-width: 1500px) {
      #wheel-root #spin_the_wheel {
        max-width: 80vw;
      }
      #wheel-root #wheel {
        width: min(80vw, 380px);
        height: min(80vw, 380px);
      }
    }
    @media (max-width: 768px) {
      #wheel-root #spin_the_wheel {
        max-width: 90vw;
      }
      #wheel-root #wheel {
        width: min(90vw, 340px);
        height: min(90vw, 340px);
      }
    }
    /* Simple layout helpers */
    .hero-wheel { margin: 32px auto; max-width: 960px; }
    .wheel-wrap { display: flex; justify-content: center; align-items: center; margin: 0 auto 32px; }
    #share { text-align: center; }
    #share a { display: inline-block; margin: 0 8px; }
    /* Theme chooser CTA */
    #wheel-theme-trigger-wrap {
      text-align: center;
      margin: 0 auto 32px;
      display: flex;
      justify-content: center;
      flex-wrap: wrap;
      gap: 12px;
    }
    .wheel-cta-btn {
      display: inline-block;
      padding: 11px 18px;
      background: #f7b71e;
      color: #111111;
      border: none;
      font: 900 14px/1 "Lato", sans-serif;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      cursor: pointer;
    }
    #wheel-custom-btn {
      background: #6ec1e4;
      color: #111111;
    }
    #results-btn {
      background: #ff6f3c;
      color: #111111;
    }
    /* Palette modal styling (reuses wheel modal look) */
    #palette-modal .modal-body {
      max-height: 360px;
      overflow: auto;
      padding-right: 8px;
    }
    #palette-modal .themes-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 14px;
    }
    #palette-modal .palette {
      display: flex;
      gap: 10px;
      padding: 8px;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
    }
    #palette-modal .swatch {
      flex: 1;
      height: 48px;
      border-radius: 6px;
      background: var(--color);
      border: 1px solid rgba(255, 255, 255, 0.15);
    }
    /* Custom modal (Homebox) */
    #custom-modal .modal {
      width: 840px;
      max-width: calc(100% - 32px);
      max-height: calc(100% - 32px);
      overflow: auto;
    }
    #custom-panel.homebox {
      background-color: #1c1c1c;
      width: 100%;
      max-width: 400px;
      border: 1px solid #aea73b;
      border-radius: 8px;
      padding: 20px;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
    }
    #custom-panel.homebox h3 {
      color: white;
      font-size: 1rem;
      text-transform: uppercase;
      margin: 0;
    }
    #custom-panel.homebox p { color: white; font-size: 14px; }
    #custom-panel input[type="text"],
    #custom-panel .wheel-text {
      height: 40px;
      border: none;
      background: #6e6e6e;
      color: #e3e3e3;
      padding: 0 12px;
      outline: none;
      -webkit-appearance: none;
      appearance: none;
      flex: 1;
    }
    #custom-panel input[type="text"]::placeholder,
    #custom-panel .wheel-text::placeholder { color: #cfcfcf; }
    #custom-panel input[type="number"],
    #custom-panel .wheel-qty {
      height: 40px;
      width: 48px;
      border: none;
      background: #6e6e6e;
      color: #e3e3e3;
      padding: 0 12px;
      outline: none;
      -webkit-appearance: none;
      appearance: textfield;
    }
    #custom-panel input[type="number"]::-webkit-outer-spin-button,
    #custom-panel input[type="number"]::-webkit-inner-spin-button,
    #custom-panel .wheel-qty::-webkit-outer-spin-button,
    #custom-panel .wheel-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    #custom-panel .input-row { display: flex; gap: 8px; align-items: center; }
    #custom-panel .homebox-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
    #custom-panel .actions-row { display: flex; gap: 8px; margin-top: 10px; }
    #custom-panel .action-btn {
      height: 36px;
      border: none;
      padding: 0 12px;
      background: #f0ae5e;
      color: #212121;
      cursor: pointer;
    }
    #custom-panel .action-btn.secondary { background: #6e6e6e; color: #e3e3e3; }
    #custom-panel .action-btn.primary { background: #f7b71e; color: #212121; }
    #custom-panel ul { list-style: none; margin: 12px 0 0; padding: 0; }
    #custom-panel li { color: #aaaaaa; font-size: 14px; padding: 4px 0; }
    #custom-panel #wheel-name-list { display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; min-height: 0; }
    #custom-panel .entry-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
    #custom-panel .entry-row input[type="text"] { flex: 1; }
    #custom-panel .checkbox-container {
      height: 40px;
      width: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      margin-bottom: 0;
      cursor: pointer;
      user-select: none;
      min-width: unset;
      font-size: unset;
      padding-left: 0;
    }
    #custom-panel .checkbox-container input[type="checkbox"] {
      position: absolute;
      opacity: 0;
      cursor: pointer;
      height: 40px;
      width: 40px;
      z-index: 2;
    }
    #custom-panel .checkmark {
      position: relative;
      display: block;
      height: 40px;
      width: 40px;
      background-color: #eee;
      border-radius: 4px;
      z-index: 1;
    }
    #custom-panel .checkbox-container:hover input ~ .checkmark { background-color: #ccc; }
    #custom-panel .checkbox-container input:checked ~ .checkmark { background-color: #2196F3; }
    #custom-panel .checkmark:after {
      content: "";
      position: absolute;
      display: none;
    }
    #custom-panel .checkbox-container input:checked ~ .checkmark:after { display: block; }
    #custom-panel .checkbox-container .checkmark:after {
      left: 13px;
      top: 10px;
      width: 7px;
      height: 14px;
      border: solid white;
      border-width: 0 3px 3px 0;
      transform: rotate(45deg);
    }
    #custom-panel .count-row { color: #e3e3e3; font-size: 12px; margin-top: 6px; }
    #custom-panel .duplicate-btn,
    #custom-panel .delete-btn {
      margin-left: 8px;
      padding: 4px 10px;
      border: none;
      cursor: pointer;
      border-radius: 4px;
    }
    #custom-panel .duplicate-btn { background: #f0ae5e; color: #212121; }
    #custom-panel .delete-btn { background: #d9534f; color: #fff; }
    /* Paste modal inside custom panel */
    #custom-modal #paste-modal {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(0,0,0,0.55);
      z-index: 1000;
    }
    #custom-modal #paste-modal.open { display: flex; }
    #custom-modal #paste-modal .modal {
      width: 700px;
      height: 420px;
      max-width: calc(100% - 48px);
      max-height: calc(100% - 48px);
      background: #1c1f23;
      border: 5px solid #aea73b;
      color: #ededed;
      padding: 20px 24px;
      box-shadow: 0 4px 8px rgba(0,0,0,0.25);
      display: flex;
      flex-direction: column;
    }
    #custom-modal #paste-modal .modal-body {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
      flex: 1;
      overflow: hidden;
    }
    #custom-modal #paste-textarea {
      width: 100%;
      height: 100%;
      resize: none;
      border: none;
      outline: none;
      background: #2a2e33;
      color: #e3e3e3;
      padding: 12px;
    }
    #custom-modal .paste-preview {
      width: 100%;
      height: 100%;
      background: #222529;
      border: 1px solid rgba(255,255,255,0.1);
      padding: 12px;
      overflow: auto;
    }
    #custom-modal #paste-modal .modal-actions {
      margin-top: 12px;
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }
    #custom-modal #paste-add,
    #custom-modal #paste-close {
      background: #f7b71e;
      color: #ffffff;
      border: none;
      padding: 10px 14px;
      font-weight: 900;
      font-size: 14px;
      line-height: 1;
      cursor: pointer;
    }
    #custom-modal #paste-close { background: #6e6e6e; }
    @media (max-width: 1500px) {
      #custom-panel.homebox { width: min(90vw, 360px); height: auto; }
    }
    @media (max-width: 768px) {
      #custom-panel.homebox {
        width: min(90vw, 340px);
        height: auto;
        padding: 16px;
      }
      #custom-panel .wheel-text { width: 100%; }
      #custom-panel #wheel-name-list {
        flex: unset;
        overflow-y: visible;
        min-height: unset;
        --entry-row-height: 48px;
        --entry-row-gap: 8px;
      }
      #custom-panel #wheel-name-list.scrolling {
        overflow-y: auto;
        max-height: calc(8 * var(--entry-row-height) + 7 * var(--entry-row-gap));
      }
    }
