:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --secondary-color: #f8fafc;
  --accent-color: #06b6d4;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.header {
  text-align: center;
  margin-bottom: 3rem;
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

.game-section {
  background: white;
  border-radius: 24px;
  padding: 3rem;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.wheels-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
  align-items: center;
}

.wheel-section {
  text-align: center;
}

.wheel-label {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wheel-container {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 0 auto;
  transition: transform 0.3s ease;
}

.wheel-container:hover {
  transform: scale(1.02);
}

canvas {
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--border-color);
  transition: box-shadow 0.3s ease;
}

canvas:hover {
  box-shadow: var(--shadow-xl);
}

.pointer {
  position: absolute;
  top: 145px;
  right: -5px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 24px solid var(--primary-color);
  z-index: 10;
  transform: rotate(-90deg);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.controls {
  text-align: center;
  margin-bottom: 3rem;
}

.shuffle-btn {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
}

.shuffle-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-hover) 0%, #3730a3 100%);
}

.shuffle-btn:active {
  transform: translateY(0);
}

.shuffle-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.shuffle-btn:hover::before {
  left: 100%;
}

.results {
  text-align: center;
}

.results-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.combo-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.combo {
  padding: 1.25rem 2rem;
  border-radius: 16px;
  font-weight: 600;
  font-size: 1.3rem;
  min-width: 300px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.combo.english {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.combo.sinhala {
  background: linear-gradient(135deg, var(--text-primary) 0%, #374151 100%);
  color: white;
  box-shadow: var(--shadow-md);
  font-size: 1.4rem;
}

.combo:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.footer {
  text-align: center;
  margin-top: 3rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-weight: 400;
}

.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Mobile-first responsive design */
@media (max-width: 480px) {
  .container {
    padding: 0.75rem;
  }

  .title {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .header {
    margin-bottom: 2rem;
  }

  .game-section {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .wheels-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .wheel-container {
    width: 240px;
    height: 240px;
  }

  .wheel-container canvas {
    width: 240px !important;
    height: 240px !important;
  }

  .pointer {
    top: 108px;
    right: -5px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 20px solid var(--primary-color);
  }

  .wheel-label {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

  .shuffle-btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    width: 100%;
    max-width: 280px;
  }

  .controls {
    margin-bottom: 2rem;
  }

  .results-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .combo {
    min-width: auto;
    width: 100%;
    max-width: 280px;
    font-size: 1rem;
    padding: 1rem 1.5rem;
  }

  .combo.sinhala {
    font-size: 1.1rem;
  }

  .footer {
    margin-top: 2rem;
    padding: 1rem;
  }

  .footer-text {
    font-size: 0.8rem;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .container {
    padding: 1.25rem;
  }

  .title {
    font-size: 2.25rem;
  }

  .game-section {
    padding: 2.5rem;
  }

  .wheels-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .wheel-container {
    width: 300px;
    height: 300px;
  }

  .wheel-container canvas {
    width: 300px !important;
    height: 300px !important;
  }

  .pointer {
    top: 138px;
  }

  .combo {
    min-width: 320px;
    font-size: 1.2rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .wheels-container {
    gap: 3rem;
  }

  .wheel-container {
    width: 280px;
    height: 280px;
  }

  .wheel-container canvas {
    width: 280px !important;
    height: 280px !important;
  }

  .pointer {
    top: 128px;
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wheel-spinning {
  animation: spin 4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(720deg);
  }
}
