@font-face {
  font-family: "RobotoMono";
  src: url("Roboto_Mono/RobotoMono-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 700;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "RobotoMono", sans-serif;
  background-image: url("fondo.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* desktop ok */
}

/* ----- LAYOUT DESKTOP ----- */
#contenedor {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  grid-column-gap: 0px;
  grid-row-gap: 0px;

  /* ✅ estabilidad */
  min-height: 100vh;
  place-items: center; /* centra el contenido dentro del grid */
}

article {
  grid-area: 2 / 2 / 6 / 6;
  background-color: #003505b7;
  width: min(850px, 92vw);
  aspect-ratio: 850 / 430;
  border-radius: 30px;

  margin: 0 auto;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(5, 1fr);
  grid-column-gap: 0px;
  grid-row-gap: 0px;
}

/* ----- BOTONES ----- */
.btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s, filter 0.2s;
}

.btn:hover {
  opacity: 0.7;
  filter: brightness(120%);
}

.btn-imagen {
  transition: all 0.3s ease;
}

.btns_esquina {
  grid-area: 1 / 3 / 2 / 4;
  text-align: right;
  margin-right: 25px;
  margin-top: 5px;
}

.btns_esquina .btn {
  margin: 10px;
}

.btns_esquina .btn img {
  height: 70px;
}

.btns_abajo {
  text-align: center;
  grid-area: 5 / 2 / 6 / 3;
  margin-bottom: 45px;
}

.btns_abajo .btn {
  margin: 5px;
}

.btns_abajo .btn img {
  height: 50px;
}

/* ----- RELOJ / START ----- */
#reloj {
  text-align: center;
  grid-area: 3 / 2 / 4 / 3;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  margin-bottom: 0.8rem;
  position: relative;
}

#start {
  text-align: center;
  grid-area: 4 / 2 / 5 / 3;
}

.time {
  color: #fff;
  font-size: 6rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 5px;
}

.colon {
  color: #fff;
  font-size: 6rem;
  font-weight: 100;
}

/* ----- BOTÓN START ----- */
.btn_start {
  background-color: #003505;
  color: #fff;
  border: none;
  border-radius: 90px;
  padding: 12px 70px;
  margin-bottom: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: "RobotoMono", monospace !important;
}

.btn_start:hover {
  background: darkolivegreen;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(94, 184, 115, 0.3);
}

/* ----- MOTIVATION ----- */
.motivation {
  grid-area: 2 / 2 / 3 / 3;
  text-align: center;
  color: #fff;
  font-size: 1.2rem;
  letter-spacing: 1px;
  opacity: 0.9;
}

/* ----- SETTINGS MODAL ----- */
.settings {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.settings.active {
  display: flex;
}

.settings-content {
  background: white;
  padding: 4rem;
  border-radius: 20px;
  max-width: 400px;
  width: 90%;
}

.settings-content h2 {
  color: olivedrab;
  margin-bottom: 1.5rem;
}

.setting-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.setting-group label {
  display: block;
  color: olivedrab;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.setting-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid darkolivegreen;
  border-radius: 10px;
  font-size: 1rem;
}

.settings-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.settings-buttons button {
  flex: 1;
  padding: 0.75rem;
  border-radius: 10px;
  font-size: 1rem;
}

.save-btn {
  background: olivedrab;
  color: white;
}

.cancel-btn {
  background: rgb(133, 185, 48);
  color: darkgreen;
}

/* ----- RESPONSIVE ----- */
@media (max-width: 750px) {

  body{
    background-attachment: scroll;
  }

  #contenedor{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;      /* mejor que 100vh en móvil */
    padding: 14px;
  }

  article{
    width: 100%;
    max-width: 420px;
    aspect-ratio: auto;      /* <- importante */
    height: auto;            /* <- importante */
    border-radius: 18px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;

    padding: 18px 16px;
  }

  /* Quitamos “restos” de desktop que estorban */
  .btns_esquina{
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 0;
  }

  .btns_esquina .btn img{ height: 56px; }
  .btns_abajo .btn img{ height: 44px; }

  .motivation{
    padding: 0;
    margin-top: 6px;
    font-size: 1rem;
    text-align: center;
  }

  #reloj{
    margin: 0;
  }

  /* ✅ Tipografía fluida para que nunca se salga */
  .time, .colon{
    font-size: clamp(3.2rem, 12vw, 4.6rem);
    letter-spacing: 2px;
  }

  #start{
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .btn_start{
    width: 100%;
    max-width: 320px;
    padding: 12px 16px;
  }

  .btns_abajo{
    margin: 0;               /* fuera el margin-bottom:45px en móvil */
  }
}