:root {
  /* Changed from #238636 to GitHub blue */
  --primary: #1f6feb;
  --secondary: #30363d;
  --accent: #58a6ff;
  --background: #0d1117;
  --card: rgba(22, 27, 34, 0.8);
  --text: #c9d1d9;
  --border: #30363d;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--background);
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 2rem;
}

.container {
  max-width: 800px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 2rem 0;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

.wheel-section {
  background: var(--card);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 8px 16px 0 rgba(174, 209, 255, 0.068);
  margin: 2rem 0;
  width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wheel-container {
  position: relative;
  margin: 2rem auto;
  transition: transform 0.3s ease;
}

.wheel-container:hover {
  transform: scale(1.02);
}

.arrow-container {
  position: relative;
  margin-bottom: 0px;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 1;
}

.arrow {
  position: absolute;
  font-size: 2rem;
  color: var(--primary);
  text-shadow: 0 0 5px rgba(129, 198, 255, 0.5);
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

button {
  background: var(--primary);
  color: white;
  border: 1px solid rgba(240, 246, 252, 0.1);
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

button:hover {
  background: #2f81f7; /* Lighter GitHub blue for hover */
  border-color: rgba(240, 246, 252, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(31, 111, 235, 0.4);
}

button:active {
  transform: translateY(0);
}

#result {
  font-size: 1.5rem;
  font-weight: 500;
  margin-top: 2rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  animation: fadeIn 0.5s ease;
  width: 300px;
  text-align: center;
  min-height: 2em;
  color: var(--text);
}

/* Safari-specific fixes */
@supports (-webkit-touch-callout: none) {
  #result {
    background: var(--card);
  }

  .wheel-section {
    background: var(--card);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  #result {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--card);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wheel-segment:nth-child(even) {
  background-color: #1e90ff; /* blue */
}

/* Mobile Optimization */
@media screen and (max-width: 480px) {
  body {
    padding: 0.5rem;
    min-height: -webkit-fill-available; /* Fix for mobile Safari */
  }

  .container {
    padding: 0.5rem;
  }

  .wheel-section {
    width: calc(100% - 2rem);
    padding: 1.5rem 1rem;
    margin: 0.5rem 0;
    box-sizing: border-box;
  }

  h1 {
    font-size: 1.6rem;
    margin: 0 0 1.5rem 0;
    padding: 0 0.5rem;
    line-height: 1.2;
  }

  .wheel-container {
    margin: 2rem auto 1.5rem;
    transform: scale(0.85);
    transform-origin: center center;
  }

  .wheel-container:hover {
    transform: scale(0.87);
  }

  .arrow-container {
    margin-bottom: -55px;
    height: 24px;
  }

  button {
    width: calc(100% - 2rem);
    max-width: 280px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    margin: 1rem 0;
  }

  #result {
    width: calc(100% - 2rem);
    max-width: 280px;
    font-size: 1.1rem;
    padding: 1rem;
    margin: 1rem 0;
    line-height: 1.4;
    box-sizing: border-box;
  }

  .arrow {
    font-size: 1.5rem;
  }
}

/* Additional breakpoint for very small devices */
@media screen and (max-width: 360px) {
  .wheel-section {
    padding: 1rem 0.5rem;
  }

  h1 {
    font-size: 1.4rem;
  }

  .wheel-container {
    transform: scale(0.75);
  }

  .wheel-container:hover {
    transform: scale(0.77);
  }

  button {
    padding: 0.8rem 1.2rem;
  }
}

/* Fix for landscape mode */
@media screen and (max-height: 480px) {
  body {
    padding: 0.5rem;
  }

  .wheel-section {
    padding: 1rem;
  }

  h1 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }

  .wheel-container {
    margin: 1rem auto;
  }

  button {
    margin: 0.5rem 0;
  }

  #result {
    margin: 0.5rem 0;
  }
}
