.dmw {
    --background: rgba(65, 68, 75, 0.78);
    --panel-background: rgba(6, 10, 22, 0.86);

    --text-color: #ffffff;
    --muted-color: #d0dcf0;

    --cyan: #00e5ff;
    --pink: #ff25ed;
    --blue: #376cff;

    --content-width: 1200px;
    --wheel-size: 570px;
    --top-logo-width: 145px;
    --center-image-size: 66%;
    --button-width: 460px;

    --font: Arial, Helvetica, sans-serif;

    /* Full-width breakout from the WordPress content column. */
    position: relative;
    width: 100%;
    max-width: none !important;
    box-sizing: border-box;

    padding: clamp(24px, 5vw, 65px) clamp(14px, 3vw, 20px) clamp(28px, 5vw, 45px);
    overflow: hidden;

    background: rgba(172, 164, 202, 0.27);
    color: var(--text-color);
    font-family: var(--font);
    text-align: center;
    isolation: isolate;
  }

  .dmw *,
  .dmw *::before,
  .dmw *::after {
    box-sizing: border-box;
  }

  .dmw [hidden] {
    display: none !important;
  }

  .dmw .dmw-inner {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
  }

  /* =========================================================
     2. TOP LOGO AND HEADINGS
     ========================================================= */
  .dmw .dmw-brand {
    min-height: 88px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
  }

  .dmw .dmw-top-logo {
    display: block;
    width: var(--top-logo-width);
    max-width: 65vw;
    height: auto;
    max-height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(255,255,255,.2));
  }

  .dmw .dmw-brand-fallback {
    font-size: clamp(34px, 6vw, 54px);
    font-weight: 800;
    letter-spacing: .2em;
    padding-left: .2em;
    line-height: 1.2;
    text-shadow: 0 0 20px rgba(0,229,255,.35);
  }

  .dmw .dmw-heading {
    margin: 0;
    color: var(--text-color);
    font-family: inherit;
    font-size: clamp(18px, 2.8vw, 29px);
    font-weight: 500;
    letter-spacing: .14em;
    line-height: 1.5;
    text-transform: uppercase;
  }

  .dmw .dmw-subheading {
    margin: 10px 0 0;
    color: var(--muted-color);
    font-size: clamp(14px, 2vw, 19px);
    letter-spacing: .065em;
    line-height: 1.6;
  }

  /* =========================================================
     3. WHEEL — RAINBOW RIM, POINTER, AND CENTER IMAGE
     ========================================================= */
  .dmw .dmw-wheel-wrap {
    position: relative;
    width: min(100%, var(--wheel-size), max(260px, calc(100vh - 200px)));
    width: min(100%, var(--wheel-size), max(260px, calc(100svh - 200px)));
    aspect-ratio: 1;
    margin: 39px auto 30px;
  }

  .dmw .dmw-rim {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 12px;
    background: conic-gradient(
      from 0deg,
      #00eaff,
      #2353ff,
      #f52bff,
      #ff4620,
      #fff22a,
      #00f7a6,
      #00eaff,
      #2765ff,
      #fc21ff,
      #00eaff
    );
    box-shadow: inset 0 0 7px rgba(255,255,255,.95);
  }

  .dmw .dmw-rim::after {
    content: "";
    position: absolute;
    inset: 5px;
    border: 2px solid rgba(236,251,255,.75);
    border-radius: 50%;
    pointer-events: none;
  }

  .dmw .dmw-disc {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 50%;
    border: 5px solid #08111e;
    background: #07101c;
    box-shadow: 0 0 0 2px rgba(0,229,255,.7);
  }

  .dmw .dmw-wheel {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    transform-origin: 50% 50%;
    will-change: transform;
  }

  /* Fixed pointer: its tip points into the winning slice. */
  .dmw .dmw-pointer {
    position: absolute;
    z-index: 5;
    top: -17px;
    left: 50%;
    width: clamp(36px, 8vw, 52px);
    height: auto;
    transform: translateX(-50%);
    overflow: visible;
    filter:
      drop-shadow(0 0 5px #00e5ff)
      drop-shadow(0 3px 4px rgba(0,0,0,.65));
    pointer-events: none;
  }

  .dmw .dmw-hub {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 50%;
    width: 23%;
    aspect-ratio: 1;
    padding: 5px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: conic-gradient(
      #00eaff, #fbff47, #00eaff, #6437ff, #ff27ed, #00eaff
    );
    box-shadow: 0 0 16px rgba(0,229,255,.8);
    pointer-events: none;
  }

  .dmw .dmw-hub-inner {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    border: 2px solid #86f5ff;
    background: radial-gradient(circle at 35% 25%, #122842, #020812 75%);
    box-shadow: inset 0 0 12px rgba(0,229,255,.45);
  }

  .dmw .dmw-center-image {
    width: var(--center-image-size);
    height: var(--center-image-size);
    object-fit: contain; /* Change to cover for a cropped photo. */
    display: block;
  }

  .dmw .dmw-center-fallback {
    font-size: clamp(13px, 3.3vw, 24px);
    font-weight: 800;
    letter-spacing: .06em;
    color: white;
    text-shadow: 0 0 10px rgba(255,255,255,.55);
  }

  /* =========================================================
     4. SPIN BUTTON
     ========================================================= */
  .dmw .dmw-spin {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;

    width: min(100%, var(--button-width));
    min-height: 66px;
    margin: 0 auto;
    padding: 15px 22px;

    border: 3px solid transparent;
    border-radius: 999px;
    background:
      linear-gradient(#071326, #030914) padding-box,
      linear-gradient(100deg, var(--pink), var(--blue), var(--cyan)) border-box;

    color: white;
    font-family: inherit;
    font-size: clamp(16px, 2.4vw, 22px);
    font-weight: 700;
    letter-spacing: .15em;
    line-height: 1.3;
    text-transform: uppercase;
    text-shadow: 0 0 10px #4296ff;
    box-shadow:
      -6px 0 22px rgba(255,37,237,.25),
      6px 0 22px rgba(0,229,255,.3),
      inset 0 0 16px rgba(0,229,255,.16);

    cursor: pointer;
    transition: filter .2s, box-shadow .2s;
  }

  .dmw .dmw-spin:hover:not(:disabled) {
    filter: brightness(1.2);
    box-shadow:
      -6px 0 30px rgba(255,37,237,.45),
      6px 0 30px rgba(0,229,255,.5);
  }

  .dmw .dmw-spin:focus-visible {
    outline: 3px solid white;
    outline-offset: 6px;
  }

  .dmw .dmw-spin:disabled {
    cursor: wait;
    opacity: .78;
  }

  .dmw .dmw-spin-icon {
    font-size: 31px;
    line-height: 1;
  }

  /* =========================================================
     6. COLOR LEGEND
     Automatically generated from CONFIG below.
     ========================================================= */
  .dmw .dmw-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px 16px;
    list-style: none;
    margin: 38px 0 0;
    padding: 0;
  }

  .dmw .dmw-legend-item {
    width: 64px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .dmw .dmw-swatch {
    display: block;
    width: 45px;
    height: 45px;
    margin: 0 auto 10px;
    border: 2px solid rgba(255,255,255,.9);
    border-radius: 50%;
    background: var(--swatch-color);
    box-shadow:
      0 0 13px var(--swatch-glow),
      inset 0 0 9px rgba(255,255,255,.18);
  }

  .dmw .dmw-legend-label {
    display: block;
    color: #f4f6ff;
    font-size: 10px;
    line-height: 1.4;
    letter-spacing: .12em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
  }

  .dmw .dmw-legend-item.is-selected .dmw-swatch {
    outline: 2px solid white;
    outline-offset: 5px;
  }

  /* =========================================================
     7. MOBILE ADJUSTMENTS
     ========================================================= */
  @media (max-width: 480px) {
    .dmw {
      padding-right: 16px;
      padding-left: 16px;
    }

    .dmw .dmw-rim {
      padding: 8px;
    }

    .dmw .dmw-disc {
      border-width: 3px;
    }

    .dmw .dmw-wheel-wrap {
      margin-top: 33px;
    }

    .dmw .dmw-hub {
      padding: 3px;
    }



    .dmw .dmw-legend {
      gap: 19px 10px;
    }

    .dmw .dmw-legend-item {
      width: 57px;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .dmw .dmw-spin {
      transition: none;
    }
  }

  /* ===== TABLET ===== */
  @media (max-width: 1024px) {
    .dmw .dmw-brand { min-height: 70px; margin-bottom: 14px; }
    .dmw .dmw-top-logo { max-height: 110px; }
    .dmw .dmw-wheel-wrap { margin: 30px auto 24px; }
    .dmw .dmw-legend { margin-top: 28px; }
  }

  /* ===== PHONE ===== */
  @media (max-width: 600px) {
    .dmw .dmw-brand { min-height: 56px; margin-bottom: 10px; }
    .dmw .dmw-top-logo { max-height: 80px; }
    .dmw .dmw-wheel-wrap { margin: 28px auto 20px; }
    .dmw .dmw-spin { min-height: 56px; padding: 12px 16px; gap: 10px; letter-spacing: .1em; }
    .dmw .dmw-spin-icon { font-size: 24px; }
    .dmw .dmw-legend-label { font-size: 9px; letter-spacing: .08em; }
    .dmw .dmw-swatch { width: 38px; height: 38px; }
  }

  /* ===== SHORT LANDSCAPE (phones/tablets sideways) ===== */
  @media (max-height: 520px) and (orientation: landscape) {
    .dmw .dmw-wheel-wrap { width: min(100%, var(--wheel-size), 70vh); width: min(100%, var(--wheel-size), 70svh); }
  }

  /* Editor preview is not interactive */
  .editor-styles-wrapper .dmw .dmw-spin { pointer-events: none; }

  /* =========================================================
     SMARTWATCH-STYLE RESULT TAKEOVER
     ========================================================= */
  .dmw .dmw-wheel-wrap { --win: #d879ff; --win-text: #ffffff; --win-edge: #000000; }

  .dmw .dmw-takeover {
    position: absolute;
    z-index: 6;
    inset: 12px;
    border-radius: 50%;
    overflow: hidden;
    container-type: inline-size;
    background:
      radial-gradient(circle at 50% 35%, var(--win) 0%, var(--win) 58%, var(--win-edge) 100%);
    color: var(--win-text);
    clip-path: circle(0% at 50% 50%);
    transition: clip-path .7s cubic-bezier(.2,.8,.2,1);
    display: grid;
    place-items: center;
    outline: none;
  }
  .dmw .dmw-takeover[hidden] { display: none !important; }
  .dmw .dmw-takeover.is-open { clip-path: circle(75% at 50% 50%); }

  .dmw .dmw-takeover-inner {
    position: relative;
    width: 78%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.2cqw;
    text-align: center;
    opacity: 0;
    transform: translateY(14px) scale(.96);
    transition: opacity .45s ease .35s, transform .45s ease .35s;
  }
  .dmw .dmw-takeover.is-open .dmw-takeover-inner { opacity: 1; transform: none; }

  .dmw .dmw-takeover-label {
    font-size: clamp(9px, 3.4cqw, 15px);
    letter-spacing: .26em;
    opacity: .8;
    text-transform: uppercase;
  }
  .dmw .dmw-takeover-name {
    font-size: clamp(18px, 9cqw, 44px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: .08em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
  }
  .dmw .dmw-takeover-mood {
    margin: 0;
    font-size: clamp(11px, 4.4cqw, 19px);
    line-height: 1.4;
    max-width: 24ch;
  }
  .dmw .dmw-takeover-link,
  .dmw .dmw-takeover-close {
    appearance: none;
    margin-top: 1.5cqw;
    padding: .55em 1.3em;
    border: 2px solid currentColor;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: clamp(10px, 3.6cqw, 15px);
    font-weight: 700;
    letter-spacing: .08em;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
  }
  .dmw .dmw-takeover-link[hidden],
  .dmw .dmw-takeover-close[hidden] { display: none !important; }
  .dmw .dmw-takeover-link:focus-visible,
  .dmw .dmw-takeover-close:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

  /* Countdown ring around the edge (like a watch timer). */
  .dmw .dmw-ring {
    position: absolute;
    left: 50%; top: 50%;
    width: 128%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%) rotate(-90deg);
    pointer-events: none;
    overflow: visible;
  }
  .dmw .dmw-ring circle { fill: none; stroke-width: 1.6; }
  .dmw .dmw-ring-track { stroke: currentColor; opacity: .22; }
  .dmw .dmw-ring-bar {
    stroke: currentColor;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
  }
  .dmw .dmw-takeover.is-counting .dmw-ring-bar {
    animation: dmw-countdown var(--count-ms, 4000ms) linear forwards;
  }
  @keyframes dmw-countdown { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }

  @media (max-width: 480px) {
    .dmw .dmw-takeover { inset: 8px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .dmw .dmw-takeover { transition: none; }
    .dmw .dmw-takeover-inner { transition: none; }
  }

  /* =========================================================
     SQUIRCLE OUTER GLOW (superellipse, between square and circle)
     ========================================================= */
  .dmw .dmw-squircle {
    position: absolute;
    z-index: 0;
    inset: -5%;
    width: 110%;
    height: 110%;
    overflow: visible;
    pointer-events: none;
    color: var(--win);
  }
  .dmw .dmw-rim { z-index: 1; }
  .dmw .dmw-sq-rainbow { opacity: 1; transition: opacity .6s ease; }
  .dmw .dmw-sq-win { opacity: 0; transition: opacity .6s ease; }
  .dmw .dmw-wheel-wrap.has-result .dmw-sq-rainbow { opacity: 0; }
  .dmw .dmw-wheel-wrap.has-result .dmw-sq-win { opacity: 1; }
  .dmw .dmw-squircle { animation: dmw-glow 3.2s ease-in-out infinite; }
  @keyframes dmw-glow { 0%,100% { opacity: .78; } 50% { opacity: 1; } }

  /* leave room so the squircle isn't clipped by the section edge */
  .dmw .dmw-wheel-wrap { width: min(calc((100% - 4px) / 1.1), var(--wheel-size), max(260px, calc(100vh - 200px))); }
  @supports (height: 100svh) {
    .dmw .dmw-wheel-wrap { width: min(calc((100% - 4px) / 1.1), var(--wheel-size), max(260px, calc(100svh - 200px))); }
  }
  @media (prefers-reduced-motion: reduce) {
    .dmw .dmw-squircle { animation: none; }
    .dmw .dmw-sq-rainbow, .dmw .dmw-sq-win { transition: none; }
  }

  /* Screen-reader-only live status (the visible result lives on the wheel). */
  .dmw .dmw-sr {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  /* =========================================================
     DESKTOP: TWO SIDE-BY-SIDE SECTIONS
     Left = logo, heading, spin button, legend. Right = wheel.
     Spacing, type and the wheel all scale with the screen height,
     so the whole block fits on screen without scrolling.
     ========================================================= */
  @media (min-width: 900px) {
    .dmw {
      --pad-y: clamp(16px, 3.5vh, 44px);
      --pad-y: clamp(16px, 3.5svh, 44px);
      padding-top: var(--pad-y);
      padding-bottom: var(--pad-y);
    }

    .dmw .dmw-inner {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
      grid-template-rows: 1fr repeat(5, auto) 1fr;
      column-gap: clamp(28px, 5vw, 84px);
      align-items: center;
    }

    /* Left section, vertically centered against the wheel. */
    .dmw .dmw-brand { grid-column: 1; grid-row: 2; min-height: 0; margin: 0 0 clamp(8px, 1.8vh, 18px); margin-bottom: clamp(8px, 1.8svh, 18px); }
    .dmw .dmw-top-logo { max-height: clamp(48px, 11vh, 110px); max-height: clamp(48px, 11svh, 110px); }
    .dmw .dmw-brand-fallback { font-size: clamp(26px, 5vh, 48px); font-size: clamp(26px, 5svh, 48px); }

    .dmw .dmw-heading { grid-column: 1; grid-row: 3; font-size: clamp(16px, 2.9vh, 27px); font-size: clamp(16px, 2.9svh, 27px); line-height: 1.4; }
    .dmw .dmw-subheading { grid-column: 1; grid-row: 4; margin-top: clamp(4px, 1vh, 10px); font-size: clamp(13px, 2.2vh, 18px); font-size: clamp(13px, 2.2svh, 18px); }

    .dmw .dmw-spin {
      grid-column: 1; grid-row: 5;
      margin: clamp(14px, 3vh, 30px) auto 0;
      margin-top: clamp(14px, 3svh, 30px);
      min-height: clamp(50px, 8vh, 66px);
      min-height: clamp(50px, 8svh, 66px);
    }

    .dmw .dmw-legend { grid-column: 1; grid-row: 6; margin: clamp(14px, 3vh, 30px) 0 0; margin-top: clamp(14px, 3svh, 30px); gap: clamp(8px, 1.6vh, 14px) 6px; gap: clamp(8px, 1.6svh, 14px) 6px; }
    .dmw .dmw-legend-item { width: 76px; }
    .dmw .dmw-swatch { width: clamp(28px, 4.6vh, 38px); height: clamp(28px, 4.6vh, 38px); width: clamp(28px, 4.6svh, 38px); height: clamp(28px, 4.6svh, 38px); margin-bottom: 6px; }
    .dmw .dmw-legend-label { font-size: 9px; letter-spacing: .05em; }

    /* Right section: wheel scales with the column AND the screen height. */
    .dmw .dmw-wheel-wrap {
      grid-column: 2;
      grid-row: 1 / -1;
      --wheel-w: min(calc(100% / var(--ring)), var(--wheel-size), max(280px, calc((100vh - 2 * var(--pad-y) - 16px) / var(--ring))));
      width: var(--wheel-w);
      /* room for the ring above and below, so it never clips at the section edge */
      margin: calc(var(--wheel-w) * (var(--ring) - 1) / 2) auto;
    }
    @supports (height: 100svh) {
      .dmw .dmw-wheel-wrap {
        --wheel-w: min(calc(100% / var(--ring)), var(--wheel-size), max(280px, calc((100svh - 2 * var(--pad-y) - 16px) / var(--ring))));
      }
    }
  }

  /* Large desktop screens: let the wheel grow a little. */
  @media (min-width: 1500px) {
    .dmw { --wheel-size: 640px; }
  }

  /* =========================================================
     COLOR RING (SQUIRCLE) SIZE
     One variable drives both the ring and the wheel width, so the ring
     is never clipped and always leaves room around it.
     ========================================================= */
  .dmw { --ring: 1.1; scroll-margin-top: 12px; }
  .dmw .dmw-squircle {
    inset: calc((1 - var(--ring)) / 2 * 100%);
    width: calc(var(--ring) * 100%);
    height: calc(var(--ring) * 100%);
  }

  /* Tablet + phone: ring hugs the wheel, with real breathing room above and below it. */
  @media (max-width: 899px) {
    .dmw { --ring: 1.07; }
    .dmw .dmw-wheel-wrap {
      width: min(calc((100% - 4px) / var(--ring)), var(--wheel-size), max(260px, calc(100vh - 200px)));
      width: min(calc((100% - 4px) / var(--ring)), var(--wheel-size), max(260px, calc(100svh - 200px)));
      margin-top: clamp(34px, 7vw, 46px);
      margin-bottom: clamp(38px, 8vw, 54px);
    }
  }

  .dmw .dmw-subheading { scroll-margin-top: 16px; }
