:root {
  color-scheme: light;
  --ink: #2a1d1d;
  --cream: #fff7ed;
  --rose: #f8c0c8;
  --rose-deep: #e18599;
  --shadow: rgba(30, 18, 18, 0.15);
}

* {
  box-sizing: border-box;
}

@font-face {
  font-family: "Majestic";
  src: url("assets/fonts/majestic.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Milker";
  src: url("assets/fonts/milker.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  background: radial-gradient(circle at 20% 20%, #fff1f4, #ffeef0 40%, #f7e0e6 70%, #f0d2d9 100%);
  color: var(--ink);
  overflow: hidden;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
}

#hud {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  box-shadow: 0 10px 25px var(--shadow);
  z-index: 10;
}

#counter {
  font-family: "Milker", "Georgia", serif;
  font-size: 22px;
  letter-spacing: 0.5px;
}

#title-card {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Majestic", "Georgia", serif;
  font-size: clamp(32px, 6vw, 64px);
  letter-spacing: 1px;
  color: #7a3345;
  text-shadow: 0 12px 30px rgba(30, 18, 18, 0.2);
  opacity: 1;
  transition: opacity 0.8s ease, transform 0.8s ease;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.8), rgba(248, 216, 224, 0.7));
  z-index: 12;
}

#title-card.hide {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

#letter {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(250, 220, 229, 0.85));
  transform: translateY(100%);
  transition: transform 0.8s ease;
  z-index: 20;
  pointer-events: none;
}

#letter.show {
  transform: translateY(0%);
  pointer-events: auto;
}

.letter-card {
  background: var(--cream);
  border: 2px solid var(--rose-deep);
  border-radius: 20px 20px 0 0;
  padding: 28px 32px 36px;
  width: min(460px, 90vw);
  text-align: center;
  box-shadow: 0 18px 50px var(--shadow);
}

.letter-card h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.letter-card p {
  font-family: "Milker", "Georgia", serif;
  font-size: 20px;
  line-height: 1.5;
  margin: 0 0 16px;
  white-space: pre-line;
}

.letter-card .sign {
  font-size: 16px;
  opacity: 0.7;
}

@media (max-width: 640px) {
  #hud {
    top: 12px;
    right: 12px;
  }
}
