* {
  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;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
}

body::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  top: -250px;
  right: -250px;
  animation: float 20s infinite ease-in-out;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  bottom: -200px;
  left: -200px;
  animation: float 15s infinite ease-in-out reverse;
  pointer-events: none;
  z-index: 0;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.container {
  position: relative;
  z-index: 10;
  padding: 20px;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}

.glass-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  padding: 40px 30px 30px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
  width: 100%;
  overflow: visible;
}

.title {
  color: white;
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 2px;
  margin-bottom: 30px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.timer-circle {
  position: relative;
  margin: 0 auto 30px;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 10px rgba(167, 139, 250, 0.5));
  position: absolute;
  top: 0;
  left: 0;
}

.progress-ring-circle {
  transition: stroke-dashoffset 0.3s linear;
  stroke-dasharray: 817;
  stroke-dashoffset: 0;
  stroke-linecap: round;
}

.timer-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 4rem;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.2);
  z-index: 1;
}

.mode-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px;
  border-radius: 15px;
}

.mode-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.mode-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.mode-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.controls {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.control-btn {
  flex: 1;
  padding: 15px 30px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.control-btn.primary {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.control-btn.primary:hover {
  box-shadow: 0 6px 25px rgba(124, 58, 237, 0.6);
}

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

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 30px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 600;
  color: white;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.stat-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 5px;
}

.settings-btn {
  width: 100%;
  padding: 12px 30px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.disclaimer {
  margin-top: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.disclaimer p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  line-height: 1.4;
  margin: 0;
  text-align: center;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 0;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

.modal-header h2 {
  color: #667eea;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: #999;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: #667eea;
  transform: rotate(90deg);
}

.modal-body {
  padding: 30px;
}

.setting-group {
  margin-bottom: 25px;
}

.setting-group:last-child {
  margin-bottom: 0;
}

.setting-group label {
  display: block;
  color: #667eea;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.setting-group input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 10px;
  font-size: 1rem;
  background: white;
  color: #333;
  transition: all 0.3s ease;
}

.setting-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-footer {
  padding: 20px 30px;
  border-top: 2px solid rgba(102, 126, 234, 0.2);
  display: flex;
  gap: 15px;
}

.modal-footer .control-btn {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid rgba(102, 126, 234, 0.3);
  background: white;
  color: #667eea;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-footer .control-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.modal-footer .control-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.modal-footer .control-btn.primary:hover {
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

@media (max-width: 480px) {
  body {
    overflow-y: auto;
    align-items: flex-start;
    padding: 20px 0;
  }
  
  .container {
    padding: 15px;
  }
  
  .glass-card {
    padding: 25px 15px 20px;
    border-radius: 20px;
    overflow: visible;
  }
  
  .title {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }
  
  .timer-circle {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    padding: 10px;
  }
  
  .progress-ring {
    width: 200px;
    height: 200px;
  }
  
  .timer-display {
    font-size: 2.2rem;
  }
  
  .mode-selector {
    gap: 6px;
    padding: 6px;
  }
  
  .mode-btn {
    font-size: 0.7rem;
    padding: 10px 8px;
  }
  
  .controls {
    gap: 10px;
  }
  
  .control-btn {
    font-size: 0.85rem;
    padding: 12px 20px;
  }
  
  .settings-btn {
    font-size: 0.8rem;
    padding: 10px 20px;
  }
  
  .disclaimer {
    margin-top: 15px;
    padding: 12px;
  }
  
  .disclaimer p {
    font-size: 0.7rem;
  }
  
  .modal-content {
    width: 95%;
    margin: 10px;
  }
  
  .modal-header {
    padding: 20px;
  }
  
  .modal-header h2 {
    font-size: 1.2rem;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .modal-footer {
    padding: 15px 20px;
    flex-direction: column;
  }
  
  .modal-footer .control-btn {
    width: 100%;
  }
}