/* =========================================================
   Happy Birthday Soraya
   ========================================================= */

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

:root {
  --pink: #ffb6c1;
  --ink: #3a2b30;
  --card: #fff6f8;
}

html, body { min-height: 100%; }

body {
  background: var(--pink);
  color: var(--ink);
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  overflow-x: hidden;
}

.hidden { display: none !important; }

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* =========================================================
   SCREENS (password + gift)
   ========================================================= */

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 40px;
}

.welcome {
  position: absolute;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  text-align: center;
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(26px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 0 #e78a99, 0 4px 0 #d97a8a, 0 10px 24px rgba(0,0,0,.18);
  animation: floaty 4s ease-in-out infinite;
}

.welcome span {
  display: inline-block;
  margin-top: 12px;
  font-size: clamp(14px, 2vw, 22px);
  font-weight: 400;
  color: #6b4b53;
  text-shadow: none;
}

@keyframes floaty {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, -10px); }
}

/* ---------- password card ---------- */

.password-card {
  background: var(--card);
  border-radius: 24px;
  padding: 34px 32px 28px;
  width: min(380px, 92vw);
  box-shadow: 0 18px 40px rgba(150, 70, 90, .25);
  text-align: center;
  animation: pop .5s cubic-bezier(.2,1.4,.4,1);
  margin-top: 60px;
}

@keyframes pop {
  from { opacity: 0; transform: scale(.85) translateY(20px); }
  to   { opacity: 1; transform: none; }
}

.lock-icon { font-size: 34px; margin-bottom: 8px; }

.password-card label {
  display: block;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #a3737f;
  margin-bottom: 10px;
  font-weight: 700;
}

.input-row {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid #ffd3da;
  border-radius: 14px;
  padding: 4px 6px 4px 14px;
  transition: border-color .2s, box-shadow .2s;
}

.input-row:focus-within {
  border-color: #ff8fa3;
  box-shadow: 0 0 0 4px rgba(255,143,163,.22);
}

.input-row input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 17px;
  letter-spacing: 2px;
  padding: 12px 0;
  color: var(--ink);
}

#peek {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 8px;
  opacity: .6;
  transition: opacity .2s, transform .2s;
}
#peek:hover { opacity: 1; transform: scale(1.15); }

.unlock-btn {
  margin-top: 18px;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-family: 'Fredoka', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #ff8fa3, #ff6b8a);
  box-shadow: 0 6px 0 #e05575;
  transition: transform .12s, box-shadow .12s, filter .2s;
}
.unlock-btn:hover  { filter: brightness(1.06); }
.unlock-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #e05575; }

.error {
  min-height: 22px;
  margin-top: 12px;
  color: #c0304f;
  font-weight: 600;
  font-size: 14px;
}

.shake { animation: shake .4s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-7px); }
  80% { transform: translateX(7px); }
}

/* =========================================================
   GIFT
   ========================================================= */

.gift-hint {
  position: absolute;
  top: 14vh;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 90%;
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(22px, 4vw, 40px);
  color: #fff;
  text-shadow: 0 2px 0 #e78a99, 0 8px 20px rgba(0,0,0,.15);
}
.gift-hint span {
  display: block;
  margin-top: 10px;
  font-size: clamp(13px, 1.8vw, 18px);
  font-weight: 400;
  color: #6b4b53;
  text-shadow: none;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:.45} 50%{opacity:1} }

.gift {
  position: relative;
  width: 190px;
  height: 190px;
  cursor: pointer;
  animation: giftIdle 2.6s ease-in-out infinite;
  transition: transform .3s cubic-bezier(.2,1.4,.4,1), filter .3s;
}

@keyframes giftIdle {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%     { transform: translateY(-12px) rotate(-2deg); }
}

.gift:hover {
  animation: giftShake .5s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(255,255,255,.95)) drop-shadow(0 0 44px rgba(255,215,0,.75));
}

@keyframes giftShake {
  0%,100% { transform: rotate(-6deg) scale(1.12); }
  25%     { transform: rotate(6deg)  scale(1.16); }
  50%     { transform: rotate(-4deg) scale(1.12); }
  75%     { transform: rotate(5deg)  scale(1.16); }
}

.gift-box {
  position: absolute;
  bottom: 0; left: 10px;
  width: 170px; height: 130px;
  border-radius: 10px;
  background: linear-gradient(160deg, #ff6b8a, #d63f63);
  box-shadow: inset 0 -18px 30px rgba(0,0,0,.18), 0 16px 26px rgba(150,40,70,.35);
}

.gift-lid {
  position: absolute;
  bottom: 122px; left: 0;
  width: 190px; height: 44px;
  border-radius: 8px;
  background: linear-gradient(160deg, #ff8fa3, #e04d70);
  box-shadow: 0 8px 16px rgba(150,40,70,.3);
  transform-origin: center bottom;
  transition: transform .35s;
  z-index: 2;
}
.gift:hover .gift-lid { transform: translateY(-14px) rotate(-8deg); }

.gift-ribbon-v {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 166px;
  background: linear-gradient(180deg, #ffe6a7, #ffcf5c);
  z-index: 3;
  border-radius: 4px;
}

.gift-bow {
  position: absolute;
  top: -18px; left: 50%;
  transform: translateX(-50%);
  font-size: 54px;
  z-index: 4;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.25));
}

/* explosion */
.gift.boom { animation: boom .5s forwards; }
@keyframes boom {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.55) rotate(8deg); }
  100% { transform: scale(0) rotate(-30deg); opacity: 0; }
}

.flash {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9998;
  pointer-events: none;
  animation: flash .7s forwards;
}
@keyframes flash {
  0%   { opacity: 0; }
  15%  { opacity: .95; }
  100% { opacity: 0; }
}

/* =========================================================
   MUSIC PLAYER
   ========================================================= */

.player {
  position: fixed;
  top: 18px; left: 18px;
  width: 250px;
  background: rgba(255, 246, 248, .92);
  backdrop-filter: blur(6px);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 14px 34px rgba(150, 70, 90, .28);
  z-index: 500;
  animation: pop .6s cubic-bezier(.2,1.4,.4,1);
}

.cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  margin-bottom: 12px;
  box-shadow: 0 8px 18px rgba(0,0,0,.2);
}

.track-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-artist {
  font-size: 13px;
  color: #8d6670;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-wrap { padding: 2px 0; }

#seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 4px;
  background: #f0c9d2;
  outline: none;
  cursor: pointer;
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #3a2b30;
  cursor: pointer;
}
#seek::-moz-range-thumb {
  width: 14px; height: 14px;
  border: none;
  border-radius: 50%;
  background: #3a2b30;
  cursor: pointer;
}

.times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #8d6670;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}

.controls button {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  display: grid;
  place-items: center;
  transition: transform .15s;
}
.controls button:hover { transform: scale(1.18); }
.controls button:active { transform: scale(.92); }

.controls svg { width: 26px; height: 26px; fill: #3a2b30; }

.controls .play {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: #3a2b30;
}
.controls .play svg { width: 22px; height: 22px; fill: #fff6f8; }

/* =========================================================
   STAGE / TITLE / PHOTOS
   ========================================================= */

.stage {
  position: relative;
  min-height: 1500px;
  padding: 190px 20px 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 44px;
}

/* ---------- 3D RGB title ---------- */

.birthday-title {
  position: relative;
  z-index: 3;
  text-align: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 3px;
  animation: rgbCycle 6s linear infinite;
  transform: perspective(700px) rotateX(12deg);
  pointer-events: none;
}

.birthday-title .line {
  display: block;
  font-size: clamp(30px, 6vw, 78px);
  color: #ff2e63;
  text-shadow:
    1px 1px 0 #d1194b,
    2px 2px 0 #c11745,
    3px 3px 0 #b2153f,
    4px 4px 0 #a21339,
    5px 5px 0 #931133,
    6px 6px 0 #830f2d,
    7px 7px 14px rgba(0,0,0,.35);
}

.birthday-title .big   { font-size: clamp(44px, 10vw, 120px); }
.birthday-title .small {
  font-size: clamp(16px, 2.6vw, 30px);
  letter-spacing: 6px;
  margin-top: 10px;
}

@keyframes rgbCycle {
  0%   { filter: hue-rotate(0deg)   saturate(1.15); }
  100% { filter: hue-rotate(360deg) saturate(1.15); }
}

/* ---------- main stacked photos ---------- */

.main-stack {
  position: relative;
  z-index: 3;
  background: #fff;
  padding: 14px 14px 10px;
  border-radius: 8px;
  box-shadow: 0 22px 50px rgba(140, 50, 75, .4);
  display: flex;
  flex-direction: column;
  transform: rotate(-1.5deg);
  transition: transform .35s cubic-bezier(.2,1.4,.4,1), box-shadow .35s;
  max-width: 92vw;
}
.main-stack:hover {
  transform: rotate(0deg) scale(1.03);
  box-shadow: 0 30px 60px rgba(140, 50, 75, .5);
}

.main-photo {
  display: block;
  width: min(420px, 84vw);
  height: auto;
  cursor: zoom-in;
}
.main-photo:first-of-type { border-radius: 4px 4px 0 0; }
.main-photo:last-of-type  { border-radius: 0 0 4px 4px; }

.stack-caption {
  text-align: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  padding: 10px 0 4px;
  color: #b03a5b;
}

/* ---------- scattered photos ---------- */

.scatter {
  position: absolute;
  inset: 170px 0 0 0;
  pointer-events: none;
  z-index: 2;
}

.polaroid {
  position: absolute;
  pointer-events: auto;
  background: #fff;
  padding: 9px 9px 26px;
  border-radius: 4px;
  box-shadow: 0 12px 26px rgba(140, 50, 75, .32);
  cursor: zoom-in;
  transition: transform .35s cubic-bezier(.2,1.4,.4,1), box-shadow .35s, filter .35s;
  will-change: transform;
}

.polaroid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

.polaroid:hover {
  transform: rotate(0deg) scale(1.22) translateY(-10px) !important;
  box-shadow: 0 26px 48px rgba(140, 50, 75, .48);
  filter: saturate(1.15);
  z-index: 20;
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(60, 20, 32, .82);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 2000;
  cursor: zoom-out;
  animation: fadeIn .25s;
  padding: 30px;
}

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border: 10px solid #fff;
  border-radius: 6px;
  box-shadow: 0 30px 70px rgba(0,0,0,.6);
  animation: zoomIn .3s cubic-bezier(.2,1.4,.4,1);
}

@keyframes zoomIn {
  from { transform: scale(.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 820px) {
  .player {
    position: static;
    width: min(320px, 92vw);
    margin: 16px auto 0;
  }

  .stage {
    min-height: 0;
    padding: 30px 16px 80px;
  }

  .scatter {
    position: static;
    inset: auto;
    pointer-events: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 30px;
  }

  .polaroid {
    position: static !important;
    width: 42vw !important;
    height: auto !important;
  }
  .polaroid img { height: 42vw; }
}
