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

:root {
  --bg-dark: #0A0E27;
  --bg-card: #1A1F3A;
  --primary: #00D9FF;
  --secondary: #39FF14;
  --accent: #A855F7;
  --text-primary: #FFFFFF;
  --text-secondary: #A0AEC0;
  --gradient: linear-gradient(135deg, #00D9FF, #A855F7, #39FF14);
}

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  position: relative;
}

.screen {
  min-height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-dark);
  background-image: 
    radial-gradient(ellipse at 20% 30%, rgba(0, 217, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
}

/* Welcome Screen */
.welcome-screen {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.settings-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
}

.settings-btn:hover {
  opacity: 1;
  transform: rotate(45deg);
}

.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.logo-container {
  animation: float 3s ease-in-out infinite;
}

.logo-emoji {
  font-size: 120px;
  display: block;
  filter: drop-shadow(0 0 30px rgba(0, 217, 255, 0.4));
}

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

.app-title {
  font-size: 48px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -2px;
}

.tagline {
  font-size: 20px;
}

.tagline-main {
  color: var(--text-primary);
}

.tagline-sub {
  color: var(--text-secondary);
}

.primary-btn {
  background: var(--gradient);
  border: none;
  padding: 18px 48px;
  font-size: 18px;
  font-weight: 700;
  color: var(--bg-dark);
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.primary-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(0, 217, 255, 0.4);
}

.primary-btn:active {
  transform: scale(0.98);
}

.secondary-btn {
  background: transparent;
  border: 2px solid var(--text-secondary);
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  margin-top: 12px;
}

.secondary-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.welcome-footer {
  position: absolute;
  bottom: 30px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.welcome-footer p {
  margin-bottom: 8px;
}

.footer-link {
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s;
}

.footer-link:hover {
  opacity: 0.8;
}

/* Back button */
.back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--bg-card);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s;
}

.back-btn:hover {
  background: var(--primary);
  color: var(--bg-dark);
}

/* Waiting Screen */
.waiting-screen {
  padding-top: 80px;
}

.screen-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 32px;
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  flex: 1;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.preset-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.preset-card:hover {
  transform: scale(1.02);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(0, 217, 255, 0.2);
}

.preset-card:active {
  transform: scale(0.98);
}

.preset-emoji {
  font-size: 36px;
}

.preset-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.preset-duration {
  font-size: 12px;
  color: var(--text-secondary);
}

.surprise-btn {
  background: var(--gradient);
  border: none;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--bg-dark);
  border-radius: 16px;
  cursor: pointer;
  margin-top: 20px;
  width: 100%;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  display: block;
  font-family: inherit;
  transition: transform 0.2s;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.1); }
}

.surprise-btn:hover {
  transform: scale(1.02);
}

/* Workout Screen */
.workout-screen {
  padding: 0;
  touch-action: pan-y;
  user-select: none;
}

.workout-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.progress-counter {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

.quit-btn {
  background: var(--bg-card);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.quit-btn:hover {
  background: #FF6B6B;
  color: white;
}

.card-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  padding: 20px;
}

.card {
  width: 100%;
  max-width: 400px;
  padding: 48px 32px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.command-card {
  background: linear-gradient(180deg, rgba(0, 217, 255, 0.1) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(0, 217, 255, 0.3);
  box-shadow: 0 0 60px rgba(0, 217, 255, 0.15);
}

.card-emoji {
  font-size: 80px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.command-text {
  font-size: 56px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -2px;
  text-shadow: 0 0 30px rgba(0, 217, 255, 0.5);
}

.card-instruction {
  font-size: 16px;
  color: var(--text-secondary);
}

.rest-card {
  background: linear-gradient(180deg, rgba(57, 255, 20, 0.1) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(57, 255, 20, 0.3);
  box-shadow: 0 0 60px rgba(57, 255, 20, 0.15);
}

.rest-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--secondary);
}

.rest-timer {
  font-size: 72px;
  font-weight: 800;
  color: var(--secondary);
  text-shadow: 0 0 30px rgba(57, 255, 20, 0.5);
  font-variant-numeric: tabular-nums;
}

.rest-subtext {
  font-size: 16px;
  color: var(--text-secondary);
  font-style: italic;
}

.motivation-card {
  background: linear-gradient(180deg, rgba(57, 255, 20, 0.1) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(57, 255, 20, 0.3);
}

.motivation-text {
  font-size: 36px;
  font-weight: 700;
  color: var(--secondary);
}

.motivation-subtext {
  font-size: 18px;
  color: var(--text-secondary);
}

.transition-card {
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.1) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.transition-text {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.transition-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.completion-card {
  background: var(--gradient);
  padding: 48px;
}

.completion-celebration {
  font-size: 24px;
  font-weight: 800;
  color: var(--bg-dark);
}

.completion-emoji {
  font-size: 64px;
}

.completion-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--bg-dark);
}

.completion-subtext {
  font-size: 16px;
  color: var(--bg-dark);
  opacity: 0.8;
}

.swipe-hint {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-secondary);
  font-size: 14px;
  animation: bounce 2s ease-in-out infinite;
}

.swipe-hint.reminder {
  color: var(--primary);
  animation: bounce 0.5s ease-in-out infinite;
}

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

/* Complete Screen */
.complete-screen {
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.complete-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  z-index: 1;
}

.complete-title {
  font-size: 36px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.complete-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.complete-emoji {
  font-size: 64px;
}

.complete-waiting-text {
  font-size: 24px;
  font-weight: 600;
}

.complete-waiting-sub {
  color: var(--text-secondary);
}

.stats-box {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  gap: 32px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.sarcastic-message {
  font-size: 16px;
  color: var(--secondary);
  font-style: italic;
}

.complete-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.action-btn {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.action-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.action-btn.primary {
  background: var(--gradient);
  color: var(--bg-dark);
  border: none;
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 100;
}

.confetti-particle {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Progress Screen */
.progress-screen {
  padding-top: 80px;
  gap: 24px;
  overflow-y: auto;
}

.progress-section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.streak-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.streak-emoji {
  font-size: 36px;
}

.streak-number {
  font-size: 48px;
  font-weight: 800;
  color: var(--secondary);
}

.streak-label {
  font-size: 16px;
  color: var(--text-secondary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-item {
  text-align: center;
}

.all-time-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.all-time-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.all-time-stat .label {
  color: var(--text-secondary);
}

.all-time-stat .value {
  font-weight: 600;
  color: var(--primary);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.achievement {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  transition: all 0.2s;
}

.achievement.unlocked {
  background: rgba(0, 217, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 217, 255, 0.1);
}

.achievement.locked {
  opacity: 0.5;
}

.achievement-badge {
  font-size: 32px;
}

.achievement-name {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
}

.progress-footer, .settings-footer {
  margin-top: auto;
  padding-top: 24px;
  text-align: center;
}

/* Settings Screen */
.settings-screen {
  padding-top: 80px;
  gap: 20px;
}

.settings-section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-label {
  font-weight: 500;
}

.toggle {
  background: var(--bg-dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.toggle.on {
  background: var(--secondary);
  color: var(--bg-dark);
  border-color: var(--secondary);
}

.sarcasm-selector {
  display: flex;
  gap: 8px;
}

.sarcasm-btn {
  flex: 1;
  background: var(--bg-dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.sarcasm-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.about-section .about-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.danger-zone .section-title.danger {
  color: #FF6B6B;
}

.clear-btn {
  background: transparent;
  border: 2px solid #FF6B6B;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: #FF6B6B;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  font-family: inherit;
}

.clear-btn:hover {
  background: #FF6B6B;
  color: white;
}

.confirm-box {
  text-align: center;
}

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

.confirm-buttons {
  display: flex;
  gap: 12px;
}

.confirm-yes, .confirm-no {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.confirm-yes {
  background: #FF6B6B;
  border: none;
  color: white;
}

.confirm-no {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

/* Achievement Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.3s ease-out;
}

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

.achievement-modal {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.achievement-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
  opacity: 0.3;
  animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

.modal-badge {
  font-size: 80px;
  display: block;
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.modal-name {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.modal-close {
  background: var(--gradient);
  border: none;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 700;
  color: var(--bg-dark);
  border-radius: 50px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  font-family: inherit;
  transition: transform 0.2s;
}

.modal-close:hover {
  transform: scale(1.05);
}

/* Responsive */
@media (max-width: 400px) {
  .app-title {
    font-size: 36px;
  }
  
  .logo-emoji {
    font-size: 80px;
  }
  
  .command-text {
    font-size: 42px;
  }
  
  .card-emoji {
    font-size: 60px;
  }
  
  .presets-grid {
    gap: 8px;
  }
  
  .preset-card {
    padding: 12px;
  }
  
  .preset-emoji {
    font-size: 28px;
  }
  
  .stats-box {
    gap: 16px;
    padding: 16px;
  }
  
  .stat-value {
    font-size: 24px;
  }
}

@media (min-width: 768px) {
  .presets-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .achievements-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}