:root {
  --zuve-black: #000000;
  --zuve-offwhite: #F7F4EF;
  --zuve-blush: #F6E5E1;
  --zuve-neutral: #CCCCCC;
  --zuve-gold: #E8A666;
  --spacing-unit: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #F7F4EF 0%, #F6E5E1 100%);
  color: var(--zuve-black);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 500px;
  margin: 0 auto;
  padding: calc(var(--spacing-unit) * 2);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  margin-bottom: calc(var(--spacing-unit) * 3);
  padding-top: calc(var(--spacing-unit) * 2);
}

.logo {
  max-height: 56px;
  width: auto;
  margin-bottom: calc(var(--spacing-unit) * 2);
  display: block;
  margin-left: auto;
  margin-right: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: calc(var(--spacing-unit) * 2);
  color: var(--zuve-black);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.intro {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: #333;
  max-width: 380px;
  margin: 0 auto;
  font-weight: 400;
}

.view {
  display: none;
  flex: 1;
}

.view.active {
  display: flex;
  flex-direction: column;
}

#formView {
  justify-content: flex-start;
}

#wheelView {
  justify-content: center;
  align-items: center;
  padding: calc(var(--spacing-unit) * 2) 0;
}

.form-group {
  margin-bottom: calc(var(--spacing-unit) * 3);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: calc(var(--spacing-unit) * 1.25);
  color: var(--zuve-black);
  font-size: 0.9375rem;
  letter-spacing: 0.3px;
}

input[type="text"],
input[type="tel"] {
  width: 100%;
  padding: calc(var(--spacing-unit) * 2);
  border: 2px solid transparent;
  border-radius: calc(var(--spacing-unit) * 1.5);
  font-size: 1.0625rem;
  font-family: 'Inter', sans-serif;
  background-color: white;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

input[type="text"]:focus,
input[type="tel"]:focus {
  outline: none;
  border-color: var(--zuve-gold);
  box-shadow: 0 4px 16px rgba(232, 166, 102, 0.25);
  transform: translateY(-1px);
}

input[type="text"].error,
input[type="tel"].error {
  border-color: #d32f2f;
  background-color: #ffebee;
}

.checkbox-group {
  margin-bottom: calc(var(--spacing-unit) * 2.5);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1.5;
  padding: calc(var(--spacing-unit) * 1.5);
  background: white;
  border-radius: calc(var(--spacing-unit) * 1);
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.checkbox-label:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.checkbox-label input[type="checkbox"] {
  margin-right: calc(var(--spacing-unit) * 1.5);
  margin-top: 2px;
  min-width: 20px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--zuve-gold);
}

.error-message {
  display: block;
  color: #d32f2f;
  font-size: 0.8125rem;
  margin-top: calc(var(--spacing-unit) * 0.75);
  font-weight: 500;
  min-height: 20px;
}

.error-alert {
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
  border: 2px solid #ef5350;
  color: #c62828;
  padding: calc(var(--spacing-unit) * 2.5);
  border-radius: calc(var(--spacing-unit) * 1.5);
  margin-top: calc(var(--spacing-unit) * 2);
  font-size: 0.9375rem;
  font-weight: 500;
  display: none;
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.2);
}

.error-alert.show {
  display: block;
  animation: slideDown 0.3s ease;
}

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

.btn-primary {
  width: 100%;
  padding: calc(var(--spacing-unit) * 2.5);
  font-size: 1.25rem;
  font-weight: 700;
  border: none;
  border-radius: calc(var(--spacing-unit) * 1.5);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(135deg, var(--zuve-black) 0%, #2a2a2a 100%);
  color: var(--zuve-offwhite);
  margin-bottom: calc(var(--spacing-unit) * 2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.btn-primary::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;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.wheel-helper {
  text-align: center;
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: calc(var(--spacing-unit) * 3);
  color: var(--zuve-black);
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wheel-container {
  position: relative;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  aspect-ratio: 1;
  filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.15));
}

.wheel-pointer {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 32px solid var(--zuve-gold);
  z-index: 10;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.wheel-pointer::after {
  content: '';
  position: absolute;
  top: -32px;
  left: -20px;
  width: 40px;
  height: 40px;
  background: var(--zuve-gold);
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  cursor: pointer;
  touch-action: none;
  border-radius: 50%;
  box-shadow: 0 0 0 8px white, 0 12px 40px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: white;
  display: block;
}

#wheelCanvas:hover {
  transform: scale(1.02);
  box-shadow: 0 0 0 8px white, 0 16px 48px rgba(0, 0, 0, 0.25);
}

#wheelCanvas:active {
  transform: scale(0.98);
}

#wheelCanvas.spinning {
  pointer-events: none;
  box-shadow: 0 0 0 8px white, 0 16px 56px rgba(232, 166, 102, 0.4);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  padding: calc(var(--spacing-unit) * 2);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

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

.modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border-radius: calc(var(--spacing-unit) * 3);
  padding: calc(var(--spacing-unit) * 5);
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--zuve-gold), var(--zuve-blush), var(--zuve-gold));
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes slideUp {
  from {
    transform: translateY(40px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.25rem;
  line-height: 1.2;
  margin-bottom: calc(var(--spacing-unit) * 2.5);
  text-align: center;
  color: var(--zuve-black);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.modal-body {
  margin-bottom: calc(var(--spacing-unit) * 4);
  text-align: center;
}

.modal-body p {
  font-size: 1.1875rem;
  line-height: 1.6;
  margin-bottom: calc(var(--spacing-unit) * 3);
  color: #333;
  font-weight: 500;
}

.result-details {
  background: linear-gradient(135deg, var(--zuve-blush) 0%, #f0d6d1 100%);
  padding: calc(var(--spacing-unit) * 3);
  border-radius: calc(var(--spacing-unit) * 2);
  margin-top: calc(var(--spacing-unit) * 3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 2px solid rgba(232, 166, 102, 0.3);
}

.result-details p {
  font-size: 1rem;
  margin-bottom: calc(var(--spacing-unit) * 1.5);
  color: var(--zuve-black);
  font-weight: 600;
}

.result-details p:last-child {
  margin-bottom: 0;
}

.redemption-code {
  background: white;
  padding: calc(var(--spacing-unit) * 2);
  border-radius: calc(var(--spacing-unit) * 1);
  margin: calc(var(--spacing-unit) * 2) 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.redemption-code strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--zuve-gold);
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.modal-footer {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 2);
}

.redeem-text {
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #666;
  margin: 0;
  padding: calc(var(--spacing-unit) * 1) 0;
  letter-spacing: 0.2px;
  text-transform: none;
}

.btn-share {
  width: 100%;
  padding: calc(var(--spacing-unit) * 2);
  font-size: 1.125rem;
  font-weight: 600;
  border: 2px solid var(--zuve-gold);
  border-radius: calc(var(--spacing-unit) * 1.5);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.5px;
  background: white;
  color: var(--zuve-black);
  transition: all 0.3s ease;
  min-height: 52px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-share:hover {
  background: var(--zuve-gold);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232, 166, 102, 0.3);
}

.btn-share:active {
  transform: translateY(0);
}

.modal-microcopy {
  text-align: center;
  font-size: 0.875rem;
  color: #666;
  line-height: 1.5;
  margin-top: calc(var(--spacing-unit) * 2);
  margin-bottom: 0;
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #wheelCanvas {
    transition: none !important;
  }
}

@media (min-width: 768px) {
  .container {
    padding: calc(var(--spacing-unit) * 4);
  }

  h1 {
    font-size: 3rem;
  }

  .intro {
    font-size: 1.1875rem;
  }

  .modal-content {
    padding: calc(var(--spacing-unit) * 7);
  }

  .modal-header h2 {
    font-size: 2.5rem;
  }

  .wheel-container {
    max-width: 500px;
  }
}

@media (max-width: 374px) {
  .container {
    padding: calc(var(--spacing-unit) * 1.5);
  }

  h1 {
    font-size: 2rem;
  }

  .logo {
    max-height: 48px;
  }

  .btn-primary {
    font-size: 1.125rem;
    padding: calc(var(--spacing-unit) * 2);
  }

  .wheel-container {
    max-width: 340px;
  }

  .modal-content {
    padding: calc(var(--spacing-unit) * 3);
  }

  .modal-header h2 {
    font-size: 1.75rem;
  }
}

@media (min-height: 700px) {
  .wheel-container {
    max-width: 480px;
  }
}

@media (min-height: 800px) {
  .wheel-container {
    max-width: 500px;
  }
}
