* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Arial", sans-serif;
  background: linear-gradient(
    135deg,
    #ff6b6b,
    #4ecdc4,
    #45b7d1,
    #96ceb4,
    #feca57
  );
  background-size: 400% 400%;
  animation: gradientShift 10s ease infinite;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.game-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 25px;
  padding: 30px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 800px;
  width: 95%;
  backdrop-filter: blur(10px);
}

h1 {
  color: #2c3e50;
  font-size: 2.5em;
  margin-bottom: 5px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
  color: #34495e;
  font-size: 1.8em;
  margin-bottom: 20px;
  font-weight: normal;
}

.instructions {
  background: linear-gradient(145deg, #e8f4fd, #d1ecf1);
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 30px;
  border: 2px solid #3498db;
}

.instructions p {
  font-size: 1.2em;
  color: #2c3e50;
  margin-bottom: 5px;
}

.wheel-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 40px 0;
}

.wheel-pointer {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 30px solid #e74c3c;
  z-index: 10;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.wheel {
  width: 400px;
  height: 400px;
  border-radius: 50%;
  position: relative;
  border: 8px solid #2c3e50;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  transition: transform 3s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.wheel-section {
  cursor: pointer;
}

.wheel-section path {
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 2;
}

.wheel-section text {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
  font-family: "Arial", sans-serif;
  pointer-events: none;
}

.wheel-section.used {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.wheel-section.used path {
  fill: #bdc3c7 !important;
}

.wheel-section.used text {
  fill: #7f8c8d !important;
}

.controls {
  margin: 30px 0;
}

.spin-button,
.new-spin-button,
.reset-button {
  background: linear-gradient(145deg, #ff6b6b, #ee5a52);
  color: white;
  border: none;
  padding: 15px 30px;
  margin: 0 10px;
  font-size: 1.3em;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
  text-transform: uppercase;
}

.reset-button {
  background: linear-gradient(145deg, #95a5a6, #7f8c8d);
  box-shadow: 0 8px 25px rgba(149, 165, 166, 0.4);
}

.spin-button:hover,
.new-spin-button:hover {
  background: linear-gradient(145deg, #ee5a52, #dc4441);
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
}

.reset-button:hover {
  background: linear-gradient(145deg, #7f8c8d, #6c757d);
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(149, 165, 166, 0.6);
}

.spin-button:active,
.new-spin-button:active,
.reset-button:active {
  transform: translateY(0);
}

.spin-button:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.result-container {
  margin-top: 30px;
  padding: 25px;
  background: linear-gradient(145deg, #f8f9fa, #e9ecef);
  border-radius: 20px;
  border: 3px solid #17a2b8;
  display: none;
}

.result-container.show {
  display: block;
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#result-title {
  color: #2c3e50;
  font-size: 1.8em;
  margin-bottom: 15px;
}

#story-prompt {
  background: #fff3cd;
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 20px;
  border: 2px solid #ffc107;
  font-size: 1.1em;
  color: #856404;
  line-height: 1.6;
}

.story-input h4 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 1.3em;
}

#story-text {
  width: 100%;
  min-height: 120px;
  padding: 15px;
  border: 3px solid #17a2b8;
  border-radius: 15px;
  font-size: 1.1em;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 20px;
}

#story-text:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
}

.spinning {
  animation: spin 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(1800deg);
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: linear-gradient(145deg, #ffffff, #f8f9fa);
  margin: 15% auto;
  padding: 0;
  border: none;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s ease;
  overflow: hidden;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5em;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.close {
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.close:hover {
  transform: scale(1.2);
}

.modal-body {
  padding: 30px;
  text-align: center;
}

.modal-body p {
  font-size: 1.2em;
  line-height: 1.6;
  color: #2c3e50;
  margin: 0;
  background: linear-gradient(145deg, #fff3cd, #ffeaa7);
  padding: 20px;
  border-radius: 15px;
  border: 3px solid #f39c12;
  box-shadow: 0 5px 15px rgba(243, 156, 18, 0.2);
}

.modal-footer {
  padding: 20px 30px 30px;
  text-align: center;
}

.close-button {
  background: linear-gradient(145deg, #2ecc71, #27ae60);
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1.1em;
  font-weight: bold;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.close-button:hover {
  background: linear-gradient(145deg, #27ae60, #229954);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
}

.close-button:active {
  transform: translateY(0);
}

@media (max-width: 600px) {
  .game-container {
    padding: 20px;
  }

  .wheel {
    width: 300px;
    height: 300px;
  }

  .wheel-section {
    font-size: 0.8em;
  }

  h1 {
    font-size: 2em;
  }

  h2 {
    font-size: 1.4em;
  }

  .instructions p {
    font-size: 1em;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }

  .modal-header h2 {
    font-size: 1.2em;
  }

  .modal-body p {
    font-size: 1em;
  }
}
