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

body {
  background: linear-gradient(45deg, #b91c1c, #c62828, #d32f2f, #e57373);
  color: #fff;
  font-family: 'Roboto', sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: background 0.5s ease;
}

h1 {
  font-size: 3rem;
  margin-bottom: 30px;
}

#mode-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
  font-size: 1.5rem;
  transition: color 0.5s ease;
}

#mode-icon {
  margin-right: 15px;
  font-size: 3rem;
}

#timer {
  width: 40vw;
  height: 40vw;
  max-width: 400px;
  max-height: 400px;
  border: 0.8vw solid #fff;
  border-radius: 50%;
  background: #b91c1c;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 6vw;
  margin-bottom: 30px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
  transition: background-color 0.5s ease, color 0.5s ease;
}

.heartbeat {
  animation: heartbeat 1.5s infinite;
}

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

button {
  background: #fff;
  color: #ff4b1f;
  padding: 15px;
  font-size: 1.5rem;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  width: 80px;
  height: 80px;
  display: flex;
  justify-content: center; 
  align-items: center; 
}

#start-button {
  margin-right: 25px;
}

#timer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#button-container {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

button:hover {
  background: rgba(255, 255, 255, 0.8);
  animation: jelly 0.5s;
}

@keyframes jelly {
  0%, 100% {
    transform: scale(1);
  }
  25% {
    transform: scale(0.9, 1.1);
  }
  50% {
    transform: scale(1.1, 0.9);
  }
  75% {
    transform: scale(0.95, 1.05);
  }
}

button:active {
  transform: scale(0.95);
}

form {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

label {
  margin-bottom: 10px;
  font-size: 1.2rem;
  color: #fff;
}

input {
  margin-bottom: 20px;
  padding: 15px;
  font-size: 1.5rem;
  border-radius: 10px;
  border: 2px solid #fff;
  width: 120px;
  text-align: center;
  background: rgb(255, 255, 255);
  color: #b91c1c;
  transition: border-color 0.3s;
}

input:focus {
  border-color: #b91c1c;
  outline: none;
}

button[type="submit"] {
  background: #b91c1c;
  color: #fff;
  padding: 15px 30px;
  font-size: 1.8rem;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

button[type="submit"]:hover {
  background: #f80101;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  background: linear-gradient(45deg, #b91c1c, #e57373);
  margin: 10% auto;
  padding: 30px;
  border: 1px solid #888;
  width: 90%;
  max-width: 600px;
  border-radius: 20px;
  text-align: center;
}

.close-button {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
}

@media screen and (max-width: 1200px) {
  h1 {
    font-size: 2.8rem;
  }

  #timer {
    width: 40vw;
    height: 40vw;
    font-size: 7vw;
  }

  button {
    width: 75px;
    height: 75px;
  }
}

@media screen and (max-width: 992px) {
  h1 {
    font-size: 2.5rem;
  }

  #timer {
    width: 45vw;
    height: 45vw;
    font-size: 8vw;
  }

  button {
    width: 70px;
    height: 70px;
  }
}

@media screen and (max-width: 768px) {
  h1 {
    font-size: 2.2rem;
  }

  #timer {
    width: 50vw;
    height: 50vw;
    font-size: 9vw;
  }

  button {
    width: 65px;
    height: 65px;
    font-size: 1.2rem;
  }
}

@media screen and (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  #timer {
    width: 55vw;
    height: 55vw;
    font-size: 10vw;
  }

  button {
    width: 60px;
    height: 60px;
    font-size: 1.1rem;
  }

  input {
    width: 100px;
  }
}
