:root{
  --bg: #E6F4FF;
  --baby-blue: #4BB0FF;
  --soft: rgba(255,255,255,0.72);
  --accent: #F8D0E6;
  --muted: rgba(10,20,30,0.06);
  --card-shadow: 0 10px 30px rgba(14,28,40,0.12);
  --glass: rgba(255,255,255,0.7);
  --radius: 18px;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

/* make sure the canvas sits behind everything */
#sakuraCanvas {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.95; /* subtle */
}

/* page + subtle patterned background using tiny SVG as a repeating image */
body,html {
  height: 100%;
  margin: 0;
  background-color: var(--bg);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-family: inherit;
}

/* ensure main content is above the canvas */
.page { z-index: 2; position: relative; }

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><text x='8' y='18' font-size='14' fill='%23BEEBFF' opacity='0.25'>♥</text><circle cx='90' cy='24' r='3' fill='%23D6F2DD' opacity='0.18'/><g transform='translate(10,60)'><circle cx='6' cy='6' r='3' fill='%23FAD7EB' opacity='0.18'/><path d='M0 0 Q6 8 12 0 Q6 6 0 0' fill='%23FAD7EB' opacity='0.12'/></g></svg>");
  background-repeat: repeat;
  background-size: 120px;
}

/* center wrapper */
.center-wrap {
  width: 100%;
  max-width: 820px;
  text-align: center;
  position: relative;
}

/* textured open button */
.open-btn {
  --shine: linear-gradient(120deg, rgba(255,255,255,0.18), rgba(255,255,255,0.03));
  display: inline-block;
  border: none;
  cursor: pointer;
  padding: 18px 32px;
  /* 💙 dreamy gradient background */
  background: linear-gradient(135deg, #4BB0FF 0%, #ff6b9a 100%);
  color: white;
  font-weight: 700;
  border-radius: 18px;
  font-size: 20px;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 18px rgba(17,57,99,0.16), inset 0 -4px 10px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
  z-index: 3;
  transition: transform 220ms cubic-bezier(.2,.9,.25,1), box-shadow 220ms;
}

/* 💋 floating kisses animation */
.open-btn::after {
  content: "♥ ♥ ♥";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #ff6b9a;
  animation: kisses 2s infinite ease-in-out;
  opacity: 0.7;
}

@keyframes kisses {
  0% { transform: translate(-50%,0) scale(0.8); opacity: 0.7; }
  50% { transform: translate(-50%,-12px) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%,-24px) scale(0.8); opacity: 0; }
}


/* pseudo shine for button */
.open-btn::before{
  content: "";
  position: absolute;
  left: -30%;
  top: -40%;
  width: 160%;
  height: 120%;
  background: linear-gradient(120deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.08) 100%);
  transform: rotate(18deg) translateX(-30%);
  transition: transform 700ms;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* hover effects */
.open-btn:hover { transform: scale(1.03); box-shadow: 0 12px 28px rgba(17,57,99,0.18); }
.open-btn:hover::before { transform: rotate(18deg) translateX(6%); }

/* apology card */
.apology-card {
  width: 94%;
  max-width: 640px;
  margin: 28px auto 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.84), rgba(255,255,255,0.72));
  box-shadow: var(--card-shadow);
  padding: 18px;
  opacity: 0;
  transform: translateY(16px) scale(0.995);
  transition: opacity 360ms cubic-bezier(.2,.9,.25,1), transform 360ms cubic-bezier(.2,.9,.25,1);
  pointer-events: none;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.5);
  z-index: 3;
}

/* open state */
.apology-card.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* header */
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 6px;
}
.dog-icon {
  width: 56px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 6px 12px rgba(10,20,30,0.08);
  border: 1px solid rgba(255,255,255,0.6);
}
.card-title {
  margin: 0;
  font-size: 18px;
  color: #0b2b3f;
  font-weight: 600;
}

/* body */
.card-body {
  padding: 8px 12px 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}
.dog-illustration img {
  width: 100%;
  border-radius: 12px;
  max-height: 260px;
  object-fit: cover;
  display: block;
  box-shadow: 0 8px 20px rgba(11,28,40,0.08);
  border: 1px solid rgba(255,255,255,0.6);
}

/* apology text */
.apology-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: #072433;
  background: linear-gradient(180deg, rgba(255,255,255,0.0), rgba(248,240,255,0.02));
  padding: 14px;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

/* actions */
.card-actions {
  display:flex;
  justify-content:flex-end;
}
.close-btn{
  background: transparent;
  border: 1px solid rgba(12,60,90,0.08);
  padding:10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight:600;
  transition: transform 160ms, background 200ms;
}
.close-btn:hover{ transform: translateY(-2px); background: rgba(255,255,255,0.6); }

/* burst layer (absolute full-screen overlay inside center) */
.burst-layer{
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 4;
}

/* burst items (hearts/dots) */
.burst-item{
  position: absolute;
  font-size: 14px;
  opacity: 0.0;
  transform-origin: center;
  animation: burst 800ms cubic-bezier(.2,.8,.3,1) forwards;
  user-select:none;
  will-change: transform, opacity;
  color: #ff6b9a;
  text-shadow: 0 2px 6px rgba(255,110,150,0.18);
}

@keyframes burst {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(0.6) translateY(0) rotate(0deg); }
  30% { opacity: 1; transform: translate(-50%,-200%) scale(1.05) rotate(12deg); }
  70% { opacity: 0.9; transform: translate(-50%,-320%) scale(0.9) rotate(-12deg); }
  100% { opacity: 0; transform: translate(-50%,-460%) scale(0.6) rotate(-60deg); }
}

/* responsive tweaks */
@media (min-width:720px){
  .card-body {
    grid-template-columns: 360px 1fr;
  }
  .dog-illustration img { max-height: 320px; border-radius: 14px; }
}

@media (max-width:420px){
  .open-btn { padding: 14px 22px; font-size: 16px; }
  .apology-text { font-size: 14px; padding: 12px; }
}
