html, body {
      background-color: #f6f6f6;
      margin: 0;
      padding: 0;
}

img {max-width: 100%;}

body {
      display: grid;
      font-family: "Segoe UI", sans-serif;
      grid-template-columns: repeat(12, 1fr);
      grid-auto-rows: minmax(auto, auto);
      color: #3e3e3e;
      text-shadow: 0.4px 0.4px 0.4px rgba(0,0,0,.2);
}

h1 {
      font-weight: lighter;
      grid-column: span 3;
      text-align: center;
      color: #ec407a;
}

#wrapper {
      display: grid;
      grid-column: 3 / 11;
      grid-template-columns: repeat(3, 1fr);
      grid-auto-rows: minmax(auto, auto);
      grid-row-gap: 20px;
      margin-top: 2rem;
}

#clock-box, #info {
      grid-column: span 3;
      display: grid;
      grid-template-columns: repeat(12, 1fr);
}

#clock-box #clock {
      grid-column: 4 / 10;
      background-color: #F8C8C8;
      padding: 1.2rem 1.8rem;
      padding-top: 1rem;
      text-align: center;
      font-size: 2rem;
      border-radius: 8rem;
      box-shadow: 0 4px 8px rgba(0,0,0,0.1);
      transition: all 0.3s ease;
      max-width: 400px;
      margin: 0 auto;
}

#clock-box #clock:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

#days-counter, #time-counter {
      display: block;
      cursor: pointer;
      transition: transform 0.3s ease;
}

#days-counter {
      font-size: 16px;
      margin-bottom: 8px;
}

#time-counter {
      font-family: "Arial", sans-serif;
      line-height: 2.8rem;
      letter-spacing: 1.5px;
}

.avt {
      width: 140px;
      height: 140px;
      border-radius: 50%;
      box-shadow: 2px 2px 8px rgba(0,0,0,.2);
      transition: all 0.3s ease;
      cursor: pointer;
}

.avt:hover {
      transform: scale(1.05);
      box-shadow: 4px 4px 16px rgba(0,0,0,.3);
}

#info {
      margin-top: 1.5rem;
}

#heart {
      grid-column: span 2;
      display: grid;
      grid-template-rows: 2;
      font-size: 38px;
      color: #b90d46;
      align-self: center;
      padding-bottom: 1.8rem;
      text-align: center;
}

#anniversary-date {
      font-size: 14px;
      letter-spacing: 0.2px;
      margin-top: 8px;
}

#info .one {
      grid-column: 3 / 6;
      text-align: center;
}

#info .two {
      grid-column: 8 / 11;
      text-align: center;
}

footer {
      grid-column: span 3;
      text-align: center;
      font-size: 1.4rem;
      font-weight: lighter;
      margin-top: 1rem;
}

/* Style cho footer content trên desktop */
#footer-content {
      font-size: 1.1rem;
      line-height: 1.4;
      color: #333;
}

#music {
      grid-column: span 3;
      position: relative;
      z-index: 1000;
      text-align: center;
      margin-top: 20px;
      display: block;
}

.music-toggle {
      background: linear-gradient(135deg, #ec407a, #f48fb1);
      border: none;
      font-size: 18px;
      cursor: pointer;
      padding: 12px 18px;
      border-radius: 50px;
      transition: all 0.3s ease;
      box-shadow: 0 4px 15px rgba(236, 64, 122, 0.3);
      color: white;
      min-width: 50px;
      height: 50px;
      display: inline-block;
      text-align: center;
      position: relative;
      font-weight: bold;
      text-shadow: 0 1px 2px rgba(0,0,0,0.3);
      margin: 0 auto;
}

.music-toggle:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(236, 64, 122, 0.4);
      background: linear-gradient(135deg, #d81b60, #e91e63);
}

.music-toggle:active {
      transform: translateY(0);
      box-shadow: 0 2px 10px rgba(236, 64, 122, 0.3);
}

.music-toggle.playing {
      background: linear-gradient(135deg, #4caf50, #66bb6a);
      box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
      animation: pulse 2s infinite;
}

.music-toggle.playing:hover {
      background: linear-gradient(135deg, #388e3c, #4caf50);
      box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.play-icon, .pause-icon {
      transition: all 0.3s ease;
      display: inline-block;
      vertical-align: middle;
      line-height: 1;
}

.pause-icon {
      display: none;
}

.music-toggle.playing .play-icon {
      display: none;
}

.music-toggle.playing .pause-icon {
      display: inline-block;
}

@keyframes pulse {
      0% { transform: scale(1); }
      50% { transform: scale(1.05); }
      100% { transform: scale(1); }
}

#mask {
      background-image: linear-gradient(to top, #6d44cc5d 0%, #f09cd880 100%);
      opacity: .42;
      width: 100vw;
      height: 150vh;
      position: fixed;
      top: 0;
      left: 0;
}

/* Style cho love-title trong clock */
#love-title {
      font-size: 1.2rem;
      font-weight: lighter;
      color: #ec407a;
      margin-bottom: 8px;
      text-shadow: 0.4px 0.4px 0.4px rgba(0,0,0,.2);
}

@media (max-width: 992px) {
      body {
            display: grid;
            grid-template-columns: repeat(12, 1fr);
            padding: 0.5rem;
      }
      
      h1 {
            display: none; /* Ẩn h1 cũ */
      }
      
      #wrapper {
            grid-column: span 12;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-top: 1rem;
            align-items: start;
      }

      #clock-box {
            grid-column: 1;
            display: flex;
            justify-content: center;
            align-items: center;
      }

      #clock-box #clock {
            width: 100%;
            max-width: 200px;
            font-size: 1rem;
            padding: 1rem;
            border-radius: 30px;
      }
      
      #love-title {
            font-size: 1rem;
            margin-bottom: 6px;
      }
      
      #days-counter {
            font-size: 12px;
            margin-bottom: 6px;
      }
      
      #time-counter {
            font-size: 1.2rem;
            line-height: 1.4rem;
            letter-spacing: 0.5px;
      }

      #info {
            grid-column: 2;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
            margin-top: 0;
      }

      #info .one, #info .two {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.3rem;
      }

      .avt {
            width: 80px;
            height: 80px;
      }

      #info .one p, #info .two p {
            margin: 0;
            font-size: 0.9rem;
      }

      #heart {
            display: flex;
            flex-direction: column;
            align-items: center;
            font-size: 28px;
            padding: 0;
            margin: 0.5rem 0;
      }

      #anniversary-date {
            font-size: 12px;
            margin-top: 5px;
      }

      #music {
            grid-column: span 2;
            margin-top: 1rem;
            text-align: center;
      }
      
      .music-toggle {
            min-width: 45px;
            height: 45px;
            font-size: 16px;
            padding: 10px 14px;
      }

      footer {
            grid-column: span 2;
            font-size: 1rem;
            margin: 1rem 0;
            padding-bottom: 1rem;
            text-align: center;
      }

      /* Enhanced mobile layout overrides */
      #wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
            margin-top: 0;
      }

      #clock-box {
            order: 1;
            width: 100%;
            display: flex;
            justify-content: center;
      }

      #clock-box #clock {
            width: 100%;
            max-width: 360px;
            padding: 1rem 1.2rem;
            border-radius: 24px;
      }

      #love-title {
            font-size: 1.1rem;
            margin-bottom: 8px;
      }

      #days-counter {
            font-size: 14px;
            margin-bottom: 6px;
      }

      #time-counter {
            font-size: 1.6rem;
            line-height: 2rem;
            letter-spacing: 1px;
      }

      #info {
            order: 2;
            width: 100%;
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            align-items: center;
            gap: 0.8rem;
            margin-top: 0.5rem;
      }

      #info .one, #info .two {
            text-align: center;
      }

      .avt {
            width: 96px;
            height: 96px;
      }

      #heart {
            font-size: 32px;
            padding: 0;
            margin: 0;
      }

      #anniversary-date {
            font-size: 13px;
            margin-top: 6px;
      }

      #music {
            order: 3;
            margin-top: 0.8rem;
      }

      footer {
            order: 4;
      }
}

/* Final mobile overrides: 2-column (55% / 45%), larger clock on the left */
@media (max-width: 992px) {
      body {
            margin: 0;
            padding: 0;
            min-height: 100vh;
            height: 100vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
      }
      
      #wrapper {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
            margin: 0;
            padding: 1rem;
            height: 100vh;
            max-height: 100vh;
      }

      #clock-box {
            width: 100%;
            max-width: 320px;
            display: flex;
            justify-content: center;
            order: 1;
      }

      #clock-box #clock {
            width: 100%;
            height: auto;
            padding: 1.5rem 1.2rem;
            border-radius: 30px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.8rem;
            box-sizing: border-box;
      }

      #love-title {
            font-size: 1.4rem;
            margin: 0;
            flex-shrink: 0;
            order: 1;
      }

      #days-counter {
            font-size: 16px;
            margin: 0;
            flex-shrink: 0;
            order: 2;
      }

      #time-counter {
            font-size: 1.8rem;
            line-height: 2rem;
            letter-spacing: 1.2px;
            flex-shrink: 0;
            margin: 0;
            order: 3;
      }

      /* Style cho music control bên trong clock */
      #clock #music {
            margin: 0;
            text-align: center;
            flex-shrink: 0;
            order: 4;
      }

      #clock .music-toggle {
            min-width: 45px;
            height: 45px;
            font-size: 16px;
            padding: 10px 14px;
      }

      /* Style cho footer content bên trong clock */
      #footer-content {
            font-size: 0.85rem;
            text-align: center;
            color: #666;
            margin: 0;
            padding: 0;
            border-top: none;
            flex-shrink: 0;
            order: 5;
            line-height: 1.3;
      }

      #info {
            width: 100%;
            max-width: 280px;
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            margin: 0;
            order: 2;
            padding: 0.5rem 0;
      }

      #info .one, #info .two {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.5rem;
            flex: 1;
      }

      .avt {
            width: 70px;
            height: 70px;
            flex-shrink: 0;
      }

      #info .one p, #info .two p {
            margin: 0;
            font-size: 0.9rem;
            flex-shrink: 0;
            font-weight: 500;
      }

      #heart { 
            font-size: 22px;
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.3rem;
      }

      #anniversary-date {
            font-size: 9px;
            margin: 0;
            flex-shrink: 0;
            text-align: center;
            line-height: 1.2;
      }
}

/* Remove standalone H1 title globally (we now show it inside the clock) */
h1 { display: none; }

