:root {
  --rw-ink: #17322d;
  --rw-muted: #596662;
  --rw-cream: #fffaf1;
  --rw-sand: #efe1ca;
  --rw-green: #2f6f5f;
  --rw-green-dark: #24584c;
  --rw-gold: #dfa83a;
  --rw-coral: #d87355;
  --rw-blue: #5f8994;
  --rw-shadow: 0 24px 80px rgba(20, 44, 38, 0.28);
}

.rw-launcher[hidden],
.rw-overlay[hidden],
.rw-result[hidden],
.rw-email-step[hidden],
.rw-success[hidden] {
  display: none !important;
}

.rw-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999980;
  animation: rw-rise 0.45s ease both;
}

.rw-launcher__button {
  appearance: none;
  display: flex;
  align-items: center;
  max-width: min(360px, calc(100vw - 32px));
  min-height: 52px;
  padding: 13px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--rw-green);
  color: #fff;
  box-shadow: 0 10px 30px rgba(32, 81, 68, 0.32);
  font: 700 15px/1.25 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.rw-launcher__button:hover {
  background: var(--rw-green-dark);
  box-shadow: 0 14px 34px rgba(32, 81, 68, 0.4);
  transform: translateY(-2px);
}

.rw-launcher__button:focus-visible,
.rw-close:focus-visible,
.rw-spin:focus-visible,
.rw-submit:focus-visible,
.rw-form input:focus-visible,
.rw-consent input:focus-visible {
  outline: 3px solid #f3bd4d;
  outline-offset: 3px;
}

.rw-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(10, 28, 24, 0.64);
  backdrop-filter: blur(5px);
  animation: rw-fade 0.2s ease both;
}

.rw-modal {
  position: relative;
  width: min(1120px, 100%);
  height: min(760px, calc(100vh - 24px));
  height: min(760px, calc(100dvh - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  background: var(--rw-cream);
  box-shadow: var(--rw-shadow);
  color: var(--rw-ink);
  animation: rw-pop 0.28s ease both;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  scrollbar-width: thin;
}

.rw-close {
  appearance: none;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: grid !important;
  box-sizing: border-box !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  aspect-ratio: 1 / 1;
  flex: 0 0 44px;
  place-items: center;
  padding: 0 0 3px !important;
  border: 1px solid rgba(23, 50, 45, 0.12);
  border-radius: 999px !important;
  background: #fff !important;
  color: var(--rw-ink);
  font: 400 30px/1 system-ui, sans-serif;
  cursor: pointer;
}

.rw-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.02fr) minmax(390px, 0.98fr);
  height: 100%;
  min-height: 0;
}

.rw-wheel-panel {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 32px 26px;
  overflow: hidden;
  border-radius: 24px 0 0 24px;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.42) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 77%, rgba(255, 255, 255, 0.28) 0 3px, transparent 4px),
    linear-gradient(145deg, #e7edf0 0%, #cfdee3 50%, #b9ced5 100%);
  background-size: 36px 36px, 52px 52px, auto;
}

.rw-wheel-wrap {
  position: relative;
  width: min(420px, 100%, calc(100vh - 92px));
  width: min(420px, 100%, calc(100dvh - 92px));
  aspect-ratio: 1;
  filter: drop-shadow(0 18px 24px rgba(33, 63, 55, 0.2));
}

.rw-wheel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 10px solid #fff9ee;
  border-radius: 50%;
  background: conic-gradient(
    from -30deg,
    #b86f59 0deg 60deg,
    #d8a32f 60deg 120deg,
    #cd6d52 120deg 180deg,
    #628797 180deg 240deg,
    #8b6f8d 240deg 300deg,
    #b68560 300deg 360deg
  );
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.38),
    0 0 0 2px rgba(23, 50, 45, 0.12);
  transition: transform 4.2s cubic-bezier(0.14, 0.72, 0.12, 1);
  will-change: transform;
}

.rw-wheel::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 35%;
  aspect-ratio: 1;
  border: 7px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: var(--rw-cream);
  box-shadow: 0 7px 18px rgba(30, 59, 52, 0.18);
  transform: translate(-50%, -50%);
}

.rw-wheel__photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  clip-path: polygon(50% 50%, 25% 6.7%, 37.1% 1.7%, 50% 0, 62.9% 1.7%, 75% 6.7%);
  opacity: 0.42;
  pointer-events: none;
  transform-origin: 50% 50%;
}

.rw-wheel__photo::before {
  content: "";
  position: absolute;
  inset: -28%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: saturate(0.82) contrast(1.08);
  transform-origin: 50% 50%;
}

.rw-wheel__photo--0 { transform: rotate(0deg); }
.rw-wheel__photo--1 { transform: rotate(60deg); }
.rw-wheel__photo--2 { transform: rotate(120deg); }
.rw-wheel__photo--3 { transform: rotate(180deg); }
.rw-wheel__photo--4 { transform: rotate(240deg); }
.rw-wheel__photo--5 { transform: rotate(300deg); }

.rw-wheel__photo--0::before { background-image: url("wheel/entry.jpg"); transform: rotate(0deg); }
.rw-wheel__photo--1::before { background-image: url("wheel/living.jpg"); transform: rotate(-60deg); }
.rw-wheel__photo--2::before { background-image: url("wheel/kitchen.jpg"); transform: rotate(-120deg); }
.rw-wheel__photo--3::before { background-image: url("wheel/bedroom.jpg"); transform: rotate(-180deg); }
.rw-wheel__photo--4::before { background-image: url("wheel/bathroom.jpg"); transform: rotate(-240deg); }
.rw-wheel__photo--5::before { background-image: url("wheel/outdoor.jpg"); transform: rotate(-300deg); }

.rw-pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  z-index: 4;
  width: 0;
  height: 0;
  border-right: 20px solid transparent;
  border-left: 20px solid transparent;
  border-top: 38px solid var(--rw-ink);
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.18));
  transform: translateX(-50%);
}

.rw-wheel__label {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: flex;
  width: 25%;
  max-width: 112px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 2px;
  color: #fff;
  font: 850 14px/1.06 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  overflow-wrap: break-word;
  white-space: normal;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%);
}

.rw-wheel__label--0 { top: 12.5%; left: 50%; }
.rw-wheel__label--1 { top: 31.25%; left: 82.48%; }
.rw-wheel__label--2 { top: 68.75%; left: 82.48%; }
.rw-wheel__label--3 { top: 87.5%; left: 50%; }
.rw-wheel__label--4 { top: 68.75%; left: 17.52%; }
.rw-wheel__label--5 { top: 31.25%; left: 17.52%; }

.rw-wheel__label--4 {
  flex-direction: column;
}

.rw-wheel__label--4 > span {
  display: block;
  white-space: nowrap;
}

.rw-spin {
  appearance: none;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: flex;
  width: 112px;
  height: 112px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 8px;
  border: 5px solid #fffaf1;
  border-radius: 50%;
  background: var(--rw-green);
  color: #fff;
  box-shadow: 0 0 0 5px var(--rw-gold), 0 10px 24px rgba(30, 59, 52, 0.32);
  font: 900 12px/1.05 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.rw-spin:hover {
  background: var(--rw-green-dark);
  color: #fff;
  box-shadow: 0 0 0 7px var(--rw-gold), 0 14px 28px rgba(30, 59, 52, 0.4);
  transform: translate(-50%, -50%) scale(1.045);
}

.rw-spin:disabled {
  cursor: default;
  opacity: 1;
}

.rw-spin__icon {
  font-size: 25px;
  line-height: 1;
}

.rw-spin__label {
  max-width: 90px;
  font-size: 11px;
}

.rw-spin__hint {
  margin-top: 2px;
  color: #dcebe5;
  font: 700 8px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.1em;
}

.rw-spin.is-spinning .rw-spin__icon {
  animation: rw-icon-spin 0.7s linear infinite;
}

.rw-spin.is-complete {
  background: var(--rw-green-dark);
  box-shadow: 0 0 0 5px #dcebe5, 0 8px 20px rgba(30, 59, 52, 0.25);
}

.rw-spin.is-complete .rw-spin__hint {
  display: none;
}

.rw-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 42px 44px 38px;
  overflow: hidden;
}

.rw-eyebrow,
.rw-result__overline {
  margin: 0 0 10px;
  color: var(--rw-green);
  font: 800 12px/1.3 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.rw-content h2 {
  margin: 0;
  color: var(--rw-ink);
  font: 800 clamp(29px, 3.2vw, 43px)/1.03 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.035em;
}

.rw-subtitle {
  margin: 18px 0 0;
  color: var(--rw-muted);
  font: 400 17px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rw-free {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  color: var(--rw-green-dark);
  font: 700 13px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rw-free span {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  background: #dcecdf;
}

.rw-modal.rw-has-result .rw-content {
  justify-content: center;
  padding-top: 28px;
  padding-bottom: 28px;
}

.rw-modal.rw-has-result .rw-eyebrow,
.rw-modal.rw-has-result .rw-content > h2,
.rw-modal.rw-has-result .rw-subtitle,
.rw-modal.rw-has-result .rw-free {
  display: none;
}

.rw-modal.rw-has-result .rw-result {
  margin-top: 0;
  padding: 15px 18px;
}

.rw-modal.rw-has-result .rw-email-step {
  margin-top: 14px;
}

.rw-modal.rw-has-result .rw-offer__copy h3 {
  margin-bottom: 3px;
  font-size: 19px;
}

.rw-modal.rw-has-result .rw-offer__copy p {
  margin-bottom: 9px;
}

.rw-modal.rw-has-result .rw-form input[type="email"] {
  height: 44px;
}

.rw-modal.rw-has-result .rw-consent {
  margin: 10px 0;
  font-size: 10px;
  line-height: 1.35;
}

.rw-modal.rw-has-result .rw-submit {
  min-height: 45px;
}

.rw-result {
  margin-top: 24px;
  padding: 18px 20px;
  border-left: 4px solid var(--rw-gold);
  border-radius: 4px 12px 12px 4px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(42, 64, 58, 0.08);
  animation: rw-rise 0.35s ease both;
}

.rw-result__overline {
  margin-bottom: 5px;
  font-size: 10px;
}

.rw-result h3 {
  margin: 0 0 6px;
  color: var(--rw-ink);
  font: 800 22px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rw-result p:last-child {
  margin: 0;
  color: #44524f;
  font: 400 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rw-email-step {
  margin-top: 22px;
  animation: rw-rise 0.42s 0.08s ease both;
}

.rw-offer {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 15px;
  align-items: center;
  margin-bottom: 11px;
}

.rw-offer__mockup {
  display: block;
  width: 112px;
  height: auto;
  filter: drop-shadow(0 10px 13px rgba(22, 48, 42, 0.2));
}

.rw-offer__badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--rw-gold);
  color: var(--rw-ink);
  font: 850 9px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
}

.rw-offer__copy h3 {
  margin: 0 0 5px;
  color: var(--rw-ink);
  font: 800 20px/1.25 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rw-offer__copy p {
  margin: 0 0 13px;
  color: var(--rw-muted);
  font: 400 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rw-field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--rw-ink);
  font: 700 13px/1.3 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rw-email-highlight {
  margin-top: 2px;
  padding: 9px 10px 10px;
  border: 3px solid #f1c232;
  border-radius: 12px;
  background: #fff9d9;
  box-shadow: 0 0 0 3px rgba(241, 194, 50, 0.18), 0 5px 14px rgba(96, 70, 0, 0.08);
}

.rw-form input[type="email"] {
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #b8c3bf;
  border-radius: 9px;
  background: #fff;
  color: var(--rw-ink);
  font: 400 16px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rw-form input[type="email"]:focus {
  border-color: var(--rw-green);
  box-shadow: 0 0 0 3px rgba(47, 111, 95, 0.12);
  outline: 0;
}

.rw-consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  align-items: start;
  margin: 13px 0;
  color: #5b6663;
  font: 400 11px/1.42 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}

.rw-consent input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--rw-green);
}

.rw-consent a {
  color: var(--rw-green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rw-submit {
  appearance: none;
  display: flex;
  width: 100%;
  min-height: 49px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 18px;
  border: 0;
  border-radius: 9px;
  background: var(--rw-green);
  color: #fff;
  font: 800 15px/1.25 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.rw-submit::before {
  content: "👉";
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1;
}

.rw-submit:hover {
  background: var(--rw-green-dark);
  transform: translateY(-1px);
}

.rw-submit:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.rw-form-message {
  min-height: 18px;
  margin: 8px 0 0;
  color: #a8372d;
  font: 600 12px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rw-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.rw-success {
  margin-top: 25px;
  padding: 20px;
  border-radius: 12px;
  background: #dfeee5;
  color: var(--rw-green-dark);
  text-align: center;
  animation: rw-rise 0.35s ease both;
}

.rw-success__icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin: 0 auto 9px;
  place-items: center;
  border-radius: 50%;
  background: var(--rw-green);
  color: #fff;
  font-size: 22px;
}

.rw-success p {
  margin: 0;
  font: 700 14px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.rw-modal-open {
  overflow: hidden;
}

@keyframes rw-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rw-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rw-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rw-icon-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 860px) {
  .rw-overlay {
    align-items: end;
    padding: 12px;
  }

  .rw-modal {
    width: 100%;
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 20px;
  }

  .rw-layout {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .rw-wheel-panel {
    min-height: 0;
    flex: 0 0 300px;
    padding: 36px 28px 24px;
    border-radius: 20px 20px 0 0;
  }

  .rw-wheel-wrap {
    width: min(270px, 76vw, calc(100dvh - 360px));
    min-width: 220px;
  }

  .rw-wheel__label {
    width: 25%;
    max-width: 78px;
    min-height: 30px;
    font-size: 10px;
  }

  .rw-spin {
    width: 92px;
    height: 92px;
    border-width: 4px;
  }

  .rw-content {
    flex: 1 1 auto;
    justify-content: flex-start;
    padding: 24px 24px 28px;
  }

  .rw-content h2 {
    font-size: 26px;
  }

  .rw-subtitle {
    margin-top: 10px;
    font-size: 14px;
  }

  .rw-free {
    margin-top: 12px;
    font-size: 11px;
  }

  .rw-modal.rw-has-result .rw-wheel-panel {
    display: none;
  }

  .rw-modal.rw-has-result .rw-content {
    justify-content: center;
    padding: 24px;
  }

  .rw-offer {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 11px;
  }

  .rw-offer__mockup {
    width: 82px;
  }

  .rw-offer__copy h3 {
    font-size: 17px;
  }

  .rw-offer__copy p {
    font-size: 12px;
    line-height: 1.35;
  }

  .rw-launcher {
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: flex;
    justify-content: flex-end;
  }

  .rw-launcher__button {
    max-width: 100%;
    min-height: 48px;
    padding: 11px 16px;
    font-size: 13px;
  }
}

@media (max-width: 390px) {
  .rw-wheel-panel {
    flex-basis: 270px;
    padding: 34px 24px 20px;
  }

  .rw-wheel-wrap {
    width: min(230px, 74vw);
    min-width: 205px;
  }

  .rw-wheel__label {
    width: 25%;
    max-width: 70px;
    font-size: 9px;
  }

  .rw-spin {
    width: 82px;
    height: 82px;
  }

  .rw-spin__icon {
    font-size: 20px;
  }

  .rw-spin__label {
    font-size: 9px;
  }

  .rw-spin__hint {
    font-size: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rw-launcher,
  .rw-overlay,
  .rw-modal,
  .rw-result,
  .rw-email-step,
  .rw-success {
    animation: none !important;
  }

  .rw-wheel {
    transition-duration: 0.8s;
  }
}
