/* ===========================
   CSS Variables (Theme)
   =========================== */
:root {
  /* Colors */
  --bg-gradient-start: #ffe6ea;
  --bg-gradient-end: #ffc0cb;
  --text-color: #5a3e3e;
  --name-color: #d63384;
  --date-color: #884444;
  --highlight-color: #ff4081;
}

/* ===========================
   Global Styles
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  font-family: 'Nunito', sans-serif;
  overflow: hidden;
  /* Prevent scrolling, everything fits in layout */
  color: var(--text-color);
  height: 100vh;
  width: 100vw;
}

/* ===========================
   Flex Layout Structure
   =========================== */
.layout-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
}

/* ===========================
   Top: Time Counter
   =========================== */
#clock-box {
  flex: 0 0 auto;
  /* Don't grow, just take needed space */
  width: 100%;
  text-align: center;
  z-index: 20;
  padding-top: 2vh;
  /* Ensure it has a background height if needed, but transparent is fine */
}

#clock-text {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--date-color);
  margin-bottom: 5px;
  font-family: 'Pacifico', cursive;
  text-shadow: 2px 2px 0px #fff;
}

#clock-text .name {
  color: var(--name-color);
  font-size: 1.2em;
}

#clock {
  font-weight: 700;
  color: var(--highlight-color);
  text-shadow: 2px 2px 0px #fff;
}

#clock .digit {
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: #d63384;
  font-family: 'Pacifico', cursive;
  margin: 0 2px;
}

/* ===========================
   Middle: Canvas Container
   =========================== */
#main {
  flex: 1 1 auto;
  /* Grow to fill available space */
  position: relative;
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#canvas {
  /* Internal resolution is 1100x680, but we display it fitted */
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* Optional: make it slightly smaller visually per user request "mas pequeño" */
  transform: scale(0.9);
}

/* ===========================
   Bottom: Love Letter
   =========================== */
#letter {
  position: absolute;
  /* Desktop Default: Left Side */
  left: 5%;
  top: 55%;
  /* Center vertically-ish, below headers */
  transform: translateY(-50%);
  width: 300px;

  display: none;
  /* JS toggles this */
  font-size: clamp(1rem, 1.2vw, 1.2rem);
  line-height: 1.5;
  color: #333;
  text-align: left;
  z-index: 30;

  /* Glass effect for readability */
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(2px);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

#letter p {
  margin-bottom: 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
}

/* ===========================
   Responsive / Mobile
   =========================== */
@media screen and (max-width: 768px) {
  #letter {
    /* Mobile: Bottom overlay */
    left: 50%;
    top: auto;
    bottom: 5vh;
    transform: translateX(-50%);
    width: 90%;
    text-align: center;
  }
}