#stw-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#stw-modal {
  width: min(560px, 100%);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f8ff 100%);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  color: #141414;
}

#stw-modal header {
  padding: 18px 20px 8px;
  position: relative;
}

#stw-modal h3 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.25;
}

#stw-modal p {
  margin: 8px 0 0;
}

.stw-body {
  padding: 16px 20px 20px;
}

.stw-icon-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #222;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stw-icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 18px rgba(0, 0, 0, 0.2);
}

.stw-wheel-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
  position: relative;
  isolation: isolate;
}

#stw-wheel {
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 10px solid #0f1320;
  position: relative;
  z-index: 1;
  overflow: hidden;
  box-shadow: 0 18px 35px rgba(15, 19, 32, 0.35), inset 0 0 0 3px rgba(255, 255, 255, 0.2);
}

#stw-wheel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 48%);
  pointer-events: none;
  z-index: 3;
}

#stw-wheel::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.5);
  pointer-events: none;
  z-index: 4;
}

.stw-wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30%;
  height: 30%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #eef0f5 100%);
  z-index: 6;
  box-shadow: 0 0 0 5px #f5f5f5, 0 8px 18px rgba(0, 0, 0, 0.2);
}

#stw-selector {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  transform: rotate(0deg);
  transition: transform 4.5s cubic-bezier(0.15, 0.8, 0.25, 1);
  z-index: 8;
  pointer-events: none;
}

#stw-selector::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 17px solid transparent;
  border-right: 17px solid transparent;
  border-top: 27px solid #000000;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.25));
}

#stw-selector::after {
  content: none;
}

#stw-spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 0;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #ee1b24;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.74rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#stw-spin-btn:hover {
  transform: translate(-50%, calc(-50% - 1px));
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.4);
}

#stw-spin-btn i {
  font-size: 1rem;
}

#stw-spin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: translate(-50%, -50%);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.22);
}

#stw-result {
  margin: 8px 0 14px;
  font-weight: 600;
  text-align: center;
  min-height: 24px;
}

/* labels displayed on the wheel segments */
.stw-wheel-label {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 5;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
  max-width: 118px;
  color: #151515;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

/* floating alert shown when a reward is active */
.stw-reward-alert {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 1000000;
  font-size: 0.9rem;
  max-width: 350px;
}

@media (max-width: 480px) {
  #stw-wheel {
    width: 300px;
    height: 300px;
  }

  .stw-wheel-label {
    max-width: 96px;
    font-size: 0.66rem;
  }
}
