* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: system-ui, sans-serif;
  background: linear-gradient(135deg, #fde7ef, #e9f6ff);
}

.stage {
  width: 720px;
  max-width: 95vw;
}

.card {
  background: rgba(255,255,255,0.75);
  border-radius: 24px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

/* ================= BEAR ================= */

.bear {
  position: relative;
  width: 200px;
  height: 260px;
  margin: 0 auto 16px;
}

.ear {
  width: 50px;
  height: 50px;
  background: #b47a4a;
  border-radius: 50%;
  position: absolute;
  top: 0;
}
.ear.left { left: 20px; }
.ear.right { right: 20px; }

.head {
    z-index: 5;
  width: 160px;
  height: 140px;
  background: #b47a4a;
  border-radius: 50%;
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.eye {
  width: 14px;
  height: 14px;
  background: #111;
  border-radius: 50%;
  position: absolute;
  top: 55px;
}
.eye.left { left: 45px; }
.eye.right { right: 45px; }

.snout {
  width: 80px;
  height: 55px;
  background: #e7c2a6;
  border-radius: 40px;
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
}

.nose {
  width: 20px;
  height: 14px;
  background: #3a2a2a;
  border-radius: 10px;
  margin: 10px auto 0;
}

.body {
  width: 160px;
  height: 120px;
  background: #b47a4a;
  border-radius: 80px;
  position: absolute;
  top: 130px;
  left: 50%;
  transform: translateX(-50%);
}

.hands {
    z-index: 4;
  position: absolute;
  top: 165px;
  width: 100%;
}

.hand {
  width: 45px;
  height: 35px;
  background: #9a643b;
  border-radius: 20px;
  position: absolute;
}
.hand.left { left: 10px; }
.hand.right { right: 10px; }

/* ================= ENVELOPE ================= */

.envelope {
  position: absolute;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 90px;
}

.env-back,
.env-front {
  position: absolute;
  inset: 0;
  background: #f6d9a6;
  border-radius: 10px;
}

.env-front {
  clip-path: polygon(0 35%, 50% 70%, 100% 35%, 100% 100%, 0 100%);
}

.env-flap {
  position: absolute;
  inset: 0;
  background: #e8c68a;
  clip-path: polygon(0 35%, 50% 0, 100% 35%, 50% 60%);
  transform-origin: top center;
  transition: transform 0.5s ease;
}

.letter {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 70px;
  background: #fffaf2;
  border-radius: 8px;
  opacity: 0;
  transition: 0.4s ease;
}

/* ================= BUTTONS ================= */

.buttons {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 16px;
  height: 70px;
}

.btn {
  min-width: 90px;
  height: 44px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  cursor: pointer;
}

.yes {
  background: #ff5ea6;
  color: white;
}

.no {
  background: #e9e9ef;
}

/* ================= YES MODE ================= */

.valentine .env-flap {
  transform: rotateX(160deg);
}

.valentine .letter {
  opacity: 1;
  transform: translate(-50%, -40px);
}

.valentine .eye::before {
  content: "💗";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 26px;
  line-height: 1;
}

.hint {
  opacity: 0.6;
}

/* ================= RESTART BUTTON ================= */
.restart {
  margin-top: 12px;  
  background: #ffffff;
  color: #333;
  border: 2px solid #ddd;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
}

.restart:hover {
    background: #f7f7f7;
}

/* hidden by default */
.hidden {
  display: none;
}

/* SHOW RESTART AFTER yes */
.valentine .restart {
    display: inline-block;
}

/* ===================MOBILE POLISH=================== */
@media (max-width: 480px) {

    .stage {
        width: 100%;
        padding: 16px;
    }

    .card {
        padding: 20px 16px 24px;
        border-radius: 20px;
    }

    h1 {
        font-size:20px;
        line-height: 1.3;
        margin-top: 8px;
    }

    .hint {
        font-size: 13px;
        margin-top: 4px;
    }

    /* Bear scaling */
    .bear {
        transform: scale(0.9);
        margin-bottom: 8px;
    }

    /* Buttons spacing */
    .buttons {
        gap: 12px;
        height: 72px;
    }

    .btn {
        min-width: 80px;
        height: 40px;
        font-size: 15px;
    }

    /* Restart button */
    .restart {
        margin-top: 14px;
        height: 44px;
        font-size: 14px;
    }
@media (max-width: 360px) {

    .bear {
        transform: scale(0.82);
    }
    h1 {
        font-size:18px;
    }

    .btn {
        min-width: 92px;
        height: 46px;
    }
button {
    -webkit-tap-highlight-color: transparent;
    }
}
}