/* Fonts (Outfit, DM Sans) are loaded once by the platform's variables.css;
   this file only declares the tool-local variables it needs. */
:root {
  --rwp-focus: #ff5f29;
  --rwp-focus-glow: rgba(255, 95, 41, 0.22);
  --rwp-secondary: #00a86b;
  --rwp-secondary-light: #e6f7f0;
  --rwp-primary: #4f46e5;
  --rwp-primary-dark: #3730a3;
  --rwp-primary-light: #eef2ff;
  --rwp-danger: #e74c3c;
  --rwp-bg: #f0f2f8;
  --rwp-bg2: #e8eaf2;
  --rwp-white: #ffffff;
  --rwp-text: #1a1c23;
  --rwp-text-muted: #6b7280;
  --rwp-border: #dde0ea;
  --rwp-radius: 10px;
  --rwp-spacing: 1.5rem;
  --rwp-gap: 0.6rem;
  --rwp-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --rwp-shadow-md: 0 8px 32px rgba(0, 0, 0, 0.09);
  --rwp-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.14);
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

/* ---- Scoped reset ----
   Namespaced to .rwp-root so this tool's font-family choice never leaks
   into the surrounding platform chrome (header/footer keep their own
   fonts from the platform stylesheet). */
.rwp-root,
.rwp-root *,
.rwp-root *::before,
.rwp-root *::after {
  box-sizing: border-box;
}

.rwp-root {
  font-family: var(--font-body);
  color: var(--rwp-text);
}

/* =============================================
   MAIN LAYOUT
   (no .rwp-header / .rwp-body — the platform's own
   <header> and page title provide that role now)
   ============================================= */
.rwp-main {
  max-width: 1200px;
  margin: 1rem auto;
}

.rwp-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--rwp-gap);
  align-items: start;
}

/* =============================================
   CARDS
   ============================================= */
.rwp-card {
  background: var(--rwp-white);
  border: 1px solid var(--rwp-border);
  border-radius: var(--rwp-radius);
  box-shadow: var(--rwp-shadow-md);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.rwp-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--rwp-spacing);
  border-bottom: 1px solid var(--rwp-border);
  background: linear-gradient(to right, rgba(79, 70, 229, 0.03), transparent);
}

.rwp-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.rwp-badge {
  min-width: 2.25rem;
  height: 2rem;
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-display);
  background: var(--rwp-primary-light);
  color: var(--rwp-primary);
  transition: all 0.2s ease;
}

/* =============================================
   WHEEL SECTION
   ============================================= */
.rwp-card--wheel {
  padding-bottom: 0.75rem;
}

.rwp-wheelWrap {
  display: grid;
  gap: 0.85rem;
  padding: var(--rwp-spacing);
}

.rwp-wheelCanvasWrap {
  position: relative;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 0.5rem;
}

/* Idle floating animation for canvas wrap */
.rwp-wheelCanvasWrap::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse,
    rgba(79, 70, 229, 0.08) 0%,
    transparent 70%
  );
  animation: rwp-glow-idle 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes rwp-glow-idle {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.97);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

#rwp-wheelCanvas {
  width: clamp(300px, 88vw, 520px);
  height: auto;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow:
    0 0 0 6px rgba(79, 70, 229, 0.08),
    0 0 0 12px rgba(79, 70, 229, 0.04),
    0 20px 60px rgba(79, 70, 229, 0.15);
  transition: box-shadow 0.3s ease;
  animation: rwp-wheel-idle 6s ease-in-out infinite;
}

@keyframes rwp-wheel-idle {
  0%,
  100% {
    box-shadow:
      0 0 0 6px rgba(79, 70, 229, 0.08),
      0 0 0 12px rgba(79, 70, 229, 0.04),
      0 20px 60px rgba(79, 70, 229, 0.15);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(79, 70, 229, 0.12),
      0 0 0 16px rgba(79, 70, 229, 0.06),
      0 28px 80px rgba(79, 70, 229, 0.2);
  }
}

/* =============================================
   CENTER SPIN BUTTON (overlaid on canvas)
   ============================================= */
.rwp-center-btn-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none; /* let clicks pass through to canvas areas outside btn */
}

.rwp-centerSpinBtn {
  position: relative;
  pointer-events: all;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(
    135deg,
    var(--rwp-primary) 0%,
    var(--rwp-focus) 100%
  );
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.9),
    0 0 0 6px rgba(79, 70, 229, 0.3),
    0 8px 24px rgba(79, 70, 229, 0.4);
  transition:
    transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease,
    background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.rwp-centerSpinBtn:hover:not(:disabled) {
  transform: scale(1.12);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.9),
    0 0 0 8px rgba(79, 70, 229, 0.4),
    0 12px 36px rgba(79, 70, 229, 0.5);
}

.rwp-centerSpinBtn:active:not(:disabled) {
  transform: scale(0.95);
  transition-duration: 0.08s;
}

.rwp-centerSpinBtn:focus-visible {
  outline: 3px solid var(--rwp-focus);
  outline-offset: 6px;
}

.rwp-centerSpinBtn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Animated pulse ring */
.rwp-centerSpinBtn__pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(79, 70, 229, 0.4);
  animation: rwp-btn-pulse 2.5s ease-out infinite;
  pointer-events: none;
}

@keyframes rwp-btn-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.65);
    opacity: 0;
  }
}

.rwp-centerSpinBtn__ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.rwp-centerSpinBtn__label {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Spinning state for the button */
.rwp-centerSpinBtn--spinning {
  animation: rwp-btn-spin-glow 0.8s ease-in-out infinite alternate;
}

@keyframes rwp-btn-spin-glow {
  from {
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, 0.9),
      0 0 0 6px rgba(79, 70, 229, 0.3),
      0 8px 24px rgba(79, 70, 229, 0.4);
  }
  to {
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, 0.9),
      0 0 0 10px rgba(255, 95, 41, 0.4),
      0 12px 40px rgba(255, 95, 41, 0.5);
  }
}

/* =============================================
   POINTER — top center of wheel
   ============================================= */
.rwp-pointer {
  position: absolute;
  top: calc(0.5rem + 2px); /* aligned with canvas padding-top */
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rwp-pointer__arrow {
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 26px solid var(--rwp-focus);
  filter: drop-shadow(0 4px 12px rgba(255, 95, 41, 0.5));
  animation: rwp-pointer-bob 2s ease-in-out infinite;
}

@keyframes rwp-pointer-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* =============================================
   WHEEL CONTROLS
   ============================================= */
.rwp-wheelControls {
  display: grid;
  gap: 0.75rem;
}

.rwp-inlineNote {
  min-height: 1.2rem;
  font-size: 0.88rem;
  color: var(--rwp-text-muted);
  text-align: center;
}

.rwp-pillRow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--rwp-border);
  border-radius: var(--rwp-radius);
  background: linear-gradient(
    135deg,
    rgba(79, 70, 229, 0.04) 0%,
    rgba(0, 168, 107, 0.03) 100%
  );
}

.rwp-pillRow[hidden] {
  display: none;
}

.rwp-field {
  display: grid;
  gap: 0.3rem;
}
.rwp-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rwp-text-muted);
  letter-spacing: 0.02em;
}
.rwp-label--inline {
  margin-right: 0.35rem;
}

/* =============================================
   FORM ELEMENTS
   ============================================= */
.rwp-select,
.rwp-input,
.rwp-textarea {
  width: 100%;
  border: 1.5px solid var(--rwp-border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font-size: 0.93rem;
  font-family: var(--font-body);
  outline: none;
  background: #fff;
  color: var(--rwp-text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.rwp-input--small {
  padding: 0.5rem 0.65rem;
  width: 7rem;
}

.rwp-textarea {
  resize: vertical;
  line-height: 1.5;
  min-height: 200px;
}

.rwp-textarea:focus,
.rwp-select:focus,
.rwp-input:focus {
  border-color: var(--rwp-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* =============================================
   QUICK ADD
   ============================================= */
.rwp-quickAdd {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
  margin: 0 var(--rwp-spacing);
  padding: 0.85rem 1rem;
  background: linear-gradient(
    135deg,
    rgba(79, 70, 229, 0.04) 0%,
    rgba(0, 168, 107, 0.03) 100%
  );
  border: 1.5px solid rgba(79, 70, 229, 0.15);
  border-radius: 14px;
}

.rwp-quickAdd__input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--rwp-border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.93rem;
  font-family: var(--font-body);
  outline: none;
  background: #fff;
  color: var(--rwp-text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.rwp-quickAdd__input:focus {
  border-color: var(--rwp-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.rwp-quickAdd__input::placeholder {
  color: #aaa;
}

.rwp-quickAdd__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    var(--rwp-primary) 0%,
    var(--rwp-primary-dark) 100%
  );
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.15s ease,
    opacity 0.15s ease;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
  -webkit-tap-highlight-color: transparent;
}

.rwp-quickAdd__btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.rwp-quickAdd__btn:not(:disabled):active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.07s;
}

.rwp-quickAdd__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.rwp-quickAdd__btn:focus-visible {
  outline: 3px solid var(--rwp-focus);
  outline-offset: 3px;
}

.rwp-quickAdd__plus {
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 900;
}

/* =============================================
   EDITOR CARD
   ============================================= */
.rwp-card--editor {
  display: grid;
  gap: 0.85rem;
  padding-bottom: 1rem;
}

.rwp-card--editor .rwp-help {
  margin: 0;
  padding: 0 var(--rwp-spacing);
  font-size: 0.9rem;
  color: var(--rwp-text-muted);
}

.rwp-card--editor .rwp-textarea {
  margin: 0 var(--rwp-spacing);
}

.rwp-code {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  background: rgba(79, 70, 229, 0.08);
  color: var(--rwp-primary);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  border: 1px solid rgba(79, 70, 229, 0.15);
  font-size: 0.88em;
}

.rwp-validation {
  margin: 0 var(--rwp-spacing);
  font-size: 0.9rem;
}

.rwp-validation .rwp-error {
  color: var(--rwp-danger);
  background: rgba(231, 76, 60, 0.07);
  border: 1px solid rgba(231, 76, 60, 0.2);
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
}

.rwp-validation .rwp-ok {
  color: var(--rwp-secondary);
  background: rgba(0, 168, 107, 0.07);
  border: 1px solid rgba(0, 168, 107, 0.2);
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
}

/* =============================================
   TABLE
   ============================================= */
.rwp-tableWrap {
  margin: 0 var(--rwp-spacing);
  border: 1px solid var(--rwp-border);
  border-radius: 12px;
  overflow: hidden;
}

.rwp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.rwp-table th,
.rwp-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(216, 220, 226, 0.5);
  vertical-align: top;
}

.rwp-table thead th {
  background: rgba(240, 242, 248, 0.8);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--rwp-text-muted);
  letter-spacing: 0.03em;
}

.rwp-table tbody tr:last-child td {
  border-bottom: none;
}
.rwp-table tbody tr:hover td {
  background: rgba(79, 70, 229, 0.03);
}
.rwp-colRight {
  text-align: right;
  white-space: nowrap;
}

#rwp-privacyNote {
  margin: 0 var(--rwp-spacing);
  padding-top: 0.15rem;
}

/* =============================================
   BUTTONS
   ============================================= */
.rwp-btn {
  border: 1.5px solid var(--rwp-border);
  border-radius: 10px;
  background: #fff;
  color: var(--rwp-text);
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition:
    transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.14s ease,
    border-color 0.14s ease,
    background 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.rwp-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rwp-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.07s;
}

.rwp-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--rwp-focus-glow);
  border-color: rgba(255, 95, 41, 0.5);
}

.rwp-btn--primary {
  background: linear-gradient(
    135deg,
    var(--rwp-primary) 0%,
    var(--rwp-primary-dark) 100%
  );
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.rwp-btn--primary:hover:not(:disabled) {
  box-shadow: 0 6px 22px rgba(79, 70, 229, 0.4);
}

.rwp-btn--ghost {
  background: transparent;
  border-color: rgba(79, 70, 229, 0.2);
}

.rwp-btn--ghost:hover:not(:disabled) {
  background: var(--rwp-primary-light);
  border-color: rgba(79, 70, 229, 0.35);
}

.rwp-btn--soft {
  background: var(--rwp-primary-light);
  border-color: rgba(79, 70, 229, 0.18);
  color: var(--rwp-primary-dark);
}

.rwp-btn--soft:hover:not(:disabled) {
  background: rgba(79, 70, 229, 0.12);
}

.rwp-btn--softDanger {
  background: rgba(231, 76, 60, 0.07);
  border-color: rgba(231, 76, 60, 0.2);
  color: var(--rwp-danger);
}

.rwp-btn--softDanger:hover:not(:disabled) {
  background: rgba(231, 76, 60, 0.12);
  border-color: rgba(231, 76, 60, 0.35);
}

/* =============================================
   ACTIONS
   ============================================= */
.rwp-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rwp-actions[hidden] {
  display: none;
}

/* =============================================
   TOGGLE BUTTONS
   ============================================= */
.rwp-toggle {
  width: 100%;
  border: 1.5px solid var(--rwp-border);
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-family: var(--font-body);
  font-weight: 600;
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.rwp-toggle:hover {
  transform: scale(1.03);
}

.rwp-toggle[aria-pressed="true"] {
  background: rgba(0, 168, 107, 0.1);
  border-color: rgba(0, 168, 107, 0.4);
  color: #007a4d;
}

/* =============================================
   ADVANCED
   ============================================= */
.rwp-advanced {
  margin-top: 0.25rem;
}

.rwp-advanced__summary {
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--rwp-border);
  border-radius: 12px;
  background: rgba(240, 242, 248, 0.8);
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
  list-style: none;
}

.rwp-advanced__summary::-webkit-details-marker {
  display: none;
}
.rwp-advanced__summary::before {
  content: "▶ ";
  font-size: 0.75em;
}
details[open] .rwp-advanced__summary::before {
  content: "▼ ";
}

.rwp-advanced__summary:hover {
  background: var(--rwp-primary-light);
  border-color: rgba(79, 70, 229, 0.25);
}

.rwp-advanced__content {
  padding: 0.75rem 0.2rem 0.2rem;
}
.rwp-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* =============================================
   SIMULATION
   ============================================= */
.rwp-sim {
  margin-top: 0.85rem;
  border: 1px solid var(--rwp-border);
  border-radius: 12px;
  padding: 0.85rem;
  background: rgba(240, 242, 248, 0.5);
}

.rwp-sim__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rwp-sim__title {
  font-weight: 700;
  font-size: 0.9rem;
}
.rwp-sim__hint {
  font-size: 0.83rem;
  color: var(--rwp-text-muted);
}

.rwp-sim__controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rwp-simCanvas {
  width: 100%;
  height: auto;
  margin-top: 0.6rem;
  background: #fff;
  border: 1px solid var(--rwp-border);
  border-radius: 12px;
}

/* =============================================
   RESULTS SECTION
   ============================================= */
.rwp-card--results {
  margin-top: var(--rwp-spacing);
}

.rwp-resultGrid {
  padding: var(--rwp-spacing);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--rwp-spacing);
}

.rwp-resultBox {
  border: 1px solid var(--rwp-border);
  border-radius: 14px;
  padding: 1.1rem;
  background: linear-gradient(
    135deg,
    rgba(79, 70, 229, 0.03) 0%,
    rgba(240, 242, 248, 0.8) 100%
  );
}

.rwp-resultLabel {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rwp-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rwp-resultWinner {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 900;
  margin-top: 0.35rem;
  background: linear-gradient(
    135deg,
    var(--rwp-primary) 0%,
    var(--rwp-focus) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rwp-resultMeta {
  margin-top: 0.4rem;
  font-size: 0.87rem;
  color: var(--rwp-text-muted);
  line-height: 1.6;
}

.rwp-history {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  max-height: 220px;
  overflow: auto;
}

.rwp-history li {
  margin: 0.3rem 0;
  line-height: 1.4;
  font-size: 0.88rem;
}

/* =============================================
   WINNER MODAL
   ============================================= */
.rwp-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 10, 20, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.rwp-modal-backdrop.is-visible {
  opacity: 1;
  pointer-events: all;
}

.rwp-modal {
  position: relative;
  width: min(480px, 100%);
  border-radius: 24px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.3);
  transform: scale(0.82) translateY(30px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rwp-modal-backdrop.is-visible .rwp-modal {
  transform: scale(1) translateY(0);
}

.rwp-modal__glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 320px;
  background: radial-gradient(
    ellipse,
    rgba(79, 70, 229, 0.35) 0%,
    transparent 70%
  );
  pointer-events: none;
  animation: rwp-modal-glow 2s ease-in-out infinite alternate;
}

@keyframes rwp-modal-glow {
  from {
    opacity: 0.6;
    transform: translateX(-50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
  }
}

.rwp-modal__confetti-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.rwp-confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: rwp-confetti-fall linear forwards;
}

@keyframes rwp-confetti-fall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(600px) rotate(720deg);
    opacity: 0;
  }
}

.rwp-modal__inner {
  position: relative;
  z-index: 2;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.rwp-modal__crown {
  font-size: 3rem;
  line-height: 1;
  animation: rwp-crown-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes rwp-crown-bounce {
  from {
    transform: scale(0) rotate(-20deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.rwp-modal__label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rwp-text-muted);
  animation: rwp-fade-up 0.4s ease 0.3s both;
}

.rwp-modal__name {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
  background: linear-gradient(
    135deg,
    var(--rwp-primary) 0%,
    var(--rwp-focus) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rwp-fade-up 0.4s ease 0.4s both;
  max-width: 100%;
  word-break: break-word;
}

.rwp-modal__meta {
  font-size: 0.88rem;
  color: var(--rwp-text-muted);
  animation: rwp-fade-up 0.4s ease 0.5s both;
}

@keyframes rwp-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rwp-modal__close {
  margin-top: 1rem;
  padding: 0.85rem 2.5rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(
    135deg,
    var(--rwp-primary) 0%,
    var(--rwp-focus) 100%
  );
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(79, 70, 229, 0.35);
  transition:
    transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.15s ease;
  animation: rwp-fade-up 0.4s ease 0.6s both;
  -webkit-tap-highlight-color: transparent;
}

.rwp-modal__close:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 10px 32px rgba(79, 70, 229, 0.45);
}

.rwp-modal__close:active {
  transform: scale(0.97);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .rwp-grid {
    grid-template-columns: 1fr;
  }

  .rwp-resultGrid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --rwp-spacing: 1rem;
  }

  .rwp-pillRow {
    grid-template-columns: 1fr;
  }

  .rwp-centerSpinBtn {
    width: 68px;
    height: 68px;
    font-size: 0.72rem;
  }

  .rwp-modal__inner {
    padding: 2rem 1.25rem 1.5rem;
  }

  .rwp-quickAdd {
    flex-direction: column;
  }

  .rwp-quickAdd__btn {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .rwp-resultGrid {
    grid-template-columns: 1fr;
  }

  .rwp-resultWinner {
    font-size: 1.4rem;
  }

  .rwp-modal__name {
    font-size: 1.6rem;
  }

  /* #rwp-wheelCanvas {
    width: min(520px, 96vw);
  } */

  .rwp-centerSpinBtn {
    width: 60px;
    height: 60px;
    font-size: 0.65rem;
  }

  .rwp-row {
    flex-direction: column;
  }
}

/* Touch device optimizations */
@media (hover: none) {
  .rwp-btn:hover,
  .rwp-quickAdd__btn:hover,
  .rwp-centerSpinBtn:hover,
  .rwp-modal__close:hover {
    transform: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
