/* Spin Wheel Page Styles - Fixed Version */

/* Hero Section */
.spinwheel-hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d1b2d 100%);
  padding: 4rem 0;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.spinwheel-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('/images/harvey-hero.png') center/cover;
  opacity: 0.1;
  z-index: 0;
}

.spinwheel-hero .hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.spinwheel-hero .hero-title {
  font-family: 'VT323', monospace;
  font-size: 3.5rem;
  margin-bottom: 1rem;
  color: #ff6b6b;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.spinwheel-hero .hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #ffd700;
  font-weight: 500;
}

.spinwheel-hero .hero-description {
  font-size: 1.125rem;
  line-height: 1.6;
  color: #e0e0e0;
  max-width: 600px;
  margin: 0 auto;
}

/* Instructions Section */
.instructions-section {
  background: #f8f9fa;
  padding: 4rem 0;
}

.instructions-section .section-title {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #1a1a1a;
}

.instructions-description {
  text-align: center;
  font-size: 1.125rem;
  color: #555;
  margin-bottom: 3rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Tools Table */
.tools-table-container {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.tools-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
}

.tools-table caption {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 1rem;
  caption-side: top;
}

.tools-table th {
  background: linear-gradient(135deg, #ff6b6b, #e55353);
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tools-table td {
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
  vertical-align: middle;
}

.tools-table .tool-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.tools-table .tool-cost {
  font-weight: 700;
  color: #ff6b6b;
  font-size: 1.1rem;
}

.tools-table .pain-level {
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

.pain-level.good {
  background: #e8f5e8;
  color: #2e7d32;
}

.pain-level.normal {
  background: #fff3e0;
  color: #f57c00;
}

.pain-level.bad {
  background: #ffebee;
  color: #c62828;
}

/* Game Section */
.game-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d1b2d 100%);
  padding: 4rem 0;
  color: white;
  text-align: center;
}

.game-section .section-title {
  color: #ff6b6b;
  margin-bottom: 3rem;
}

/* Game Status */
.game-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.money-display {
  font-size: 1.25rem;
  font-weight: 600;
}

.money-amount {
  color: #ffd700;
  font-size: 1.5rem;
  margin: 0 0.5rem;
}

.current-tool {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

.current-tool .tool-icon {
  font-size: 1.5rem;
}

.current-tool .tool-cost {
  color: #ff6b6b;
  font-weight: 700;
}

/* Wheel Container - PERFECTLY POSITIONED */
.wheel-container {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 0 auto 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Spin Wheel - CORRECTED COLORS (Pink/Purple) */
.wheel {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  position: relative;
  border: 8px solid #ff6b6b;
  box-shadow: 0 0 25px rgba(255, 107, 107, 0.4);
  transition: transform 3s cubic-bezier(0.23, 1, 0.32, 1);
  background: conic-gradient(
    #ff6b6b 0deg 60deg,
    #8e24aa 60deg 120deg,
    #ff6b6b 120deg 180deg,
    #8e24aa 180deg 240deg,
    #ff6b6b 240deg 300deg,
    #8e24aa 300deg 360deg
  );
  overflow: hidden;
}

/* Wheel Segments - PRECISE POSITIONING */
.wheel-segment {
  position: absolute;
  width: 50%;
  height: 50%;
  transform-origin: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: filter 0.3s ease;
}

.wheel-segment:nth-child(1) { transform: rotate(0deg); }
.wheel-segment:nth-child(2) { transform: rotate(60deg); }
.wheel-segment:nth-child(3) { transform: rotate(120deg); }
.wheel-segment:nth-child(4) { transform: rotate(180deg); }
.wheel-segment:nth-child(5) { transform: rotate(240deg); }
.wheel-segment:nth-child(6) { transform: rotate(300deg); }

/* Segment Content - TEXT ONLY */
.segment-content {
  transform: rotate(30deg);
  text-align: center;
  color: white;
  font-weight: 800;
  font-size: 0.9rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  pointer-events: none;
  line-height: 1;
}

.segment-icon {
  display: none !important;
}

.segment-text {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* Wheel Center - EXACTLY CENTERED */
.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spin-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd700, #ffb300);
  border: 4px solid white;
  color: #1a1a1a;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spin-button:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.spin-button:active:not(:disabled) {
  transform: scale(0.95);
}

.spin-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Wheel Pointer - FIXED AT TOP */
.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 24px solid #ffd700;
  z-index: 20;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

/* Tools Purchased - SEQUENTIAL DISPLAY */
.tools-purchased {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.tools-purchased h3 {
  margin-bottom: 1rem;
  color: #ff6b6b;
}

.purchased-tools-list {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 2.5rem;
  align-items: center;
}

.tool-purchased {
  background: rgba(255, 107, 107, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid #ff6b6b;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.tool-purchased:hover {
  background: rgba(255, 107, 107, 0.3);
  transform: translateY(-1px);
}

.no-tools {
  color: #999;
  font-style: italic;
  font-size: 1rem;
}

/* Result Modal System */
.result-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(5px);
}

.result-modal-content {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  animation: modalAppear 0.3s ease-out;
}

.result-modal-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #1a1a1a;
}

.result-modal-title.accept {
  color: #4caf50;
}

.result-modal-title.reject {
  color: #f44336;
}

.result-modal-message {
  font-size: 1.1rem;
  line-height: 1.5;
  color: #555;
  margin-bottom: 1.5rem;
}

.result-modal-button {
  background: linear-gradient(135deg, #ff6b6b, #e55353);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.result-modal-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Game Result */
.game-result {
  margin-top: 3rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.game-result.hidden {
  display: none;
}

.result-title {
  color: #ffd700;
  margin-bottom: 2rem;
  font-size: 2rem;
}

.result-content {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.harvey-final-state {
  text-align: center;
}

.harvey-final-state img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid #ff6b6b;
  margin-bottom: 1rem;
}

.state-description {
  font-size: 1.1rem;
  color: #e0e0e0;
  line-height: 1.5;
}

.ending-badge {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ending-badge.good {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
}

.ending-badge.normal {
  background: linear-gradient(135deg, #2196f3, #1565c0);
  color: white;
}

.ending-badge.bad {
  background: linear-gradient(135deg, #f44336, #c62828);
  color: white;
}

/* Voting Section */
.voting-section {
  background: #f8f9fa;
  padding: 4rem 0;
}

.voting-section .section-title {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #1a1a1a;
}

.voting-description {
  text-align: center;
  font-size: 1.125rem;
  color: #555;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.endings-vote-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.ending-option {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ending-option:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.ending-option.voted {
  border: 2px solid #4caf50;
  background: #f1f8e9;
}

.ending-image {
  margin-bottom: 1.5rem;
}

.ending-image img {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  object-fit: cover;
}

.ending-option h3 {
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.ending-option p {
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.vote-btn {
  background: linear-gradient(135deg, #ff6b6b, #e55353);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.vote-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.vote-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.vote-count {
  font-weight: 600;
  color: #333;
  font-size: 1.1rem;
}

/* Poll Results */
.poll-results {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.poll-results.hidden {
  display: none;
}

.poll-results h4 {
  text-align: center;
  margin-bottom: 2rem;
  color: #1a1a1a;
  font-size: 1.5rem;
}

.results-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.result-good,
.result-normal,
.result-bad {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.result-label {
  min-width: 120px;
  font-weight: 600;
  color: #333;
}

.result-progress {
  flex: 1;
  background: #e9ecef;
  height: 30px;
  border-radius: 15px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  transition: width 1s ease-in-out;
  border-radius: 15px;
}

#progress-good {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
}

#progress-normal {
  background: linear-gradient(135deg, #2196f3, #1565c0);
}

#progress-bad {
  background: linear-gradient(135deg, #f44336, #c62828);
}

.result-percentage {
  min-width: 50px;
  font-weight: 700;
  color: #333;
}

.total-votes {
  text-align: center;
  font-weight: 600;
  color: #666;
  font-size: 1.1rem;
}

/* Animation Classes */
.spinning {
  animation: spin 3s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(var(--final-rotation, 1080deg));
  }
}

.pulse {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Segment Highlighting - ACCURATE */
.wheel-segment.selected {
  animation: segmentHighlight 1.5s ease-in-out;
}

@keyframes segmentHighlight {
  0% { filter: brightness(1) saturate(1); }
  30% { filter: brightness(1.4) saturate(1.5) drop-shadow(0 0 10px rgba(255,255,255,0.5)); }
  70% { filter: brightness(1.4) saturate(1.5) drop-shadow(0 0 10px rgba(255,255,255,0.5)); }
  100% { filter: brightness(1) saturate(1); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .spinwheel-hero .hero-title {
    font-size: 2.5rem;
  }

  .spinwheel-hero .hero-subtitle {
    font-size: 1.25rem;
  }

  .game-status {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .wheel-container {
    width: 280px;
    height: 280px;
  }

  .wheel {
    width: 250px;
    height: 250px;
  }

  .spin-button {
    width: 70px;
    height: 70px;
    font-size: 0.8rem;
  }

  .endings-vote-container {
    grid-template-columns: 1fr;
  }

  .tools-table {
    font-size: 0.9rem;
  }

  .tools-table th,
  .tools-table td {
    padding: 0.75rem 0.5rem;
  }

  .result-good,
  .result-normal,
  .result-bad {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .result-label {
    min-width: auto;
  }

  .result-modal-content {
    padding: 2rem;
    margin: 1rem;
  }

  .result-modal-title {
    font-size: 1.5rem;
  }

  .segment-text {
    font-size: 0.8rem;
    letter-spacing: 1px;
  }
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }