@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #0e4b99 100%);
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  color: #e2e8f0;
  overflow:auto;
  position: relative;
}

body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-20px) rotate(1deg); }
}

.floating-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.6) 0%, rgba(96, 165, 250, 0.1) 70%, transparent 100%);
  border-radius: 50%;
  animation: particleFloat 15s infinite linear;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

.container {
  text-align: center;
  max-width: 480px;
  width: 100%;
  position: relative;
  z-index: 10;
  background: rgba(15, 15, 35, 0.4);
  backdrop-filter: blur(20px);
  border-radius: 32px;
  padding: 48px 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 32px 64px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(96, 165, 250, 0.5);
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 1rem;
  color: #94a3b8;
  margin-bottom: 32px;
  font-weight: 400;
  opacity: 0.8;
}

#instruction {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 32px;
  min-height: 32px;
  color: #f1f5f9;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  letter-spacing: -0.01em;
}

.circle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 40px 0;
  position: relative;
  height: 220px;
}

.circle {
  width: 160px;
  height: 160px;
  background: linear-gradient(135deg, 
    rgba(96, 165, 250, 0.2) 0%, 
    rgba(167, 139, 250, 0.2) 50%, 
    rgba(244, 114, 182, 0.2) 100%);
  border-radius: 50%;
  transition: all 4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 0 0 1px rgba(96, 165, 250, 0.2),
    0 0 60px rgba(96, 165, 250, 0.1),
    inset 0 0 60px rgba(255, 255, 255, 0.05);
  z-index: 2;
}

.circle::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  border-radius: 50%;
  background: linear-gradient(135deg, transparent, rgba(96, 165, 250, 0.1), transparent);
  opacity: 0;
  transition: opacity 1s ease;
}

.inner-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  transition: all 4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.progress-svg {
  transform: rotate(-90deg);
}

.progress-circle {
  transition: stroke-dashoffset 0.1s ease-out, stroke 0.3s ease;
}

.expand {
  transform: scale(1.4);
  box-shadow: 
    0 0 0 1px rgba(96, 165, 250, 0.4),
    0 0 80px rgba(96, 165, 250, 0.3),
    0 0 120px rgba(167, 139, 250, 0.2),
    inset 0 0 60px rgba(255, 255, 255, 0.1);
}

.expand::before {
  opacity: 1;
}

.expand .inner-circle {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 0 30px rgba(96, 165, 250, 0.4);
}

.contract {
  transform: scale(0.7);
  box-shadow: 
    0 0 0 1px rgba(244, 114, 182, 0.4),
    0 0 40px rgba(244, 114, 182, 0.2),
    inset 0 0 40px rgba(255, 255, 255, 0.05);
}

.contract .inner-circle {
  transform: translate(-50%, -50%) scale(0.8);
  box-shadow: 0 0 15px rgba(244, 114, 182, 0.4);
}

.hold {
  box-shadow: 
    0 0 0 1px rgba(167, 139, 250, 0.4),
    0 0 60px rgba(167, 139, 250, 0.3),
    inset 0 0 60px rgba(255, 255, 255, 0.05);
}

.hold .inner-circle {
  box-shadow: 0 0 25px rgba(167, 139, 250, 0.4);
}

.breathing-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 2s ease;
  pointer-events: none;
  z-index: 0;
}

.controls {
  margin: 32px 0;
}

.primary-btn {
  position: relative;
  padding: 14px 32px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 24px;
  transition: all 0.3s ease;
  box-shadow: 
    0 8px 24px rgba(59, 130, 246, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 32px rgba(59, 130, 246, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

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

.primary-btn.stop-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 
    0 8px 24px rgba(239, 68, 68, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

.primary-btn.stop-btn:hover {
  box-shadow: 
    0 12px 32px rgba(239, 68, 68, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.btn-glow {
  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;
}

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

.stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

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

.stat-label {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.back-link:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.back-link svg {
  transition: transform 0.3s ease;
}

.back-link:hover svg {
  transform: translateX(-2px);
}

/* Responsive Design */
@media (max-width: 480px) {
  .container {
    padding: 32px 24px;
    margin: 10px;
  }

  h1 {
    font-size: 2rem;
  }

  .circle {
    width: 140px;
    height: 140px;
  }

  .circle-container {
    height: 200px;
  }

  .stats {
    gap: 24px;
  }

  .primary-btn {
    padding: 12px 24px;
    font-size: 1rem;
  }
}

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

  .particle {
    display: none;
  }
}

/* Focus states for keyboard navigation */
.primary-btn:focus-visible,
.back-link:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}