:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #a855f7;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #334155;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1e293b 100%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 600px;
}

.header {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeInDown 0.8s ease-out;
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.progress-bar {
  background: var(--bg-card);
  border-radius: 20px;
  height: 40px;
  position: relative;
  overflow: hidden;
  margin-bottom: 40px;
  border: 2px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 18px;
  width: 0%;
  transition: width 0.5s ease-out;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.ad-btn {
  background: linear-gradient(135deg, var(--bg-card) 0%, #334155 100%);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 30px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ad-btn:hover:not(:disabled) {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.ad-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ad-btn.completed {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  border-color: var(--success);
  cursor: default;
}

.btn-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.btn-text {
  font-size: 1rem;
  color: var(--text-secondary);
}

.ad-btn.completed .btn-text {
  color: white;
}

.timer-container {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  border: 2px solid var(--primary);
  position: relative;
  overflow: hidden;
}

.timer-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
  animation: pulse 2s ease-in-out infinite;
}

.timer-text {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.timer-display {
  font-size: 5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  position: relative;
  z-index: 1;
}

.timer-unit {
  font-size: 3rem;
  opacity: 0.7;
}

.timer-subtext {
  margin-top: 20px;
  color: var(--text-secondary);
}

.message-box {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  border: 2px solid var(--border);
}

.message-box.error {
  border-color: var(--error);
}

.message-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.message-box h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.message-box p {
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.success-container {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 50px 40px;
  text-align: center;
  border: 2px solid var(--success);
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.success-container h2 {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--success);
}

.success-container p {
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.reward-code {
  background: var(--bg-dark);
  border-radius: 16px;
  padding: 30px;
  border: 2px solid var(--border);
}

.reward-code label {
  display: block;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.code-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

#codeText {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Courier New', monospace;
}

.copy-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.copy-btn:hover {
  background: var(--primary-dark);
}

.copy-btn.copied {
  background: var(--success);
}

.hidden {
  display: none !important;
}

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

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

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 2rem;
  }
  
  .button-grid {
    grid-template-columns: 1fr;
  }
  
  .timer-display {
    font-size: 4rem;
  }
}

