* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Helvetica', 'sans-serif', system-ui, 'Segoe UI', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  background-color: white;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  padding: 20px;
}
.container {
  background-color: whitesmoke;
  color: black;
  padding: 35px;
  border-radius: 35px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 400px;
  display: flex;
  text-align: center;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
h1 {
  font-size: 2rem;
  margin-bottom: 30px;
}
.timer {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 30px auto;
}
svg circle {
  fill: none;
  stroke-width: 10;
}
.bg {
  stroke: #23234a;
  stroke-width: 10;
  fill: none;
  opacity: 0.25;
}
.time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
}
.buttons, .set-time {
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
button {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-weight: bolder;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}
.start { background-color: #28a745; color: whitesmoke; }
.pause { background-color: #d79e0d; color: whitesmoke; }
.reset { background-color: #cc2435; color: whitesmoke; }
#edit-time-btn {
  justify-content: center;
  background-color: #2962ff;
  color: whitesmoke;
  margin-bottom: 25px;
}
.set-time {
  align-items: center;
  flex-direction: column;
  background: #ffffff;
  padding: 15px;
  border-radius: 12px;
  display: none;  /* hidden by default */
  gap: 10px;
  text-align: center;
}
.set-time label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ccc;
  justify-content: center;
  width: 100%;
}
/* Indent Short and Long under Breaks */
.set-time label.breaks-label {
  justify-content: center;
  max-width: 200px;
  margin: 0 auto;
}
.set-time .breaks-header {
  margin-top: 10px;
  color: #aaa;
  font-weight: bold;
  text-align: center;
  max-width: 200px;
  margin-left: auto;
  margin-right: auto;
}
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: whitesmoke;
  color: black;
  padding: 30px 30px 20px 30px;
  border-radius: 16px;
  min-width: 260px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  text-align: left;
}
.modal-content label {
  display: block;
  margin: 18px 0 5px 0;
}
.modal-content input {
  background-color: #cdcdcd;
  font-size: medium;
  text-align: center;
  border-radius: 5px;
  margin-right: 5px;
  width: 60px;
  height: 30px;
  padding: 0;
}
.progress {
  stroke-width: 10;
  fill: none;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s linear;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-linecap: round;
}
#modal-set-btn {
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
#modal-set-btn:hover {
  background: #218838;
}

#modal-cancel-btn {
  background: #cc2435;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 20px;
  font-size: 1rem;
  cursor: pointer;
  margin-left: 10px;
  transition: background 0.2s;
}
#modal-cancel-btn:hover {
  background: #a81d2a;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: black;
  }
  .container {
    background-color:  #1f1f1f;
    color: whitesmoke;
  }
  .bg {
    stroke: black;
    opacity: 50%;
  }
  .set-time {
    background: #2c2c2c;
  }
  button {
    color: whitesmoke;
    background-color: #333a56;
  }
  .start { background-color: darkgreen; color: #fff; }
  .pause { background-color: darkgoldenrod; color: #fff; }
  .reset { background-color: darkred; color: #fff; }
  .edit-time-btn {
    background-color: darkblue;
  }
  .set-time input {
    background-color: #22232e;
    color: #fff;
  }
  .modal-content {
    background: #1f1f1f;
    color: whitesmoke;
  }
  .modal-content input {
    background-color: #777777;
    color: whitesmoke;
  }
}