/* Overlay & Modal */
#spin-wheel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#spin-wheel-overlay.active {
  opacity: 1;
  visibility: visible;
}

.spin-wheel-modal {
  background: transparent;
  width: 90%;
  max-width: 500px;
  position: relative;
  text-align: center;
  font-family: "Inter", sans-serif;
  transform: translateY(
    20px
  ); /* Slightly lower than center as requested? "trohi vyshche tsentru". Actually user said "trohi vyshche tsentru" (slightly ABOVE center). Layout normal centering is fine, maybe margin-bottom */
  margin-bottom: 5vh;
  animation: spinModalEntry 0.5s ease forwards;
}

@keyframes spinModalEntry {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.spin-wheel-close {
  position: absolute;
  top: -15px;
  right: -30px;
  background: none;
  border: none;
  font-size: 40px;
  cursor: pointer;
  color: #ccc;
  transition: color 0.3s;
  line-height: 1;
}
.spin-wheel-close:hover {
  color: #ccc;
  background: none;
	box-shadow:none!important;
}

/* Wheel */
.spin-wheel-container {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto;
}

.spin-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.16, 0.99); /* Custom easing for spin */
  border: 5px solid #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.spin-wheel-text {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 2px; /* Anchor line */
  background: transparent;
  transform-origin: 0 1px; /* Center of wheel */
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.spin-wheel-text span {
  display: block;
  transform: rotate(0deg); /* Text orientation - aligned radially */
  transform-origin: center;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  margin-right: 20px;
  width:58%;
  color: inherit;
  line-height: 1em;
}

/* 4 Sections - 360 / 4 = 90deg each.
   Positions:
   0: 0-90 (Starts at 3o'clock normally) - We need to offset text to center of slice. 45deg.
*/
.spin-wheel-text:nth-child(1) {
  transform: rotate(-45deg);
}
.spin-wheel-text:nth-child(2) {
  transform: rotate(45deg);
}
.spin-wheel-text:nth-child(3) {
  transform: rotate(135deg);
}
.spin-wheel-text:nth-child(4) {
  transform: rotate(225deg);
}

.spin-wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 25px solid #333;
  z-index: 10;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

.spin-wheel-center-btn {
  position: absolute;
  top: 41%;
  left: 41%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: #333;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 10;
  user-select: none;
  animation: pulse 1.5s infinite;
}
.spin-wheel-center-btn:active {
  transform: translate(-50%, -50%) scale(0.95);
}

/* Result */
.spin-wheel-result {
  text-align: center;
  padding: 20px;
  background: #fff;
    border-radius: 10px;
}
.spin-wheel-hidden {
  display: none !important;
}

.spin-result-title {
  font-size: 24px;
  margin-bottom: 10px;
  color: #333;
}
.spin-result-message {
  font-size: 18px;
  margin-bottom: 20px;
  color: #555;
}
.spin-result-btn {
  display: inline-block;
  padding: 12px 30px;
  background: #ff4757;
  color: #fff;
  text-decoration: none;
  border-radius: 30px;
  font-weight: bold;
  transition: transform 0.2s, box-shadow 0.2s;
}
.spin-result-btn:hover {
  /* No default hover effects, managed by inline styles for color */
}

@media (max-width: 600px) {
  .spin-wheel-container {
    width: 250px;
    height: 250px;
  }
	.spin-wheel-center-btn {
 
  top: 38%;
  left: 38%;
  
}
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.4);
    transform: translate(-50%, -50%) scale(1);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
    transform: translate(-50%, -50%) scale(1.1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    transform: translate(-50%, -50%) scale(1);
  }
}
