@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Playfair+Display:ital,wght@0,500;0,600;1,500&display=swap');


:root {
  --text: #f8f2e9;
  --muted: #b9b6b4;
  --pink: #f6b5aa;
}


* {
  box-sizing: border-box;
}


html,
body {
  margin: 0;
  min-height: 100%;
}


body {
  min-height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 30px;

  background: #1b232d;

  color: var(--text);

  font-family: "DM Sans", sans-serif;
}


/* =========================
   BACKGROUND
========================= */

body::before {
  content: "";

  position: fixed;
  inset: 0;

  z-index: -1;

  background:
    radial-gradient(
      ellipse at 65% 20%,
      #404150 0%,
      transparent 46%
    ),
    radial-gradient(
      ellipse at 15% 85%,
      #42313e 0%,
      transparent 47%
    );

  pointer-events: none;
}


/* =========================
   MAIN LAYOUT
========================= */

.container {
  width: 100%;
  max-width: 1000px;

  text-align: center;

  display: flex;
  flex-direction: column;

  gap: 90px;
}


/* =========================
   TIMER
========================= */

.timer-section {
  width: 100%;
}


.label {
  margin: 0 0 28px;

  color: var(--pink);

  text-transform: uppercase;

  letter-spacing: 0.25em;

  font-size: 0.8rem;
  font-weight: 600;
}


.timer {
  display: grid;

  grid-template-columns: repeat(5, 1fr);

  gap: 20px;

  align-items: start;
}


.time-box {
  min-width: 0;

  display: flex;
  flex-direction: column;

  gap: 8px;
}


.time-box span {
  font-family: "Playfair Display", serif;

  font-size: clamp(2.6rem, 6vw, 5.5rem);

  line-height: 1;

  color: var(--text);
}


.time-box small {
  color: var(--muted);

  text-transform: uppercase;

  letter-spacing: 0.15em;

  font-size: 0.7rem;
}


/* =========================
   HEART SECTION
========================= */

.heart-section {
  display: flex;
  flex-direction: column;

  align-items: center;

  gap: 10px;
}


.heart-wrap {
  position: relative;

  width: 190px;
  height: 170px;

  display: grid;
  place-items: center;
}


/* =========================
   HEART BUTTON
========================= */

.heart-button {
  position: relative;

  width: 150px;
  height: 140px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  outline: none;

  background: transparent;

  padding: 0;

  cursor: pointer;

  font-family: Arial, Helvetica, sans-serif;

  font-size: 9rem;

  line-height: 1;

  color: #f6b5aa;

  filter:
    drop-shadow(
      0 10px 20px rgba(246, 181, 170, 0.18)
    )
    drop-shadow(
      0 0 25px rgba(246, 181, 170, 0.15)
    );

  transition:
    transform 0.2s ease,
    filter 0.2s ease;

  user-select: none;
  -webkit-user-select: none;

  -webkit-tap-highlight-color: transparent;

  /* Prevent iPhone double-tap zoom on fast clicks */
  touch-action: manipulation;
}


/* =========================
   HEART HOVER
========================= */

@media (hover: hover) and (pointer: fine) {

  .heart-button:hover {
    transform: scale(1.08);

    filter:
      drop-shadow(
        0 12px 25px rgba(246, 181, 170, 0.35)
      )
      drop-shadow(
        0 0 40px rgba(246, 181, 170, 0.3)
      );
  }

}


/* Keyboard focus */

.heart-button:focus-visible {
  outline: 2px solid var(--pink);

  outline-offset: 8px;

  border-radius: 50%;
}


/* =========================
   HEART CLICK POP
========================= */

.heart-button.clicked {
  animation: heartPop 0.55s ease;
}


@keyframes heartPop {

  0% {
    transform: scale(1);
  }

  20% {
    transform: scale(0.78);
  }

  50% {
    transform: scale(1.27);
  }

  70% {
    transform: scale(0.94);
  }

  100% {
    transform: scale(1);
  }

}


/* =========================
   GLOW RING
========================= */

.heart-button::after {
  content: "";

  position: absolute;

  width: 95px;
  height: 95px;

  border: 2px solid rgba(246, 181, 170, 0.8);

  border-radius: 50%;

  opacity: 0;

  transform: scale(0.5);

  pointer-events: none;
}


.heart-button.clicked::after {
  animation: heartRing 0.7s ease-out;
}


@keyframes heartRing {

  0% {
    opacity: 0.8;

    transform: scale(0.5);
  }

  100% {
    opacity: 0;

    transform: scale(2);
  }

}


/* =========================
   HEART COUNTER
========================= */

.heart-count {
  margin: 0;

  font-family: "Playfair Display", serif;

  line-height: 1;
}


.heart-count span {
  color: var(--pink);

  font-size: 3rem;
}


.heart-label {
  margin: 4px 0 0;

  color: var(--muted);

  font-size: 0.8rem;

  letter-spacing: 0.08em;
}


/* =========================
   PARTICLE CONTAINER
========================= */

.heart-particles {
  position: absolute;

  inset: 0;

  pointer-events: none;

  overflow: visible;
}


/* =========================
   FLOATING HEART PARTICLES
========================= */

.particle {
  position: absolute;

  left: 50%;
  top: 50%;

  color: #f6b5aa;

  opacity: 0;

  pointer-events: none;

  font-family: Arial, Helvetica, sans-serif;

  font-size: 1.3rem;

  line-height: 1;

  text-shadow:
    0 0 12px rgba(246, 181, 170, 0.35);

  animation:
    floatHeart 1s ease-out forwards;
}


@keyframes floatHeart {

  0% {
    opacity: 1;

    transform:
      translate(-50%, -50%)
      scale(0.4)
      rotate(var(--rotation));
  }

  30% {
    opacity: 1;
  }

  100% {
    opacity: 0;

    transform:
      translate(
        calc(-50% + var(--x)),
        calc(-50% + var(--y))
      )
      scale(1.4)
      rotate(var(--rotation));
  }

}


/* =========================
   TABLET
========================= */

@media (max-width: 850px) {

  .timer {
    grid-template-columns: repeat(3, 1fr);

    gap: 32px 18px;
  }

}


/* =========================
   MOBILE
========================= */

@media (max-width: 650px) {

  body {
    padding: 22px;
  }


  .container {
    gap: 70px;
  }


  .label {
    margin-bottom: 25px;
  }


  .timer {
    grid-template-columns: repeat(2, 1fr);

    gap: 32px 15px;
  }


  .time-box span {
    font-size: clamp(
      3rem,
      15vw,
      4.8rem
    );
  }


  .time-box:last-child {
    grid-column: 1 / -1;
  }


  .heart-wrap {
    width: 170px;
    height: 155px;
  }


  .heart-button {
    width: 135px;
    height: 125px;

    font-size: 8rem;
  }


  .heart-count span {
    font-size: 2.7rem;
  }

}


/* =========================
   VERY SMALL PHONES
========================= */

@media (max-width: 380px) {

  body {
    padding: 18px;
  }


  .container {
    gap: 60px;
  }


  .timer {
    gap: 28px 10px;
  }


  .time-box span {
    font-size: 2.8rem;
  }


  .time-box small {
    font-size: 0.62rem;

    letter-spacing: 0.12em;
  }


  .heart-button {
    font-size: 7.5rem;
  }

}


/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;
  }

}
/* =========================
   SPOTIFY
========================= */

.spotify-section {
  width: 100%;
  max-width: 620px;

  margin: 0 auto;
}


.spotify-card {
  display: flex;

  align-items: center;

  gap: 22px;

  padding: 22px;

  border: 1px solid rgba(255, 255, 255, 0.08);

  border-radius: 22px;

  background: rgba(255, 255, 255, 0.035);

  backdrop-filter: blur(10px);

  -webkit-backdrop-filter: blur(10px);

  text-align: left;
}


.spotify-cover {
  width: 120px;
  height: 120px;

  flex-shrink: 0;

  object-fit: cover;

  border-radius: 16px;

  display: none;

  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.25);
}


.spotify-info {
  min-width: 0;
}


.spotify-status {
  margin: 0 0 7px;

  color: var(--pink);

  font-size: 0.75rem;

  text-transform: uppercase;

  letter-spacing: 0.14em;
}


.spotify-title {
  margin: 0;

  font-family: "Playfair Display", serif;

  font-size: 1.7rem;

  font-weight: 500;

  color: var(--text);

  line-height: 1.2;
}


.spotify-artist {
  margin: 7px 0 15px;

  color: var(--muted);

  font-size: 0.95rem;
}


@media (max-width: 650px) {

  .spotify-card {
    flex-direction: column;

    text-align: center;
  }


  .spotify-cover {
    width: 150px;
    height: 150px;
  }

}

/* =========================
   SHARED NOTE WALL
========================= */

.notes-section {
  width: 100%;
  max-width: 650px;

  margin: 0 auto;
}


/* =========================
   NOTE FORM
========================= */

.note-form {
  display: flex;
  flex-direction: column;

  gap: 12px;

  margin-bottom: 35px;
}


.note-text {
  width: 100%;

  min-height: 115px;

  padding: 16px;

  border:
    1px solid
    rgba(255, 255, 255, 0.09);

  border-radius: 16px;

  outline: none;

  resize: vertical;

  background:
    rgba(255, 255, 255, 0.035);

  color: var(--text);

  font-family:
    "DM Sans",
    sans-serif;

  font-size: 1rem;

  line-height: 1.6;

  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}


.note-text::placeholder {
  color: #8f8b89;
}


.note-text:focus {
  border-color:
    rgba(246, 181, 170, 0.7);

  background:
    rgba(255, 255, 255, 0.05);
}


/* =========================
   FORM BOTTOM
========================= */

.note-form-bottom {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 15px;
}


.note-characters {
  color: var(--muted);

  font-size: 0.75rem;
}


.note-button {
  padding: 11px 20px;

  border:
    1px solid
    var(--pink);

  border-radius: 999px;

  background: transparent;

  color: var(--pink);

  font-family:
    "DM Sans",
    sans-serif;

  font-size: 0.85rem;
  font-weight: 600;

  cursor: pointer;

  touch-action:
    manipulation;

  -webkit-tap-highlight-color:
    transparent;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}


.note-button:hover {
  background:
    var(--pink);

  color:
    #1b232d;
}


.note-button:active {
  transform:
    scale(0.96);
}


.note-button:disabled {
  opacity: 0.5;

  cursor: default;
}


/* =========================
   NOTES LIST
========================= */

.notes-list {
  display: flex;
  flex-direction: column;

  gap: 14px;
}


/* Other person's note */

.note-card {
  max-width: 88%;

  margin-right: auto;

  padding: 17px 19px;

  border:
    1px solid
    rgba(255, 255, 255, 0.07);

  border-radius:
    18px 18px 18px 6px;

  background:
    rgba(255, 255, 255, 0.035);

  text-align: left;
}


/* Your note */

.note-card.my-note {
  margin-right: 0;
  margin-left: auto;

  border-color:
    rgba(246, 181, 170, 0.25);

  border-radius:
    18px 18px 6px 18px;

  background:
    rgba(246, 181, 170, 0.10);
}


/* =========================
   NOTE TEXT
========================= */

.note-message {
  margin: 0;

  color: #ddd8d5;

  font-family:
    "Playfair Display",
    serif;

  font-size: 1.15rem;

  line-height: 1.6;

  white-space: pre-wrap;

  overflow-wrap: anywhere;
}


.note-card.my-note
.note-message {
  color: #f8f2e9;
}


/* =========================
   NOTE DATE / TIME
========================= */

.note-date {
  margin-top: 9px;

  color: #888482;

  font-size: 0.68rem;

  text-align: right;
}


.note-card.my-note
.note-date {
  color:
    rgba(246, 181, 170, 0.75);
}


/* =========================
   EMPTY / LOADING
========================= */

.notes-loading,
.notes-empty {
  margin: 0;

  color: var(--muted);

  text-align: center;

  font-size: 0.9rem;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 650px) {

  .note-card {
    max-width: 92%;

    padding:
      15px 17px;
  }


  .note-button {
    padding:
      11px 17px;
  }


  .note-message {
    font-size: 1.08rem;
  }

}