* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DynaPuff', sans-serif;
  background: linear-gradient(135deg, #8E44AD 0%, #3498DB 100%);
  min-height: 100vh;
  overflow-x: hidden;
  padding: 10px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.background {
    position: fixed;
    z-index: -1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

h1 {
  text-align: center;
  color: white;
  font-size: 36px;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 20px;
  align-items: start;
  flex: 1;
}

.wheel-section {
  background: white;
  border-radius: 10px;
  border:#aa36d4 3px solid;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#wheelCanvas {
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  margin-bottom: 15px;
  flex-shrink: 1;
}

.button {
  font-family: 'DynaPuff', sans-serif;
  font-size: 16px;
  letter-spacing: 2px;
  text-decoration: none;
  text-transform: uppercase;
  background-color: violet;
  color: white;
  color: #000;
  cursor: pointer;
  border-radius: 5px;
  border: 3px solid #000;
  padding: 0.75em 1.25em;
  box-shadow: 1px 1px 0px 0px #000, 2px 2px 0px 0px #000, 3px 3px 0px 0px #000, 4px 4px 0px 0px #000, 5px 5px 0px 0px #000;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.spin-button {
  animation: rotate-bg-color 10s infinite;
}

@keyframes rotate-bg-color {
  0% {
    background-color: steelblue;
    color: white;
  }
  10% {
    background-color: red;
    color: white;
  }
  20% {
    background-color: orange;
    color: black;
  }
  30% {
    background-color: yellow;
    color: black;
  }
  40% {
    background-color: green;
    color: white;
  }
  50% {
    background-color: blue;
    color: white;
  }
  60% {
    background-color: indigo;
    color: white;
  }
  70% {
    background-color: violet;
    color: white;
  }
  80% {
    background-color: pink;
    color: black;
  }
  90% {
    background-color: brown;
    color: white;
  }
  100% {
    background-color: black;
    color: white;
  }
}

.button:active {
  box-shadow: 0px 0px 0px 0px;
  top: 5px;
  left: 5px;
}

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

.result-display {
  margin-top: 10px;
  padding: 10px 20px;
  font-size: 42px;
  font-weight: bold;
  color: #8E44AD;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
}

@keyframes celebrateResult {
  0% {
    transform: scale(0.5) rotate(-10deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.names-section {
  background: white;
  border-radius: 10px;
  border:#aa36d4 3px solid;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  min-height: 500px;
}

.names-section h2 {
  color: #333;
  margin-bottom: 8px;
  font-size: 20px;
  flex-shrink: 0;
}

.names-section p {
  color: #666;
  margin-bottom: 10px;
  font-size: 13px;
  flex-shrink: 0;
}

#namesInput {
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: 12px;
  font-size: 15px;
  border: 2px solid #aa36d4;
  border-radius: 5px;
  resize: none;
  font-family: 'DynaPuff', sans-serif;
  margin-bottom: 10px;
}

#namesInput:focus {
  outline: none;
  border-color: #8E44AD;
}

.update-button {
  appearance: button;
  background-color: #aa36d4;
  background-image: none;
  border: 1px solid #000;
  border-radius: 4px;
  box-shadow: #fff 4px 4px 0 0,#000 4px 4px 0 1px;
  box-sizing: border-box;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font-family: 'DynaPuff', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  margin: 0 5px 10px 0;
  overflow: visible;
  padding: 12px 40px;
  text-align: center;
  text-transform: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  vertical-align: middle;
  white-space: nowrap;
}

.update-button:focus {
  text-decoration: none;
}

.update-button:hover {
  text-decoration: none;
}

.update-button:active {
  box-shadow: rgba(0, 0, 0, .125) 0 3px 5px inset;
  outline: 0;
}

.update-button:not([disabled]):active {
  box-shadow: #fff 2px 2px 0 0, #000 2px 2px 0 1px;
  transform: translate(2px, 2px);
}

.info-button-container {
  position: absolute;
  top: 10px;
  right: 10px;
}

.info-button {
  width: 35px;
  height: 35px;
  background-color: rgb(78, 204, 239);
  border-radius: 50%;
  font-size: 22px;
  line-height: 30px;
  padding: 0;
  text-align: center;
}

@media (max-width: 1024px) {
  body {
    padding: 5px;
  }
  
  h1 {
    order: 0;
  }
  
  .main-content {
    grid-template-columns: 1fr;
    gap: 15px;
    order: 1;
  }
  
  .names-section {
    order: 1;
    min-height: 280px;
  }
  
  .wheel-section {
    order: 2;
    margin-bottom: 20px;
  }
  
  h1 {
    font-size: 28px;
    margin-bottom: 10px;
  }
  
  #wheelCanvas {
    max-height: 40vh;
    width: 100%;
  }
  
  #namesInput {
    height: 120px;
    flex: none;
  }

  .info-button-container {
    position: static;
    text-align: center;
    margin: 5px 0;
    order: 3;
  }
}

/* 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);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-out;
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: white;
  border-radius: 15px;
  border: 3px solid #aa36d4;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.4s ease-out;
  position: relative;
}

.modal-header {
  background: linear-gradient(135deg, #8E44AD 0%, #aa36d4 100%);
  color: white;
  padding: 20px 30px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.modal-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.close-button {
  background: none;
  border: none;
  color: white;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.close-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.modal-body {
  padding: 30px;
  text-align: center;
}

.modal-result {
  font-size: 48px;
  font-weight: bold;
  color: #8E44AD;
  margin: 20px 0;
  animation: celebrateModalResult 0.8s ease-out;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-footer {
  padding: 0 30px 30px;
  text-align: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-50px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes celebrateModalResult {
  0% {
    transform: scale(0.3) rotate(-15deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Mobile modal adjustments */
@media (max-width: 1024px) {
  .modal-content {
    width: 95%;
    margin: 10px;
  }
  
  .modal-header {
    padding: 15px 20px;
  }
  
  .modal-header h2 {
    font-size: 24px;
  }
  
  .close-button {
    width: 35px;
    height: 35px;
    font-size: 28px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .modal-result {
    font-size: 36px;
  }
  
  .modal-footer {
    padding: 0 20px 20px;
  }
}
