/* =============================================
   DAS SOCKEN-RAD — Wheel of Fortune
   ============================================= */

.sw-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a0a2e 0%, #0d0514 60%, #000 100%);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ---- CONTAINER ---- */
.sw-container {
  position: relative;
  width: 700px;
  max-width: 95vw;
  background: linear-gradient(180deg, #2d1b4e 0%, #1a0f2e 50%, #2d1b4e 100%);
  border-radius: 30px;
  padding: 10px;
  box-shadow:
    0 0 0 3px #ffd700,
    0 0 0 6px #1a0f2e,
    0 20px 60px rgba(0,0,0,0.8),
    inset 0 0 100px rgba(255,215,0,0.1);
}

.sw-inner {
  background: linear-gradient(180deg, #3d2b5e 0%, #2a1a3e 50%, #3d2b5e 100%);
  border-radius: 24px;
  padding: 30px;
  position: relative;
}

/* ---- HEADER ---- */
.sw-header {
  text-align: center;
  margin-bottom: 20px;
}

.sw-title {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(90deg, #ffd700, #ff6b35, #ffd700);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: 3px;
  animation: shimmer 3s linear infinite;
  filter: drop-shadow(0 0 10px rgba(255,215,0,0.3));
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.sw-balance {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0,0,0,0.5);
  padding: 12px 24px;
  border-radius: 12px;
  border: 2px solid #ffd700;
  color: #ffd700;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 0 20px rgba(255,215,0,0.2);
}

/* ---- WHEEL CONTAINER ---- */
.sw-wheel-wrapper {
  position: relative;
  width: 400px;
  height: 400px;
  margin: 20px auto;
}

/* Outer ring with lights */
.sw-wheel-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: linear-gradient(45deg, #ffd700, #ff6b35, #ffd700, #ff6b35);
  background-size: 400% 400%;
  animation: rotateRing 3s linear infinite;
  box-shadow: 0 0 40px rgba(255,215,0,0.5);
}

@keyframes rotateRing {
  0% { background-position: 0% 50%; transform: rotate(0deg); }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; transform: rotate(360deg); }
}

/* Bulbs around the wheel */
.sw-bulbs {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
}

.sw-bulb {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #444;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
  animation: bulbBlink 1s ease-in-out infinite alternate;
}

.sw-bulb.on {
  background: #fff8e7;
  box-shadow: 0 0 15px #ffd700, 0 0 30px #ffd700;
}

@keyframes bulbBlink {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* The wheel itself */
.sw-wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    #dc2626 0deg 30deg,
    #ea580c 30deg 60deg,
    #f59e0b 60deg 90deg,
    #22c55e 90deg 120deg,
    #06b6d4 120deg 150deg,
    #3b82f6 150deg 180deg,
    #8b5cf6 180deg 210deg,
    #d946ef 210deg 240deg,
    #f43f5e 240deg 270deg,
    #10b981 270deg 300deg,
    #f97316 300deg 330deg,
    #ffd700 330deg 360deg
  );
  box-shadow:
    inset 0 0 50px rgba(0,0,0,0.5),
    0 10px 40px rgba(0,0,0,0.5);
  transition: transform 4s cubic-bezier(0.1, 0.7, 0.1, 1);
}

/* Center cap */
.sw-wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, #ffd700 0%, #b8860b 100%);
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow:
    0 0 20px rgba(255,215,0,0.6),
    inset 0 0 10px rgba(255,255,255,0.3);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

/* Pointer/Arrow */
.sw-pointer {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-top: 40px solid #ffd700;
  filter: drop-shadow(0 5px 10px rgba(255,215,0,0.8));
  z-index: 20;
  animation: pointerPulse 1s ease-in-out infinite;
}

@keyframes pointerPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.1); }
}

/* Sector labels */
.sw-sector-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: 0 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  pointer-events: none;
}

/* ---- CONTROLS ---- */
.sw-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.sw-spin-btn {
  padding: 20px 60px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(145deg, #22c55e 0%, #16a34a 50%, #15803d 100%);
  color: #fff;
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 1.4rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow:
    0 8px 30px rgba(34,197,94,0.4),
    inset 0 -4px 10px rgba(0,0,0,0.2),
    inset 0 4px 10px rgba(255,255,255,0.2);
  transition: all 0.2s;
}

.sw-spin-btn:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 12px 40px rgba(34,197,94,0.6),
    inset 0 -4px 10px rgba(0,0,0,0.2);
}

.sw-spin-btn:active:not(:disabled) {
  transform: translateY(2px) scale(0.98);
}

.sw-spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.sw-cost {
  color: #aaa;
  font-size: 0.9rem;
}

.sw-cost strong {
  color: #ffd700;
}

/* ---- RESULT DISPLAY ---- */
.sw-result {
  text-align: center;
  margin-top: 20px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sw-result-icon {
  font-size: 4rem;
  animation: resultPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: drop-shadow(0 0 20px currentColor);
}

@keyframes resultPop {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  50% { transform: scale(1.3) rotate(10deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.sw-result-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.sw-result-value {
  font-size: 1.5rem;
  color: #ffd700;
  font-weight: 800;
  margin-top: 4px;
}

/* ---- HISTORY ---- */
.sw-history {
  margin-top: 24px;
  padding: 16px;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
}

.sw-history-title {
  font-size: 0.85rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.sw-history-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.sw-history-item {
  padding: 8px 14px;
  background: rgba(255,215,0,0.15);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 8px;
  font-size: 0.9rem;
  color: #ffd700;
}

/* ---- CLOSE BUTTON ---- */
.sw-close {
  position: absolute;
  top: -20px;
  left: -20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid #dc2626;
  background: linear-gradient(145deg, #991b1b, #7f1d1d);
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(220,38,38,0.4);
}

.sw-close:hover {
  transform: scale(1.1) rotate(90deg);
  background: linear-gradient(145deg, #dc2626, #991b1b);
}

/* ---- ANIMATIONS ---- */
@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(255,215,0,0.4); }
  50% { box-shadow: 0 0 40px rgba(255,215,0,0.8); }
}

.glow {
  animation: glow 2s ease-in-out infinite;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .sw-wheel-wrapper {
    width: 300px;
    height: 300px;
  }
  
  .sw-title {
    font-size: 1.4rem;
  }
  
  .sw-balance {
    font-size: 0.9rem;
    padding: 8px 16px;
  }
  
  .sw-spin-btn {
    padding: 16px 40px;
    font-size: 1.1rem;
  }
}
