@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300&family=Montserrat:wght@200;300&display=swap');

@font-face {
  font-family: 'Minecraft';
  src: url('minecraft.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #07020c;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Minecraft', monospace;
  color: white;
  transition: background 3s ease;
}

/* ── HIDDEN INITIALLY (shown after password) ── */
.hidden-initially { display: none !important; }

/* ── PASSWORD SCREEN ── */
#passwordScreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #04010a;
  transition: opacity 1.4s ease, visibility 1.4s ease;
}
#passwordScreen.gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.password-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.pw-label {
  font-family: 'Minecraft', monospace;
  font-size: 11px;
  font-weight: 200;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: rgba(255, 180, 210, 0.55);
  animation: fadeUp 1.5s ease forwards;
}
.pw-hint {
  font-family: 'Minecraft', monospace;
  font-size: clamp(14px, 2.5vw, 18px);
  font-weight: 300;
  font-style: italic;
  color: rgba(255, 200, 225, 0.4);
  letter-spacing: 0.08em;
  animation: fadeUp 1.5s ease 0.3s both;
}
.pw-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 160, 190, 0.35);
  outline: none;
  text-align: center;
  font-family: 'Minecraft', monospace;
  font-size: clamp(28px, 6vw, 52px);
  font-weight: 300;
  letter-spacing: 0.25em;
  color: rgba(255, 220, 235, 0.9);
  caret-color: rgba(255, 160, 190, 0.7);
  width: clamp(180px, 40vw, 320px);
  padding-bottom: 8px;
  animation: fadeUp 1.5s ease 0.6s both;
  transition: border-color 0.4s ease;
}
.pw-input:focus { border-bottom-color: rgba(255, 160, 190, 0.75); }
.pw-error {
  font-family: 'Minecraft', monospace;
  font-style: italic;
  font-size: 16px;
  color: rgba(255, 140, 170, 0.7);
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.5s ease;
  min-height: 22px;
}
.pw-error.show { opacity: 1; }

/* ── LIVE COUNTER ── */
.live-counter {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  text-align: center;
  pointer-events: none;
  animation: fadeIn 2s ease 1s both;
}
.live-counter span {
  font-family: 'Minecraft', monospace;
  font-size: 10px;
  font-weight: 200;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 190, 220, 0.72);
  white-space: nowrap;
  text-shadow: 0 0 14px rgba(255, 140, 180, 0.35);
}

/* ── TITLE TOUCH BURST ── */
@keyframes heartBurst {
  0%   { transform: translate(-50%,-50%) scale(0); opacity: 1; }
  60%  { transform: translate(-50%,-50%) scale(1.4); opacity: 0.9; }
  100% { transform: translate(-50%,-50%) scale(2.2); opacity: 0; }
}
.title-heart-burst {
  position: fixed;
  font-size: 22px;
  pointer-events: none;
  z-index: 999;
  animation: heartBurst 0.7s ease forwards;
}

/* ── INTRO ── */
#intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #04010a;
  transition: opacity 1.4s ease, visibility 1.4s ease;
  cursor: pointer;
}
#intro.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.intro-inner { text-align: center; }
.intro-for {
  font-family: 'Minecraft', monospace;
  font-size: 11px;
  font-weight: 200;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: rgba(255, 180, 210, 0.5);
  margin-bottom: 16px;
  animation: fadeUp 1.5s ease forwards;
}
.intro-name {
  font-size: clamp(80px, 14vw, 140px);
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: white;
  text-shadow:
    0 0 50px rgba(255, 140, 180, 0.7),
    0 0 120px rgba(200, 100, 255, 0.3);
  animation: fadeUp 1.5s ease 0.3s both;
  line-height: 1;
}
.intro-tap {
  font-family: 'Minecraft', monospace;
  font-size: 10px;
  font-weight: 200;
  letter-spacing: 0.3em;
  color: rgba(255, 200, 225, 0.45);
  margin-top: 36px;
  animation: pulse 2.5s ease infinite, fadeUp 1.5s ease 0.8s both;
}
@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 0.9; }
}

/* ── SCENE CANVAS ── */
#sceneBg {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

/* ── CONTAINER ── */
.container {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 24px;
  max-width: 700px;
  width: 100%;
  transition: opacity 1s ease;
}

/* ── DRAGGABLE TITLE ── */
.title {
  font-size: clamp(64px, 11vw, 115px);
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  letter-spacing: 0.28em;
  line-height: 1;
  margin-bottom: 8px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  display: inline-block;
  background: linear-gradient(135deg,
    #ff9de2, #ffd700, #7dffb3, #70c3ff, #c084fc, #ff9de2);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: none;
  animation: gradientShift 6s ease infinite, fadeUp 1.2s ease both;
  transition: filter 0.3s ease;
  will-change: transform;
}
.title:active { cursor: grabbing; }
.title.dragging { animation: none; filter: drop-shadow(0 0 18px rgba(255,180,255,0.7)); }

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.drag-hint {
  font-family: 'Minecraft', monospace;
  font-size: 9px;
  font-weight: 200;
  letter-spacing: 0.3em;
  color: rgba(255, 200, 230, 0.35);
  text-transform: uppercase;
  margin-bottom: 40px;
  animation: fadeIn 2s ease 2s both;
  transition: opacity 1s ease;
}
.drag-hint.gone { opacity: 0; }

/* ── STORY TEXT ── */
.story-text {
  font-size: clamp(13px, 2vw, 18px);
  font-weight: 300;
  line-height: 2;
  color: rgba(255, 220, 235, 0.92);
  letter-spacing: 0.05em;
  min-height: 88px;
  margin-bottom: 46px;
  text-shadow: 0 0 20px rgba(255, 150, 190, 0.35);
  white-space: pre-wrap;
  transition: color 2s ease, text-shadow 2s ease;
}
.story-text.fading { opacity: 0; transform: translateY(-10px); transition: opacity 0.5s, transform 0.5s; }
.story-text.final  { font-style: italic; font-size: clamp(14px, 2.3vw, 20px); }

/* ── BUTTON ── */
#btn {
  background: transparent;
  border: 1px solid rgba(255, 160, 190, 0.32);
  border-radius: 40px;
  color: rgba(255, 210, 230, 0.75);
  font-family: 'Minecraft', monospace;
  font-size: 10px;
  font-weight: 200;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  padding: 13px 36px;
  cursor: pointer;
  transition: all 0.5s ease;
  box-shadow: 0 0 16px rgba(255, 120, 160, 0.07);
}
#btn:hover {
  border-color: rgba(255, 160, 190, 0.75);
  color: #fff;
  box-shadow: 0 0 28px rgba(255, 120, 160, 0.4);
  transform: scale(1.04);
}
#btn:active  { transform: scale(0.97); }
#btn.hidden  { opacity: 0; pointer-events: none; }

/* ── END / REPLAY ── */
.end-message {
  font-size: clamp(13px, 2vw, 17px);
  font-style: italic;
  color: rgba(255, 180, 205, 0.5);
  letter-spacing: 0.14em;
  margin-top: 22px;
  opacity: 0;
  transition: opacity 2.5s ease;
  min-height: 24px;
}
.end-message.visible { opacity: 1; }

.replay-btn {
  margin-top: 20px;
  background: transparent;
  border: 1px solid rgba(255, 160, 190, 0.22);
  border-radius: 40px;
  color: rgba(255, 190, 215, 0.48);
  font-family: 'Minecraft', monospace;
  font-size: 9px;
  font-weight: 200;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 10px 26px;
  cursor: pointer;
  transition: all 0.5s ease;
}
.replay-btn:hover {
  color: rgba(255, 210, 230, 0.9);
  border-color: rgba(255, 160, 190, 0.5);
  box-shadow: 0 0 18px rgba(255, 120, 160, 0.2);
}

/* ── MUSIC INDICATOR ── */
.music-indicator {
  position: fixed;
  bottom: 20px;
  right: 22px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 7px;
  opacity: 0;
  transition: opacity 1.5s ease;
}
.music-indicator.visible { opacity: 1; }
.music-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 160, 190, 0.7);
  animation: blink 2.5s ease infinite;
}
@keyframes blink {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.3); }
}
.music-txt {
  font-family: 'Minecraft', monospace;
  font-size: 8px;
  font-weight: 200;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 190, 215, 0.45);
}

/* ── PARTICLES (petals, hearts) ── */
.petal {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  animation: floatUp linear forwards;
  user-select: none;
}
@keyframes floatUp {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 0; }
  8%   { opacity: 0.85; }
  92%  { opacity: 0.6; }
  100% { transform: translateY(-105vh) rotate(400deg) scale(0.3); opacity: 0; }
}

/* ── SPARKS ── */
.spark {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  z-index: 999;
  animation: sparkOut var(--d, 0.65s) ease forwards;
}
@keyframes sparkOut {
  from { transform: translate(0,0) scale(1); opacity: 1; }
  to   { transform: translate(var(--x),var(--y)) scale(0); opacity: 0; }
}

/* ── HEART CURSOR ── */
body { cursor: none; }
#heartCursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 18px;
  color: rgba(255, 150, 190, 0.9);
  text-shadow: 0 0 10px rgba(255, 100, 160, 0.8), 0 0 22px rgba(255, 100, 160, 0.4);
  transform: translate(-50%, -50%);
  transition: transform 0.05s ease;
  user-select: none;
  line-height: 1;
}

/* ── PROGRESS DOTS ── */
.progress-dots {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
  opacity: 0;
  transition: opacity 1s ease;
}
.progress-dots.visible { opacity: 1; }
.progress-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255, 160, 190, 0.25);
  transition: background 0.5s ease, transform 0.4s ease, box-shadow 0.4s ease;
}
.progress-dot.active {
  background: rgba(255, 160, 190, 0.9);
  transform: scale(1.4);
  box-shadow: 0 0 8px rgba(255, 120, 160, 0.6);
}
.progress-dot.done {
  background: rgba(255, 160, 190, 0.45);
}

/* ── EASTER EGG ── */
.easter-egg {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 1, 10, 0.92);
  backdrop-filter: blur(6px);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.easter-egg.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.easter-egg.visible { opacity: 1; visibility: visible; pointer-events: all; }
.easter-inner { text-align: center; position: relative; }
.easter-hearts {
  position: absolute;
  inset: -100px;
  pointer-events: none;
}
.easter-msg {
  font-family: 'Minecraft', monospace;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 300;
  color: white;
  letter-spacing: 0.1em;
  text-shadow: 0 0 40px rgba(255, 140, 180, 0.8);
  animation: fadeUp 0.8s ease forwards;
}
.easter-sub {
  font-family: 'Minecraft', monospace;
  font-size: 10px;
  font-weight: 200;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255, 180, 210, 0.5);
  margin-top: 14px;
  animation: fadeUp 0.8s ease 0.3s both;
}
.easter-close-hint {
  font-family: 'Minecraft', monospace;
  font-size: 9px;
  font-weight: 200;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 180, 210, 0.3);
  margin-top: 32px;
  animation: fadeUp 0.8s ease 1.2s both;
}
.egg-heart {
  position: absolute;
  pointer-events: none;
  animation: eggHeartFly linear forwards;
  font-size: 20px;
  user-select: none;
}
@keyframes eggHeartFly {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.5); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--ex), var(--ey)) scale(1.4) rotate(var(--er)); }
}

/* ── REPLY MOMENT ── */
.reply-moment {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 24px;
  background: rgba(4, 1, 10, 0.88);
  backdrop-filter: blur(8px);
  transition: opacity 1s ease, visibility 1s ease;
}
.reply-moment.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.reply-moment.visible { opacity: 1; visibility: visible; pointer-events: all; }
.reply-prompt {
  font-family: 'Minecraft', monospace;
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 300;
  color: rgba(255, 220, 235, 0.9);
  letter-spacing: 0.08em;
  text-shadow: 0 0 30px rgba(255, 140, 180, 0.5);
  animation: fadeUp 0.8s ease forwards;
}
.reply-input {
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 160, 190, 0.25);
  border-radius: 12px;
  color: rgba(255, 220, 235, 0.9);
  font-family: 'Minecraft', monospace;
  font-size: 18px;
  font-weight: 300;
  padding: 16px 18px;
  resize: none;
  height: 110px;
  outline: none;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  animation: fadeUp 0.8s ease 0.2s both;
}
.reply-input::placeholder { color: rgba(255, 180, 210, 0.3); }
.reply-input:focus {
  border-color: rgba(255, 160, 190, 0.55);
  box-shadow: 0 0 20px rgba(255, 120, 160, 0.15);
}
.reply-send {
  background: transparent;
  border: 1px solid rgba(255, 160, 190, 0.3);
  border-radius: 40px;
  color: rgba(255, 210, 230, 0.75);
  font-family: 'Minecraft', monospace;
  font-size: 10px;
  font-weight: 200;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  padding: 12px 32px;
  cursor: pointer;
  transition: all 0.4s ease;
  animation: fadeUp 0.8s ease 0.4s both;
}
.reply-send:hover {
  border-color: rgba(255, 160, 190, 0.7);
  color: #fff;
  box-shadow: 0 0 24px rgba(255, 120, 160, 0.35);
  transform: scale(1.03);
}
.reply-sent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 560px;
  font-family: 'Minecraft', monospace;
  font-size: clamp(22px, 4.5vw, 42px);
  font-style: italic;
  font-weight: 300;
  color: rgba(255, 215, 230, 0.95);
  letter-spacing: 0.1em;
  text-shadow:
    0 0 40px rgba(255, 140, 180, 0.9),
    0 0 80px rgba(255, 100, 160, 0.5);
  opacity: 0;
  transition: opacity 1.8s ease;
  text-align: center;
  line-height: 1.6;
  pointer-events: none;
  z-index: 2;
}
.reply-sent.visible { opacity: 1; }

/* ── STAR ARRIVAL GLOW (when words reach the top) ── */
@keyframes starArrival {
  0%   { opacity: 0; transform: scale(0.5); filter: blur(2px); }
  40%  { opacity: 1; transform: scale(2.2); filter: blur(0px);
         text-shadow: 0 0 20px rgba(255,160,200,1), 0 0 50px rgba(255,100,180,0.8); }
  100% { opacity: 0; transform: scale(1.4); filter: blur(3px); }
}
.star-arrival {
  position: fixed;
  pointer-events: none;
  z-index: 160;
  animation: starArrival 1.1s ease forwards;
}

/* ── TYPING STAR ── */
@keyframes typingStar {
  0%   { opacity: 0; transform: translateY(0) scale(0.5); }
  30%  { opacity: 1; transform: translateY(-12px) scale(1); }
  100% { opacity: 0; transform: translateY(-50px) scale(0.3); }
}
.typing-star {
  position: fixed;
  pointer-events: none;
  z-index: 160;
  animation: typingStar 1.8s ease forwards;
}

/* ── STAR LAUNCH (send to stars) ── */
@keyframes starLaunch {
  0%   { opacity: 0.9; transform: translateY(0) scale(1); }
  40%  { opacity: 1;   transform: translateY(-30vh) scale(1.1); }
  100% { opacity: 0;   transform: translateY(-95vh) scale(0.4); }
}
.star-word {
  position: fixed;
  pointer-events: none;
  z-index: 160;
  font-family: 'Minecraft', monospace;
  font-style: italic;
  font-weight: 300;
  animation: starLaunch ease forwards;
}

/* ── FINAL MESSAGE ── */
.final-message {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 1, 10, 0.96);
  transition: opacity 1.2s ease, visibility 1.2s ease;
  touch-action: none;
}
.final-message.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.final-message.visible { opacity: 1; visibility: visible; pointer-events: all; }

#finalText {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(28px, 6vw, 72px);
  font-weight: 700;
  color: rgba(255, 220, 235, 0.95);
  text-align: center;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-shadow:
    0 0 40px rgba(255, 140, 180, 0.6),
    0 0 80px rgba(200, 100, 255, 0.3);
  cursor: grab;
  user-select: none;
  touch-action: none;
  -webkit-user-select: none;
  pointer-events: all;
  display: inline-block;
  position: relative;
  z-index: 182;
  animation: fadeUp 1.2s ease forwards;
  will-change: transform;
}
#finalText:active { cursor: grabbing; }

/* ── SHARED ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
