/* ============================================================
   Hello Kitty Birthday Site — shared styles
   Palette: soft pinks, white, Hello Kitty bow red, butter yellow
   ============================================================ */

:root {
  --pink-50:  #fff3f8;
  --pink-100: #ffe4ef;
  --pink-200: #ffc9de;
  --pink-300: #ff9ec2;
  --pink-400: #ff7bab;
  --pink-500: #f4548f;
  --bow-red:  #ee4266;
  --yellow:   #ffcf5c;
  --ink:      #4a3340;
  --white:    #ffffff;
  --card-shadow: 0 10px 30px rgba(244, 84, 143, 0.18);
}

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

html {
  scroll-behavior: smooth;
  /* keeps the page width identical whether or not a scrollbar shows,
     so nothing jumps sideways when navigating between pages */
  scrollbar-gutter: stable;
}

body {
  font-family: "Baloo 2", "Comic Sans MS", "Segoe UI", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background-color: #ffe9f2;
  background-image:
    radial-gradient(#ffcfe1 12%, transparent 13%),
    radial-gradient(#ffdcea 12%, transparent 13%);
  background-size: 46px 46px;
  background-position: 0 0, 23px 23px;
  animation: pageFade 0.6s ease both;
  overflow-x: hidden;
}

/* Slides DOWN from above (-8px): sliding up from below made the page
   momentarily taller than the window, flashing the scrollbar on load. */
@keyframes pageFade {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

.hidden { display: none !important; }

/* ---------- Kitty SVG sizing ---------- */
.kitty        { width: 150px; height: auto; display: block; margin: 0 auto; }
.kitty-small  { width: 46px;  height: auto; }

/* ============================================================
   LOGIN
   ============================================================ */
#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--white);
  border: 4px solid var(--pink-300);
  border-radius: 34px;
  box-shadow: var(--card-shadow);
  padding: 34px 36px 30px;
  width: min(400px, 92vw);
  text-align: center;
  position: relative;
}

.login-card h1 {
  font-size: 1.9rem;
  margin: 12px 0 4px;
  color: var(--pink-500);
}

.login-card .sub {
  font-family: "Caveat", cursive;
  font-size: 1.35rem;
  color: var(--pink-400);
  margin-bottom: 20px;
}

.login-card label {
  display: block;
  text-align: left;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 12px 4px 4px;
  color: var(--pink-500);
}

.login-card input {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  border: 3px solid var(--pink-200);
  border-radius: 999px;
  outline: none;
  background: var(--pink-50);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card input:focus {
  border-color: var(--pink-400);
  box-shadow: 0 0 0 5px rgba(255, 158, 194, 0.3);
}

.login-card button {
  margin-top: 22px;
  width: 100%;
  padding: 13px;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(244, 84, 143, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.login-card button:hover  { transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 22px rgba(244, 84, 143, 0.45); }
.login-card button:active { transform: scale(0.98); }

.error {
  min-height: 1.4em;
  margin-top: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bow-red);
}

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

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 16px 6px;
  position: relative;
  z-index: 5;
}

.nav a, .nav button {
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--pink-500);
  background: var(--white);
  border: 3px solid var(--pink-200);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.nav a:hover, .nav button:hover {
  transform: translateY(-2px);
  border-color: var(--pink-400);
}

.nav a.active {
  background: var(--pink-400);
  border-color: var(--pink-400);
  color: var(--white);
}

/* ============================================================
   PARTY / HERO
   ============================================================ */
.hero {
  text-align: center;
  padding: 18px 16px 0;
  position: relative;
  z-index: 2;
}

.big-title {
  font-size: clamp(2.1rem, 6.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  margin-top: 10px;
}

.big-title span {
  display: inline-block;
  animation: popIn 0.55s cubic-bezier(0.24, 1.6, 0.4, 1) both;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(26px) scale(0.4) rotate(-8deg); }
  to   { opacity: 1; transform: none; }
}

.hero .subtitle {
  font-family: "Caveat", cursive;
  font-size: clamp(1.3rem, 3.5vw, 1.7rem);
  color: var(--pink-500);
  margin-top: 6px;
}

/* ============================================================
   CAKE
   ============================================================ */
.cake-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 16px 10px;
  position: relative;
  z-index: 2;
}

.cake {
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 18px 22px rgba(244, 84, 143, 0.25));
}

.candles {
  display: flex;
  gap: 26px;
  margin-bottom: -6px;
  position: relative;
  z-index: 3;
}

.candle {
  width: 13px;
  height: 46px;
  border-radius: 7px 7px 3px 3px;
  background: repeating-linear-gradient(45deg, #fff 0 6px, var(--pink-300) 6px 12px);
  position: relative;
  box-shadow: inset -2px 0 0 rgba(0,0,0,0.06);
}

.candle::before { /* wick */
  content: "";
  position: absolute;
  top: -7px; left: 50%;
  width: 2px; height: 7px;
  background: #7a5c4f;
  transform: translateX(-50%);
}

.flame {
  position: absolute;
  top: -28px; left: 50%;
  width: 17px; height: 23px;
  transform: translateX(-50%);
  background: radial-gradient(circle at 50% 70%, #fff8cf 0%, #ffd166 45%, #ff9e42 100%);
  border-radius: 50% 50% 50% 50% / 64% 64% 36% 36%;
  box-shadow: 0 0 18px 7px rgba(255, 195, 90, 0.5);
  cursor: pointer;
  animation: flicker 0.28s ease-in-out infinite alternate;
  transition: opacity 0.35s, transform 0.35s;
}

@keyframes flicker {
  from { transform: translateX(-50%) scale(1) rotate(-2.5deg); }
  to   { transform: translateX(-50%) scale(0.9, 1.08) rotate(2.5deg); }
}

.flame.out {
  animation: none;
  opacity: 0;
  transform: translateX(-50%) scale(0.3);
  pointer-events: none;
  box-shadow: none;
}

.smoke {
  position: absolute;
  top: -24px; left: 50%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(160, 160, 170, 0.55);
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
}

.smoke.puff { animation: puff 1.2s ease-out forwards; }

@keyframes puff {
  0%   { opacity: 0.8; transform: translate(-50%, 0) scale(0.7); }
  100% { opacity: 0;   transform: translate(-50%, -46px) scale(2.1); }
}

.tier {
  position: relative;
  border-radius: 16px;
  margin-top: -5px;
}

.tier.t3 { width: 160px; height: 52px; background: #ffd3e3; z-index: 3; }
.tier.t2 { width: 215px; height: 58px; background: #ffe9f2; z-index: 2; }
.tier.t1 {
  width: 268px; height: 64px; background: #ffc2da; z-index: 1;
  background-image: radial-gradient(circle, #fff 3.5px, transparent 4.5px);
  background-size: 28px 20px;
  background-position: 6px 26px;
}

.icing {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 16px;
  background: var(--white);
  border-radius: 16px 16px 0 0;
}

.icing::after { /* frosting drips */
  content: "";
  position: absolute;
  top: 100%; left: 5px; right: 5px;
  height: 14px;
  background-image: radial-gradient(circle at 11px -3px, #fff 12px, transparent 13px);
  background-size: 24px 16px;
  background-repeat: repeat-x;
}

.decal {
  position: absolute;
  left: 50%; bottom: 5px;
  transform: translateX(-50%);
  font-size: 26px;
  line-height: 1;
}

.decal.left  { left: 22%; font-size: 20px; }
.decal.right { left: 78%; font-size: 20px; }

.plate {
  width: 330px;
  height: 26px;
  margin-top: -8px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 8px 10px -4px rgba(180, 90, 130, 0.3), inset 0 -5px 0 #ffe4ef;
}

.hint {
  text-align: center;
  font-family: "Caveat", cursive;
  font-size: 1.35rem;
  color: var(--pink-400);
  padding: 16px;
  position: relative;
  z-index: 2;
}

/* ---------- Wish message ---------- */
.wish {
  margin: 8px auto 30px;
  width: min(480px, 92vw);
  background: var(--white);
  border: 4px dashed var(--pink-300);
  border-radius: 26px;
  padding: 24px 26px;
  text-align: center;
  box-shadow: var(--card-shadow);
  animation: popIn 0.6s cubic-bezier(0.24, 1.6, 0.4, 1) both;
  position: relative;
  z-index: 2;
}

.wish p {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--pink-500);
  margin-bottom: 14px;
}

.wish button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--pink-500);
  background: var(--pink-100);
  border: 3px solid var(--pink-300);
  border-radius: 999px;
  padding: 9px 20px;
  cursor: pointer;
  transition: transform 0.15s;
}

.wish button:hover { transform: scale(1.05); }

/* Our cake photo, revealed when all the candles are blown out */
.wish-photo {
  width: min(280px, 82%);
  margin: 4px auto 18px;
  background: var(--white);
  padding: 10px 10px 12px;
  border-radius: 6px;
  box-shadow: 0 10px 26px rgba(180, 90, 130, 0.3);
  transform: rotate(-2.5deg);
  animation: develop 1.6s ease 0.25s both;
}

.wish-photo img {
  width: 100%;
  display: block;
  border-radius: 4px;
}

.wish-photo figcaption {
  font-family: "Caveat", cursive;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--pink-500);
  padding-top: 8px;
}

/* fades in like a developing polaroid */
@keyframes develop {
  from { opacity: 0; filter: sepia(0.7) blur(6px) brightness(1.25); transform: rotate(-2.5deg) scale(0.94); }
  to   { opacity: 1; filter: none; transform: rotate(-2.5deg) scale(1); }
}

/* ============================================================
   FLOATING BITS
   ============================================================ */
#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

.float-heart {
  position: fixed;
  bottom: -50px;
  z-index: 1;
  animation: floatUp linear forwards;
  pointer-events: none;
}

@keyframes floatUp {
  to { transform: translateY(-115vh) rotate(24deg); opacity: 0; }
}

#music-btn {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 60;
  width: 56px; height: 56px;
  font-size: 26px;
  background: var(--white);
  border: 3px solid var(--pink-300);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: transform 0.15s;
}

#music-btn:hover { transform: scale(1.1) rotate(-8deg); }

/* ============================================================
   PAGE HEADERS (inner pages)
   ============================================================ */
.page-head {
  text-align: center;
  padding: 12px 16px 4px;
  position: relative;
  z-index: 2;
}

.page-head h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  color: var(--pink-500);
}

.page-head p {
  font-family: "Caveat", cursive;
  font-size: 1.4rem;
  color: var(--pink-400);
}

/* ============================================================
   GALLERY
   ============================================================ */
.gal-sec {
  margin-bottom: 34px;
  position: relative;
  z-index: 2;
}

.sec-title {
  text-align: center;
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--pink-500);
  margin-top: 26px;
}

.sec-title::after {
  content: "";
  display: block;
  width: 130px;
  height: 5px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--pink-300), transparent);
}

.sec-sub {
  text-align: center;
  font-family: "Caveat", cursive;
  font-size: 1.35rem;
  color: var(--pink-400);
  margin-top: 4px;
}

.gallery {
  width: min(1050px, 94vw);
  margin: 22px auto 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 30px;
  position: relative;
  z-index: 2;
}

.pol {
  background: var(--white);
  padding: 12px 12px 40px;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(180, 90, 130, 0.25);
  transform: rotate(var(--r, 0deg));
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
}

.pol:hover {
  transform: rotate(0deg) scale(1.06);
  box-shadow: 0 16px 32px rgba(180, 90, 130, 0.35);
  z-index: 3;
}

.pol img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  /* favor the top of the photo so faces survive the square crop */
  object-position: 50% 22%;
  border-radius: 4px;
  display: block;
  cursor: zoom-in;
}

.pol::after {
  content: "♡";
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  color: var(--pink-400);
  font-size: 20px;
}

.empty-note {
  grid-column: 1 / -1;
  text-align: center;
  background: var(--white);
  border: 4px dashed var(--pink-300);
  border-radius: 26px;
  padding: 40px 26px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pink-500);
}

/* ---------- Lightbox (tap a photo to view it full size) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(74, 51, 64, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
  animation: pageFade 0.25s ease both;
}

.lightbox img {
  max-width: min(920px, 94vw);
  max-height: 88vh;
  border: 6px solid var(--white);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* ============================================================
   LETTER
   ============================================================ */
.envelope-wrap {
  display: flex;
  justify-content: center;
  padding: 50px 16px;
  position: relative;
  z-index: 2;
}

.envelope {
  width: 300px; height: 200px;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s;
}

.envelope:hover { transform: scale(1.04); }

.env-back {
  position: absolute; inset: 0;
  background: var(--pink-300);
  border-radius: 12px;
}

.env-note {
  position: absolute;
  left: 12px; right: 12px; top: 12px; bottom: 12px;
  background: var(--white);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Caveat", cursive;
  font-size: 1.5rem;
  color: var(--pink-500);
  transition: transform 0.7s ease 0.45s;
  z-index: 2;
}

.fold-l, .fold-r, .fold-b {
  position: absolute; inset: 0;
  z-index: 3;
  border-radius: 12px;
}

.fold-l { background: #ff8fb8; clip-path: polygon(0 0, 52% 50%, 0 100%); }
.fold-r { background: #ff8fb8; clip-path: polygon(100% 0, 48% 50%, 100% 100%); }
.fold-b { background: var(--pink-400); clip-path: polygon(0 100%, 50% 42%, 100% 100%); }

.flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 55%;
  background: var(--pink-500);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-radius: 12px 12px 0 0;
  transform-origin: top center;
  transition: transform 0.6s ease;
  z-index: 4;
}

.seal {
  position: absolute;
  left: 50%; top: 46%;
  transform: translate(-50%, -50%);
  font-size: 38px;
  z-index: 5;
  transition: opacity 0.3s;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.15));
}

.envelope.open .flap    { transform: rotateX(180deg); z-index: 1; }
.envelope.open .seal    { opacity: 0; }
.envelope.open .env-note{ transform: translateY(-130px); }

.tap-note {
  text-align: center;
  font-family: "Caveat", cursive;
  font-size: 1.4rem;
  color: var(--pink-400);
}

.letter-paper {
  width: min(640px, 92vw);
  margin: 30px auto 70px;
  background: var(--white);
  border: 4px solid var(--pink-200);
  border-radius: 26px;
  box-shadow: var(--card-shadow);
  padding: 40px 44px;
  font-family: "Caveat", cursive;
  font-size: 1.55rem;
  line-height: 1.65;
  color: var(--ink);
  position: relative;
  z-index: 2;
  animation: popIn 0.6s cubic-bezier(0.24, 1.6, 0.4, 1) both;
}

.letter-paper h2 {
  font-family: "Baloo 2", "Comic Sans MS", sans-serif;
  color: var(--pink-500);
  margin-bottom: 14px;
}

.letter-paper p { margin-bottom: 14px; }

.letter-paper .sign {
  text-align: right;
  font-size: 1.7rem;
  color: var(--pink-500);
  margin-top: 26px;
}

/* ============================================================
   REASONS (flip cards)
   ============================================================ */
.reasons {
  width: min(980px, 94vw);
  margin: 26px auto 70px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 24px;
  position: relative;
  z-index: 2;
}

.rcard {
  perspective: 900px;
  height: 210px;
  cursor: pointer;
}

.rcard .inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 1.4, 0.5, 1);
}

.rcard.flipped .inner { transform: rotateY(180deg); }

.rcard .face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
}

.rcard .front {
  background: var(--white);
  border: 4px solid var(--pink-200);
  box-shadow: var(--card-shadow);
  font-weight: 800;
  color: var(--pink-500);
  font-size: 1.1rem;
  gap: 6px;
}

.rcard .front .big { font-size: 44px; }

.rcard .back {
  background: linear-gradient(150deg, var(--pink-400), var(--pink-500));
  color: var(--white);
  transform: rotateY(180deg);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.45;
  box-shadow: var(--card-shadow);
}

/* ---------- Secret letter unlock (appears when every card is flipped) ---------- */
.secret-unlock {
  width: min(460px, 92vw);
  margin: 10px auto 50px;
  background: var(--white);
  border: 4px dashed var(--pink-300);
  border-radius: 26px;
  padding: 24px 26px;
  text-align: center;
  box-shadow: var(--card-shadow);
  animation: popIn 0.6s cubic-bezier(0.24, 1.6, 0.4, 1) both;
  position: relative;
  z-index: 2;
}

.secret-unlock p {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--pink-500);
  margin-bottom: 16px;
}

.secret-btn {
  display: inline-block;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--white);
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
  border-radius: 999px;
  padding: 12px 24px;
  box-shadow: 0 6px 16px rgba(244, 84, 143, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
  animation: heartbeat 1.8s ease-in-out infinite;
}

.secret-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 22px rgba(244, 84, 143, 0.45);
  animation: none;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  12%      { transform: scale(1.06); }
  24%      { transform: scale(1); }
}

/* ---------- Secret letter password gate ---------- */
.secret-lock {
  display: flex;
  justify-content: center;
  padding: 36px 16px 60px;
  position: relative;
  z-index: 2;
}

.lock-emoji {
  font-size: 46px;
  line-height: 1;
}

.letter-paper .forever {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--pink-500);
  margin-bottom: 6px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  text-align: center;
  padding: 10px 16px 30px;
  font-family: "Caveat", cursive;
  font-size: 1.3rem;
  color: var(--pink-400);
  position: relative;
  z-index: 2;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .cake { transform: scale(0.82); margin: -20px 0; }
  .candles { gap: 20px; }
  .letter-paper { padding: 28px 24px; font-size: 1.35rem; }
}
