@import url("https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;600&display=swap");

:root {
  --bg: #ffd1e6;         /* pastel pink */
  --card: rgba(255, 255, 255, 0.65);
  --card2: rgba(255, 255, 255, 0.35);
  --text: #2b1b24;
  --btn: rgba(255, 255, 255, 0.75);
  --btnBorder: rgba(0, 0, 0, 0.12);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Pixelify Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(circle at 30% 20%, #ffe5f2 0%, var(--bg) 55%, #ffc3df 100%);
  color: var(--text);
  overflow: hidden;
}

.wrap {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 18px;
}

.card {
  width: min(980px, 96vw);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--card), var(--card2));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 16px 16px 10px;
  position: relative;
  backdrop-filter: blur(10px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px 10px;
}

.lives {
  font-size: 22px;
  letter-spacing: 2px;
  min-height: 28px;
  user-select: none;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.06));
}

.music {
  border: 1px solid var(--btnBorder);
  background: rgba(255,255,255,0.65);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.music:active { transform: translateY(1px); }

.content {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 430px) 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px 8px 4px;
}

.gif {
  width: clamp(120px, 18vw, 220px);
  height: auto;
  justify-self: center;
  image-rendering: auto;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.12));
  pointer-events: none;
  user-select: none;
}

.center {
  text-align: center;
  padding: 10px 10px 14px;
}

.title {
  margin: 10px 0 8px;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.05;
  text-shadow: 0 3px 0 rgba(255,255,255,0.6);
}

.subtitle {
  margin: 0 0 12px;
  font-size: clamp(16px, 2.4vw, 22px);
  opacity: 0.95;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  justify-items: stretch;
}

.btn {
  position: relative;
  border: 1px solid var(--btnBorder);
  background: var(--btn);
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 20px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  transition: transform 0.08s ease;
  user-select: none;
}

.btn.primary {
  background: rgba(255, 255, 255, 0.88);
}

.btn:active { transform: translateY(2px) scale(0.99); }

.tiny {
  margin: 4px 0 0;
  text-align: center;
  opacity: 0.6;
  font-size: 14px;
}

.hidden { display: none !important; }

.input-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}

.text-answer {
  width: min(260px, 70vw);
  font-family: inherit;
  font-size: 20px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--btnBorder);
  background: rgba(255,255,255,0.82);
  outline: none;
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

.shake {
  animation: shake 0.35s ease;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-6px); }
  100% { transform: translateX(0); }
}

/* Floating hearts layer */
#hearts-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.heart {
  position: absolute;
  font-size: 26px;
  opacity: 0.85;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.12));
  animation: floatUp linear infinite;
  will-change: transform, opacity;
}

@keyframes floatUp {
  0% { transform: translateY(120vh) translateX(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.9; }
  80% { opacity: 0.9; }
  100% { transform: translateY(-30vh) translateX(40px) rotate(12deg); opacity: 0; }
}

/* Confetti canvas */
#confetti {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Main content above hearts, below confetti canvas */
.wrap, .card { position: relative; z-index: 2; }

/* Mobile tweaks */
@media (max-width: 720px) {
  .content {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .gif {
    width: 160px;
  }
  .buttons {
    grid-template-columns: 1fr;
  }
}