:root {
  --desk-wood: #2d1c13;
  --desk-shadow: rgba(10, 6, 4, 0.6);
  --gold: #e8c07a;
  --paper: #f7f0e9;
  --ink: #0e1116;
  --soft-pink: #f4d8d8;
  --glow: rgba(255, 211, 158, 0.2);
  font-family: 'Playfair Display', 'Times New Roman', serif;
  color: var(--ink);
}

/* everything uses the same cursor unless we explicitly change it */
* {
  box-sizing: border-box;
  cursor: inherit;
}

/* global custom cursor */
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #3d261a 0%, #1b0f0a 70%);
  color: var(--ink);
  cursor: url('2809-bearballoons.png') 16 16, auto;

}

.scene {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px 16px;
}

.desk {
  position: relative;
  width: min(1000px, 90vw);
  height: min(620px, 80vh);
  background: linear-gradient(135deg, rgba(61, 42, 27, 0.82), rgba(44, 28, 19, 0.8), rgba(33, 19, 12, 0.78)),
    url('./stylish_wooden_grunge_texture_background.jpg') center/cover no-repeat;
  border-radius: 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
  isolation: isolate;
}

.desk::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-32deg, rgba(255, 255, 255, 0.06) 0 10px,
      rgba(0, 0, 0, 0.08) 10px 20px),
    repeating-linear-gradient(58deg, rgba(0, 0, 0, 0.08) 0 12px, rgba(255, 255, 255, 0.06) 12px 22px);
  opacity: 0.08;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.glow {
  position: absolute;
  inset: 12%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 226, 195, 0.16), transparent 55%),
    radial-gradient(circle at 70% 40%, rgba(238, 178, 112, 0.14), transparent 50%);
  filter: blur(1px);
}

.prop {
  position: absolute;
  filter: drop-shadow(0 12px 24px var(--desk-shadow));
  opacity: 0.95;
  transition: transform 220ms ease, filter 220ms ease, opacity 220ms ease;
}

.prop.pen {
  width: 220px;
  height: 28px;
  background: linear-gradient(90deg, #f4d8d8 0%, #d0a06f 40%, #c08653 60%, #f4d8d8 100%);
  border-radius: 14px;
  top: 60%;
  left: 12%;
  transform: rotate(-9deg);
}

.prop.pen::after {
  content: '';
  position: absolute;
  right: -20px;
  top: -6px;
  width: 42px;
  height: 42px;
  background: radial-gradient(circle at 30% 30%, #fdf8f3, #d9b27a 60%);
  border-radius: 50% 50% 42% 10%;
  box-shadow: inset 0 -4px 10px rgba(0, 0, 0, 0.2);
  transform: rotate(20deg);
}

.prop.ink {
  width: 82px;
  height: 82px;
  background: radial-gradient(circle at 35% 30%, #3d4a65, #0b0f1a);
  border-radius: 26px;
  top: 24%;
  left: 18%;
  box-shadow: inset 0 3px 8px rgba(255, 255, 255, 0.08);
}

.prop.ink::after {
  content: '';
  position: absolute;
  inset: 16px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.5), rgba(48, 59, 87, 0.6));
  border-radius: 20px;
  mix-blend-mode: screen;
  opacity: 0.8;
}

/* no custom pointer here – it inherits the bear cursor */
.envelope {
  position: absolute;
  inset: 0;
  margin: auto;
  width: clamp(260px, 28vw, 420px);
  aspect-ratio: 4 / 3;
  border: none;
  background: linear-gradient(135deg, #fdf8f2 0%, #f1ded0 50%, #e1c9ac 100%);
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: inherit;
  transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
  transform-origin: center center;
}

.envelope::before,
.envelope::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(0, 0, 0, 0.08), transparent 60%);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.envelope::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 40%);
  clip-path: polygon(0 0, 100% 0, 50% 60%);
  transform-origin: top;
  transition: transform 420ms ease, opacity 420ms ease;
}

.envelope .seal {
  position: absolute;
  inset: auto auto 12% 50%;
  transform: translateX(-50%);
  background: var(--soft-pink);
  color: #7b1020;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.18), 0 6px 10px rgba(0, 0, 0, 0.22);
}

.envelope .hint {
  position: absolute;
  bottom: -38px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 14px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.envelope:hover,
.envelope:focus-visible {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 26px 52px rgba(0, 0, 0, 0.45);
  filter: drop-shadow(0 4px 14px rgba(255, 224, 180, 0.2));
}

.envelope:hover .seal {
  transform: translateX(-50%) scale(1.04);
}

.envelope.wiggle {
  animation: wiggle 1.8s ease-in-out infinite;
}

.envelope.open::after {
  transform: rotateX(180deg);
  opacity: 0;
}

.envelope.open .seal {
  opacity: 0;
  transition: opacity 250ms ease;
}

.letter {
  position: fixed;
  inset: 0;
  background: rgba(12, 8, 6, 0.6);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}

.letter.visible {
  opacity: 1;
  pointer-events: auto;
}

.paper {
  background: radial-gradient(circle at 20% 20%, #fffdf8, #f3e6d9 45%, #e4d2c0 80%);
  color: #331f15;
  width: min(900px, 90vw);
  padding: clamp(28px, 4vw, 48px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  border-radius: 18px;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-family: 'Dancing Script', cursive;
}

.paper h1 {
  font-size: clamp(2.2rem, 3vw, 3rem);
  margin-top: 0;
  margin-bottom: 12px;
}

.paper p {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.8;
  margin: 0 0 12px;
}

.paper .closing {
  text-align: right;
  margin-top: 24px;
}

/* back button uses same cute cursor */
.ghost {
  font-family: 'Playfair Display', serif;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(242, 225, 205, 0.9));
  padding: 10px 18px;
  border-radius: 12px;
  cursor: inherit;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.ghost:hover,
.ghost:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.music-player {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: min(320px, 90vw);
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(22, 14, 10, 0.9);
  backdrop-filter: blur(10px);
  color: #fdf8f3;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  display: grid;
  row-gap: 6px;
  z-index: 10;
}

.mp-track-info {
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-progress-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 8px;
}

#progressBar {
  width: 100%;
  accent-color: #f4d8d8;
}

.mp-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

#playPauseBtn,
#nextBtn {
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  background: linear-gradient(180deg, #f4d8d8, #e0bfa7);
  color: #3a1f14;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  transition: transform 120ms ease, box-shadow 120ms ease, background 160ms ease;
}

#playPauseBtn:hover,
#nextBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45);
}

.mp-volume {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

#volumeSlider {
  width: 90px;
}

@keyframes wiggle {
  0%, 100% { transform: translateY(-6px) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(-1.2deg); }
  50% { transform: translateY(-2px) rotate(1.2deg); }
  75% { transform: translateY(-8px) rotate(-0.5deg); }
}

@keyframes wiggle {
  0%, 100% { transform: translateY(-6px) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(-1.2deg); }
  50% { transform: translateY(-2px) rotate(1.2deg); }
  75% { transform: translateY(-8px) rotate(-0.5deg); }
}

/* 🕯️ Candle prop – top-right corner */
.prop.candle {
  position: absolute;
  top: 14%;
  right: 12%;
  width: 26px;
  height: 60px;
  display: flex;
  flex-direction: column-reverse; /* put flame above body, even though HTML has body first */
  align-items: center;
  gap: 2px;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5));
}

/* Candle body */
.prop.candle .candle-body {
  width: 20px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff9ee, #f0ddc2 60%, #c39c79 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.8),
    inset 0 -3px 5px rgba(0, 0, 0, 0.25);
  position: relative;
}

/* Little melted wax lip */
.prop.candle .candle-body::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 3px;
  width: 14px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 248, 235, 0.95);
  box-shadow: 0 3px 3px rgba(0, 0, 0, 0.06);
}

/* Flame – sits right on top of the body */
.prop.candle .candle-flame {
  width: 14px;
  height: 22px;
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  background: radial-gradient(circle at 50% 20%, #fff9da, #f9c86a 55%, #e58833 85%);
  box-shadow:
    0 0 10px rgba(255, 220, 160, 0.85),
    0 0 18px rgba(255, 200, 120, 0.7);
  transform-origin: bottom center;
  margin-bottom: -2px; /* overlap slightly with the candle top */
  animation:
    flameFlicker 1.6s ease-in-out infinite,
    flameGlow 2.2s ease-in-out infinite;
}

/* Glow on desk */
.prop.candle::after {
  content: '';
  position: absolute;
  bottom: -4px;
  width: 52px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 214, 150, 0.6), transparent 70%);
  opacity: 0.75;
  filter: blur(1px);
  animation: candleHalo 3s ease-in-out infinite;
}


@keyframes flameFlicker {
  0%, 100% {
    transform: translateY(0) scale(1, 1);
  }
  25% {
    transform: translateY(-1px) scale(0.96, 1.06);
  }
  50% {
    transform: translateY(-2px) scale(1.02, 0.96);
  }
  75% {
    transform: translateY(-0.5px) scale(0.98, 1.04);
  }
}

@keyframes flameGlow {
  0%, 100% {
    box-shadow:
      0 0 10px rgba(255, 220, 160, 0.7),
      0 0 20px rgba(255, 190, 120, 0.6);
    opacity: 0.92;
  }
  40% {
    box-shadow:
      0 0 14px rgba(255, 235, 190, 0.95),
      0 0 30px rgba(255, 210, 140, 0.8);
    opacity: 1;
  }
  70% {
    box-shadow:
      0 0 8px rgba(255, 205, 145, 0.6),
      0 0 18px rgba(255, 180, 110, 0.5);
    opacity: 0.88;
  }
}

@keyframes candleHalo {
  0%, 100% {
    opacity: 0.75;
    transform: scaleX(1);
  }
  50% {
    opacity: 1;
    transform: scaleX(1.06);
  }
}

@media (max-width: 640px) {
  .desk {
    height: 70vh;
  }

  .prop.pen {
    width: 180px;
    top: 66%;
    left: 10%;
  }

  .prop.ink {
    top: 20%;
    left: 10%;
  }
}

/* Replace the background texture and shapes with your own assets by
   placing images in the assets folder, then updating the URLs above. */
