:root {
  --bg: #0f172a;
  --card: rgba(15, 23, 42, 0.85);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #22c55e;
  --primary-dark: #16a34a;
  --secondary: #334155;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --input-bg: rgba(255, 255, 255, 0.06);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top, #1e293b 0%, #0f172a 55%, #020617 100%);
  color: var(--text);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.app {
  width: 100%;
  max-width: 480px;
}

.card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  animation: fadeInUp 0.5s ease;
}

.title {
  margin: 0;
  font-size: 2rem;
  text-align: center;
}

.subtitle {
  margin: 8px 0 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.time-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.time-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

.time-group input {
  width: 100%;
  border: none;
  outline: none;
  border-radius: 16px;
  padding: 16px;
  font-size: 1.2rem;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.time-group input:focus {
  border-color: rgba(34, 197, 94, 0.8);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.display-wrap {
  text-align: center;
  padding: 16px 0 10px;
}

.status {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 8px;
  min-height: 24px;
}

.display {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 8px;
  transition: transform 0.2s ease;
}

.progress-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.progress-bar {
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 14px 0 22px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  border-radius: inherit;
  transition: width 0.25s linear;
}

.buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.btn {
  border: none;
  border-radius: 18px;
  padding: 16px 18px;
  font-size: 1.05rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, background 0.2s ease;
  min-height: 56px;
}

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

.btn-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

.btn-secondary {
  background: linear-gradient(180deg, #475569, var(--secondary));
}

.btn-danger {
  background: linear-gradient(180deg, var(--danger), var(--danger-dark));
}

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

.running .display {
  transform: scale(1.03);
}

.finished .display {
  animation: pulse 0.8s ease infinite;
  color: #fde68a;
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(253, 230, 138, 0);
  }
  50% {
    transform: scale(1.05);
    text-shadow: 0 0 18px rgba(253, 230, 138, 0.6);
  }
}

@media (min-width: 600px) {
  .buttons {
    grid-template-columns: repeat(3, 1fr);
  }

  .card {
    padding: 24px;
  }

  .display {
    font-size: 4.5rem;
  }
}
